/* ── VARIABILI ──────────────────────────────────────────────── */
:root {
  --bg:       #faf9f5;
  --text:     #1a1712;
  --muted:    rgba(26,23,18,0.42);
  --accent:   #8a6020;
  --sep:      rgba(26,23,18,0.1);
  --white:    #ffffff;

  --font-d:   'Cormorant Garamond', Georgia, serif;
  --font-m:   'Courier New', Courier, monospace;
  --font-s:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-h:    66px;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── NAVIGAZIONE ────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.nav-logo {
  font-family: var(--font-d);
  font-size: 1.5rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #000;
  z-index: 1001;
}

.nav-links {
  display: flex;
  gap: 2.8rem;
  list-style: none;
}

.nav-links a {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
  opacity: 0.78;
  transition: opacity 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
}

/* ── HAMBURGER ──────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
  z-index: 1001;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── TRANSIZIONE PAGINA ─────────────────────────────────────── */
.page {
  display: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.page.active {
  display: block;
  opacity: 1;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
/* Sta in fondo alle pagine interne. In home non c'e': li' la pagina
   scorre in orizzontale e non ha una fine dove appoggiarlo. */
#footer {
  display: none;
  background: #12100d;
  color: var(--bg);
  padding: 6vh 6vw 2.4rem;
}

#footer.visibile { display: block; }

.ft-corpo {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 3vw;
  max-width: 1400px;
  margin: 0 auto;
}

.ft-col__tit {
  font-family: var(--font-d);
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 1.2rem;
}

.ft-col__tit a { color: var(--bg); }

.ft-frase {
  font-family: var(--font-s);
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(250,249,245,0.62);
  margin: 0 0 1.2rem;
  max-width: 30ch;
}

.ft-lista {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ft-lista li { margin-bottom: 0.6rem; }

.ft-lista a,
#footer a {
  font-family: var(--font-s);
  font-size: 0.92rem;
  /* Non pieno bianco: sul nero stancherebbe, e lascia risaltare i titoli */
  color: rgba(250,249,245,0.66);
  text-decoration: none;
  transition: color 0.2s;
}

.ft-lista a:hover,
.ft-col__tit a:hover { color: var(--bg); }

.ft-piede {
  max-width: 1400px;
  margin: 5vh auto 0;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(250,249,245,0.14);
  font-family: var(--font-m);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: rgba(250,249,245,0.45);
}

@media (max-width: 768px) {
  /* Due colonne invece di quattro: a colonna singola diventerebbe
     una lista lunghissima da scorrere */
  .ft-corpo { grid-template-columns: 1fr 1fr; gap: 2.4rem 6vw; }
  .ft-col--contatti { grid-column: 1 / -1; }
  #footer { padding: 5vh 7vw 2rem; }
}

/* ── MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  /* Senza backdrop-filter #nav non "intrappola" più il position:fixed
     di .nav-links, che così copre l'intera viewport */
  #nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Overlay full-page — sfondo bianco come la barra desktop */
  .nav-links {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ffffff;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    z-index: 999;
    padding: 0 10vw;
    /* Transizione di apertura */
    display: flex;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--sep);
  }

  .nav-links li:first-child {
    border-top: 1px solid var(--sep);
  }

  .nav-links a {
    display: block;
    padding: 1.4rem 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #000;
    opacity: 0.55;
    transition: opacity 0.2s;
  }

  .nav-links a.active {
    opacity: 1;
  }
}