/* ─── MAGAZINE — lista articoli per categoria / ricerca ─────────────── */

/* Sfondo chiaro — la pagina magazine usa var(--paper) */
body.page-magazine { background: var(--paper); --mg-serif: 'Newsreader', Georgia, serif; }

/* PAGE HEADER — usa .pg-head di shell.css (stessa fascia nera di
   eventi, esperti, gallery, video). Qui nessuna regola dedicata:
   duplicarla è ciò che aveva fatto divergere i margini. */

/* ══════════════════════════════════════════════════
   SECTION (griglia + paginazione)
══════════════════════════════════════════════════ */
/* larghezza e padding laterali: .container di Bootstrap (stessa della home) */
.mg-section {
  padding-top: 44px; padding-bottom: 80px;
}

/* ══════════════════════════════════════════════════
   GRIGLIA CARD — stile dark overlay
══════════════════════════════════════════════════ */
.mg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 40px;
}

/* ── Card articolo: stile identico alle card news in homepage (.hv2-card) ── */
.mg-card {
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; cursor: pointer;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(9,9,11,.04), 0 8px 24px rgba(9,9,11,.06);
  transition: transform .25s, box-shadow .25s;
}
.mg-card:hover { transform: translateY(-5px); box-shadow: 0 20px 60px rgba(9,9,11,.14); }
.mg-card__img {
  aspect-ratio: 16/9;
  overflow: hidden; flex-shrink: 0;
  background: var(--border);
}
.mg-card__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s;
  display: block;
}
.mg-card:hover .mg-card__img img { transform: scale(1.06); }

.mg-card__body {
  padding: 18px 18px 22px;
  flex: 1; display: flex; flex-direction: column;
}
.mg-card__title {
  font-family: var(--mg-serif); font-size: 1.18rem;
  font-weight: 600; color: var(--ink);
  line-height: 1.22; letter-spacing: -.01em;
  /* titolo sempre intero: niente line-clamp */
  overflow-wrap: break-word;
  transition: color .2s; margin: 0;
}
.mg-card:hover .mg-card__title { color: var(--red); }
.mg-card__excerpt { display: none; }
.mg-card__date {
  margin-top: 12px;
  font-family: var(--f-d); font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--teal);
}

/* ── Banner/ad: rigo a se, fuori dalla griglia (full-width) ── */
.mg-adband {
  width: 100%;
  text-align: center;
  margin: 12px 0 28px;
}
.mg-adband__cap {
  display: block; font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.mg-adband__slot {
  width: 100%; text-align: center; min-height: 90px;
}
/* <ins> AdSense responsive: serve larghezza definita (no flex che lo azzera) */
.mg-adband__slot ins.adsbygoogle { display: block; width: 100%; }
.mg-adband__slot img,
.mg-adband__slot iframe { max-width: 100%; height: auto; }

/* ══════════════════════════════════════════════════
   PAGINAZIONE
══════════════════════════════════════════════════ */
.mg-pagination {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: nowrap; gap: 4px; padding: 8px 0 16px;
}
.mg-pagination .dots {
  min-width: 20px; text-align: center; color: var(--muted);
  font-family: var(--f-d); font-size: 14px; border: none; background: none;
}
.mg-pagination a,
.mg-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 3px; border-radius: 7px;
  font-family: var(--f-d); font-size: 12px; font-weight: 600;
  text-decoration: none; transition: all .2s;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--paper);
}
.mg-pagination a:hover { border-color: var(--teal); color: var(--teal); }
.mg-pagination span.active {
  background: var(--teal); border-color: var(--teal);
  color: var(--ink); font-weight: 700;
}
/* Indicatore compatto: solo mobile */
.mg-pagination .pg-status {
  display: none; min-width: 0; padding: 0 14px; border: none; background: none;
  font-family: var(--f-d); font-size: 14px; font-weight: 700; color: var(--ink);
}
@media (max-width: 575.98px) {
  .mg-pagination { gap: 8px; }
  .mg-pagination a:not(.pg-nav),
  .mg-pagination span.active,
  .mg-pagination .dots { display: none; }
  .mg-pagination .pg-status { display: inline-flex; align-items: center; }
  .mg-pagination .pg-nav { min-width: 44px; height: 44px; font-size: 18px; }
}

/* ══════════════════════════════════════════════════
   STATO VUOTO
══════════════════════════════════════════════════ */
.mg-empty {
  text-align: center; padding: 80px 0;
}
.mg-empty__icon {
  font-family: var(--f-d); font-size: 3rem;
  color: var(--border); margin-bottom: 16px; line-height: 1;
}
.mg-empty__title {
  font-family: var(--f-d); font-size: 1.4rem; font-weight: 700;
  color: var(--ink); margin-bottom: 10px;
}
.mg-empty__text {
  font-family: var(--f-b); font-size: 15px;
  color: var(--muted);
}
.mg-empty__text a { color: var(--teal); }

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .mg-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .mg-header { padding: 40px 20px 32px; }
  .mg-section { padding-top: 24px; padding-bottom: 56px; }
  .mg-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
@media (max-width: 480px) {
  .mg-grid { grid-template-columns: 1fr; }
}
