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

/* Sfondo chiaro — la pagina magazine usa var(--paper) */
body.page-magazine { background: var(--paper); }

/* ══════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════ */
.mg-header {
  background: var(--ink);
  padding: 64px 40px 48px 72px;
  border-bottom: 1px solid var(--border-dark);
}
.mg-header__inner { max-width: 1320px; margin: 0 auto; }

.mg-header__eyebrow {
  font-family: var(--f-d); font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--teal); margin-bottom: 12px;
}
.mg-header__h1 {
  font-family: var(--f-d);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 800; color: #fff;
  letter-spacing: -.03em; line-height: 1.05;
  margin-bottom: 0;
}
.mg-header__search {
  margin-top: 28px; max-width: 440px;
  display: flex; gap: 8px;
}
.mg-header__search input {
  flex: 1; font-family: var(--f-b); font-size: 14px; color: var(--white);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 100px; padding: 11px 20px; outline: none;
  transition: border-color .2s;
}
.mg-header__search input:focus { border-color: var(--teal); background: rgba(11,189,194,.06); }
.mg-header__search input::placeholder { color: rgba(255,255,255,.28); }
.mg-header__search button {
  font-family: var(--f-d); font-size: 12px; font-weight: 700;
  color: var(--ink); background: var(--teal);
  border: none; border-radius: 100px;
  padding: 11px 24px; cursor: pointer;
  white-space: nowrap; transition: all .2s;
}
.mg-header__search button:hover { background: var(--teal-d); transform: translateY(-1px); }

/* ══════════════════════════════════════════════════
   SECTION (griglia + paginazione)
══════════════════════════════════════════════════ */
.mg-section {
  max-width: 1320px; margin: 0 auto;
  padding: 44px 40px 80px;
}

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

/* ── Card articolo: foto piena + testo overlay ── */
.mg-card {
  aspect-ratio: 3/2;
  position: relative; overflow: hidden;
  text-decoration: none; cursor: pointer;
  display: block; border-radius: 3px;
}
.mg-card__img {
  position: absolute; inset: 0;
}
.mg-card__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease), filter .5s;
  filter: grayscale(14%);
}
.mg-card:hover .mg-card__img img { transform: scale(1.06); filter: grayscale(0%); }

/* Gradiente sempre presente */
.mg-card__body {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 14px 16px 16px;
  background: linear-gradient(to top, rgba(14,12,11,.94) 0%, rgba(14,12,11,.1) 70%, transparent 100%);
  z-index: 1;
}
.mg-card__title {
  font-family: var(--f-d); font-size: clamp(.82rem, 1vw, .96rem);
  font-weight: 700; color: #fff;
  line-height: 1.28; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  transition: color .2s;
}
.mg-card:hover .mg-card__title { color: var(--teal); }
.mg-card__excerpt { display: none; } /* nascosto — spazio troppo piccolo */

/* Prima card più grande (prima col, 2 righe) */
.mg-grid .mg-card:first-child {
  grid-column: span 2;
  grid-row: span 2;
}
.mg-grid .mg-card:first-child .mg-card__title {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  -webkit-line-clamp: 4;
}

/* ── Card banner/ad ── */
.mg-card--ad {
  background: var(--dark-2);
  display: flex; align-items: center; justify-content: center;
  min-height: 180px; aspect-ratio: unset;
  cursor: default; border-radius: 3px;
}
.mg-card--ad:hover .mg-card__img img { transform: none; }

/* ══════════════════════════════════════════════════
   PAGINAZIONE
══════════════════════════════════════════════════ */
.mg-pagination {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px; padding: 8px 0 16px;
}
.mg-pagination a,
.mg-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 4px; border-radius: 8px;
  font-family: var(--f-d); font-size: 13px; 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;
}

/* ══════════════════════════════════════════════════
   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); }
  .mg-grid .mg-card:first-child { grid-column: span 2; grid-row: span 2; }
}
@media (max-width: 768px) {
  .mg-header { padding: 40px 20px 32px; }
  .mg-section { padding: 24px 20px 56px; }
  .mg-grid { grid-template-columns: repeat(2, 1fr); gap: 3px; }
  .mg-grid .mg-card:first-child { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 480px) {
  .mg-grid { grid-template-columns: repeat(2, 1fr); }
  .mg-grid .mg-card:first-child { grid-column: span 2; grid-row: span 1; }
}
