/* ==========================================================
   Versione B — header essenziale + menu laterale a cascata
   ========================================================== */

/* ---------- Header ---------- */
.hb { position: sticky; top: 0; z-index: 40; background: #fff; color: var(--ink); border-bottom: 1px solid var(--line);
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s; }
.hb svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.hb__util { max-width: var(--max); margin: 0 auto; padding: 8px var(--gut) 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-size: 12px; letter-spacing: .04em; }
.hb__util p { text-align: center; }
.hb__util-right { display: flex; justify-content: flex-end; gap: 22px; }
.hb__util-link { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; }
.hb__util-link svg { width: 15px; height: 15px; }
.hb__util-link:hover { color: var(--gold); }
.hb__row { max-width: var(--max); margin: 0 auto; padding: 6px var(--gut) 12px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.hb__left, .hb__right { display: flex; align-items: center; gap: 20px; }
.hb__right { justify-content: flex-end; }
.hb__menu { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: 13px; letter-spacing: .08em; }
.hb__menu:hover { color: var(--gold); }
.hb__burger { display: flex; flex-direction: column; gap: 5px; width: 22px; }
.hb__burger span { height: 1px; background: currentColor; transition: width .3s var(--ease); }
.hb__burger span:nth-child(2) { width: 70%; }
.hb__menu:hover .hb__burger span:nth-child(2) { width: 100%; }
.hb__logo img { height: 78px; width: auto; transition: height .3s var(--ease), filter .35s; }
.hb.is-compact .hb__logo img { height: 54px; }

/* header trasparente sopra la hero in home */
.layout-b.is-home .hb:not(.is-solid) { background: transparent; color: #fff; border-color: transparent; }
.layout-b.is-home .hb:not(.is-solid) .hb__logo img { filter: invert(1); }
.layout-b.is-home .hb:not(.is-solid) .badge { background: #fff; color: var(--ink); }
.layout-b.is-home .hb { position: fixed; left: 0; right: 0; }
.layout-b.is-home .hero::before { content: ''; position: absolute; inset: 0 0 auto; height: 180px; z-index: 1; background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,0)); pointer-events: none; }

/* ---------- Menu laterale ---------- */
.sm { position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; display: flex; pointer-events: none; }
.sm__panels { display: flex; height: 100%; transform: translateX(-100%); transition: transform .5s var(--ease); pointer-events: auto; box-shadow: 0 0 60px rgba(0,0,0,.08); }
.sm.is-on .sm__panels { transform: none; }
.sm__panel { width: 340px; height: 100%; background: #fff; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.sm__panel + .sm__panel { border-left: 1px solid var(--line); animation: sm-in .4s var(--ease); }
@keyframes sm-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.sm__head { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 28px; flex: none; }
.sm__head svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.sm__back { display: none; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; min-height: 44px; }
.sm__title { font: 400 11px var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.sm__list { padding: 4px 0 24px; flex: none; }
.sm__item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  padding: 11px 28px; font-size: 15px; letter-spacing: .02em; position: relative; transition: color .2s, background .2s; }
.sm__item:hover { color: var(--gold-dark); }
.sm__item.is-on { font-weight: 400; background: var(--ivory); }
.sm__item.is-on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.sm__item svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; flex: none; }
.sm__item--big { font-family: var(--serif); font-size: 22px; padding-top: 9px; padding-bottom: 9px; }
.sm__item--accent { color: var(--gold-dark); }
.sm__thumb { display: flex; align-items: center; gap: 14px; }
.sm__thumb img { width: 44px; height: 44px; object-fit: cover; background: var(--ivory); }
.sm__sep { height: 1px; background: var(--line); margin: 14px 28px; }
.sm__label { display: block; padding: 14px 28px 6px; font: 400 11px var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.sm__teaser { display: block; margin: 8px 28px 28px; }
.sm__teaser img { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-bottom: 12px; transition: transform .8s var(--ease); }
.sm__teaser:hover img { transform: scale(1.03); }
.sm__teaser-wrap { overflow: hidden; }
.sm__teaser strong { display: block; font-family: var(--serif); font-size: 21px; font-weight: 400; }
.sm__teaser small { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.sm__util { margin-top: auto; padding: 18px 28px; border-top: 1px solid var(--line); display: grid; gap: 4px; flex: none; }
.sm__util a { display: flex; align-items: center; gap: 12px; font-size: 13px; min-height: 34px; }
.sm__util a:hover { color: var(--gold-dark); }
.sm__util svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.sm__locale { display: flex; align-items: center; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--line); font-size: 13px; flex: none; }
.sm__flag { width: 26px; height: 26px; border-radius: 50%; background: var(--ivory); border: 1px solid var(--line); display: grid; place-items: center; font-size: 9px; letter-spacing: .05em; }
.sm__lang { margin-left: auto; color: var(--muted); font-size: 12px; }
.sm__lang b { color: var(--ink); font-weight: 400; }

/* ---------- Mobile: livelli a scorrimento con "Indietro" ---------- */
@media (max-width: 900px) {
  .hb__util p, .hb__util-right .hb__util-link:first-child { display: none; }
  .hb__util { grid-template-columns: 1fr 1fr; }
  .hb__menu-label { display: none; }
  .hb__logo img { height: 58px; }
  .hb__right { gap: 14px; }
  .sm__panels { position: relative; width: 100vw; max-width: 420px; }
  .sm__panel { position: absolute; inset: 0; width: 100%; }
  .sm__panel + .sm__panel { border-left: 0; animation: sm-slide .4s var(--ease); }
  @keyframes sm-slide { from { transform: translateX(100%); } to { transform: none; } }
  .sm__back { display: inline-flex; }
  .sm__item.is-on { background: none; }
  .sm__item.is-on::before { display: none; }
}
@media (max-width: 600px) {
  .hb__util { display: none; }
  .hb__row { padding-top: 10px; }
}
