/* ===================================================================
   TRILOGY HUMAN — Shared stylesheet for inner pages
   =================================================================== */

:root {
  --bg-deep: #000;
  --bg-section: #0a0a08;
  --bg-elev: #14120d;
  --gold: #C5A55A;
  --gold-soft: #d4b76a;
  --gold-dim: #9a8455;
  --gold-line: rgba(197,165,90,0.22);
  --gold-glow: rgba(197,165,90,0.08);
  --ink: #fff;
  --ink-mute: #c9c5bd;
  --ink-dim: #888378;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Montserrat', -apple-system, sans-serif;
  --w-content: 1180px;
  --w-narrow: 820px;
  --r-md: 8px;
  --r-lg: 14px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg-deep);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
em { font-style: italic; }

/* ============ NAV ============ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(197,165,90,0.12);
  transition: background .3s, box-shadow .3s;
}
.navbar.scrolled {
  background: rgba(0,0,0,0.97);
  box-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.nav-logo img { height: 38px; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  font-size: 0.78rem; font-weight: 500; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--ink-mute);
  transition: color .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-cta {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--gold);
  color: var(--gold) !important;
  border-radius: 100px;
}
.nav-cta:hover { background: var(--gold); color: #000 !important; }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--gold); transition: all .3s; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============ PAGE HEADER ============ */
.page-header {
  padding: 9rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 1000px; height: 600px;
  background: radial-gradient(ellipse at center, var(--gold-glow), transparent 60%);
  pointer-events: none;
}
.breadcrumb {
  font-size: 0.7rem; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 1.5rem;
  position: relative;
}
.breadcrumb a { transition: color .25s; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { margin: 0 0.6rem; opacity: 0.5; }
.breadcrumb .current { color: var(--gold-dim); }
.page-header h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 1.25rem;
  position: relative;
}
.page-header h1 em { font-style: italic; color: var(--gold); font-weight: 400; }
.page-header .lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink-mute);
  max-width: 60ch;
  margin: 0 auto;
  position: relative;
}
.page-header .eyebrow {
  font-size: 0.7rem; letter-spacing: 4px; text-transform: uppercase;
  color: var(--gold); font-weight: 500; display: inline-block; margin-bottom: 1.5rem;
  position: relative;
}

/* ============ GENERIC SECTION ============ */
.section { padding: 5rem 2rem; }
.section-dark { background: var(--bg-section); }
.section-elev { background: var(--bg-elev); }
.section-bordered {
  border-top: 1px solid rgba(197,165,90,0.1);
  border-bottom: 1px solid rgba(197,165,90,0.1);
}
.container { max-width: var(--w-content); margin: 0 auto; }
.container-narrow { max-width: var(--w-narrow); margin: 0 auto; }

.section-eyebrow {
  font-size: 0.7rem; letter-spacing: 4px; text-transform: uppercase;
  color: var(--gold); font-weight: 500;
  display: block; margin-bottom: 1rem;
}
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.section-title em { font-style: italic; color: var(--gold); font-weight: 400; }
.section-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink-mute);
  max-width: 60ch;
  margin-bottom: 2.5rem;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 100px;
  transition: all .3s ease;
  border: 1px solid transparent;
}
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: var(--gold-soft); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-ghost:hover { background: var(--gold); color: #000; }
.btn svg { width: 14px; height: 14px; }

/* CTA inline corsivo dorato — uso preferito per "Scopri →" */
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--gold);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  border-bottom: 1px solid rgba(197,165,90,0.4);
  padding-bottom: 0.3rem;
  transition: gap .25s, border-color .25s;
}
.link-arrow:hover { gap: 0.95rem; border-bottom-color: var(--gold); }
.link-arrow .arrow { font-size: 1.1rem; line-height: 1; }

/* ============ FOOTER ============ */
.footer {
  background: #030303;
  border-top: 1px solid var(--gold-line);
  padding: 4rem 2rem 2rem;
  text-align: center;
}
.footer-logo { width: 120px; margin: 0 auto 1.5rem; opacity: 0.5; }
.footer-text {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 4px;
  margin-bottom: 1.5rem;
}
.footer-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin: 2rem auto;
  max-width: 800px;
  text-align: center;
}
.footer-info-row > div p:first-child {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  margin-bottom: 1rem;
}
.footer-info-row > div p:last-child {
  color: var(--ink-mute);
  font-size: 0.82rem;
  line-height: 1.9;
  letter-spacing: 0.3px;
}
.footer-info-row a { color: var(--ink-mute); transition: color .2s; }
.footer-info-row a:hover { color: var(--gold); }
.footer-divider {
  width: 60px; height: 1px;
  background: rgba(197,165,90,0.3);
  margin: 1.2rem auto;
}
.footer-divider-faint { background: rgba(197,165,90,0.15); }
.footer-copy {
  color: var(--ink-dim);
  font-size: 0.7rem;
  letter-spacing: 1px;
  margin-top: 1.5rem;
}

