/* === VARIABILI COLORI — palette ufficiale Casa Giò === */
:root {
  --navy:        #1b2a4a;           /* blu navy scuro — hero, sezione dove siamo */
  --navy-light:  #243555;           /* navy medio — hover, accenti scuri */
  --beige:       #f5efe6;           /* beige caldo — sfondo gallery e footer */
  --beige-dark:  #e8ddd0;           /* beige più scuro — bordi, separatori */
  --gold:        #c9a84c;           /* oro — accenti, bottoni, linee decorative */
  --text-light:  #f5efe6;           /* testo su sfondi scuri */
  --text-dark:   #1b2a4a;           /* testo su sfondi chiari */
}

/* === RESET BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Elimina qualsiasi margine di default su html e body */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Lato', sans-serif;
  color: var(--text-dark);
  overflow-x: hidden;
  line-height: 1.65;
}

/* === ANIMAZIONE FADE-IN (gestita da sito.js con IntersectionObserver) === */
/* Stato iniziale: invisibile, spostato verso il basso */
.fade-el {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Classe aggiunta da JS quando l'elemento entra nel viewport */
.fade-el.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Se il sistema operativo richiede meno animazioni, mostra tutto subito */
@media (prefers-reduced-motion: reduce) {
  .fade-el {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* === TITOLI DI SEZIONE === */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 0.6em;
  position: relative;
}

/* Lineetta decorativa dorata sotto ogni titolo di sezione */
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 0.4em auto 0;
  border-radius: 2px;
}

/* ============================
   SEZIONE 1: HERO
   ============================ */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  background-image: url('../img/img-bg-desktop.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

/* Overlay beige chiaro semitrasparente: opacizza la foto senza scurirla */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 239, 230, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  text-align: center;
  color: var(--text-light);
  padding: clamp(1rem, 4vw, 3rem);
  z-index: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

/* Titolo principale Casa Giò — colore arancione caldo */
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(4.5rem, 13vw, 9.5rem);
  font-weight: 700;
  color: #c9a84c;
  /* Arancione caldo professionale — per testare altri toni:
     #E8650A arancione bruciato
     #FF6B2B arancione più vivace
     #D4551A arancione terracotta */
  letter-spacing: 0.04em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
  margin-bottom: 0.5em;
  line-height: 1.1;
  -webkit-text-stroke: 1px #000;
  paint-order: stroke fill;
}

/* Linea decorativa orizzontale oro sotto il titolo (60px × 2px) */
.hero-line {
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto 1em;
  border-radius: 1px;
}

/* Sottotitolo in maiuscolo spaziato, font Lato leggero */
.hero-subtitle {
  font-family: 'Lato', sans-serif;
  font-size: clamp(1.3rem, 3.8vw, 2.2rem);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.2em;
  color: #000000;
  text-shadow:
    0 0 8px rgba(201, 168, 76, 0.9),
    0 0 16px rgba(201, 168, 76, 0.5);
  -webkit-text-stroke: 0.6px #000;
  paint-order: stroke fill;
}

/* CIN obbligatorio per legge — discreto, quasi invisibile */
.hero-cin {
  display: block;
  font-size: clamp(0.62rem, 1.3vw, 0.8rem);
  color: rgba(245, 239, 230, 0.45);
  letter-spacing: 0.1em;
  font-family: 'Lato', sans-serif;
}

/* ============================
   SEZIONE 2: GALLERY
   ============================ */
.gallery-section {
  background: var(--beige);
  padding: clamp(3rem, 7vw, 6.5rem) clamp(1rem, 5vw, 4rem);
}

.gallery-section .section-title {
  color: var(--text-dark);
}

/* Griglia adattiva — 3 colonne desktop, 2 tablet, 2 mobile */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(0.8rem, 2vw, 1.4rem);
  max-width: 1300px;
  margin: 0 auto;
}

/* Ogni card immagine: quadrata, overflow hidden obbligatorio per contenere lo zoom */
.gallery-item {
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
}

/* Immagine copre tutto il quadrato — al hover scala del 7% */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.45s ease;
}

/* Zoom CSS puro al passaggio del mouse — zero JavaScript */
.gallery-item:hover img {
  transform: scale(1.07);
}

/* ============================
   SEZIONE 3: DOVE SIAMO
   ============================ */
.dove-siamo-section {
  background: var(--navy);
  padding: clamp(3rem, 7vw, 6.5rem) clamp(1rem, 5vw, 4rem);
}

.dove-siamo-section .section-title {
  color: var(--gold);
}

/* Due colonne affiancate su desktop */
.dove-siamo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

/* Indirizzo in testo chiaro */
.ds-indirizzo {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-light);
  margin-bottom: 1.4rem;
  line-height: 1.5;
}

/* Badge evidenziato — sfondo oro, testo navy */
.ds-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  padding: 0.55em 1.1em;
  border-radius: 6px;
  font-weight: 700;
  font-size: clamp(0.82rem, 1.5vw, 0.95rem);
  line-height: 1.4;
  margin-bottom: 1.4rem;
}

