/* =========================================================
   XLLAB — Magazine
   ========================================================= */
.mag-hero { padding: clamp(150px, 15vw, 200px) 0 clamp(50px, 6vw, 80px); position: relative; overflow: hidden; }
.mag-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 70% at 90% 20%, rgba(201,162,39,.14), transparent 65%); }
.mag-hero .wrap { position: relative; }
.mag-hero h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(34px, 4.3vw, 62px); line-height: .95; letter-spacing: -.02em; margin: 22px 0 0; }
.mag-hero h1 em { font-family: var(--f-serif); font-weight: 400; color: var(--gold); letter-spacing: 0; }
.mag-hero .lead { margin-top: 22px; color: rgba(255,255,255,.7); }

/* Sottosezioni */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.tabs a { font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; padding: 11px 18px; border-radius: 99px; border: 1px solid var(--line-dark); color: rgba(255,255,255,.75); transition: all .3s; }
.tabs a:hover { border-color: var(--gold); color: var(--gold); }
.tabs a.on { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.tabs a span { opacity: .6; margin-left: 6px; }

/* Copertine generate (nessuna foto: grafica coordinata per categoria) */
.cover { position: relative; overflow: hidden; display: grid; place-items: center; isolation: isolate; }
.cover .cm { width: 26%; max-width: 120px; color: #fff; position: relative; z-index: 1; }
.cover .ck { position: absolute; left: 6%; bottom: 8%; z-index: 1; font-family: var(--f-display); font-weight: 800; font-size: clamp(12px, 1.2vw, 15px); letter-spacing: .2em; text-transform: uppercase; }
.cover .cw { position: absolute; right: -4%; bottom: -14%; font-family: var(--f-display); font-weight: 800; font-size: clamp(90px, 14vw, 220px); line-height: 1; opacity: .12; letter-spacing: -.04em; }
.cv-guide { background: linear-gradient(135deg, #141416, #0b0b0c); } .cv-guide .ck { color: var(--gold); } .cv-guide .cw { color: var(--gold); }
.cv-statistiche { background: #c9a227; } .cv-statistiche .cm { color: #111; } .cv-statistiche .ck, .cv-statistiche .cw { color: #111; }
.cv-statistiche::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: 0; height: 60%; background: linear-gradient(90deg, rgba(0,0,0,.18) 0 12%, transparent 12% 18%, rgba(0,0,0,.24) 18% 30%, transparent 30% 36%, rgba(0,0,0,.14) 36% 48%, transparent 48% 54%, rgba(0,0,0,.3) 54% 66%, transparent 66% 72%, rgba(0,0,0,.2) 72% 84%, transparent 84% 90%, rgba(0,0,0,.36) 90%); -webkit-mask: linear-gradient(0deg, #000 30%, transparent); mask: linear-gradient(0deg, #000 30%, transparent); }
.cv-interviste { background: #f4f1ea; } .cv-interviste .cm { color: #111; } .cv-interviste .ck { color: #8f7219; } .cv-interviste .cw { color: #111; font-family: var(--f-serif); font-style: italic; font-weight: 400; }
.cv-tech { background: #0b0b0c; } .cv-tech .ck { color: var(--gold); } .cv-tech .cw { color: var(--gold); }
.cv-tech::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(201,162,39,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(201,162,39,.16) 1px, transparent 1px); background-size: 26px 26px; -webkit-mask: radial-gradient(circle, #000, transparent 70%); mask: radial-gradient(circle, #000, transparent 70%); }

/* In evidenza */
.feat { display: grid; grid-template-columns: 1.2fr 1fr; border: 1px solid var(--line-dark); border-radius: 10px; overflow: hidden; background: var(--ink-2); }
.feat .cover { min-height: 380px; }
.feat .txt { padding: clamp(26px, 4vw, 54px); display: flex; flex-direction: column; justify-content: center; }
.feat h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(24px, 2.8vw, 40px); line-height: 1.08; margin: 14px 0; }
.feat p { color: rgba(255,255,255,.66); margin: 0 0 26px; }
@media (max-width: 860px) { .feat { grid-template-columns: 1fr; } .feat .cover { min-height: 240px; } }

/* Elenco articoli */
.meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.meta .cat { color: var(--gold); font-weight: 600; }
.light .meta { color: var(--muted-light); } .light .meta .cat { color: var(--gold-3); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line-light); transition: transform .6s var(--ease), box-shadow .6s; }
.card:hover { transform: translateY(-6px); box-shadow: 0 26px 50px rgba(0,0,0,.12); }
.card .cover { aspect-ratio: 16 / 10; }
.card .cover .cm { width: 20%; }
.card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-family: var(--f-display); font-weight: 800; font-size: 19px; line-height: 1.2; margin: 12px 0 10px; color: var(--text-dark); }
.card p { margin: 0 0 18px; font-size: 15px; color: var(--muted-light); }
.card .go { margin-top: auto; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-3); font-weight: 600; }
@media (max-width: 1000px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

/* Pagina articolo */
.art-hero { padding: clamp(140px, 14vw, 190px) 0 50px; }
.art-hero .wrap { max-width: 980px; }
.art-hero h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 3.4vw, 48px); line-height: 1.04; letter-spacing: -.015em; margin: 20px 0; }
.art-hero .lead { color: rgba(255,255,255,.72); max-width: 760px; }
.art-cover { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.art-cover .cover { aspect-ratio: 21 / 9; border-radius: 10px; }
.art-cover .cover .cm { width: 12%; }
.prose { max-width: 760px; margin: 0 auto; font-size: 18px; line-height: 1.75; color: #2a2926; }
.prose h2 { font-family: var(--f-display); font-weight: 800; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; margin: 54px 0 16px; color: var(--text-dark); }
.prose h3 { font-family: var(--f-display); font-weight: 800; font-size: 20px; margin: 34px 0 10px; color: var(--text-dark); }
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { margin: 0 0 24px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--gold-3); font-weight: 700; }
.prose strong { color: var(--text-dark); }
.prose a { color: var(--gold-3); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 34px 0; padding: 6px 0 6px 26px; border-left: 3px solid var(--gold); font-family: var(--f-serif); font-style: italic; font-size: 26px; line-height: 1.3; color: var(--text-dark); }
.prose .q { font-family: var(--f-display); font-weight: 800; font-size: 19px; color: var(--text-dark); margin: 34px 0 8px; }
.prose .q::before { content: "D · "; color: var(--gold-3); }
.prose .a::before { content: "R · "; font-family: var(--f-display); font-weight: 800; color: var(--gold-3); }
.callout { margin: 34px 0; padding: 26px 28px; border-radius: 10px; background: var(--text-dark); color: #fff; font-size: 16px; }
.callout b { display: block; font-family: var(--f-display); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; color: var(--gold); margin-bottom: 8px; }
.formula { margin: 24px 0; padding: 18px 22px; border: 1px dashed var(--gold-3); border-radius: 8px; font-family: Consolas, monospace; font-size: 15px; background: #fbf8f0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0; }
.stats div { background: #fff; border: 1px solid var(--line-light); border-radius: 8px; padding: 18px; }
.stats b { display: block; font-family: var(--f-display); font-weight: 800; font-size: 28px; color: var(--gold-3); line-height: 1; }
.stats span { font-size: 14px; color: var(--muted-light); }
@media (max-width: 620px) { .stats { grid-template-columns: 1fr; } }
.author { max-width: 760px; margin: 60px auto 0; display: flex; gap: 20px; align-items: center; padding-top: 30px; border-top: 1px solid var(--line-light); }
.author .av { width: 64px; height: 64px; border-radius: 50%; background: var(--text-dark); display: grid; place-items: center; flex: none; }
.author .av svg { width: 30px; color: #fff; }
.author b { font-family: var(--f-display); font-weight: 800; display: block; color: var(--text-dark); }
.author span { font-size: 14px; color: var(--muted-light); }
.tags { max-width: 760px; margin: 26px auto 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font-size: 12px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-light); color: var(--muted-light); }
.tags a:hover { border-color: var(--gold-3); color: var(--gold-3); }

/* Home: ultimi articoli */
.home-mag .cards .card { background: var(--ink-2); border-color: var(--line-dark); }
.home-mag .card h3 { color: #fff; }
.home-mag .card p { color: rgba(255,255,255,.6); }
.home-mag .card .go { color: var(--gold); }

/* Copertine con fotografia */
.cover.has-img { background: #0b0b0c; }
.cover.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; z-index: 0; transition: transform 1.2s var(--ease-out); }
.cover.has-img::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(11, 11, 12, 0) 45%, rgba(11, 11, 12, 0.75)); }
.cover.has-img .ck { color: var(--gold-2); }
.card:hover .cover.has-img img, .feat:hover .cover.has-img img { transform: scale(1.04); }
.art-cover .cover.has-img { aspect-ratio: 1189 / 1148; max-width: 760px; margin: 0 auto; }
.art-cover .cover.has-img img { object-fit: contain; object-position: center; }
.art-cover .cover.has-img::after, .art-cover .cover.has-img .ck { display: none; }

/* Griglia senza card orfane: card doppie orizzontali (classe generata da genera-magazine.js) */
@media (min-width: 1001px) {
  .card.wide { grid-column: span 2; flex-direction: row; }
  .card.wide.full { grid-column: 1 / -1; }
  .card.wide .cover { flex: 0 0 54%; aspect-ratio: auto; min-height: 300px; }
  .card.wide .body { justify-content: center; padding: 34px 38px; }
  .card.wide h3 { font-size: 24px; }
  .card.wide .go { margin-top: 8px; }
}
/* Su due colonne l'ultima card dispari occupa tutta la riga */
@media (min-width: 621px) and (max-width: 1000px) {
  .cards > .card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
  .cards > .card:last-child:nth-child(odd) .cover { flex: 0 0 50%; aspect-ratio: auto; min-height: 240px; }
  .cards > .card:last-child:nth-child(odd) .body { justify-content: center; }
}
