/*
Theme Name: Nerdgate
Author: Nerdgate
Description: Tema personalizzato per Nerdgate, il sito di intrattenimento a 360 gradi. Sfondo bianco, menu che scorre da destra, recensioni con scheda tecnica, voto e sintesi finale compilati con Advanced Custom Fields, testo di articoli e pagine giustificato.
Version: 1.0.8
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nerdgate
*/

/* ==========================================================================
   Variabili
   ========================================================================== */
:root {
    --bg: #FFFFFF;
    --surface: #F4F6F9;
    --fg: #0F1B2B;
    --muted: #5A6779;
    --line: #DDE3EA;
    --accent: #C2410C;
    --good: #1B7F4B;
    --bad: #B3402A;
    --c: #0F1B2B;
    --font-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Modo scuro: segue il telefono/computer, oppure si sceglie con l'interruttore in alto. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0E141C;
    --surface: #172130;
    --fg: #E8EDF3;
    --muted: #9AA7B8;
    --line: #2A3646;
    --accent: #F2753E;
    --good: #46C27F;
    --bad: #F08468;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0E141C;
        --surface: #172130;
        --fg: #E8EDF3;
        --muted: #9AA7B8;
        --line: #2A3646;
        --accent: #F2753E;
        --good: #46C27F;
        --bad: #F08468;
    }
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: break-word;
}

img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal;
}
.skip-link:focus {
    clip: auto; clip-path: none; height: auto; width: auto; margin: 0; padding: 12px 16px;
    background: var(--fg); color: var(--bg); z-index: 100000; left: 8px; top: 8px; border-radius: 8px;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin-inline: auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.site-main { padding-bottom: 40px; min-height: 60vh; }

/* ==========================================================================
   Testata
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header__in { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.site-logo {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em;
}
.site-logo svg { width: 30px; height: 30px; flex: none; }
.site-logo b { color: var(--accent); font-weight: 800; }
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { max-height: 44px; width: auto; }

.menu-toggle {
    width: 48px; height: 48px; display: grid; place-items: center;
    background: transparent; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.menu-toggle:hover { border-color: var(--accent); }
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
    display: block; width: 20px; height: 2px; background: var(--fg); border-radius: 2px; position: relative; content: "";
}
.menu-toggle__bars::before { position: absolute; top: -6px; }
.menu-toggle__bars::after { position: absolute; top: 6px; }

/* ==========================================================================
   Menu che scorre da destra
   ========================================================================== */
.drawer-scrim {
    position: fixed; inset: 0; z-index: 9990;
    background: rgba(5, 10, 18, 0.55);
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 9991;
    width: min(86vw, 360px);
    background: var(--bg);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.3s;
    padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px)) 24px;
    display: flex; flex-direction: column; gap: 24px; overflow-y: auto;
}
.admin-bar .drawer { top: 32px; }
@media (max-width: 782px) { .admin-bar .drawer { top: 46px; } }
@media (max-width: 600px) { .admin-bar .drawer { top: 0; } }

.drawer-open .drawer { transform: none; visibility: visible; transition-delay: 0s; }
.drawer-open .drawer-scrim { opacity: 1; pointer-events: auto; }

.drawer__head { display: flex; justify-content: space-between; align-items: center; }
.drawer__label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.drawer__close {
    width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
    background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer;
}

.drawer-menu, .drawer-menu ul { list-style: none; margin: 0; padding: 0; }
.drawer-menu > li > a {
    display: block; padding: 10px 0; border-bottom: 1px solid var(--line);
    font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1.2; letter-spacing: -0.02em;
}
.drawer-menu a:hover, .drawer-menu .current-menu-item > a { color: var(--accent); }
.drawer-menu .sub-menu { padding: 6px 0 6px 14px; }
.drawer-menu .sub-menu a { display: block; padding: 6px 0; font-size: 1.05rem; font-weight: 600; color: var(--muted); }

.drawer__cats { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 0.85rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
}
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: block; }
.chip:hover { border-color: var(--c); }

/* ==========================================================================
   Ricerca
   ========================================================================== */
.search-form { display: flex; gap: 8px; }
.search-form__input {
    flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--bg); min-height: 48px;
}
.search-form__btn {
    padding: 0 18px; min-height: 48px; border-radius: 12px; border: 0; background: var(--fg); color: var(--bg);
    font-weight: 600; cursor: pointer;
}
.search-form__btn:hover { background: var(--accent); }

