/* Pasticceria Delsoglio dal 1987 · Saluzzo — mock-up. Token da SPEC §3. */
:root {
  --ink: #120B08; --paper: #F6EEDF; --gold: #C9A24B; --rhum: #8C4A1E; --cream: #EADFC8;
  --ink-2: #1C120D; --paper-ink: rgba(18, 11, 8, .62);
  --r-s: 8px; --r-m: 16px; --gut: 16px; --wrap: 1240px;
  --display: 'Gloock', Georgia, serif; --text: 'Onest', system-ui, sans-serif;
  --abar: 72px; --nav: 72px;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body { background: var(--ink); color: var(--paper); font-family: var(--text); font-size: 1.0625rem; line-height: 1.5; font-weight: 400; overflow-x: clip; }
img, canvas, iframe { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gut); top: -60px; z-index: 100; background: var(--gold); color: var(--ink); padding: 10px 14px; border-radius: var(--r-s); }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Tipografia ---------- */
.h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2.75rem, 6vw, 5.5rem); line-height: .96; letter-spacing: -.01em; margin-bottom: 24px; text-wrap: pretty; }
[data-lines] { font-kerning: none; }
.lead { font-size: clamp(1.125rem, 1.4vw, 1.375rem); line-height: 1.45; max-width: 34ch; margin-bottom: 24px; }
.data { font-size: .9375rem; font-weight: 500; color: var(--gold); margin-bottom: 32px; }
.data--muted { color: color-mix(in srgb, var(--paper) 55%, transparent); margin: 32px 0 0; }
.band--paper .data { color: var(--rhum); }

