/* =========================================
   1. VARIABILI E RESET GLOBALE
   ========================================= */
:root {
  --primary-color: #2e7d32; /* Verde Palma */
  --text-dark: #1f2937;
  --bg-light: #f9fafb;
  --whatsapp-color: #25D366;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Evita che la navbar copra i titoli al click */
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--bg-light);
}

body.no-scroll {
  overflow: hidden; /* Blocca il sito quando il lightbox è aperto */
}

/* Typography */
h1, h2 { font-weight: 800; margin-bottom: 1rem; }
h2 { text-align: center; margin-top: 2rem; }

/* =========================================
   2. BOTTONI GLOBALI
   ========================================= */
.btn-primary, .btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s;
  margin-top: 15px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-whatsapp {
  background-color: var(--whatsapp-color);
  color: white;
  width: 100%;
}

.btn-primary:hover, .btn-whatsapp:hover {
  transform: scale(1.02);
}

/* =========================================
   3. LAYOUT E SEZIONI
   ========================================= */
section {
  max-width: 1000px;
  margin: 40px auto;
  padding: 20px;
}

/* =========================================
   4. COMPONENTI SPECIFICI
   ========================================= */

/* --- Navbar --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  padding: 15px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease-in-out; 
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  /*font-family: 'Playfair Display', serif;*/
  font-family: 'Inter', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.5px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
}

.nav-btn {
  background: var(--primary-color);
  color: white !important;
  padding: 8px 16px;
  border-radius: 5px;
}

/* --- Hero Section --- */
.hero.video-hero {
  position: relative;
  isolation: isolate;
  height: 73vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background-color: var(--text-dark);
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  /* Allineamento Video */
  object-fit: cover;
  object-position: center center;
  z-index: -2;

  /*RIMOSSO  /* Allineamento Immagine di Sfondo (Poster) * / background-color: var(--text-dark);background-image: url('../img/poster-desktop.jpg');background-size: cover;background-position: center center; /* Deve essere identico a object-position * /background-repeat: no-repeat;*/
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: -1;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 20px;
  max-width: 800px;
}

.hero-content h1, 
.hero-content p {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.hero-content h1 { font-size: 3rem; }
.hero-content p { font-size: 1.2rem; font-weight: 600; }

/* --- Galleria --- */
.gallery-section {
  max-width: 1600px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 20px;
}

.foto-item {
  border-radius: 12px;
  position: relative;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  overflow: hidden; 
  z-index: 1; 
  transform: translateZ(0); /* Evita glitch su Safari */
}

.foto-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  backface-visibility: hidden;
  cursor: zoom-in;
}

.foto-item:hover img {
  transform: scale(1.06);
}

/* --- Lightbox / Modal Galleria --- */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  overscroll-behavior: none;
  touch-action: none;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  object-fit: contain;
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-lightbox:hover {
  color: #cccccc;
}

.nav-lightbox {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  padding: 15px;
  user-select: none;
  transition: color 0.2s ease, background-color 0.2s ease;
  border-radius: 5px;
}

.nav-lightbox:hover {
  color: #cccccc;
  background-color: rgba(255, 255, 255, 0.1);
}

.prev-lightbox { left: 20px; }
.next-lightbox { right: 20px; }

/* --- Servizi (Amenities) --- */
.amenities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.amenity {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* --- Mappa e Punti di Interesse --- */
.map-address {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.1rem;
  color: #4b5563;
}

.poi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.poi-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border-left: 4px solid var(--primary-color);
}

.poi-item .material-symbols-outlined {
  color: var(--primary-color);
  font-size: 32px;
}

.poi-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.poi-text strong { font-size: 1rem; color: var(--text-dark); }
.poi-text span { font-size: 0.85rem; color: #6b7280; }

.map-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* --- Prenotazione --- */
.booking {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  text-align: center;
}

.calendar-container {
  max-width: 400px;
  margin: 20px auto;
}

#data-scelta {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}

.fallback-contact {
  margin-top: 20px;
  font-size: 0.9rem;
  color: #4b5563;
}

.fallback-contact a {
  color: var(--primary-color);
  font-weight: 600;
}

/* --- Tasto WhatsApp Fluttuante --- */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--whatsapp-color);
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 1000;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-float svg { width: 35px; height: 35px; }

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 20px;
  background: var(--text-dark);
  color: white;
  font-size: 0.8rem;
}

/* =========================================
   5. MEDIA QUERIES (SMARTPHONE)
   ========================================= */
@media screen and (max-width: 768px) {
  
  /* Navbar */
  .navbar.navbar-hidden { transform: translateY(-100%); }
  .nav-container { flex-direction: column; gap: 12px; padding: 10px; }
  .logo { font-size: 1.5rem; white-space: nowrap; }
  .nav-links { width: 100%; justify-content: space-around; gap: 8px; }
  .nav-links a { font-size: 0.9rem; }
  .nav-btn { padding: 6px 12px; font-size: 0.9rem; }

  .hero.video-hero { height: 63vh; min-height: 350px; }
  .hero-content h1 { font-size: 2rem; }

  /*RIMOSSO: /* Sovrascrive lo sfondo per i telefoni * /.hero-video {/* Cambia il file * /background-image: url('../img/poster-mobile.jpg');/* Forza il browser a non "inventare" zoom strani * /background-size: cover;background-position: center center;/* Importante: se il video mobile è molto verticale, a volte 'top center' aiuta a eliminare lo scatto rispetto a 'center center' * /    /* object-position: center center; * /}*/

  /* Galleria orizzontale a scorrimento */
  .gallery {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px 20px 20px;
    gap: 15px;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .foto-item {
    flex: 0 0 85%; 
    scroll-snap-align: center; 
    transform: none !important; 
  }

  /* Lightbox Navigation */
  .nav-lightbox { font-size: 30px; padding: 10px; }
  .prev-lightbox { left: 0; }
  .next-lightbox { right: 0; }

  /* Mappa */
  .map-container {
    aspect-ratio: 1 / 1; 
    height: 400px;       
  }

  /* WhatsApp Fluttuante */
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
  .whatsapp-float svg { width: 28px; height: 28px; }
}
