/* ════════════════════════════════════════════════════════════════
   FARO · LA CARTA — menu-digitale.css (rev. Atelier, in produzione)
   Carta crema calda italiana + percorsi d'umore. Antitesi del dark
   card-list precedente. Menu engineering invisibile (no leak).
   Driven by: <body class="sheet-open"> per il bottom-sheet.
   ════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }

:root {
  --bg: #FBF7EF;
  --bg-warm: #F4ECDC;
  --paper: #FFFDF8;
  --ink: #2A211B;
  --ink-soft: #51463D;
  --muted: #6E6258;
  --soft: #8E8174;
  --line: rgba(42, 33, 27, 0.12);
  --line-hi: rgba(42, 33, 27, 0.22);
  --terra: #A8401F;
  --terra-hi: #C85A3C;
  --terra-soft: rgba(181, 70, 46, 0.10);
  --gold: #A87A3A;
  --gold-hi: #C49146;
  --wine: #6E1F2A;
  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --maxw: 720px;
  --top-h: 168px;
  --radius: 3px;
}

html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background:
    radial-gradient(120% 50% at 80% -5%, rgba(181,70,46,0.05), transparent 60%),
    radial-gradient(90% 40% at 0% 0%, rgba(168,122,58,0.05), transparent 55%),
    var(--bg);
  color: var(--ink); font-family: var(--sans); font-weight: 400; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.sheet-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; transform: translateY(-160%); padding: 10px 14px; border-radius: 4px; background: var(--ink); color: var(--bg); }
.skip-link:focus { transform: translateY(0); }

/* ── deck sticky ── */
.deck { position: sticky; top: 0; z-index: 40; background: rgba(251,247,239,.86); backdrop-filter: blur(14px) saturate(1.15); border-bottom: 1px solid var(--line); }
.deck-row { max-width: var(--maxw); margin: 0 auto; padding: 11px 20px 0; display: flex; align-items: center; gap: 14px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: .32em; padding-left: .32em; color: var(--ink); }
.deck-now { flex: 1; min-width: 0; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--terra); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.deck-now b { font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-soft); font-size: 13px; }

.deck-search { max-width: var(--maxw); margin: 0 auto; padding: 10px 20px 0; }
.search-box { display: flex; align-items: center; gap: 9px; padding: 9px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; }
.search-box:focus-within { border-color: var(--terra); }
.search-mark { width: 14px; height: 14px; flex: none; border: 1.6px solid var(--soft); border-radius: 50%; position: relative; }
.search-mark::after { content: ""; position: absolute; right: -4px; bottom: -3px; width: 6px; height: 1.6px; background: var(--soft); transform: rotate(45deg); transform-origin: left; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); }
.search-box input::placeholder { color: var(--soft); }
.search-clear { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--bg-warm); color: var(--ink-soft); font-size: 15px; line-height: 1; display: grid; place-items: center; }

