/* ==================== LAYOUT PRINCIPALE ==================== */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Forum';
  background: url("../img/header_sito_giornalino_originale.png")
    center / cover no-repeat fixed;
  background-color: rgba(255, 255, 255, 0.88);
  background-blend-mode: overlay; /* VELINA COME GALLERY */
  color: #333;
}

main {
  display: block;
}

/* ==================== CONTENITORE ==================== */
.magazine-layout {
  padding: 5.5rem 1rem calc(3rem + var(--player-safe-space));
  max-width: 1400px;
  margin: 0 auto;
}

/* ==================== SEZIONE MAGAZINE ==================== */
.magazine-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(0,0,0,0.08);
  text-align: center;
  margin-bottom: 2rem;
}

.magazine-header h1 {
  font-size: 2.4rem;
  margin-bottom: 1.5rem;
  color: #222;
}

/* ==================== GRIGLIA ==================== */
.magazine-flex {
  display: flex;
  gap: 3rem;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.magazine-box {
  background: rgba(255, 255, 255, 0.95);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  text-align: center;

  flex: 1 1 0;            /* si dividono lo spazio */
  max-width: 520px;       /* leggermente più largo */
}

.magazine-logo {
  width: 100%;
  max-width: 420px;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ==================== BOTTONE ==================== */
.btn-magazine {
  display: inline-block;
  background: #007bff;
  color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.25s ease, background 0.3s ease;
}

.btn-magazine:hover {
  transform: translateY(-2px);
  background: #0056b3;
}

.magazine-caption {
  margin-top: 1.2rem;
  font-size: 1.05rem;
  color: #555;
  font-style: italic;
}

/* ==================== SLIDESHOW ==================== */
.slideshow {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 300px;
  margin: 0 auto 2rem;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.8s ease;
  cursor: pointer;
}

.slide.active {
  opacity: 1;
  position: relative;
}

/* ==================== LIGHTBOX ==================== */
.zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  cursor: pointer;
}

.zoom-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* ==================== MOBILE MAGAZINE ==================== */
@media (max-width: 768px) {

  .magazine-flex {
    flex-direction: column;
    gap: 2rem;
  }

  .magazine-box {
    max-width: 100%;
    padding: 2rem 1.5rem;
  }

  /* slideshow fluido */
  .slideshow {
    max-width: 100%;
    height: auto;              /* via altezza fissa */
    aspect-ratio: 4 / 3;       /* proporzione corretta */
  }

  .slide {
    position: absolute;
    inset: 0;
    border-radius: 14px;
  }
}

@media (max-width: 480px) {
  .magazine-layout {
    padding-top: 4.5rem;
    padding-bottom: calc(3rem + var(--player-safe-space));
  }
}