/* ══════════════════════════════════════════════════════════════════
   Il Vecchio Forno di Affori — Via Astesani 15, Milano
   Concept: «ERA IL MIO PANIFICIO DA BAMBINA». La testimonianza al posto
   del prodotto: in cima non c'è il pane ma la voce di una cliente tornata
   dopo vent'anni. Secondo gesto: il NOME SPEZZATO IN DUE, come sulla loro
   facciata, dove l'insegna sta su due pannelli attorno allo spigolo.
   Colori campionati dalle insegne: il blu notte dei pannelli, il sabbia
   delle tende, il crema del lettering, l'ottone delle cornici.
   ══════════════════════════════════════════════════════════════════ */

/* ---------- PLUMBING (reset tecnico canonico) ---------- */
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; }
}

/* ---------- STATO INIZIALE DEI .reveal ----------
   Obbligatorio con `immediateRender:false`: senza, gli elementi compaiono,
   vengono azzerati allo scatto del trigger e ri-dissolti (il flash del
   19/7). Verificato da `lint-sito` col check `reveal-initial-state`. */
.js .reveal { opacity: 0; }
.js .reveal.in-view { opacity: 1; }
html:not(.js) .reveal, html.reduced-motion .reveal { opacity: 1; }

/* ---------- design system ---------- */
:root {
  --blu: #1F2A44;
  --blu-chiaro: #2E3C5C;
  --sabbia: #D8C9A8;
  --crema: #F5EFE2;
  --carta: #FBF7EE;
  --ottone: #B08D4F;
  --inchiostro: #241F1A;
  --tenue: #79705F;
  --filetto: #DED3BC;

  --display: 'Prata', Georgia, serif;
  --testo: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --gut: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--testo);
  font-size: clamp(1rem, .5vw + .9rem, 1.08rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.14; margin: 0; }
h2 { font-size: clamp(1.9rem, 4.6vw, 3.2rem); color: var(--blu); }
p { margin: 0 0 1.05em; }
a { color: inherit; }
strong { font-weight: 600; }

.eyebrow {
  font-size: .78rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ottone); margin-bottom: .9rem;
}
.sec-head { max-width: var(--max); margin: 0 auto clamp(2rem, 5vw, 3rem); }
.sec-sub { max-width: 50ch; color: var(--tenue); }
section { padding: clamp(4rem, 9vw, 7rem) var(--gut); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--blu); color: var(--crema); padding: .8rem 1.2rem; z-index: 999; }
.skip:focus { left: .5rem; top: .5rem; }

/* ══════════ intro ══════════ */
#intro {
  position: fixed; inset: 0; z-index: 300;
  background: var(--blu); color: var(--sabbia);
  display: grid; place-items: center; padding: 2rem;
  transition: opacity .6s ease;
}
#intro.hide { opacity: 0; pointer-events: none; }
html:not(.js) #intro { display: none; }
#introMark { font-family: var(--display); font-size: clamp(1.3rem, 5vw, 2.6rem); text-align: center; }
.reduced-motion #intro { display: none; }

/* ══════════ header ══════════ */
#header {
  position: fixed; inset: 0 0 auto 0; z-index: 200;
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem var(--gut);
  background: var(--carta);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
#header.scrolled { border-bottom-color: var(--filetto); }
.brand { font-family: var(--display); font-size: 1.2rem; color: var(--blu); text-decoration: none; margin-right: auto; }
#mainNav { display: flex; align-items: center; gap: clamp(.5rem, 1.3vw, 1.4rem); }
#mainNav a:not(.cta) {
  text-decoration: none; font-size: .93rem;
  padding: .3rem 0; border-bottom: 1.5px solid transparent; white-space: nowrap;
}
#mainNav a:not(.cta):hover { border-bottom-color: var(--ottone); }
#langToggle {
  font-size: .78rem; letter-spacing: .1em;
  background: none; border: 1.5px solid var(--filetto); border-radius: 2rem;
  padding: .25rem .7rem; color: inherit; cursor: pointer;
}
#langToggle:hover { border-color: var(--ottone); color: var(--ottone); }
/* `:not(.cta)` + inline-flex: senza, `#mainNav a` batte `.cta` per
   specificità e le azzera il padding orizzontale. */