/* ============ COOKIE BANNER ============ */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #111;
  border-top: 1px solid rgba(197,165,90,0.2);
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  z-index: 200;
  transform: translateY(100%);
  transition: transform .4s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { font-size: 0.78rem; color: #ccc; flex: 1; margin: 0; }
.cookie-banner p a { color: var(--gold); text-decoration: underline; cursor: pointer; }
.cookie-banner button {
  background: var(--gold); color: #000;
  border: none; border-radius: 4px;
  padding: 0.5rem 1.5rem;
  font-family: var(--sans);
  font-weight: 600; font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .3s;
}
.cookie-banner button:hover { background: var(--gold-soft); }
@media (max-width: 768px) {
  .cookie-banner { flex-direction: column; text-align: center; padding: 1rem 1.25rem; }
}

/* ============ PRIVACY MODAL ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  display: none; align-items: center; justify-content: center;
  padding: 2rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #111;
  border: 1px solid rgba(197,165,90,0.2);
  border-radius: var(--r-lg);
  max-width: 720px; width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
}
.modal-box h2 {
  font-family: var(--serif);
  font-size: 1.8rem; color: var(--gold);
  margin-bottom: 1rem;
}
.modal-box p, .modal-box li {
  font-size: 0.85rem; color: var(--ink-mute); line-height: 1.7;
  margin-bottom: 0.6rem;
}
.modal-box h3 {
  font-size: 0.95rem; color: var(--gold);
  margin: 1.2rem 0 0.5rem;
  letter-spacing: 0.5px;
}
.modal-box a { color: var(--gold); }
.modal-close {
  position: absolute;
  top: 1rem; right: 1.25rem;
  background: none; border: none;
  color: var(--gold); font-size: 1.7rem;
  cursor: pointer; line-height: 1;
}
@media (max-width: 600px) {
  .modal-box { padding: 1.5rem; }
}

/* ============ RESPONSIVE NAV ============ */
/* Backdrop dietro al pannello mobile: presente nel DOM solo quando il menu e'
   aperto. Coperto da JS (site-chrome.js). Click sul backdrop chiude il menu. */
.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
/* Lock dello scroll del body quando il menu mobile è aperto. */
body.nav-mobile-open { overflow: hidden; }

@media (max-width: 900px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    /* Altezza basata su dynamic viewport height (dvh): considera la URL bar
       dinamica di iOS Safari/Chrome. `bottom: 0` o `height: 100vh` su iOS
       calcolano sulla viewport "ideale" piena, ma il pannello visibile e'
       ridotto dalle barre browser → contenuto va in overflow. Con `100dvh`
       l'altezza coincide con la viewport visibile. Fallback `100vh` per
       browser piu' vecchi che non supportano dvh. */
    height: 100vh;
    height: 100dvh;
    width: min(320px, 85vw);
    /* Sfondo SOLIDO (no rgba con alpha) per non far traspassare i contenuti. */
    background: #0a0a0a;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(197,165,90,0.18);
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    /* Padding ridotto al minimo + voci col flex-grow. Layout: la nav-cta
       resta in basso (margin-top: auto), le voci normali in alto. Scroll
       interno solo se davvero non ci stanno (caso veramente raro). */
    padding: 4rem 1.5rem max(1rem, env(safe-area-inset-bottom));
    gap: 0.25rem;
    transform: translateX(100%);
    transition: transform .35s ease;
    align-items: stretch;
    z-index: 99;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a {
    font-size: 0.85rem;
    width: 100%;
    padding: 0.6rem 0;
    text-align: left;
  }
  .hamburger { display: flex; z-index: 101; position: relative; }
  /* nav-cta: pill compatto centrato in basso, NON stretched a tutta larghezza.
     Specificity boost (.nav-links a.nav-cta) per battere .nav-links a che ha
     width: 100% e padding orizzontale 0. Senza questo, le proprietà del pill
     vengono sovrascritte e diventa stretched. */
  .nav-links a.nav-cta {
    width: auto;
    align-self: center;
    text-align: center;
    margin: auto auto 0.75rem;
    padding: 0.9rem 2.5rem;
    letter-spacing: 1.5px;
  }
}

@media (max-width: 768px) {
  .page-header { padding: 7rem 1.25rem 3rem; }
  .section { padding: 3.5rem 1.25rem; }
  .footer-info-row { grid-template-columns: 1fr; gap: 2.5rem; }
}
