
body.classiche {
  overflow-x: hidden;
}

/* SEZIONE */
.favole-brevi-section {
  padding: 3rem 2rem;
  background: #f7f3e8;
  text-align: center;
  overflow-x: hidden;
}

.favole-brevi-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  color: #5a3b1e;
}

.subtitle {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.1rem;
  color: #6a5a4a;
  margin-bottom: 2.5rem;
}


/* GRIGLIA FLUIDA OTTIMIZZATA */
.favole-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;

  /* Stabilità cross-browser */
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;

  /* Centratura */
  margin: 0 auto;
}


/* CARD */
.favola-card {
  background-color: #fff;
  border: 2px solid #e0c080;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  padding: 1.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.favola-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

/* STRUTTURA INTERNA */
.favola-inner {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: center; /* ✅ centra orizzontalmente immagine + testo */
}

@media (max-width: 600px) {
  .favola-inner {
    flex-direction: column;
    text-align: center;
    align-items: center; /* ✅ centra anche su mobile */
  }
}

/* IMMAGINE */
.favola-img img {
  width: 120px;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

/* TESTO */
.favola-text h3 {
  font-family: 'Cinzel', serif;
  color: #5a3b1e;
  margin: 0;
}

.favola-text p {
  font-family: 'Quicksand', sans-serif;
  color: #333;
  font-size: 0.95rem;
  margin: 0.5rem 0 1rem;
}

/* PULSANTE */
.leggi-btn {
  display: inline-block;
  background-color: #f7d35c;
  color: #333;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.25s ease;
}

.leggi-btn:hover {
  background-color: #f4c63d;
}

/* Contenitore del PDF */
.favola-card.doppia {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Sezione RETErendum */
.reteren-section {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.reterendum-banner {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
}

.banner-base {
  width: 100%;
  display: block;
  position: relative; /* fondamentale */
  z-index: 1;         /* fondamentale */
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: fadeCycle 18s infinite;
  z-index: 3;
}

.slide:nth-child(1) {
  animation-delay: 0s;
}

.slide:nth-child(2) {
  animation-delay: 6s;
}

.slide:nth-child(3) {
  animation-delay: 12s;
}

.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

@keyframes fadeCycle {
  0%, 40% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.banner-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.reterendum-button {
  display: inline-block;
  margin: 20px auto;
  padding: 12px 28px;
  background: #4a2;
  color: #fff;
  font-size: 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.reterendum-button:hover {
  background: #3a1;
}

.divisore {
  text-align: center;
  margin: 2rem 0;
}

.divisore img {
  display: inline-block;
  max-width: 100%;
}

.submit-btn.voto-btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: #C39A0B; /* il tuo oro */
  color: #fff;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.submit-btn.voto-btn:hover {
  background-color: #a68509; /* oro più scuro */
}

@media (max-width: 600px) {
  .character.bunny {
    max-width: 220px;
  }
}

.reteren-title {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  animation: reterenColor 6s infinite alternate;
}

@keyframes reterenColor {
  0%   { color: #AA0808; }
  25%  { color: #C39A0B; }
  50%  { color: #6a8f5f; }
  75%  { color: #3a6ea5; }
  100% { color: #AA0808; }
}

@keyframes bunnyFloat {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

.reteren-top {
  width: 100%;
  text-align: center;
  margin: 2rem 0;
}

.character.bunny {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  overflow: hidden; /* fondamentale per il mobile */
  animation: bunnyFloat 4s ease-in-out infinite;
}

.character.bunny img {
  width: 100%;
  height: auto;
  display: block;
}

/* Override SOLO per la pagina Brevi */
body.classiche .hero-main {
  padding: 2rem 1rem !important;
}

body.classiche .nonnobru-footer .footer-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

/* Modal per Fullscreen Image */

modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90vh;
}

.chiudi {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* FINE Modal per Fullscreen Image */


#navBackToTop {
  display: block;
  /* Forza la larghezza totale indipendentemente dai contenitori padri */
  width: 100vw; 
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  
  /* Stile grafico */
  background-color: #5A5858;
  color: #ffffff;
  text-align: center;
  padding: 15px 0;
  font-family: Arial, sans-serif;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box; /* Evita che il padding sballi la larghezza */
  transition: background-color 0.2s ease;
}

#navBackToTop:hover {
  background-color: #000000;
}