.cta {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; white-space: nowrap;
  background: var(--blu); color: var(--crema) !important;
  padding: .55rem 1.3rem; border-radius: 2px;
  font-weight: 600; text-decoration: none;
}
.cta:hover { background: var(--ottone); }
.cta-big { margin-top: 1.6rem; padding: .85rem 1.8rem; font-size: 1.02rem; }

#burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: .4rem; }
#burger span { display: block; width: 26px; height: 2px; background: var(--blu); }

/* ══════════ HERO ══════════ */
#hero {
  min-height: 100vh; min-height: 100svh;
  padding-top: 7rem;
  max-width: var(--max); margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
}
/* --- il nome spezzato: due pannelli, come sulla facciata --- */
.nome-spezzato { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }
.np {
  font-family: var(--display);
  background: var(--blu); color: var(--crema);
  padding: .5rem 1.1rem;
  border: 3px double var(--sabbia);
  line-height: 1.1;
}
.np-1 { font-size: clamp(1.2rem, 3.2vw, 2.2rem); }
.np-2 { font-size: clamp(2.4rem, 8vw, 5.4rem); letter-spacing: .04em; }
.hero-nota { margin-top: 1.1rem; font-size: .92rem; color: var(--tenue); max-width: 44ch; }

.hero-cit {
  margin: clamp(2.2rem, 5vw, 3.4rem) 0 0;
  padding-left: clamp(1rem, 3vw, 2rem);
  border-left: 3px solid var(--ottone);
  max-width: 34ch;
}
.hero-cit p {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.7vw, 1.95rem);
  line-height: 1.32; color: var(--blu); margin-bottom: .7rem;
}
.hero-cit cite { font-style: normal; font-size: .86rem; color: var(--tenue); }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1rem 2.4rem; align-items: baseline;
  margin-top: 2.2rem; padding-top: 1.3rem; border-top: 1px solid var(--filetto);
}
.hero-rating { margin: 0; font-size: .95rem; color: var(--tenue); }
.hero-rating strong { font-family: var(--display); font-size: 1.6rem; color: var(--ottone); vertical-align: -.1em; }
.hero-call { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--ottone); }

/* ══════════ due colonne (pane, feste) ══════════ */
.due-col {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.col-testo h2 { margin-bottom: 1.2rem; }
.col-testo p { max-width: 44ch; }
.col-fig { margin: 0; }
.col-fig img { width: 100%; display: block; border: 1px solid var(--filetto); }
.col-fig figcaption { margin-top: .7rem; font-size: .85rem; color: var(--tenue); }
#pane { background: var(--crema); }
.feste-nota { font-size: .85rem; color: var(--tenue); border-top: 1px solid var(--filetto); padding-top: .9rem; }

/* ══════════ PASTICCERIA ══════════ */
.torte-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.2rem, 3vw, 2.2rem); align-items: start;
}
.torta { margin: 0; }
.torta img { width: 100%; height: 320px; object-fit: cover; display: block; border: 1px solid var(--filetto); }
.torta figcaption { margin-top: .6rem; font-size: .95rem; }
.torta-testo p { max-width: 40ch; }
.torta-tip {
  border-left: 3px solid var(--ottone); padding-left: 1rem;
  font-size: .95rem; color: var(--tenue);
}

/* ══════════ FESTE ══════════ */
#feste { background: var(--blu); color: var(--crema); }
#feste h2 { color: var(--crema); }
#feste .eyebrow { color: var(--sabbia); }
#feste p { color: #DED6C6; }
#feste .col-fig figcaption { color: var(--sabbia); }
#feste .feste-nota { border-top-color: rgba(216, 201, 168, .3); color: var(--sabbia); }

/* ══════════ RECENSIONI ══════════ */
.voci-grid { max-width: var(--max); margin: 0 auto; columns: 2 320px; column-gap: 1.6rem; }
.voci-grid blockquote {
  break-inside: avoid; margin: 0 0 1.5rem; padding: 1.3rem 1.4rem;
  background: var(--crema); border: 1px solid var(--filetto);
}
.voci-grid p { font-size: .98rem; margin-bottom: .7rem; }
.voci-grid cite { font-style: normal; font-size: .82rem; color: var(--tenue); }