.chips { max-width: var(--maxw); margin: 0 auto; padding: 9px 20px 11px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; font-size: 12px; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; transition: all .18s; }
.chip:hover { border-color: var(--line-hi); }
.chip[data-active="1"] { color: #FFFDF8; background: var(--ink); border-color: var(--ink); }
.chip .g { color: var(--gold); font-size: 8px; }
.chip-reset { color: var(--terra); border-color: rgba(168,64,31,.35); background: var(--terra-soft); }

/* ── overture ── */
.overture { max-width: var(--maxw); margin: 0 auto; padding: 36px 24px 14px; display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; }
@media (min-width: 600px) { .overture { grid-template-columns: 1.4fr 1fr; padding-top: 48px; } }
.ov-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--terra); margin-bottom: 14px; }
.ov-kicker::before { content: ""; width: 26px; height: 1px; background: var(--terra); }
.overture h1 { font-family: var(--serif); font-weight: 300; font-optical-sizing: auto; font-size: clamp(46px,12vw,74px); line-height: .96; letter-spacing: -.02em; margin: 0 0 14px; color: var(--ink); }
.overture h1 em { font-style: italic; font-weight: 400; color: var(--terra); }
.ov-lede { font-size: 15px; line-height: 1.65; color: var(--ink-soft); max-width: 42ch; margin: 0 0 16px; }
.ov-note { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; background: var(--bg-warm); border-left: 2px solid var(--terra); border-radius: 0 4px 4px 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); font-style: italic; max-width: 46ch; }
.ov-note .lab { font-family: var(--serif); font-style: normal; font-weight: 500; color: var(--terra); }
.ov-photo { position: relative; aspect-ratio: 4/5; border-radius: 4px; overflow: hidden; background: linear-gradient(135deg,var(--bg-warm),#e8dcc4); box-shadow: 0 24px 60px -28px rgba(42,33,27,.45); }
.ov-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.02) contrast(1.01); }
.ov-photo .tag { position: absolute; left: 12px; bottom: 12px; font-family: var(--serif); font-style: italic; font-size: 13px; color: #FFFDF8; background: rgba(42,33,27,.5); backdrop-filter: blur(4px); padding: 4px 11px; border-radius: 999px; }

/* ── percorsi d'umore ── */
.percorsi { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 8px; }
.percorso { border-top: 1px solid var(--line); }
.percorso:last-child { border-bottom: 1px solid var(--line); }
.perc-head { width: 100%; display: grid; grid-template-columns: auto 1fr auto auto; align-items: baseline; gap: 16px; padding: 22px 4px; text-align: left; }
.perc-num { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 15px; color: var(--terra); }
.perc-title { font-family: var(--serif); font-weight: 400; font-size: clamp(23px,6vw,30px); line-height: 1.05; letter-spacing: -.01em; color: var(--ink); }
.perc-title small { display: block; font-family: var(--sans); font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.perc-title em { font-style: italic; color: var(--terra); font-weight: 400; }
.perc-hint { grid-column: 1/-1; font-size: 11.5px; font-style: italic; color: var(--soft); margin: -6px 0 0; }
.perc-count { font-size: 11px; letter-spacing: .08em; color: var(--soft); font-variant-numeric: tabular-nums; }
.perc-chev { width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-soft); transition: transform .3s; }
.perc-chev svg { width: 14px; height: 14px; }
.percorso[data-open="1"] .perc-chev { transform: rotate(180deg); color: var(--terra); }
.perc-body { display: none; padding-bottom: 26px; }
.percorso[data-open="1"] .perc-body { display: block; }

/* feature (Il piatto del momento) */
.feature { width: 100%; display: grid; gap: 14px; padding: 8px 0 4px; text-align: left; }
.feature-photo { aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: linear-gradient(135deg,var(--bg-warm),#e8dcc4); }
.feature-photo img { width: 100%; height: 100%; object-fit: cover; }
.feature-label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--terra); }
.feature h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.05; letter-spacing: -.01em; margin: 2px 0 6px; color: var(--ink); }
.feature-note { font-style: italic; color: var(--ink-soft); font-size: 14px; line-height: 1.55; margin: 0; }
.feature-foot { display: flex; align-items: baseline; justify-content: flex-end; }
.feature-price { font-family: var(--sans); font-weight: 500; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* sub-index sticky */
.subindex { position: sticky; top: var(--top-h); z-index: 20; margin: 0 -4px 6px; padding: 9px 4px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; background: linear-gradient(var(--bg) 70%, transparent); }
.subindex::-webkit-scrollbar { display: none; }
.subindex button { flex: none; padding: 5px 11px; font-size: 12px; color: var(--muted); border-radius: 999px; white-space: nowrap; position: relative; transition: color .2s, opacity .2s; }
.subindex button[aria-current="true"] { color: var(--ink); font-weight: 500; }
.subindex button[aria-current="true"]::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 1px; height: 1.5px; background: var(--gold); }
.subindex button[disabled] { opacity: .32; }

.subgroup { padding: 8px 4px 4px; scroll-margin-top: calc(var(--top-h) + 40px); }
.subgroup-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 14px; color: var(--soft); margin: 0 0 2px; }

/* item */
.item { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 14px; padding: 14px 0; border-top: 1px dashed var(--line); text-align: left; width: 100%; transition: background .15s; }
.item:hover { background: rgba(181,70,46,.025); }
.item-star { padding-top: 20px; }
.item-name { font-family: var(--serif); font-weight: 400; font-size: 18px; line-height: 1.2; color: var(--ink); letter-spacing: -.005em; }
.item-star .item-name { font-size: 21px; }
.item-star .item-name::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(168,122,58,.16); margin-right: 9px; vertical-align: middle; transform: translateY(-2px); }
.item-subname { display: block; font-family: var(--sans); font-size: 12px; color: var(--soft); margin-top: 2px; font-style: italic; }
.item-main { min-width: 0; }
.item-copy { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 4px 0 0; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 10.5px; letter-spacing: .06em; text-transform: lowercase; color: var(--soft); }
.item-meta .novita { font-family: var(--sans); text-transform: uppercase; font-size: 9px; letter-spacing: .16em; color: var(--terra); background: var(--terra-soft); border: 1px solid rgba(181,70,46,.3); padding: 2px 7px; border-radius: 999px; }
.item-meta .avail { color: var(--terra); font-style: italic; text-transform: none; letter-spacing: 0; font-size: 11px; }
.item-price { font-family: var(--sans); font-weight: 500; font-size: 15px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-star .item-price { font-size: 17px; color: var(--muted); }
.item-price .cur { font-size: 10.5px; color: var(--soft); margin-right: 1px; vertical-align: 2px; }

.empty-note { padding: 18px 4px; font-size: 13px; font-style: italic; color: var(--soft); }
.empty-note a { color: var(--terra); text-decoration: underline; }

/* ── bottom sheet (driven by body.sheet-open) ── */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(42,33,27,.42); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
body.sheet-open .scrim { opacity: 1; visibility: visible; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; max-width: var(--maxw); margin: 0 auto; max-height: 90dvh; overflow-y: auto; background: var(--paper); border-radius: 18px 18px 0 0; box-shadow: 0 -20px 60px -20px rgba(42,33,27,.4); transform: translateY(100%); transition: transform .34s cubic-bezier(.22,.61,.36,1); padding: 0 0 calc(18px + env(safe-area-inset-bottom)); }
body.sheet-open .sheet { transform: translateY(0); }
.sheet-handle { position: sticky; top: 0; height: 28px; display: grid; place-items: center; background: var(--paper); z-index: 3; cursor: grab; touch-action: none; }
.sheet-handle::before { content: ""; width: 40px; height: 4px; border-radius: 999px; background: var(--line-hi); }
.sheet-close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 5; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-warm); border: 1px solid var(--line); display: grid; place-items: center; font-size: 19px; line-height: 1; color: var(--ink-soft); }
.sheet-close:hover { background: var(--paper); border-color: var(--line-hi); }

