/* La Collina delle Origini: foglio di stile unico. Colori della pietra e del logo. */
@font-face { font-family: "EB Garamond"; src: url("/assets/fonts/ebgaramond.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/assets/fonts/ebgaramond-italic.woff2") format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap; }

:root {
  --pietra: #f4efe6; --carta: #fbf8f2; --inchiostro: #2e251e; --bruno: #5b3a22;
  --blu: #2f6f8f; --muto: #62594f; --linea: #d8cdbc; --accento-testo: #ffffff;
  --mark: #f3dfa8;
  color-scheme: light;
}
/* tema scuro: scelto con il bottone (data-tema="scuro"), oppure dal telefono se il visitatore non ha scelto */
:root[data-tema="scuro"] { --pietra: #1d1814; --carta: #28211b; --inchiostro: #f1e9dc; --bruno: #e0bd96;
          --blu: #93c6de; --muto: #bcb0a3; --linea: #41372e; --accento-testo: #1d1814; --mark: #5a4a22; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="chiaro"]) { --pietra: #1d1814; --carta: #28211b; --inchiostro: #f1e9dc; --bruno: #e0bd96;
          --blu: #93c6de; --muto: #bcb0a3; --linea: #41372e; --accento-testo: #1d1814; --mark: #5a4a22; color-scheme: dark; }
}

* { box-sizing: border-box; }
html { font-size: 118.75%; -webkit-text-size-adjust: 100%; }
html.grande { font-size: 143%; }
body { margin: 0; background: var(--pietra); color: var(--inchiostro);
       font-family: "EB Garamond", Georgia, "Times New Roman", serif; line-height: 1.55; }
img, svg { max-width: 100%; }
a { color: var(--blu); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blu); outline-offset: 3px; border-radius: 4px; }
.salta { position: absolute; left: -999px; top: 0; background: var(--carta); padding: .5rem 1rem; z-index: 10; }
.salta:focus { left: 1rem; top: 1rem; }
mark.da-completare { background: var(--mark); color: inherit; padding: 0 .15em; border-radius: 3px; }

/* ---------------------------------------------------------------- testata e piede */
.testata { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
           max-width: 42rem; margin: 0 auto; padding: .75rem 1rem; }
.testata .nome { display: flex; align-items: center; gap: .6rem; color: var(--bruno); text-decoration: none;
                 font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: .82rem; }
.testata .nome img { width: 32px; height: 48px; display: block; }
.controlli { display: flex; gap: .5rem; flex: none; }
.bottone-tema { display: grid; place-items: center; padding: 0; }
.bottone-tema svg { width: 22px; height: 22px; fill: currentColor; }
.bottone-tema .sole { display: none; }
:root[data-tema="scuro"] .bottone-tema .luna { display: none; }
:root[data-tema="scuro"] .bottone-tema .sole { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="chiaro"]) .bottone-tema .luna { display: none; }
  :root:not([data-tema="chiaro"]) .bottone-tema .sole { display: block; }
}
.bottone-testo { font: inherit; font-weight: 600; min-width: 48px; min-height: 44px; border-radius: 22px;
                 border: 1.5px solid var(--muto); background: var(--carta); color: var(--inchiostro); cursor: pointer; }