/* ══════════ GALLERY ══════════ */
#vetrina { background: var(--crema); }
.vetrina-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem;
}
.shot { padding: 0; border: 1px solid var(--filetto); background: none; cursor: pointer; overflow: hidden; display: block; }
.shot img { width: 100%; height: 290px; object-fit: cover; display: block; transition: transform .5s ease; }
.shot:hover img { transform: scale(1.04); }
.shot-wide { grid-column: span 2; }
.vetrina-nota { max-width: var(--max); margin: 1.5rem auto 0; font-size: .86rem; color: var(--tenue); }

/* ══════════ DOVE ══════════ */
.dove-grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: .85fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
.dove-info address { font-style: normal; font-size: 1.1rem; line-height: 1.5; margin-bottom: .5rem; }
.dove-tel a { font-family: var(--display); font-size: 1.35rem; color: var(--ottone); text-decoration: none; }
.dove-stato { font-size: .93rem; color: var(--tenue); margin-bottom: 1.3rem; }
.orari { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.orari li { display: flex; justify-content: space-between; gap: 1rem; padding: .48rem 0; border-bottom: 1px solid var(--filetto); }
.orari li.is-today { color: var(--ottone); font-weight: 600; }
.orari li.is-today b { color: var(--ottone); }
.dove-serv { margin-top: 1.1rem; font-size: .9rem; color: var(--tenue); }
.dove-map iframe { width: 100%; height: clamp(340px, 46vw, 470px); border: 1px solid var(--filetto); }

/* ══════════ FAQ ══════════ */
#faq { background: var(--crema); }
#faq h2 { max-width: var(--max); margin: 0 auto clamp(1.6rem, 4vw, 2.4rem); }
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-list details { border-bottom: 1px solid var(--filetto); padding: 1.1rem 0; }
.faq-list summary {
  cursor: pointer; font-weight: 600; font-size: 1.02rem;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; color: var(--ottone); font-size: 1.4rem; line-height: 1; }
.faq-list details[open] summary::after { content: '–'; }
.faq-list p { margin: .8rem 0 0; color: var(--tenue); max-width: 62ch; }

/* ══════════ FOOTER ══════════ */
footer { background: var(--blu); color: var(--crema); }
.foot-inner {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gut) 1.5rem;
  display: grid; grid-template-columns: auto 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem); align-items: start;
}
.foot-name { font-family: var(--display); font-size: 1.4rem; color: var(--sabbia); }
.foot-col p { margin: 0 0 .4rem; font-size: .93rem; opacity: .85; }
.foot-col a { color: var(--sabbia); }
.foot-credit { text-align: center; padding: 0 var(--gut) 2.2rem; font-size: .8rem; opacity: .6; }
.foot-credit a { color: var(--sabbia); }

/* ══════════ action bar mobile ══════════ */
#actionBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 190;
  display: none; gap: 1px; background: var(--blu);
  transform: translateY(100%); transition: transform .35s ease;
}
#actionBar.is-visible { transform: translateY(0); }
#actionBar a { flex: 1; text-align: center; padding: .95rem .5rem; text-decoration: none; font-weight: 600; font-size: .95rem; }
.ab-call { background: var(--blu); color: var(--crema); }
.ab-map { background: var(--sabbia); color: var(--blu); }

/* ══════════ lightbox ══════════ */
#lightbox {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(31, 42, 68, .94);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
#lightboxImg { max-width: 92vw; max-height: 88vh; }
#lightboxClose { position: absolute; top: 1.2rem; right: 1.4rem; background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; }

/* ══════════ responsive ══════════ */
@media (max-width: 960px) {
  #burger { display: flex; }
  #mainNav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--carta); border-bottom: 1px solid var(--filetto);
    padding: .5rem var(--gut) 1.2rem;
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .35s ease, visibility .35s;
  }
  #mainNav.nav-open { max-height: 32rem; visibility: visible; }
  #mainNav a:not(.cta) { padding: .75rem 0; border-bottom: 1px solid var(--filetto); }
  #langToggle { align-self: flex-start; margin: .8rem 0; }
  .due-col, .dove-grid { grid-template-columns: 1fr; }
  .col-fig { max-width: 480px; }
  #actionBar { display: flex; }
  body { padding-bottom: 3.4rem; }
}
@media (max-width: 640px) {
  .voci-grid { columns: 1; }
  .shot-wide { grid-column: span 1; }
  .shot img { height: 220px; }
  .torta img { height: 240px; }
  .foot-inner { grid-template-columns: 1fr; }
}