/* ---------- Bottoni ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: var(--r-s); font-weight: 600; font-size: 1rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s; }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: #D9B45E; }
.btn--ghost { border-color: color-mix(in srgb, var(--paper) 35%, transparent); color: var(--paper); background: transparent; }
.btn--ghost:hover { border-color: var(--paper); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--rhum); }

/* ---------- Badge aperto/chiuso ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 500; }
.status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #B23A2E; flex: none; }
.status[data-open="true"]::before { background: #3C9A5F; }
.status--paper { color: var(--ink); margin-bottom: 20px; }

/* ---------- Nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--nav); display: flex; align-items: center; gap: 24px; padding-inline: clamp(16px, 2.5vw, 40px); color: var(--paper); transition: transform .45s cubic-bezier(.2, .7, .2, 1), background-color .35s; }
.nav.is-solid { background: color-mix(in srgb, var(--ink) 86%, transparent); backdrop-filter: blur(10px); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__brand { font-family: var(--display); font-size: 1.5rem; text-decoration: none; white-space: nowrap; }
.nav__brand span { font-family: var(--text); font-size: .875rem; font-weight: 500; color: var(--gold); margin-left: 2px; }
.nav__links { display: flex; gap: 22px; margin-left: 12px; }
.nav__links a { text-decoration: none; font-weight: 500; font-size: .9375rem; opacity: .85; }
.nav__links a:hover { opacity: 1; color: var(--gold); }
.nav__status { margin-left: auto; }
@media (max-width: 1023px) { .nav__links { display: none; } }
@media (max-width: 767px) { .nav__status, .nav__cta { display: none; } .nav__brand { font-size: 1.375rem; } }

/* ---------- Hero: piano sequenza ---------- */
.hero { position: relative; height: calc(100svh + 1000vh); background: var(--ink); }
.hero__stage { position: sticky; top: 0; height: 100svh; overflow: clip; isolation: isolate; }
.hero__wordwrap { position: absolute; inset: 0; display: grid; place-items: center; padding-inline: clamp(16px, 2.5vw, 40px); z-index: 1; pointer-events: none; }
.hero__word { font-family: var(--display); font-size: 14vw; line-height: .9; letter-spacing: -.02em; color: var(--cream); white-space: nowrap; }
.hero__panelwrap { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; pointer-events: none; }
.hero__panel { position: relative; width: min(66svh, 86vw); aspect-ratio: 4 / 5; border-radius: var(--r-m); overflow: hidden; background: var(--ink-2); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8); }
.hero__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__poster--fine { display: none; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; }
.hero__kicker { position: absolute; left: clamp(16px, 2.5vw, 40px); top: calc(var(--nav) + 12px); z-index: 3; font-family: var(--text); font-weight: 600; font-size: 1rem; line-height: 1.3; max-width: 18ch; }
.hero__kicker span { display: block; font-weight: 500; color: var(--gold); }
.hero__lines { position: absolute; left: clamp(16px, 2.5vw, 40px); bottom: clamp(32px, 6vh, 56px); z-index: 3; width: min(30rem, 36vw); height: 4.2em; }
.hero__line { position: absolute; left: 0; bottom: 0; font-size: clamp(1.25rem, 1.9vw, 1.75rem); line-height: 1.25; font-weight: 500; padding-left: 20px; border-left: 2px solid var(--gold); }
.hero__line .w { display: inline-block; }
.hero__cta { position: absolute; right: clamp(16px, 2.5vw, 40px); bottom: clamp(32px, 6vh, 56px); z-index: 3; display: flex; gap: 8px; }
.hero__hint { position: absolute; left: 50%; bottom: 14px; z-index: 3; margin-left: -2ch; font-size: .8125rem; font-weight: 500; letter-spacing: .04em; color: var(--gold); }
.hero__hint::after { content: ''; display: block; width: 1px; height: 26px; margin: 6px auto 0; background: var(--gold); }
html.js:not(.reduce) .hero__line, html.js:not(.reduce) .hero__cta { visibility: hidden; }
/* la parola grande resta nascosta finché JS non l'ha misurata (sw.fit): niente flash a misura sbagliata */
.hero__word { visibility: hidden; }
html:not(.js) .hero__word { visibility: visible; }
/* tablet: pannello più stretto (la parola resta leggibile ai lati) e kicker nascosto, il nome vive nella nav e nella parola */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero__panel { width: min(62svh, 60vw); }
  .hero__kicker { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 767px) {
  .hero__word { font-size: 22vw; line-height: .88; white-space: normal; }
  .hero__word span { display: block; }
  .hero__wordwrap { place-items: start; padding: calc(var(--nav) + 44px) var(--gut) 0; z-index: 3; }
  .hero__word { color: var(--paper); }
  .hero__panelwrap { place-items: stretch; }
  .hero__panel { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .hero__panel::before, .hero__panel::after { content: ''; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none; }
  .hero__panel::before { top: 0; height: 46%; background: linear-gradient(180deg, rgba(18, 11, 8, .78), rgba(18, 11, 8, 0)); }
  .hero__panel::after { bottom: 0; height: 42%; background: linear-gradient(0deg, rgba(18, 11, 8, .82), rgba(18, 11, 8, 0)); }
  /* mobile: il nome è già nella nav e nella parola grande; l'h1 resta per screen reader e SEO */
  .hero__kicker { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero__lines { width: calc(100% - 2 * var(--gut)); bottom: calc(var(--abar) + 96px); height: 3.6em; }
  .hero__line { font-size: 1.25rem; }
  .hero__cta { left: var(--gut); right: var(--gut); bottom: calc(var(--abar) + 24px); }
  .hero__cta .btn { flex: 1; }
  .hero__hint { bottom: calc(var(--abar) + 2px); }
}
/* reduced motion: hero statico sul frame della facciata, tutto visibile, nessun pin */
html.reduce .hero { height: auto; }
html.reduce .hero__stage { position: relative; height: 100svh; }
html.reduce .hero__poster { display: none; }
html.reduce .hero__poster--fine { display: block; }
html.reduce .hero__canvas, html.reduce .hero__hint { display: none; }
html.reduce .hero__word { visibility: visible; }
html.reduce .hero__lines { height: auto; display: grid; gap: 6px; }
html.reduce .hero__line { position: static; font-size: 1rem; }

/* ---------- Bande e split ---------- */
.band { position: relative; padding-block: clamp(72px, 10vw, 136px); }
.band--paper { background: var(--paper); color: var(--ink); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.split--rev .media { order: 2; }
.split__text { min-width: 0; }
.media { border-radius: var(--r-m); overflow: hidden; background: var(--ink-2); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--sq { aspect-ratio: 1; }
.media--wide { aspect-ratio: 3 / 2; }
@media (max-width: 899px) { .split { grid-template-columns: 1fr; } .split--rev .media { order: 0; } }

/* ---------- Banco: 6 tessere ---------- */
.tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-m); overflow: hidden; background: var(--ink-2); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.tile__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 18px 16px; font-family: var(--display); font-size: clamp(1.375rem, 2vw, 1.875rem); line-height: 1; background: linear-gradient(0deg, rgba(18, 11, 8, .85), rgba(18, 11, 8, 0)); transition: opacity .35s, transform .5s cubic-bezier(.2, .7, .2, 1); }
@media (hover: hover) and (pointer: fine) {
  .tile__cap { opacity: 0; transform: translateY(8px); }
  .tile:hover img, .tile:focus-within img { transform: scale(1.04); }
  .tile:hover .tile__cap, .tile:focus-within .tile__cap { opacity: 1; transform: none; }
}
@media (max-width: 767px) { .tiles { grid-template-columns: 1fr 1fr; gap: 8px; } .tile__cap { padding: 32px 12px 12px; } }

/* ---------- Ordina: modulo ---------- */
.form { display: grid; gap: 18px; max-width: 36rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; font-size: .875rem; font-weight: 500; color: color-mix(in srgb, var(--paper) 70%, transparent); }
.field input { width: 100%; min-height: 48px; padding: 8px 0; background: transparent; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--paper) 30%, transparent); color: var(--paper); font: inherit; font-size: 1.0625rem; border-radius: 0; }
.field input:focus { outline: none; border-bottom-color: var(--gold); }
.field input::placeholder { color: color-mix(in srgb, var(--paper) 35%, transparent); }
.field input[type="date"] { color-scheme: dark; }
.form__send { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 8px; }
.form__alt { font-size: .9375rem; }
.form__alt a { color: var(--gold); font-weight: 600; text-decoration: none; }
@media (max-width: 479px) { .form__row { grid-template-columns: 1fr; } }