/* ==========================================================================
   Pulsanti e messaggi
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 22px; border-radius: 12px; border: 1px solid var(--line); background: transparent;
    font-weight: 600; cursor: pointer; min-height: 48px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.empty { color: var(--muted); padding-block: 8px; }

/* ==========================================================================
   Home
   ========================================================================== */
.intro { padding-block: 28px 8px; display: flex; flex-direction: column; gap: 6px; }
.intro h1 {
    font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 6vw, 3rem);
    line-height: 1.05; letter-spacing: -0.03em; margin: 0; text-wrap: balance;
}
.intro p { margin: 0; color: var(--muted); max-width: 52ch; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 28px 14px; }
.sec-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; margin: 0; }

/* Griglia di card */
.reviews-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) {
    .reviews-grid { grid-template-columns: repeat(2, 1fr); }
    .card--featured { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
    .reviews-grid { grid-template-columns: repeat(3, 1fr); }
    .card--featured { grid-column: span 2; }
}

.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.card__cover {
    position: relative; display: block; color: #fff; background-color: var(--c);
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0 2px, transparent 2px 14px);
    aspect-ratio: 16 / 9;
}
.card:not(.card--img) .card__cover { aspect-ratio: auto; min-height: 112px; }
.card--featured:not(.card--img) .card__cover { min-height: 148px; }
@media (min-width: 700px) { .card--featured.card--img .card__cover { aspect-ratio: 21 / 9; } }

.card__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card--img .card__cover::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 55%);
}
.card__meta {
    position: absolute; inset: 0; z-index: 1; padding: 14px 16px;
    display: flex; justify-content: space-between; align-items: flex-start;
}
.card:not(.card--img) .card__meta { position: relative; inset: auto; min-height: 112px; }
.card--featured:not(.card--img) .card__meta { min-height: 148px; }

.card__cat { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
.card__vote { text-align: right; line-height: 1; }
.card__vote b {
    font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.card__vote small { font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.85; }

.card__body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card__title {
    font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; line-height: 1.15;
    letter-spacing: -0.02em; margin: 0; text-wrap: balance;
}
.card--featured .card__title { font-size: 1.6rem; }
.card__title a:hover { color: var(--accent); }
.card__text { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card__text em {
    font-style: normal; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--fg); margin-right: 6px;
}

/* Scheda tecnica (nelle card e nell'articolo) */
.specs { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 0.92rem; }
.specs dt { color: var(--muted); font-family: var(--font-mono); font-size: 0.8rem; padding-top: 1px; }
.specs dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.specs--mono {
    gap: 4px 14px; font-family: var(--font-mono); font-size: 0.8rem; padding-top: 10px; border-top: 1px dashed var(--line);
}
.specs--mono dt { font-size: inherit; padding-top: 0; }
.specs--mono dd { font-weight: 400; }

/* News */
.news-list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding-inline: 16px; }
.news-row {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline;
    padding-block: 14px; border-bottom: 1px solid var(--line);
}
.news-row:last-child { border-bottom: 0; }
.news-row__tag {
    grid-column: 1 / -1; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--c); font-weight: 500;
}
.news-row__title { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.3; min-width: 0; text-wrap: balance; }
.news-row__title a:hover { color: var(--accent); }
.news-row__time { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.news-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.news-nav .btn { flex: 1 1 200px; }

/* ==========================================================================
   Articolo: intestazione
   ========================================================================== */
.crumbs { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 24px; }
.crumbs a:hover { color: var(--accent); }
.crumbs__cat { color: var(--c); font-weight: 500; }

.entry-title {
    font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 7vw, 3.4rem);
    line-height: 1.04; letter-spacing: -0.03em; margin: 10px 0 8px; text-wrap: balance; text-align: left;
}
.single-page .entry-title { margin-top: 28px; }
.byline { color: var(--muted); font-size: 0.9rem; margin: 0 0 22px; }
.byline__author { color: var(--ink, inherit); font-weight: 600; text-decoration: none; }
.byline__author:hover { color: var(--accent); text-decoration: underline; }

.hero {
    margin: 0 0 22px; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
    aspect-ratio: 16 / 9;
}
@media (min-width: 900px) { .hero { aspect-ratio: 21 / 9; } }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-caption {
    margin: -12px 0 22px; font-size: 0.85rem; line-height: 1.5; color: var(--muted);
    text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto;
}

