/* ============================================================
   staged.ai — institutional pages add-ons
   Builds on styles.css tokens (cream / gold / espresso).
   Adds: mobile nav, page hero, forms, legal prose, cookie banner.
   ============================================================ */

/* ---------- NAV: mobile burger + dropdown ---------- */
.nav-burger {
  display: none; width: 42px; height: 42px; border-radius: var(--r-md);
  align-items: center; justify-content: center; color: var(--ink);
}
.nav-burger span, .nav-burger span::before, .nav-burger span::after {
  content: ""; display: block; width: 20px; height: 2px; background: currentColor;
  border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.nav-burger span { position: relative; }
.nav-burger span::before { position: absolute; top: -6px; left: 0; }
.nav-burger span::after  { position: absolute; top: 6px; left: 0; }

/* dropdown inside the flat nav (used for "Prodotto") */
.nav-dd { position: relative; }
.nav-dd__toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-2); font-weight: 500; }
.nav-dd__toggle:hover, .nav-dd[data-open="true"] .nav-dd__toggle { color: var(--ink); }
.nav-dd__toggle svg { transition: transform .2s var(--ease); }
.nav-dd[data-open="true"] .nav-dd__toggle svg { transform: rotate(180deg); }
.nav-dd__menu {
  position: absolute; top: calc(100% + 16px); left: 50%; transform: translateX(-50%) translateY(-6px);
  min-width: 220px; padding: 8px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-md);
  opacity: 0; visibility: hidden; transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.nav-dd[data-open="true"] .nav-dd__menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-dd__menu a { display: block; padding: 9px 12px; border-radius: var(--r-sm); font-size: 14.5px; color: var(--ink-2); }
.nav-dd__menu a:hover { background: var(--cream-2); color: var(--ink); }

@media (max-width: 900px) {
  .nav-burger { display: inline-flex; }
  /* override styles.css `.nav{display:none}` to a slide-down panel */
  .nav.nav--mobile {
    display: flex !important; position: fixed; inset: 72px 0 auto 0; z-index: 55;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px; max-height: calc(100dvh - 72px); overflow-y: auto;
    box-shadow: var(--sh-md);
  }
  .nav:not(.nav--mobile) { display: none; }
  .nav.nav--mobile a, .nav.nav--mobile .nav-dd__toggle { padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 16px; width: 100%; }
  .nav.nav--mobile .nav-dd { width: 100%; }
  .nav.nav--mobile .nav-dd__menu {
    position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none;
    border: 0; min-width: 0; padding: 0 0 6px 14px; max-height: 0; overflow: hidden; transition: max-height .2s var(--ease);
  }
  .nav.nav--mobile .nav-dd[data-open="true"] .nav-dd__menu { max-height: 340px; }
}

/* ---------- PAGE HERO (internal pages) ---------- */
.page-hero { padding-block: var(--s-11) var(--s-8); }
.page-hero .eyebrow { margin-bottom: var(--s-5); }
.page-hero h1 { margin-bottom: var(--s-5); }
.page-hero .lead { max-width: 60ch; }
.page-hero--center { text-align: center; }
.page-hero--center .eyebrow { justify-content: center; }
.page-hero--center .lead { margin-inline: auto; }