.dish-visual { aspect-ratio: 4/3; overflow: hidden; background: linear-gradient(135deg,var(--bg-warm),#e8dcc4); }
.dish-visual img { width: 100%; height: 100%; object-fit: cover; }
.dish-visual-empty { display: grid; place-items: center; aspect-ratio: 5/2; }
.dish-monogram { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--gold); }
.dish-monogram img { width: 34px; height: auto; opacity: .7; }
.dish-monogram span { font-family: var(--serif); font-weight: 600; letter-spacing: .3em; font-size: 12px; }

.sheet-title { padding: 22px 24px 4px; }
.sheet-title h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.08; letter-spacing: -.01em; margin: 0 0 6px; color: var(--ink); }
.sheet-title p { font-size: 14px; color: var(--muted); margin: 0 0 10px; font-style: italic; }
.sheet-price { font-family: var(--serif); font-weight: 300; font-size: 30px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sheet-price .cur { font-size: 16px; color: var(--soft); }

.sheet-section { padding: 14px 24px 0; }
.sheet-section h3 { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--terra); margin: 0 0 9px; }
.sheet-section p { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); margin: 0; }
.sheet-warn h3 { color: var(--wine); }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-chip { font-size: 11.5px; padding: 5px 10px; border-radius: 999px; background: var(--bg-warm); color: var(--ink-soft); border: 1px solid var(--line); }
.detail-chip.warn { background: rgba(110,31,42,.08); color: var(--wine); border-color: rgba(110,31,42,.25); }
.combo-item { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px dashed var(--line); }
.combo-item:first-child { border-top: 0; }
.combo-item strong { font-family: var(--serif); font-weight: 400; font-size: 15px; color: var(--ink); }
.combo-item span { font-size: 11px; color: var(--soft); }

.sheet-loading { display: flex; align-items: center; gap: 10px; padding: 24px; color: var(--soft); font-size: 13px; }
.sheet-loading span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-hi); border-top-color: var(--terra); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sheet-error { padding: 8px 24px 4px; color: var(--terra); font-size: 13px; }
.sheet-error button { margin-top: 6px; padding: 6px 14px; border: 1px solid var(--terra); border-radius: 999px; color: var(--terra); font-size: 12px; }

/* ── footer ── */
.footer { max-width: var(--maxw); margin: 36px auto 0; padding: 32px 24px calc(84px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); text-align: center; }
.footer .mark { font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: .4em; padding-left: .4em; color: var(--ink); }
.footer .tag { font-size: 12px; color: var(--muted); margin: 8px 0 18px; }
.footer .links { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.footer .links a:hover { color: var(--terra); }

/* ── dock Prenota ── */
.dock { position: fixed; z-index: 30; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 8px; padding: 6px; background: rgba(26,21,30,.9); backdrop-filter: blur(12px); border: 1px solid rgba(244,239,230,.18); border-radius: 999px; box-shadow: 0 14px 40px rgba(0,0,0,.22); transition: opacity .25s; }
body.sheet-open .dock { opacity: 0; pointer-events: none; }
.dock a { white-space: nowrap; padding: 9px 16px; border-radius: 999px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: #F4EFE6; }
.dock a.primary { background: var(--terra); color: #FFFDF8; font-weight: 600; }

@media (max-width: 420px) { .overture, .percorsi { padding-left: 18px; padding-right: 18px; } .deck-row, .deck-search, .chips { padding-left: 16px; padding-right: 16px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
