/* Section Header Styling */
.section-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  max-width: var(--container-width-narrow);
  margin-left: auto;
  margin-right: auto;
}

.section-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-sage-dark);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--color-text-main);
  opacity: 0.8;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
  }
  .section-desc {
    font-size: 1rem;
  }
}

/* 1. Hero Section */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  color: var(--color-white-warm);
  padding: 0;
  overflow: hidden;
}

.hero-video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: var(--color-navy-dark);
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  pointer-events: none;
}

.hero-vimeo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;
  min-width: 177.78vh;
  min-height: 100vh;
  transform: translate(-50%, -50%);
  border: 0;
  z-index: 2;
  pointer-events: none;
}

.hero-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: opacity 0.5s ease;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-overlay), var(--color-overlay-dark));
  z-index: 3;
}

.hero .container {
  position: relative;
  z-index: 4;
  height: 100%;
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 940px;                    /* ottimizza gli spazi in orizzontale: colonna più ampia per non spezzare i paragrafi */
  text-align: left;
}

.hero-badge {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
  display: block;
  /* text-shadow sottile per staccare il badge dallo sfondo video */
  text-shadow: 0 1px 8px rgba(15, 25, 34, 0.55), 0 1px 3px rgba(15, 25, 34, 0.7);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 4.5rem;
  color: var(--color-text-on-dark);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.05;
  /* text-shadow marcata per il titolo — layer sfocato + layer netto ravvicinato */
  text-shadow:
    0 4px 32px rgba(10, 20, 34, 0.65),
    0 2px 12px rgba(10, 20, 34, 0.55),
    0 1px 3px rgba(10, 20, 34, 0.8);
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-on-dark-soft);
  margin-bottom: 1.5rem;
  line-height: 1.3;
  text-shadow:
    0 2px 20px rgba(10, 20, 34, 0.6),
    0 1px 6px rgba(10, 20, 34, 0.65);
}

.hero-text {
  font-size: 1.3rem;                   /* corpo più leggibile (era 1.1rem) */
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.94);
  max-width: 860px;                    /* linee più lunghe per sfruttare la colonna allargata */
  margin-bottom: 1.1rem;               /* spazio ridotto tra i due paragrafi consecutivi */
  text-shadow:
    0 2px 18px rgba(10, 20, 34, 0.65),
    0 1px 4px rgba(10, 20, 34, 0.7);
}
.hero-text + .hero-text {
  margin-top: 0;                        /* i due <p> restano vicini come blocco unico */
}
.hero-text:last-of-type {
  margin-bottom: 2.5rem;                /* margine più ampio prima delle CTA */
}

.hero-ctas {
  display: flex;
  gap: 1rem;
}

@media (max-width: 768px) {
  .hero-badge {
    font-size: 0.85rem;
    letter-spacing: 0.18em;
  }
  .hero h1 {
    font-size: 3rem;
  }
  .hero-subtitle {
    font-size: 1.6rem;
  }
  .hero-text {
    font-size: 1.15rem;
    margin-bottom: 1rem;
  }
  .hero-text:last-of-type {
    margin-bottom: 2rem;
  }
  .hero-ctas {
    flex-direction: column;
    gap: 0.8rem;
  }
}

/* 2. In Sintesi Section */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* 3. Location & Connections */
.location-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--spacing-lg);
  align-items: stretch;         /* le due colonne si allungano alla stessa altezza */
}

/*
 * La colonna destra (immagine) è un wrapper .reveal che deve estendersi
 * verticalmente e riempire tutto lo spazio della cella grid, così l'immagine
 * ha la stessa altezza del blocco di testo a sinistra.
 */
.location-grid > .reveal:last-child {
  display: flex;
  flex-direction: column;
}

.location-map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  border: 1px solid rgba(18, 48, 71, 0.05);
  position: relative;
  background-color: var(--color-white-warm);
  flex: 1;                       /* riempi l'altezza del wrapper flex */
  display: flex;
}

.location-map-wrapper {
  position: relative;
  width: 100%;
  flex: 1;                       /* si estende all'altezza del container */
  min-height: 380px;             /* garanzia minima per casi di testo cortissimo */
  overflow: hidden;
}

.location-map-wrapper img {
  --x-shift: 0px;                       /* aggiornata dallo scroll (JS inline) per effetto parallasse orizzontale */
  /*
   * L'immagine è più larga del container (buffer di 90px per lato) così quando
   * si sposta orizzontalmente col parallasse (±60px) non lascia mai bordi vuoti:
   * ci sono sempre pixel dell'immagine disponibili da mostrare.
   */
  width: calc(100% + 180px);
  margin-left: -90px;
  max-width: none;
  height: 100%;
  object-fit: cover;                    /* riempi in altezza; l'eccedenza si mostra grazie al buffer */
  object-position: center center;
  transform: translateX(var(--x-shift));
  transition: transform 0.15s ease-out;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .location-map-wrapper img {
    --x-shift: 0px !important;          /* nessun movimento se l'utente lo preferisce */
    transition: none;
  }
}

