/* Sezioni - layout e stile */
.hero-section {
  background-color: #e9ecef; /* uguale alla sezione alternata */
  color: #333;
  position: fixed; /* resta sempre visibile in alto */
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  /* Usa unità viewport dinamiche per coprire sempre l'intero schermo */
  height: calc(100vh - var(--topbar-h, 0px));
  height: calc(100svh - var(--topbar-h, 0px));
  height: calc(100dvh - var(--topbar-h, 0px));
  z-index: 1;
  padding: 2rem; /* padding generale per non attaccare ai bordi */
  /* Evita che il contenuto finisca sotto la topbar */
  padding-top: calc(2rem + var(--topbar-h, 0px));
  /* Spazio extra in basso per il bottone Esplora (con safe area) */
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
}

/* Classe separata per l'immagine di sfondo dell'hero */
.hero-section-bg {
  background-image: url('../images/bg-hero/bg-hero.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

/* Overlay scuro per migliorare il contrasto del contenuto - solo sopra l'immagine */
.hero-section.hero-section-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1;
  pointer-events: none;
}

/* Classe per mettere in risalto i singoli componenti dell'hero con ombreggiatura */
.hero-section-highlight .hero-content h2,
.hero-section-highlight .hero-content .lead {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6),
               0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Ombreggiatura per le immagini del logo */
.hero-section-highlight .hero-content img {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

/* Ombreggiatura per la barra di ricerca */
.hero-section-highlight .hero-content .search-bar-centered {
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4));
}

/* Ombreggiatura per i container dei loghi */
.hero-section-highlight .hero-content > div {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* Hero section compatta - riutilizzabile */
.hero-section-compact {
  height: 25vh;
  height: calc(25vh - var(--topbar-h, 0px));
  padding: 1rem;
  min-height: 300px;
}

/* Contenuto hero ottimizzato per versione compatta */
.hero-section-compact .hero-content {
  transform: none;
  padding: 0.5rem 0;
}

.hero-section-compact .hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero-section-compact .hero-content .lead {
  font-size: 1.1rem;
  margin-bottom: 0;
}

.hero-content {
  width: 100%;
  max-width: 700px; /* contenitore per logo, barra e tasti */
  margin: 0 auto;
  text-align: center;
  transform: translateY(-12vh); /* alza il blocco verso l'alto ma lascia spazio al bottone */
  transition: transform .3s ease;
  position: relative;
  z-index: 2;
  /* Aggiunge ombra leggera al testo per migliorare la leggibilità */
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Logo a piena larghezza */
.hero-section .hero-content img {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.hero-spacer {
  height: 10vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 500;
  position: relative;
}

.hero-spacer .patreon-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 20px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.hero-spacer .patreon-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff424d;
}

.hero-spacer .patreon-icon svg {
  width: 100%;
  height: 100%;
}

.content-section {
  background-color: #f8f9fa;
  color: #333;
}

.content-section-alt {
  background-color: #e9ecef;
  color: #333;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 1.1rem;
  color: #6c757d;
  max-width: 600px;
  margin: 0 auto;
}

/* Pulsante Esplora altro */
.explore-more-container {
  position: relative;
}

.explore-more-btn {
  background: rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(0, 0, 0, 0.2);
  color: #333;
  padding: 0.55rem 1.1rem;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: .95rem;
  position: relative;
}

.explore-more-btn:hover {
  background: rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.3);
  color: #333;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.explore-icon {
  animation: bounce 2s infinite;
  font-size: 1.25rem;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* Dark mode */
/* Mantieni visibile il bottone "Esplora" nella hero */
.hero-section .explore-more-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 5;
}

[data-bs-theme="dark"] .content-section {
  background-color: #1a202c;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .content-section-alt {
  background-color: #1b1e2f; /* 2d3748 */;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .hero-section {
  background-color: #1b1e2f; /* 2d3748 */;
  color: #e2e8f0;
}

/* Dark mode per il banner Patreon */

[data-bs-theme="dark"] .hero-spacer .patreon-banner {
  background: rgba(0, 0, 0, 0.5);
  color: #e2e8f0;
}

[data-bs-theme="dark"] .section-description { color: #a0aec0; }

/* Stili per main-hero-subtitle - adattato per dark e light mode */
#main-hero-subtitle {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6),
               0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] #main-hero-subtitle {
  color: #e2e8f0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8),
               0 4px 16px rgba(0, 0, 0, 0.6);
}

