/* ===== MAGAZINE — EDITORIAL / RIVISTA LAYOUT ===== */

/* Header testata */
.mag-header {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1f3a2c 60%, #0a7d3e 100%);
  color: #fff;
  padding: 56px 24px 44px;
  text-align: center;
}
.mag-header-inner {
  max-width: 720px;
  margin: 0 auto;
}
.mag-label {
  display: inline-block;
  padding: 5px 16px;
  background: var(--accent);
  color: #1a1208;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 16px;
}
.mag-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.05;
  margin-bottom: 12px;
}
.mag-header p {
  font-size: 16px;
  opacity: .85;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Filtri categorie */
.mag-filters {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mag-tag {
  padding: 8px 18px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.mag-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.mag-tag.active {
  background: var(--bg-dark);
  border-color: var(--bg-dark);
  color: #fff;
}

/* Layout principale */
.mag-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 64px;
}

/* Hero articolo principale — stile copertina rivista */
.mag-hero {
  display: block;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
  aspect-ratio: 21/9;
  background: var(--bg-dark);
  text-decoration: none;
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: transform .2s;
}
.mag-hero:hover {
  transform: translateY(-3px);
}
.mag-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.mag-hero-placeholder {
  background: linear-gradient(135deg, #1a2e22 0%, #2d4a38 50%, #0a7d3e 100%);
}
.mag-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 40%, transparent 70%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 36px;
}
.mag-hero-overlay h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.5px;
  margin-bottom: 8px;
  max-width: 700px;
}
.mag-hero-summary {
  font-size: 16px;
  opacity: .9;
  line-height: 1.5;
  max-width: 560px;
  margin-bottom: 8px;
}
.mag-hero-meta {
  font-size: 13px;
  opacity: .65;
  font-weight: 600;
}
.mag-cat-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent);
  color: #1a1208;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 10px;
  width: fit-content;
}

/* Griglia articoli secondari — stile rivista */
.mag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* Card articolo */
.mag-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, box-shadow .15s;
}
.mag-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.mag-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--bg-alt);
}
.mag-card-placeholder {
  background: linear-gradient(135deg, var(--bg-alt) 0%, #d4ddd8 100%);
}
.mag-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.mag-cat-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary);
}
.mag-card-body h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.3px;
  color: var(--bg-dark);
}
.mag-card-body p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mag-card-meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}

/* Empty / loading */
.mag-empty, .mag-loading {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-light);
  font-size: 16px;
}

/* Active nav link */
.nav-link-btn.active {
  color: var(--primary);
  border-color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .mag-hero {
    aspect-ratio: 4/3;
  }
  .mag-hero-overlay {
    padding: 24px 20px;
  }
  .mag-hero-overlay h2 {
    font-size: 22px;
  }
  .mag-hero-summary {
    font-size: 14px;
  }
  .mag-grid {
    grid-template-columns: 1fr;
  }
  .mag-header {
    padding: 40px 20px 32px;
  }
}

@media (max-width: 480px) {
  .mag-hero {
    aspect-ratio: 3/4;
    border-radius: 12px;
  }
  .mag-hero-overlay h2 {
    font-size: 20px;
  }
}
