/* Stile delle pagine /guida/: stessi token e font della landing (DESIGN.md). */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/fredoka-v17-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/nunito-sans-v19-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/nunito-sans-v19-latin-italic.woff2') format('woff2');
}

:root {
  --sand: oklch(0.972 0.042 95);
  --sand-deep: oklch(0.936 0.06 92);
  --sky: oklch(0.75 0.11 240);
  --sea: oklch(0.56 0.115 243);
  --ink: oklch(0.31 0.055 245);
  --ink-soft: oklch(0.44 0.045 243);
  --sun: oklch(0.86 0.145 88);
  --sun-deep: oklch(0.78 0.15 82);
  --teal: oklch(0.52 0.095 187);
  --teal-deep: oklch(0.44 0.085 190);
  --paper: oklch(0.995 0.008 95);
  --line: oklch(0.88 0.04 92);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito Sans', 'Segoe UI', sans-serif;
  background: var(--sand);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Fredoka', 'Nunito Sans', sans-serif; line-height: 1.2; }
a { color: var(--teal-deep); }

.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--paper); font-weight: 800;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
.narrow { max-width: 760px; margin: 0 auto; }

/* ============ Testata ============ */
.top { background: var(--sky); color: var(--paper); }
.top header { display: flex; align-items: center; gap: 12px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; }
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.brand span { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 20px; }
nav.main { display: flex; gap: clamp(12px, 2.5vw, 26px); align-items: center; }
nav.main a { color: var(--paper); text-decoration: none; font-weight: 700; font-size: 15px; }
nav.main a:hover { text-decoration: underline; text-underline-offset: 4px; }
nav.main a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 800;
  border-radius: 999px; padding: 12px 24px; font-size: 16px;
}
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: var(--sun-deep); }
nav.main .btn { padding: 8px 18px; font-size: 14px; color: var(--ink); }
@media (max-width: 640px) { nav.main a.hide-sm { display: none; } }

/* ============ Articolo ============ */
.crumbs { font-size: 14px; color: var(--ink-soft); padding-top: 22px; }
.crumbs a { color: var(--ink-soft); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; }

article { padding-block: 8px 48px; }
article h1 { font-size: clamp(30px, 4.6vw, 44px); margin: 14px 0 10px; text-wrap: balance; }
article .meta { color: var(--ink-soft); font-size: 14px; margin: 0 0 22px; }
article .intro { font-size: 19px; color: var(--ink); }
article h2 { font-size: clamp(23px, 3vw, 28px); margin: 38px 0 10px; }
article h3 { font-size: 20px; margin: 26px 0 6px; }
article p, article li { max-width: 68ch; }
article ul, article ol { padding-left: 1.3em; }
article li { margin-bottom: 6px; }
article strong { color: var(--ink); }

.box {
  background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--teal);
  border-radius: 12px; padding: 14px 18px; margin: 24px 0;
}
.box p { margin: 0; }
.box.tip { border-left-color: var(--sun-deep); }
.box .label { display: block; font-weight: 800; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 4px; color: var(--ink-soft); }

table { border-collapse: collapse; width: 100%; margin: 18px 0; background: var(--paper); border-radius: 12px; overflow: hidden; font-size: 16px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--sand-deep); font-weight: 800; }
.table-scroll { overflow-x: auto; }

.related { background: var(--sand-deep); padding-block: 34px 40px; }
.related h2 { font-size: 24px; margin: 0 0 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; text-decoration: none; color: var(--ink);
}
.card:hover { border-color: var(--teal); }
.card strong { display: block; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 18px; line-height: 1.25; margin-bottom: 6px; }
.card span { font-size: 15px; color: var(--ink-soft); line-height: 1.5; display: block; }

.cta {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px; margin: 36px 0 0;
}
.cta h2 { margin-top: 0; }
.cta p { margin: 0 0 16px; }

/* ============ Indice guida ============ */
.hub-head { padding-block: 10px 6px; }
.hub-head h1 { font-size: clamp(32px, 5vw, 48px); margin: 14px 0 10px; }
.hub-head p { font-size: 19px; max-width: 62ch; }
.hub-section { padding-block: 18px; }
.hub-section h2 { font-size: 24px; margin: 18px 0 12px; }

/* ============ Annuncio ============ */
.ad-slot { margin: 30px 0; }
.ad-slot ins { display: block; }
.ad-label {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 6px; text-align: center;
}
.ad-slot:not(.requesting):not(.filled) { display: none; }
.ad-slot.requesting { min-height: 110px; }

/* ============ Piede ============ */
footer { background: oklch(0.27 0.05 246); color: oklch(0.88 0.02 235); padding: 34px 0 30px; font-size: 14px; }
footer .cols { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer a { color: oklch(0.88 0.02 235); text-decoration: none; }
footer a:hover { color: var(--paper); text-decoration: underline; }
footer .brand span { font-size: 18px; }
footer .brand img { width: 34px; height: 34px; }
footer .legal { margin-top: 18px; font-size: 13px; color: oklch(0.75 0.03 240); }

/* ============ Banner cookie ============ */
#cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50;
  max-width: 560px; margin-inline: auto;
  background: oklch(0.3 0.05 246); color: oklch(0.94 0.015 235);
  border-radius: 16px; padding: 18px 20px;
  box-shadow: 0 8px 24px oklch(0.2 0.04 246 / 0.35);
  display: none; gap: 14px; flex-wrap: wrap; align-items: center;
  font-size: 14px; line-height: 1.5;
}
#cookie-banner.show { display: flex; }
body.cookie-open footer { padding-bottom: 170px; }
#cookie-banner p { margin: 0; flex: 1 1 260px; }
#cookie-banner a { color: oklch(0.85 0.08 90); }
#cookie-banner .actions { display: flex; gap: 10px; flex: none; }
#cookie-banner button {
  font-family: inherit; font-weight: 800; font-size: 14px; cursor: pointer;
  border-radius: 999px; padding: 9px 20px; border: none;
  background: var(--sun); color: var(--ink);
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  article .intro { font-size: 17px; }
  .brand span { font-size: 18px; }
  #cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 12px 14px; font-size: 13px; }
  #cookie-banner .actions { width: 100%; }
  #cookie-banner .actions button { flex: 1; }
}