/* generic prose body sits on cream; constrain width */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-5); }
.icard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-3);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.icard:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--sh-md); }
.icard .ico {
  width: 46px; height: 46px; border-radius: var(--r-md); background: var(--gold-soft);
  display: grid; place-items: center; font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--gold-deep);
}
.icard h3 { font-family: var(--font-display); font-size: 20px; font-weight: 500; }
.icard p { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.icard a { color: var(--gold-deep); font-weight: 600; }

/* ---------- TIMELINE (storia / roadmap) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.timeline li { position: relative; padding: 0 0 var(--s-7) var(--s-7); border-left: 1.5px solid var(--line-2); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.timeline .t-label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep); }
.timeline h4 { font-family: var(--font-display); font-size: 20px; font-weight: 500; margin: 6px 0 6px; }
.timeline p { font-size: 15px; color: var(--ink-2); margin: 0; line-height: 1.55; }

/* ---------- FORMS ---------- */
.form { display: grid; gap: var(--s-5); max-width: 560px; }
.form .row { display: grid; gap: var(--s-5); grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.form textarea.input { resize: vertical; min-height: 130px; line-height: 1.5; }
.form .req { color: var(--gold-deep); }
select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238C8275' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
.form-msg { font-size: 14.5px; padding: 13px 16px; border-radius: var(--r-md); display: none; }
.form-msg.show { display: block; }
.form-msg.ok { background: var(--sage-soft); color: var(--sage); }
.form-msg.err { background: #F6E3DC; color: #9A4B36; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* inline newsletter */
.newsletter { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: flex-end; max-width: 600px; }
.newsletter .field { flex: 1 1 200px; }
.newsletter .btn { white-space: nowrap; }
.newsletter .form-msg { flex-basis: 100%; }

/* ---------- LEGAL PROSE ---------- */
.prose { max-width: 760px; }
.prose .updated { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); margin-bottom: var(--s-4); }
.prose h2 {
  font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.15;
  margin: var(--s-9) 0 var(--s-3); scroll-margin-top: 88px;
}
.prose h3 { font-family: var(--font-display); font-weight: 500; font-size: 19px; margin: var(--s-6) 0 var(--s-2); }
.prose p, .prose li { color: var(--ink-2); line-height: 1.7; font-size: 16px; }
.prose ul, .prose ol { padding-left: 22px; margin: var(--s-3) 0; }
.prose li { margin-bottom: 7px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
.prose a:hover { text-decoration-color: var(--gold-deep); }
.prose .callout {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: var(--r-md); padding: 16px 18px; margin: var(--s-5) 0; font-size: 15px; color: var(--ink-2);
}
.prose table { width: 100%; border-collapse: collapse; margin: var(--s-5) 0; font-size: 14.5px; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.prose td { color: var(--ink-2); }
.prose td code, .prose p code { font-family: var(--font-mono); background: var(--cream-2); padding: 2px 6px; border-radius: 5px; font-size: 13px; color: var(--ink); }
.prose .cta-inline { color: var(--gold-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- COOKIE BANNER + MODAL ---------- */
.ck-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  max-width: 560px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg); padding: 22px 24px;
  animation: ckIn .3s var(--ease) both;
}
@keyframes ckIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ck-banner p { margin: 0 0 var(--s-4); font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.ck-banner p a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 2px; }
.ck-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.ck-link { color: var(--ink-3); font-size: 14px; text-decoration: underline; text-underline-offset: 2px; margin-left: auto; }
.ck-link:hover { color: var(--ink-2); }

.ck-overlay {
  position: fixed; inset: 0; z-index: 95; display: none;
  background: rgba(34,29,21,.45); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.ck-overlay.show { display: flex; }
.ck-modal { width: 100%; max-width: 470px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-lg); padding: var(--s-7); }
.ck-modal h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin-bottom: var(--s-2); }
.ck-modal > p { margin: 0 0 var(--s-5); font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.ck-toggle { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-5); padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.ck-toggle:first-of-type { border-top: none; }
.ck-toggle .t-text strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 3px; }
.ck-toggle .t-text span { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.ck-switch { position: relative; flex: 0 0 auto; width: 44px; height: 24px; }
.ck-switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ck-switch .track { position: absolute; inset: 0; background: var(--sand); border-radius: var(--r-full); transition: background .2s var(--ease); }
.ck-switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--card); box-shadow: var(--sh-sm); transition: transform .2s var(--ease); }
.ck-switch input:checked + .track { background: var(--gold); }
.ck-switch input:checked + .track::after { transform: translateX(20px); }
.ck-switch input:disabled + .track { background: var(--gold); opacity: .55; }
.ck-modal-actions { display: flex; gap: var(--s-3); margin-top: var(--s-6); }
.ck-modal-actions .btn { flex: 1; justify-content: center; }

/* hreflang/lang switch in nav uses .lang from styles.css; ensure links look like buttons */
.lang a { padding: 5px 12px; border-radius: var(--r-full); color: var(--ink-3); transition: all .2s var(--ease); }
.lang a[aria-current="true"] { background: var(--card); color: var(--ink); box-shadow: var(--sh-sm); }

/* ---------- STUDIO (functional demo on index.html) ---------- */
.studio__drop.is-over { border-color: var(--gold); background: var(--gold-soft); }
.hs-preview { display: none; align-items: center; gap: var(--s-4); padding: var(--s-4); background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.hs-preview.show { display: flex; }
.hs-preview__thumb { width: 64px; height: 48px; border-radius: var(--r-sm); background: var(--sand) center/cover no-repeat; flex: 0 0 auto; border: 1px solid var(--line); }
.hs-preview__meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hs-preview__meta b { font-size: 14px; }
.hs-preview__meta span { font-size: 12.5px; color: var(--ink-3); }

.hs-loading { display: none; flex-direction: column; gap: 12px; padding: var(--s-5) 0; }
.hs-loading.show { display: flex; }
.hs-loading__row { display: flex; align-items: center; gap: 12px; }
.hs-loading__bar { height: 4px; border-radius: var(--r-full); background: var(--sand); overflow: hidden; }
.hs-loading__bar span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: var(--r-full); transition: width .8s var(--ease); }
.hs-loading .mono { color: var(--ink-2); }
.hs-loading__stat { font-size: 14.5px; color: var(--ink); line-height: 1.5; min-height: 2.6em; }
.hs-loading__stat b { color: var(--gold-deep); font-family: var(--font-display); font-size: 20px; }
.hs-spinner { width: 22px; height: 22px; flex: 0 0 auto; border: 2.5px solid var(--sand); border-top-color: var(--gold); border-radius: 50%; animation: hsSpin .8s linear infinite; }
@keyframes hsSpin { to { transform: rotate(360deg); } }
.hs-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; line-height: 1.4; }
.hs-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--gold-deep); flex: 0 0 auto; }
.hidden { display: none !important; }
.proof__grid--3 { grid-template-columns: repeat(3, 1fr) !important; }
@media (max-width: 720px) { .proof__grid--3 { grid-template-columns: 1fr 1fr !important; } }
.proof__src { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: var(--s-5); }
@media (prefers-reduced-motion: reduce) { .hs-spinner { animation-duration: 2s; } }