.map-pins {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.distance-table-container {
  background-color: var(--color-white-warm);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(18, 48, 71, 0.03);
}

.distance-table-container h3 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--color-sand);
  padding-bottom: 0.5rem;
}

.distance-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.distance-table th, .distance-table td {
  padding: 0.75rem 0.5rem;
  font-size: 0.9rem;
}

.distance-table th {
  border-bottom: 2px solid var(--color-tech-gray);
  color: var(--color-navy);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.distance-table tr {
  border-bottom: 1px solid rgba(18, 48, 71, 0.04);
}

.distance-table tr:last-child {
  border-bottom: none;
}

.distance-table td.highlight {
  font-weight: 600;
  color: var(--color-navy);
}

@media (max-width: 900px) {
  .location-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

/* 4. Lifestyle Riviera */
.lifestyle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.lifestyle-card {
  background-color: var(--color-white-warm);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-smooth);
  border: 1px solid rgba(18, 48, 71, 0.03);
}

.lifestyle-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
  border-color: rgba(143, 163, 147, 0.3); /* Sage on hover */
}

.lifestyle-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.lifestyle-card-content {
  padding: 1.5rem;
}

.lifestyle-card-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--color-navy);
  margin-bottom: 0.5rem;
}

.lifestyle-card-desc {
  font-size: 0.9rem;
  color: var(--color-text-main);
  opacity: 0.8;
}

@media (max-width: 900px) {
  .lifestyle-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .lifestyle-grid {
    grid-template-columns: 1fr;
  }
}

/* 5. Operazione Immobiliare */
.operation-section {
  background-color: #E6E3DD; /* Technical gray bg */
}

.operation-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}

.operation-text h3 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

.operation-text p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.operation-text ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.operation-text li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.operation-text li::before {
  content: "✓";
  color: var(--color-sage-dark);
  font-weight: bold;
}

@media (max-width: 900px) {
  .operation-grid {
    grid-template-columns: 1fr;
  }
}

/* 6. Technology & Energy Section */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.tech-card {
  border-top: 4px solid var(--color-sage);
}

.tech-card .icon-wrapper {
  background-color: rgba(143, 163, 147, 0.1);
  color: var(--color-sage-dark);
}

@media (max-width: 900px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .tech-grid {
    grid-template-columns: 1fr;
  }
}

/* 7. Technical Price Section */
.tech-price-section {
  background-color: var(--color-white-warm);
  border-top: 1px solid var(--color-tech-gray);
  border-bottom: 1px solid var(--color-tech-gray);
}

.tech-price-box {
  background-color: var(--color-bg-warm);
  border: 1px solid var(--color-tech-gray);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.tech-price-box h3 {
  font-size: 2rem;
  color: var(--color-navy);
  margin-bottom: 1rem;
}

.tech-price-box p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text-main);
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* 8. Technical Network Section */
.network-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
  position: relative;
}

.network-timeline::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-tech-gray);
  z-index: 1;
}

.timeline-step {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--color-white-warm);
  border: 3px solid var(--color-sand);
  color: var(--color-navy);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: var(--transition-smooth);
}

.timeline-step:hover .timeline-dot {
  background-color: var(--color-navy);
  color: var(--color-white-warm);
  border-color: var(--color-navy);
  transform: scale(1.1);
}

.timeline-step-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.65rem;
  line-height: 1.25;
}

.timeline-step-desc {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--color-text-primary);
  opacity: 0.85;
  max-width: 230px;
}

/* Scope: leggera enfasi tipografica per l'intera sezione network */
#network .section-desc {
  font-size: 1.2rem;
  line-height: 1.7;
}
#network .section-title {
  font-size: 2.6rem;
}

@media (max-width: 900px) {
  .network-timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 1.5rem;
  }
  .network-timeline::before {
    display: none;
  }
  #network .section-title { font-size: 2.1rem; }
  #network .section-desc  { font-size: 1.1rem; }
}

@media (max-width: 600px) {
  .network-timeline {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .timeline-step-desc {
    max-width: none;
  }
}

/*
 * Sezione parallasse "finale": transizione visiva tra network e location.
 * Usa background-attachment: fixed per un effetto parallasse leggero su desktop
 * (l'immagine di sfondo resta ferma mentre la pagina scorre, creando la
 * sensazione di profondità). Su mobile iOS/Safari 'fixed' viene ignorato:
 * degradazione gradevole a background statico centrato.
 */
.parallax-section {
  position: relative;
  width: 100%;
  min-height: 65vh;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow: hidden;
}

#parallax-finale     { background-image: url('/Media/Finale.png'); }
#parallax-vistamario { background-image: url('/Media/VistaMario.webp'); }

/*
 * Contenuto testuale sovrapposto alla parallasse (citazione).
 * Il container occupa tutta la sezione e centra la frase con flex.
 * z-index sopra all'overlay ma dentro alla stessa sezione.
 */
.parallax-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  z-index: 2;
}