[data-bs-theme="light"] #main-hero-subtitle {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6),
               0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Stili per typewrite - adattato per dark e light mode */
.typewrite {
  text-shadow: none;
  font-weight: bold;
  padding: 0.2em 0.4em;
  border-radius: 0.25em;
}

[data-bs-theme="light"] .typewrite {
  background: rgba(150, 113, 23, 0.56);
  color: #ffffff;
}

[data-bs-theme="dark"] .typewrite {
  background: rgba(255, 255, 255, 0.1);
  color: #eee8aa;
}

[data-bs-theme="dark"] .explore-more-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

[data-bs-theme="dark"] .explore-more-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Riduzione larghezza su mobile: logo, barra, tasti */
.hero-section .search-bar-centered { width: 100%; max-width: 600px; margin-left: auto; margin-right: auto; }

@media (max-width: 576px) {
  .section-title { font-size: 2rem; }
  .section-description { font-size: 1rem; }
  .explore-more-btn { padding: 0.5rem 0.9rem; font-size: .9rem; }
  .explore-icon { font-size: 1.1rem; }

  .hero-section { padding: .75rem 1rem; }
  .hero-content { max-width: 520px; }
  .hero-content { transform: translateY(-3vh); }
  /* logo: mantieni 100% width anche su mobile */
  .hero-section .search-bar-centered { max-width: 90%; }
  .hero-section .d-flex.gap-3 { flex-wrap: wrap; gap: .5rem; justify-content: center; }
  .hero-section .d-flex.gap-3 .btn { padding: .5rem .75rem; font-size: .9rem; min-width: 120px; }
  
  /* Hero compatta su mobile */
  .hero-section-compact {
    height: 20vh;
    height: calc(20vh - var(--topbar-h, 0px));
    min-height: 200px;
    padding: 0.5rem;
  }
  
  .hero-section-compact .hero-content h1 {
    font-size: 2rem;
  }
  
  .hero-section-compact .hero-content .lead {
    font-size: 1rem;
  }
  
  /* Spazio normale su mobile */
  .content-section,
  .content-section-alt {
    padding-bottom: 1rem;
  }
  
  .content-section:last-of-type,
  .content-section-alt:last-of-type {
    padding-bottom: 1.5rem; /* Spazio normale per l'ultima sezione su mobile */
  }
}

/* Ultima sezione - spazio normale */
.content-section:last-of-type,
.content-section-alt:last-of-type {
  padding-bottom: 1rem; /* Spazio normale per l'ultima sezione */
}

/* Small tablet */
@media (min-width: 577px) and (max-width: 768px) {
  .hero-section { padding: 1rem 1.25rem; }
  .hero-content { max-width: 640px; }
  .hero-content { transform: translateY(-15vh); }
  /* logo: mantieni 100% width anche su small tablet */
  .hero-section .search-bar-centered { max-width: 88%; }
  
  /* Hero compatta su tablet */
  .hero-section-compact {
    height: 22vh;
    height: calc(22vh - var(--topbar-h, 0px));
    min-height: 180px;
  }
  
  .hero-section-compact .hero-content h1 {
    font-size: 2.2rem;
  }
  
  /* Spazio normale su tablet */
  .content-section:last-of-type,
  .content-section-alt:last-of-type {
    padding-bottom: 1.5rem; /* Spazio normale per l'ultima sezione su tablet */
  }
}