.hs-result { display: none; flex-direction: column; gap: var(--s-5); }
.hs-result.show { display: flex; }
.hs-result__frame { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--sh-md); background: var(--sand); }
.hs-result__frame img { width: 100%; display: block; }
.hs-result__toggle { position: absolute; right: 14px; bottom: 14px; background: rgba(255,253,249,.92); backdrop-filter: blur(6px); color: var(--ink); padding: 8px 14px; border-radius: var(--r-full); font-size: 12.5px; font-weight: 600; box-shadow: var(--sh-sm); }

.hs-register { border-top: 1px solid var(--line); padding-top: var(--s-6); }
.hs-register h3 { margin-bottom: var(--s-2); }
.hs-register > p { color: var(--ink-2); font-size: 15px; margin-bottom: var(--s-5); max-width: 60ch; }
.hs-sent { display: none; margin-top: var(--s-4); padding: 14px 16px; background: var(--sage-soft); border-radius: var(--r-md); }
.hs-sent.show { display: block; }
.hs-sent b { display: block; color: var(--sage); margin-bottom: 3px; }
.hs-sent span { font-size: 14px; color: var(--ink-2); }

/* hero before/after slider (tabbed) */
.ba { cursor: ew-resize; }
.ba__layer img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ba__handle { box-shadow: 0 0 0 1px rgba(34,29,21,.12), 0 0 14px 3px rgba(201,168,108,.75); }
.ba__knob { box-shadow: var(--sh-md), 0 0 16px 3px rgba(201,168,108,.6); cursor: ew-resize; }
.ba-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ba-tab { padding: 7px 13px; border-radius: var(--r-full); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all .18s var(--ease); }
.ba-tab:hover { color: var(--ink); }
.ba-tab.is-on { background: var(--gold-soft); color: var(--gold-deep); box-shadow: inset 0 0 0 1px var(--gold); }

/* real images: hero lens, finalità cards, steps */
.lens__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fin-card__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); margin-bottom: var(--s-2); display: block; }
.step__media img.step__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* city autocomplete (studio) */
.hs-ac { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--sh-md); overflow: hidden; display: none; }
.hs-ac.show { display: block; }
.hs-ac__item { display: block; width: 100%; text-align: left; padding: 10px 14px; font-size: 14.5px; color: var(--ink); }
.hs-ac__item:hover { background: var(--cream-2); }

/* utility */
.center { text-align: center; }
.mt-6 { margin-top: var(--s-6); }
.mt-9 { margin-top: var(--s-9); }