/* Testo descrittivo sotto il badge */
.ds-testo {
  color: rgba(245, 239, 230, 0.8);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Bottone WhatsApp — sfondo oro, testo navy scuro */
.btn-whatsapp {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  padding: 0.75em 2em;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: background 0.25s ease, transform 0.25s ease;
}

.btn-whatsapp:hover {
  background: #dfc06a;
  transform: translateY(-2px);
}

/* Indirizzo nella colonna sinistra aggiornata */
.address {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-light);
  margin-bottom: 1.4rem;
  line-height: 1.5;
}

.location-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--beige);
  opacity: 0.85;
  margin-bottom: 1.4rem;
}

.phones {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1.4rem;
}

.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--beige);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.phone-link:hover { opacity: 1; color: var(--gold); }

/* Bottone WhatsApp nella sezione Dove Siamo */
.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gold);
  color: var(--navy);
  padding: 0.75em 2em;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  transition: background 0.25s ease, transform 0.25s ease;
}

.wa-btn:hover {
  background: #dfc06a;
  transform: translateY(-2px);
}

/* Iframe mappa con ombra */
.dove-siamo-mappa iframe {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.35);
  display: block;
}

/* ============================
   FOOTER
   ============================ */
footer {
  background: var(--beige);
  border-top: 1px solid var(--beige-dark);
  padding: 4rem 2rem 2.5rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  align-items: start;
}

/* Colonna sinistra — Brand */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--navy);
  line-height: 1;
}
.footer-address {
  font-size: 0.82rem;
  color: var(--navy);
  opacity: 0.55;
  line-height: 1.5;
}
.footer-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-wa:hover { opacity: 0.75; }

/* Colonna centrale */
.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.footer-gold-line {
  width: 1px;
  height: 48px;
  background: var(--gold);
  margin: 0 auto 4px;
}
.footer-copy {
  font-size: 0.78rem;
  color: var(--navy);
  opacity: 0.5;
  line-height: 1.7;
}
.footer-cin {
  font-size: 0.68rem;
  color: var(--navy);
  opacity: 0.3;
  letter-spacing: 0.05em;
}

/* Colonna destra — Anvira */
.footer-anvira {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
}
.footer-anvira-label {
  font-size: 0.7rem;
  color: var(--navy);
  opacity: 0.35;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.footer-anvira-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  opacity: 0.7;
  letter-spacing: 0.08em;
}
.footer-anvira-detail {
  font-size: 0.72rem;
  color: var(--navy);
  opacity: 0.45;
  line-height: 1.5;
}
.footer-anvira-mail {
  font-size: 0.72rem;
  color: var(--gold);
  text-decoration: none;
  margin-top: 2px;
  transition: opacity 0.2s;
}
.footer-anvira-mail:hover { opacity: 0.7; }

@media (max-width: 700px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-brand { align-items: center; }
  .footer-anvira { align-items: center; text-align: center; }
  .footer-gold-line { width: 40px; height: 1px; margin: 8px auto; }
}

/* === LIGHTBOX === */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}
#lightbox.active {
  display: flex;
}
#lb-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  user-select: none;
}
#lb-close {
  position: fixed;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
  z-index: 10000;
}
#lb-close:hover { opacity: 1; }
#lb-prev,
#lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 2.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10000;
}
#lb-prev { left: 20px; }
#lb-next { right: 20px; }
#lb-prev:hover,
#lb-next:hover { background: rgba(255,255,255,0.18); }
.gallery-item { cursor: pointer; }

@media (max-width: 600px) {
  #lb-prev { left: 8px; }
  #lb-next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #lb-close, #lb-prev, #lb-next { transition: none; }
}

/* ============================
   RESPONSIVITÀ
   ============================ */

/* Tablet (max 900px): dove siamo passa a colonna singola */
@media (max-width: 900px) {
  .dove-siamo-grid {
    grid-template-columns: 1fr;
  }
  /* background-attachment: fixed non funziona su iOS Safari */
  .hero {
    background-attachment: scroll;
  }
}

/* Mobile medio (max 600px): gallery a 2 colonne strette */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
}

/* Mobile piccolo (max 380px): gallery a colonna singola */
@media (max-width: 380px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile (max 768px): immagine verticale ottimizzata per smartphone */
@media (max-width: 768px) {
  .hero {
    background-image: url('../img/img-bg-mobile.webp');
    background-size: cover;
    background-position: center center;
    min-height: 55vh;
    height: 55vh;
  }

  /* TEST MOBILE — sposta testo hero verso l'alto
     per allinearlo sopra l'orizzonte dell'immagine.
     Modifica il valore di margin-bottom per aggiustare
     manualmente la posizione: più alto = testo più in alto */
  .hero-content {
    margin-bottom: -85%;
    /* REGOLA DI TEST: cambia 30% per spostare il testo.
       Aumenta il valore per salire, diminuisci per scendere.
       Valori consigliati da testare: 20%, 25%, 30%, 35%, 40% */
  }
}

/* Desktop (min 769px): sposta il testo hero verso il basso */
@media (min-width: 769px) {
  .hero-content {
    margin-top: 25%;
    /* REGOLA DI TEST DESKTOP: cambia il valore di margin-top
       per spostare tutto il testo verso il basso (dentro l'acqua).
       Valori consigliati da testare: 30%, 35%, 40%, 45%, 50% */
  }
}