/* ==========================================================================
   Recensione: colonna del testo + voto e scheda
   ========================================================================== */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 900px) {
    .layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
    .side { position: sticky; top: 84px; order: 2; }
    .admin-bar .side { top: 116px; }
    .article-col { order: 1; }
}
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.article-col { min-width: 0; }
.layout--no-side { max-width: 740px; margin-inline: auto; }
@media (min-width: 900px) { .layout.layout--no-side { grid-template-columns: minmax(0, 1fr); } }

.editor-note {
    margin: 0 0 20px; padding: 12px 14px; border: 1px dashed var(--accent); border-radius: 12px;
    background: var(--surface); font-size: 0.9rem; color: var(--muted);
    text-align: justify; hyphens: auto;
}
.editor-note a { color: var(--accent); font-weight: 600; text-decoration: underline; }

.scorebox {
    background-color: var(--c); color: #fff; border-radius: 16px; padding: 16px;
    display: flex; justify-content: space-between; align-items: flex-end; min-height: 120px;
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0 2px, transparent 2px 14px);
}
.scorebox__k { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.scorebox__n {
    font-family: var(--font-display); font-weight: 800; font-size: 4rem; line-height: 0.9;
    letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.scorebox__n small { font-family: var(--font-mono); font-size: 1rem; font-weight: 400; letter-spacing: 0; opacity: 0.85; }

.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.sheet h2 {
    font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--muted); margin: 0 0 10px;
}

/* Sintesi finale */
.final {
    margin-top: 32px; background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--c);
    border-radius: 16px; padding: 20px 18px;
}
.final__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.final__head h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; margin: 0; }
.final__vote {
    font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.03em;
    color: var(--c); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.final__vote small { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.final__text p { margin: 0 0 1em; font-size: 1.0625rem; line-height: 1.75; }

.pc { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 8px; }
@media (min-width: 600px) { .pc { grid-template-columns: 1fr 1fr; } }
.pc h3 { font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 8px; }
.pc__col--pro h3 { color: var(--good); }
.pc__col--con h3 { color: var(--bad); }
.pc ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pc li { font-size: 0.95rem; line-height: 1.5; padding-left: 20px; position: relative; }
.pc li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 10px; height: 2px; background: currentColor; }
.pc__col--pro li::before { color: var(--good); }
.pc__col--con li::before { color: var(--bad); }

/* ==========================================================================
   Testo di articoli e pagine: sempre giustificato
   ========================================================================== */
.prose { max-width: 740px; margin-inline: auto; }

.entry-content, .final__text, .comment-content, .archive-head__desc {
    font-size: 1.0625rem; line-height: 1.75;
}
.entry-content p,
.entry-content li,
.entry-content dd,
.entry-content td,
.entry-content blockquote p,
.entry-content figcaption,
.entry-content .wp-caption-text,
.final__text p,
.comment-content p,
.pc li {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
}
.entry-content p { margin: 0 0 1.1em; }

.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5, .entry-content h6 {
    font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2;
    margin: 1.8em 0 0.5em; text-align: left; text-wrap: balance;
}
.entry-content h2 { font-size: 1.5rem; }
.entry-content h3 { font-size: 1.25rem; }
.entry-content > :first-child { margin-top: 0; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-thickness: 2px; }
.entry-content ul, .entry-content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content blockquote {
    margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--c); color: var(--muted);
}
.entry-content blockquote p { margin-bottom: 0.6em; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.entry-content pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 0.9rem; line-height: 1.5; }
.entry-content code { font-family: var(--font-mono); font-size: 0.9em; }
.entry-content table { display: block; overflow-x: auto; border-collapse: collapse; max-width: 100%; margin-bottom: 1.2em; font-size: 0.95rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 10px; }
.entry-content::after { content: ""; display: table; clear: both; }