.bottone-testo[aria-pressed="true"] { border-color: var(--bruno); color: var(--bruno); }
.piede { max-width: 42rem; margin: 3rem auto 0; padding: 1.5rem 1rem 2.5rem; border-top: 1px solid var(--linea);
         color: var(--muto); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.piede a { color: var(--muto); }
.piede .firma { flex-basis: 100%; font-size: .85rem; }

/* ---------------------------------------------------------------- contenuto */
main { max-width: 42rem; margin: 0 auto; padding: 0 1rem; }
h1, h2, h3 { color: var(--bruno); line-height: 1.2; font-weight: 600; }
h1 { font-size: 2rem; margin: .3rem 0 .2rem; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
p { margin: 0 0 .9rem; }
.etichetta { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muto); font-weight: 600; margin: 0; }
.sottotitolo { font-style: italic; font-size: 1.2rem; color: var(--muto); margin: 0 0 1rem; }
.icona { width: 64px; height: 64px; color: var(--bruno); display: block; margin: 1.2rem 0 .3rem; }
.icona-piccola { width: 30px; height: 30px; color: var(--bruno); flex: none; }
.apertura { font-variant: small-caps; letter-spacing: .06em; }
.chiusura { font-style: italic; font-weight: 600; color: var(--bruno); font-size: 1.15rem; margin-top: 1.2rem; }

/* ---------------------------------------------------------------- home */
.eroe { text-align: center; padding: 1.5rem 0 .5rem; }
.eroe .logo { width: 160px; height: 238px; display: block; margin: 0 auto; }
.eroe h1 { font-size: 2.3rem; }
.eroe .motto { font-style: italic; font-size: 1.3rem; color: var(--muto); margin-bottom: 1.2rem; }
.azioni { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: 1.2rem 0; }
.bottone { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .4rem 1.2rem;
           border-radius: 24px; border: 1.5px solid var(--bruno); color: var(--bruno); background: transparent;
           font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.bottone.pieno { background: var(--bruno); color: var(--accento-testo); }
.riquadro { background: var(--carta); border: 1px solid var(--linea); border-radius: 14px; padding: 1rem 1.1rem; margin: 1.2rem 0; }
.stato { color: var(--muto); font-size: .95rem; margin: .6rem 0 0; min-height: 1.4em; }

/* elenco delle tappe */
.tappe { list-style: none; padding: 0; margin: 0; }
.tappe li { border-bottom: 1px solid var(--linea); }
.tappe a { display: flex; gap: .9rem; align-items: center; padding: .8rem .2rem; color: inherit; text-decoration: none; min-height: 56px; }
.tappe a:hover .titolo-tappa { text-decoration: underline; }
.tappe .testo { display: flex; flex-direction: column; }
.tappe .etichetta { font-size: .7rem; }
.titolo-tappa { font-weight: 600; color: var(--inchiostro); }
.tappe .frase { color: var(--muto); font-size: .95rem; }
.tappe [aria-current="page"] { background: var(--carta); border-radius: 10px; }
.tappe [aria-current="page"] .titolo-tappa::after { content: " · sei qui"; font-weight: 400; font-style: italic; color: var(--bruno); }

/* ---------------------------------------------------------------- lettore audio */
.ascolta { background: var(--carta); border: 1px solid var(--linea); border-radius: 16px; padding: 1rem 1.1rem 1.1rem; margin: 1.2rem 0 1.6rem; }
.ascolta h2 { margin: 0 0 .2rem; font-size: 1.1rem; letter-spacing: .12em; text-transform: uppercase; }
.invito { font-style: italic; margin: 0 0 .8rem; }
.lettore { display: grid; grid-template-columns: auto 1fr; gap: .8rem 1rem; align-items: center; }
.play { width: 72px; height: 72px; border-radius: 50%; border: none; background: var(--bruno); color: var(--accento-testo); cursor: pointer; display: grid; place-items: center; }
.play svg { width: 30px; height: 30px; fill: currentColor; }
.barra { display: flex; flex-direction: column; gap: .3rem; }
.barra input[type=range] { width: 100%; accent-color: var(--bruno); min-height: 32px; }
.tempi { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; color: var(--muto); font-size: .9rem; }
.comandi { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }
.comandi button { font: inherit; min-height: 44px; min-width: 44px; padding: .2rem .8rem; border-radius: 22px;
                  border: 1.5px solid var(--linea); background: transparent; color: var(--inchiostro); cursor: pointer; }
.comandi button[aria-pressed="true"] { border-color: var(--bruno); color: var(--bruno); font-weight: 600; }
.in-arrivo { color: var(--muto); font-style: italic; margin: .2rem 0 0; }
details { border-top: 1px solid var(--linea); padding: .6rem 0; }
details:last-of-type { border-bottom: 1px solid var(--linea); }
summary { cursor: pointer; color: var(--bruno); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.trascrizione p { margin-bottom: .7rem; }

/* ---------------------------------------------------------------- tappe vicine, liste */
.vicine { display: flex; justify-content: space-between; gap: 1rem; margin: 2rem 0 0; }
.vicine a { display: inline-flex; flex-direction: column; min-height: 48px; text-decoration: none; max-width: 48%; }
.vicine a span { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muto); }
.vicine .dopo { text-align: right; margin-left: auto; }
dl.voci { margin: 0; }
dl.voci dt { font-weight: 600; color: var(--bruno); margin-top: 1rem; }
dl.voci dd { margin: .2rem 0 0; }
ol.regole li, ul.fonti li { margin-bottom: .4rem; }

@media (min-width: 40rem) {
  h1 { font-size: 2.4rem; }
  .eroe h1 { font-size: 2.8rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