/* ---------- Dal 1987 ---------- */
.years { list-style: none; padding: 0; display: grid; gap: 10px; }
.years li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 12px; font-size: .9375rem; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--paper) 14%, transparent); }
.years__y { font-family: var(--display); font-size: 1.25rem; color: var(--gold); line-height: 1.2; }

/* ---------- Recensioni ---------- */
.voci .h2 { max-width: 14ch; }
.voci__score { color: var(--gold); }
.voci__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-block: 32px 36px; }
.voce { padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); }
.voce p { font-size: 1.125rem; line-height: 1.45; margin-bottom: 14px; text-wrap: pretty; }
.voce footer { font-size: .875rem; font-weight: 500; color: var(--gold); }
@media (max-width: 899px) { .voci__grid { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- Orari e dove siamo ---------- */
.dove .h2 { max-width: 12ch; }
.week { border-collapse: collapse; width: 100%; max-width: 30rem; margin-bottom: 28px; font-variant-numeric: tabular-nums; }
.week th, .week td { padding: 8px 0; text-align: left; font-weight: 400; border-top: 1px solid rgba(18, 11, 8, .14); font-size: 1rem; }
.week td { text-align: right; white-space: nowrap; }
.week tr.is-today th, .week tr.is-today td { font-weight: 600; color: var(--rhum); }
.contatti { font-style: normal; display: grid; gap: 6px; font-size: 1rem; }
.contatti a { color: var(--ink); font-weight: 600; text-decoration: none; }
.contatti a:first-child { font-family: var(--display); font-size: 2rem; font-weight: 400; line-height: 1.1; }
.map { position: relative; border-radius: var(--r-m); overflow: hidden; background: var(--cream); aspect-ratio: 4 / 3; }
.map__frame { width: 100%; height: 100%; border: 0; display: block; }
.map__load { display: grid; place-content: center; gap: 10px; width: 100%; height: 100%; border: 0; cursor: pointer; text-align: center; color: var(--ink); font: inherit;
  background: var(--cream) repeating-linear-gradient(0deg, transparent 0 39px, rgba(18, 11, 8, .06) 39px 40px), repeating-linear-gradient(90deg, transparent 0 39px, rgba(18, 11, 8, .06) 39px 40px); }
.map__load:hover .map__pin, .map__load:focus-visible .map__pin { transform: translateY(-4px); }
.map__pin { width: 22px; height: 22px; margin: 0 auto; border-radius: 50% 50% 50% 0; background: var(--rhum); transform: rotate(-45deg); transition: transform .3s; box-shadow: 0 6px 14px rgba(18, 11, 8, .25); }
.map__addr { font-family: var(--display); font-size: 1.35rem; line-height: 1.2; }
.map__hint { font-size: .85rem; opacity: .7; }
.map__cta { position: absolute; left: 16px; bottom: 16px; }

/* ---------- Footer ---------- */
.foot { padding: 56px 0 calc(40px + var(--abar)); font-size: .9375rem; color: color-mix(in srgb, var(--paper) 72%, transparent); border-top: 1px solid color-mix(in srgb, var(--paper) 12%, transparent); }
.foot p + p { margin-top: 8px; }
.foot__brand { font-family: var(--display); font-size: 1.75rem; color: var(--paper); margin-bottom: 14px; }
.foot__brand span { font-family: var(--text); font-size: .875rem; font-weight: 500; color: var(--gold); margin-left: 6px; }
.foot a { color: var(--paper); }
.foot__note { font-size: .8125rem; margin-top: 20px !important; }
@media (min-width: 768px) { .foot { padding-bottom: 40px; } }

/* ---------- Barra azioni (solo mobile) ---------- */
.actionbar { position: fixed; inset: auto 0 0 0; z-index: 50; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--ink) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid color-mix(in srgb, var(--paper) 12%, transparent); }
.actionbar a { min-height: 48px; display: grid; place-items: center; font-weight: 600; font-size: .9375rem; color: var(--paper); text-decoration: none; border-radius: var(--r-s); }
.actionbar a.is-main { background: var(--gold); color: var(--ink); }
@media (min-width: 768px) { .actionbar { display: none; } :root { --abar: 0px; } }

/* stati di partenza degli ingressi (solo con JS e senza reduce) */
html.js:not(.reduce) [data-up] { visibility: hidden; }

/* Desktop e tablet: la parola sta davanti al pannello, in alto, così DELSOGLIO resta leggibile per intero
   (dietro al pannello si leggeva "DEL…LIO"); il pannello riceve la stessa ombra alta del mobile. */
@media (min-width: 768px) {
  .hero__wordwrap { z-index: 3; place-items: start center; padding-top: calc(var(--nav) + 3.5vh); }
  .hero__word { color: var(--paper); text-shadow: 0 2px 28px rgba(18, 11, 8, .6), 0 0 2px rgba(18, 11, 8, .45); }
  .hero__kicker { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero__panel::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 48%; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(18, 11, 8, .72), rgba(18, 11, 8, 0)); }
}
