/* ============================================================= */
/* FONT                                                          */
/* ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap');

@font-face {
  font-family: "RaiderCrusader";
  /* Assicurati che il file sia nella stessa cartella del css o aggiorna il percorso */
  src: url("raidercrusader.ttf") format("truetype"); 
  font-display: swap;
}

/* ============================================================= */
/* VARIABILI                                                     */
/* ============================================================= */

:root {
  --rosso: #d10000;
  --blu-scuro: #0b1e2d;
  --bianco: #ffffff;
  --grigio-chiaro: #f4f4f4;
}

/* ============================================================= */
/* BASE                                                          */
/* ============================================================= */

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Open Sans", sans-serif;
  color: var(--blu-scuro);
  line-height: 1.6;
  background-color: var(--bianco);
}

/* TITOLI GLOBALI */
h1, h2, h3, h4 {
  font-family: "RaiderCrusader", serif;
  letter-spacing: 0.05em;
  margin-top: 0;
}

/* LINK GENERICI */
a {
  color: var(--rosso);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

a:hover {
  color: var(--blu-scuro);
}

/* SEZIONI GENERICHE */
.section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: auto;
}

.section.alt {
  background-color: var(--grigio-chiaro);
  width: 100%;
  max-width: 100%; /* Full width background */
}

/* Liste Attività e Servizi */
.section ul {
  list-style: none;
  padding: 0;
  font-size: 1.1rem;
}

.section ul li {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

/* ============================================================= */
/* HEADER                                                        */
/* ============================================================= */

.top-banner {
  background: var(--rosso);
  color: var(--bianco);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.top-banner h1 {
  font-size: 1.5rem;
  margin: 0;
  color: white;
}

.top-banner nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.top-banner nav a {
  color: var(--bianco);
  font-size: 0.95rem;
}

.top-banner nav a:hover {
  text-decoration: underline;
  color: var(--bianco);
}

.coming-soon::after {
  content: "soon";
  margin-left: 6px;
  font-size: 0.65rem;
  background: white;
  color: var(--rosso);
  padding: 2px 6px;
  border-radius: 10px;
  vertical-align: middle;
}

/* ============================================================= */
/* HERO SLIDER                                                   */
/* ============================================================= */

.hero {
  position: relative;
  height: 85vh; /* Altezza leggermente ridotta per mobile friendly */
  overflow: hidden;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease;
  z-index: 0;
}

.hero .slide.active {
  opacity: 1;
}

/* Overlay scuro sulle slide */
.hero .slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35); 
}

.hero-text {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 1.5rem;
}

.hero h2 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.hero-sub {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  font-weight: 300;
}

/* Pulsanti Slider (Frecce) */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 1rem;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.3s;
}

.slider-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.prev { left: 20px; }
.next { right: 20px; }

/* ============================================================= */
/* BOTTONI (Generali)                                            */
/* ============================================================= */

.buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  background: var(--rosso);
  color: white;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  padding: 0.9rem 2rem;
  display: inline-block;
  transition: transform 0.2s, background 0.3s;
}

.btn:hover {
  transform: translateY(-2px);
  color: white;
  background: #a30000;
}

.btn.secondary {
  background: white;
  color: var(--rosso);
  border: 2px solid white; /* Bordo bianco su sfondo scuro */
}

.btn.secondary:hover {
  background: #f0f0f0;
  color: var(--rosso);
}

/* ============================================================= */
/* SURF HOUSE                                                    */
/* ============================================================= */

#surfhouse {
  position: relative;
  padding: 0; /* Full width bg requires padding reset inside */
  background: #000;
  overflow: hidden;
}

.surfhouse-bg {
  position: absolute;
  inset: 0;
  background-image: var(--img);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.surfhouse-bg.active {
  opacity: 1;
}

/* Overlay scuro Surf House */
#surfhouse::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1;
}

