/* Stili condivisi delle pagine Menu e Sezione (stile Marea: nero, oro, Playfair + Montserrat) */

:root {
  --gold: #D4AF37;
  --gold-light: #F3E5AB;
  --ink: #050505;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body { background: var(--ink); color: #fff; }
::selection { background: var(--gold); color: var(--ink); }

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Focus visibile per chi usa la tastiera */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* Link "salta al contenuto" */
.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100; padding: 12px 16px;
  background: var(--gold); color: var(--ink); font-weight: 600; font-size: 14px; border-radius: 4px;
  transition: transform .3s var(--ease);
}
.skip-link:focus { transform: translateY(80px); }

/* ---------------------------------------------------------------- navigazione flottante */
.site-nav { transition: transform .5s var(--ease); }
.site-nav .nav-shell {
  background: rgba(5, 5, 5, .55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: background-color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
/* Quando si scorre, una fascia scura copre la zona sopra la barra fissa: niente contenuti che "passano" dietro la nav */
.site-nav::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 76px; z-index: -1;
  background: rgba(5, 5, 5, .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; transition: opacity .4s var(--ease); pointer-events: none;
}
@media (min-width: 768px) { .site-nav::before { height: 84px; } }
.site-nav.is-scrolled::before { opacity: 1; }
.site-nav.is-scrolled .nav-shell {
  background: rgba(5, 5, 5, .82);
  border-color: rgba(212, 175, 55, .18);
  box-shadow: 0 16px 40px -20px rgba(0, 0, 0, .9);
}
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9999px;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .75);
  transition: color .3s var(--ease), background-color .3s var(--ease);
}
.nav-link:hover { color: var(--gold); background: rgba(255, 255, 255, .04); }
.nav-link[aria-current="page"] { color: var(--gold); }

/* Selettore lingua */
.lang-switcher { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, .12); font-size: 12px; letter-spacing: .12em; color: #fff;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.lang-btn:hover, .lang-btn[aria-expanded="true"] { border-color: var(--gold); background: rgba(212, 175, 55, .08); }
.lang-btn img { border-radius: 2px; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 12px); min-width: 200px; padding: 8px;
  background: rgba(18, 18, 18, .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9);
  animation: pop-in .3s var(--ease);
}
.lang-item {
  display: flex; width: 100%; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; color: rgba(255, 255, 255, .8); text-align: left;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.lang-item:hover, .lang-item:focus-visible { background: rgba(255, 255, 255, .06); color: var(--gold); outline: none; }
.lang-item.is-active { color: var(--gold); }
.lang-item img { border-radius: 2px; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* ---------------------------------------------------------------- hero */
.hero-media { transform: scale(1.06); animation: hero-in 1.6s var(--ease) forwards; }
@keyframes hero-in { to { transform: scale(1); } }
/* Sfuma la foto nel nero della pagina */
.hero-fade { background: linear-gradient(to bottom, rgba(5, 5, 5, 0) 0%, var(--ink) 100%); }

.eyebrow { font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.gold-rule { display: inline-block; width: 40px; height: 1px; background: var(--gold); vertical-align: middle; }

/* Campo di ricerca */
.search-field {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.search-field:focus-within { border-color: var(--gold); background: rgba(5, 5, 5, .7); }
.search-field input { background: transparent; outline: none; }
.search-field input::placeholder { color: rgba(255, 255, 255, .45); }
.search-field input::-webkit-search-cancel-button { display: none; }

/* ---------------------------------------------------------------- barre fisse (cucine / sezioni) */
.sticky-bar {
  background: rgba(5, 5, 5, .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.scroll-x { overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { scroll-snap-align: start; }

.tab {
  position: relative; flex-shrink: 0; padding: 12px 16px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55); white-space: nowrap; transition: color .3s var(--ease);
}
.tab::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px; height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: center; transition: transform .5s var(--ease);
}
.tab:hover { color: #fff; }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--gold); }
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after { transform: scaleX(1); }

.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 8px 16px; border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, .14); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #fff;
  transition: border-color .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.chip-btn:hover { border-color: var(--gold); color: var(--gold); }
.chip-btn:active { transform: scale(.98); }
.chip-btn.is-on { background: var(--gold); border-color: var(--gold); color: var(--ink); }

/* ---------------------------------------------------------------- card delle sezioni */
.section-card img { transition: transform 1.4s var(--ease); }
.section-card:hover img, .section-card:focus-visible img { transform: scale(1.06); }
.section-card .card-shade { transition: background-color .5s var(--ease); }
.section-card:hover .card-shade { background-color: rgba(0, 0, 0, .3); }
.section-card .card-frame { transition: border-color .5s var(--ease), inset .5s var(--ease); }
.section-card:hover .card-frame { border-color: rgba(212, 175, 55, .55); }
.section-card .card-arrow { transition: transform .5s var(--ease), background-color .3s var(--ease), color .3s var(--ease); }
.section-card:hover .card-arrow { transform: translate(2px, -2px); background: var(--gold); color: var(--ink); }

/* ---------------------------------------------------------------- piatti */
.leader { flex: 1; min-width: 24px; border-bottom: 1px dotted rgba(255, 255, 255, .18); transform: translateY(-6px); }
.dish { transition: opacity .5s var(--ease); }
.dish.is-soldout .dish-name { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .35); }
.dish.is-highlighted { animation: highlight 2.4s var(--ease); }
@keyframes highlight { 0%, 40% { background: rgba(212, 175, 55, .12); } 100% { background: transparent; } }

.allergen-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, .12); font-size: 11px; line-height: 16px; letter-spacing: .04em; color: rgba(255, 255, 255, .65);
}
.allergen-tag.is-traces { border-style: dashed; color: rgba(255, 255, 255, .45); }
.allergen-tag svg { color: var(--gold); }

/* Pannello filtro allergeni: dal basso su mobile, centrato su desktop */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .4s var(--ease); }
.sheet-backdrop.is-open { opacity: 1; }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto;
  background: #121212; border: 1px solid rgba(255, 255, 255, .08); border-radius: 24px 24px 0 0;
  transform: translateY(105%); transition: transform .5s var(--ease);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet.is-open { transform: translateY(0); }
@media (min-width: 768px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 640px; border-radius: 24px; transform: translate(-50%, -46%); opacity: 0; transition: transform .5s var(--ease), opacity .4s var(--ease); }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
}
.allergen-toggle {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; text-align: left;
  border: 1px solid rgba(255, 255, 255, .1); font-size: 14px; color: rgba(255, 255, 255, .85);
  transition: border-color .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.allergen-toggle:hover { border-color: rgba(212, 175, 55, .6); }
.allergen-toggle svg { color: var(--gold); flex-shrink: 0; }
.allergen-toggle[aria-pressed="true"] { background: rgba(212, 175, 55, .14); border-color: var(--gold); color: #fff; }
.allergen-toggle .check { margin-left: auto; opacity: 0; transform: scale(.6); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.allergen-toggle[aria-pressed="true"] .check { opacity: 1; transform: scale(1); }

/* ---------------------------------------------------------------- comparsa allo scroll */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- caricamento */
.skeleton {
  background: linear-gradient(90deg, #141414 0%, #1f1f1f 50%, #141414 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 32px;
  background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  transition: background-color .3s var(--ease), transform .2s var(--ease);
}
.btn-gold:hover { background: #fff; }
.btn-gold:active { transform: scale(.98); }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 32px;
  border: 1px solid var(--gold); color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.btn-outline:hover { background: var(--gold); color: var(--ink); }
.btn-outline:active { transform: scale(.98); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { transform: none; }
  .hero-media { transform: none; }
}