.parallax-quote {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 3rem;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.8rem, 3.8vw, 3.35rem);
  line-height: 1.35;
  color: var(--color-text-on-dark);
  text-shadow: 0 2px 24px rgba(10, 20, 34, 0.55), 0 1px 4px rgba(10, 20, 34, 0.6);
  letter-spacing: 0.005em;
  text-wrap: pretty;
  border: none;
  quotes: "«" "»";
}

/* Virgolette basse italiane come pseudo-elementi decorativi */
.parallax-quote::before,
.parallax-quote::after {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  color: var(--color-accent);
  opacity: 0.85;
  font-size: 1.6em;
  line-height: 0.5;
  text-shadow: 0 2px 12px rgba(10, 20, 34, 0.5);
}
.parallax-quote::before {
  content: "«";
  margin-right: 0.15em;
  vertical-align: -0.15em;
}
.parallax-quote::after {
  content: "»";
  margin-left: 0.15em;
  vertical-align: -0.15em;
}

/*
 * Ogni riga della citazione appare in sequenza appena la sezione entra
 * nel viewport (osservata dal reveal Intersection Observer di main.js).
 * Delay progressivo via nth-child per creare l'effetto "cascata" leggibile.
 */
.parallax-quote-line {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.parallax-quote-line.revealed {
  opacity: 1;
  transform: translateY(0);
}
.parallax-quote-line:nth-child(1) { transition-delay: 0.2s; }
.parallax-quote-line:nth-child(2) { transition-delay: 1.6s; }
.parallax-quote-line:nth-child(3) { transition-delay: 3.0s; }

/*
 * Testo informativo sulla parallasse "finale": 3 paragrafi che raccontano
 * la dotazione tecnica. Font più moderato del quote poetico, colonna
 * limitata per leggibilità, comparsa a cascata dei paragrafi.
 */
.parallax-text {
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
  color: var(--color-text-on-dark);
  text-shadow: 0 2px 20px rgba(10, 20, 34, 0.6), 0 1px 3px rgba(10, 20, 34, 0.65);
}

.parallax-text-line {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.3vw, 1.9rem);
  line-height: 1.5;
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.parallax-text-line + .parallax-text-line { margin-top: 1.1rem; }
.parallax-text-line.revealed { opacity: 1; transform: translateY(0); }
.parallax-text-line:nth-child(1) { transition-delay: 0.15s; }
.parallax-text-line:nth-child(2) { transition-delay: 0.85s; }
.parallax-text-line:nth-child(3) { transition-delay: 1.55s; }

/* Overlay più marcato per garantire contrasto di 3 paragrafi sopra l'immagine */
#parallax-finale .parallax-overlay {
  background:
    radial-gradient(ellipse at center, rgba(10, 20, 34, 0.55) 0%, rgba(10, 20, 34, 0.25) 70%),
    linear-gradient(180deg,
      rgba(15, 30, 43, 0.30) 0%,
      rgba(15, 30, 43, 0.15) 40%,
      rgba(15, 30, 43, 0.15) 60%,
      rgba(15, 30, 43, 0.40) 100%);
}

#parallax-finale {
  min-height: 78vh;                     /* leggermente più alta perché contiene testo */
}

@media (prefers-reduced-motion: reduce) {
  .parallax-text-line { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 600px) {
  .parallax-quote { padding: 0 1.25rem; }
  .parallax-quote::before,
  .parallax-quote::after { font-size: 1.3em; }
}

@media (prefers-reduced-motion: reduce) {
  .parallax-quote-line {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/*
 * Overlay più marcato sulle parallassi che contengono testo:
 * un secondo gradient radiale scurisce il centro per garantire contrasto
 * anche su porzioni chiare dell'immagine (cielo, mare in controluce).
 */
#parallax-vistamario .parallax-overlay {
  background:
    radial-gradient(ellipse at center, rgba(10, 20, 34, 0.45) 0%, rgba(10, 20, 34, 0.15) 70%),
    linear-gradient(180deg,
      rgba(15, 30, 43, 0.25) 0%,
      rgba(15, 30, 43, 0.05) 40%,
      rgba(15, 30, 43, 0.05) 60%,
      rgba(15, 30, 43, 0.35) 100%);
}

.parallax-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 30, 43, 0.25) 0%,
    rgba(15, 30, 43, 0.05) 40%,
    rgba(15, 30, 43, 0.05) 60%,
    rgba(15, 30, 43, 0.35) 100%
  );
  pointer-events: none;
}

@media (max-width: 900px) {
  .parallax-section {
    min-height: 45vh;
    background-attachment: scroll;
  }
}

/* Utenti che preferiscono ridurre il movimento: disattiva il fixed. */
@media (prefers-reduced-motion: reduce) {
  .parallax-section {
    background-attachment: scroll;
  }
}

/* 9. Target Profile Section */
.target-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.target-card {
  border-bottom: 4px solid var(--color-sand);
}

@media (max-width: 1024px) {
  .target-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .target-grid {
    grid-template-columns: 1fr;
  }
}