.surfhouse-content {
  position: relative;
  z-index: 2;
  min-height: 60vh;
  max-width: 900px;
  margin: auto;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.surfhouse-content h2 {
  color: white;
  font-size: 2.5rem;
}

.tagline {
  color: white;
  margin-bottom: 2rem;
  font-size: 1.2rem;
}

.coming-box {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(5px);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  color: var(--blu-scuro);
  max-width: 600px;
}

.whatsapp-btn {
  background: #25D366; /* Verde Whatsapp */
  color: white;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1rem;
}

.whatsapp-btn:hover {
  background: #1ebc57;
  color: white;
}

/* GALLERIA SURF HOUSE */
.surfhouse-gallery {
  position: relative;
  z-index: 2;
  background: white;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.surfhouse-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s;
}

.surfhouse-gallery img:hover {
  transform: scale(1.02);
}

/* ============================================================= */
/* CONTATTI                                                      */
/* ============================================================= */

.contact-section {
  padding: 4rem 2rem;
  background: #f9f9f9;
  text-align: center;
}

.contact-tagline {
  margin-bottom: 3rem;
  font-size: 1.1rem;
  color: #666;
}

.contact-cards {
  max-width: 1100px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: white;
  text-decoration: none;
  color: var(--blu-scuro);
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: transform 0.3s box-shadow 0.3s;
  text-align: left;
}

.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.contact-card .icon {
  font-size: 2rem;
}

.contact-card strong {
  display: block;
  font-size: 1.1rem;
}

.contact-card span {
  font-size: 0.9rem;
  color: #666;
}

.contatti-map {
  margin-top: 3rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.contatti-map iframe {
  width: 100%;
  height: 350px;
  border: 0;
  display: block;
}

/* ============================================================= */
/* FOOTER                                                        */
/* ============================================================= */

footer {
  background: var(--blu-scuro);
  color: white;
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
}

/* ============================================================= */
/* POPUP SYSTEM (Unificato)                                      */
/* ============================================================= */

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none; /* Nascosto di default */
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.popup-overlay.active {
  display: flex;
  opacity: 1;
}

/* Stile Base Popup (Box Bianco - es. Listini) */
.popup-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  width: auto;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  text-align: center;
}

/* Bottone Chiudi */
.popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: inherit; /* Prende il colore del testo del popup */
  z-index: 10;
}

/* Immagini dentro i popup (Listini) */
.popup-image {
  max-width: 100%;
  height: auto;
  max-height: 80vh; /* Evita che l'immagine esca dallo schermo */
  display: block;
  margin: 1rem auto 0;
  border-radius: 8px;
}


/* --- VARIANTE: SCUBA EXPERIENCE (Override) --- */
/* Uso l'ID per sovrascrivere lo stile base solo per questo popup */

#scubaPopup .popup-content {
  background-image: url("images/scuba_attestato.png"); /* Togli se non hai l'img */
  background-color: var(--blu-scuro); /* Fallback */
  background-size: cover;
  background-position: center;
  color: white;
  max-width: 600px;
  width: 100%;
}

/* Overlay interno scuro per leggere il testo sopra l'immagine */
#scubaPopup .popup-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 12px;
  z-index: 0;
}

/* Assicura che testo e bottone siano sopra l'overlay */
#scubaPopup .popup-content > * {
  position: relative;
  z-index: 1;
}

#scubaPopup .popup-close {
  color: white;
}

#scubaPopup h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #4dc4ff; /* Un azzurro per risaltare */
}

#scubaPopup p {
  text-align: justify;
  margin-bottom: 1rem;
}


/* ============================================================= */
/* MOBILE / RESPONSIVE                                           */
/* ============================================================= */

@media (max-width: 768px) {
  
  /* Header */
  .top-banner {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .top-banner nav {
    justify-content: center;
    gap: 1rem;
  }

  /* Hero */
  .hero h2 { font-size: 2rem; }
  .hero-sub { font-size: 1.1rem; }
  .slider-btn { width: 40px; height: 40px; font-size: 1.2rem; }
  
  /* Surf House */
  .surfhouse-content {
    padding: 2rem 1rem;
    min-height: auto;
  }
  
  .coming-box {
    background: rgba(255,255,255,0.95);
    backdrop-filter: none;
    padding: 1.5rem;
  }

  /* Forza visibilità bottoni su mobile */
  .coming-box a, 
  .coming-box button {
     width: 100%;
     text-align: center;
     justify-content: center;
  }

  /* Contatti */
  .contact-cards {
    grid-template-columns: 1fr;
  }
  
  .contact-card.email span {
    word-break: break-all;
  }
}

.popup-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.popup-gallery-grid img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.popup-gallery-grid img:hover {
  border-color: var(--rosso);
}