/* Immagini nel testo */
.entry-content figure, .entry-content .wp-caption { margin: 1.6em 0; max-width: 100%; }
.entry-content figure img, .entry-content .wp-caption img { display: block; width: 100%; border-radius: 12px; }
.entry-content figcaption, .entry-content .wp-caption-text {
    font-size: 0.85rem; line-height: 1.5; color: var(--muted); margin-top: 8px;
}
.entry-content .alignleft { float: left; margin: 0.4em 1.2em 0.8em 0; max-width: 50%; }
.entry-content .alignright { float: right; margin: 0.4em 0 0.8em 1.2em; max-width: 50%; }
.entry-content .aligncenter { display: block; margin-inline: auto; }
@media (max-width: 599px) {
    .entry-content .alignleft, .entry-content .alignright { float: none; margin-inline: 0; max-width: 100%; }
}
.entry-content .wp-block-embed, .entry-content .wp-block-video { margin: 1.6em 0; }
.entry-content iframe { max-width: 100%; border: 0; }
.entry-content .wp-block-gallery { margin: 1.6em 0; }

.page-links { margin: 1.4em 0; font-family: var(--font-mono); font-size: 0.85rem; }
.tags { margin: 1.6em 0 0; font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.tags a:hover { border-color: var(--accent); color: var(--accent); }

/* Articolo precedente e successivo */
.post-navigation { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .post-navigation .nav-links { grid-template-columns: 1fr 1fr; } }
.post-navigation a { display: block; font-weight: 600; line-height: 1.3; }
.post-navigation a:hover { color: var(--accent); }
.nav-next { text-align: right; }
.nav-sub { display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* ==========================================================================
   Archivi, ricerca, 404
   ========================================================================== */
.archive-head { padding-block: 28px 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; position: relative; }
.archive-head::before { content: ""; display: block; width: 48px; height: 6px; background: var(--c); border-radius: 3px; margin-bottom: 14px; }
.archive-head__k { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.archive-head h1 {
    font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 7vw, 3.2rem);
    line-height: 1.05; letter-spacing: -0.03em; margin: 6px 0 0; text-wrap: balance;
}
.archive-head__desc { color: var(--muted); margin-top: 10px; max-width: 62ch; text-align: justify; hyphens: auto; }
.archive-head__desc p { margin: 0 0 0.6em; }

.pagination { margin-top: 28px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-numbers {
    min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; font-weight: 600;
}
a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.page-numbers.current { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.page-numbers.dots { border-color: transparent; }

.notfound { padding-block: 48px; max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.notfound h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 7vw, 3rem); letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
.notfound p { margin: 0; color: var(--muted); }

/* ==========================================================================
   Commenti
   ========================================================================== */
.comments { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.comments__title { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; margin: 0 0 16px; }
.comment-list, .comment-list ol { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: 20px; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: 0.85rem; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.comment-meta .avatar { border-radius: 50%; }
.comment-meta .fn { font-weight: 600; color: var(--fg); font-style: normal; }
.comment-content p { margin: 8px 0; font-size: 1rem; line-height: 1.6; }
.reply a { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.comment-respond { margin-top: 24px; }
.comment-reply-title { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; margin: 0 0 12px; }
.comment-form p { margin: 0 0 12px; }
.comment-form label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.comment-form .submit {
    padding: 0 22px; min-height: 48px; border-radius: 12px; border: 0; background: var(--fg); color: var(--bg); font-weight: 600; cursor: pointer;
}
.comment-form .submit:hover { background: var(--accent); }

/* ==========================================================================
   Piè di pagina
   ========================================================================== */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.site-footer__in { padding-block: 22px; display: flex; flex-direction: column; gap: 10px; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-menu a:hover { color: var(--accent); }
.site-footer__copy { margin: 0; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; }

@media (prefers-reduced-motion: reduce) {
    .drawer, .drawer-scrim { transition: none; }
}

/* News in home: blocchi piccoli */
.news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .news-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 1000px) { .news-grid { grid-template-columns: repeat(4, 1fr); } }
.ncard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.ncard__cover { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--c); overflow: hidden; }
.ncard__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ncard__tag {
    position: absolute; left: 8px; bottom: 8px; background: var(--c); color: #fff;
    font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 3px 7px; border-radius: 4px;
}
.ncard:not(.ncard--img) .ncard__tag { background: rgba(255, 255, 255, 0.2); }
.ncard__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ncard__title { margin: 0; font-size: 0.95rem; font-weight: 600; line-height: 1.3; text-align: left; text-wrap: balance; }
.ncard__title a:hover { color: var(--accent); }
.ncard__time { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); margin-top: auto; }

/* Interruttore modo scuro */
.site-header__actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
    width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer;
    background: transparent; border: 1px solid var(--line); border-radius: 12px; color: var(--fg);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.site-footer__copy a:hover { color: var(--accent); text-decoration: underline; }
