/* ═══════════════════════════════════════════════════════════
   forum.css — Tana del Ladro · Forum
   Allineato con base.css, negozio.css, liste_responsive.css
   ═══════════════════════════════════════════════════════════ */

@import url("../../core/css/base.css");

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
    background: var(--bg-void);
    color: var(--text-main);
    font-family: 'Celestia', Georgia, serif;
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-light); }

img { max-width: 100%; height: auto; }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   HERO — pattern condiviso con shop-hero
═══════════════════════════════════════════════════════════ */
.forum-hero {
    position: relative; width: 100%;
    height: clamp(180px, 22vh, 320px);
    overflow: hidden;
    background: var(--bg-deep);
    max-width: 1400px;
    margin: 0 auto;
}
.forum-hero.compact { height: clamp(140px, 16vh, 220px); }

.forum-hero-bg {
    position: absolute; inset: 0;
    background:
            radial-gradient(ellipse at 30% 30%, rgba(201,168,76,.12) 0%, transparent 60%),
            linear-gradient(135deg, #1a1410 0%, #0a0807 70%);
}
/* Pattern decorativo opzionale — esagoni dorati */
.forum-hero-bg.pattern-hex::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
            repeating-linear-gradient(60deg, transparent 0, transparent 40px, rgba(201,168,76,.04) 40px, rgba(201,168,76,.04) 41px),
            repeating-linear-gradient(-60deg, transparent 0, transparent 40px, rgba(201,168,76,.04) 40px, rgba(201,168,76,.04) 41px);
    opacity: .6;
}
/* Varianti per gruppo forum */
.forum-hero-bg.group-staff      { background: radial-gradient(ellipse at 30% 30%, rgba(0,180,255,.08) 0%, transparent 60%), linear-gradient(135deg, #0a141e 0%, #060808 70%); }
.forum-hero-bg.group-locazione  { background: radial-gradient(ellipse at 70% 40%, rgba(251,190,9,.07) 0%, transparent 60%), linear-gradient(135deg, #1a1410 0%, #060807 70%); }
.forum-hero-bg.group-clan       { background: radial-gradient(ellipse at 50% 40%, rgba(155,44,44,.07) 0%, transparent 60%), linear-gradient(135deg, #18100c 0%, #060604 70%); }

.forum-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom,
    rgba(8,8,8,.05) 0%, rgba(8,8,8,.5) 60%, rgba(8,8,8,.95) 100%);
}
.forum-hero-content {
    position: absolute;
    bottom: clamp(16px, 3vh, 36px);
    left: clamp(20px, 3vw, 48px);
    right: clamp(20px, 3vw, 48px);
    z-index: 2;
}
.forum-hero-label {
    font-family: 'minor-headers', serif;
    font-size: .78rem;
    letter-spacing: .4em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
}
.forum-hero-title {
    font-family: 'Ringbearer', serif;
    font-size: clamp(1.6rem, 3.6vw, 3rem);
    color: var(--text-main);
    text-shadow: 0 2px 30px rgba(0,0,0,.95);
    line-height: 1.1;
    letter-spacing: .02em;
    font-weight: 400;
}
.forum-hero.compact .forum-hero-title {
    font-size: clamp(1.3rem, 2.6vw, 2.2rem);
}
.forum-hero-subtitle {
    font-family: 'base-text', Georgia, serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 6px;
    max-width: 700px;
}
.forum-hero-back {
    position: absolute;
    top: clamp(16px, 3vh, 28px);
    right: clamp(20px, 3vw, 40px);
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .2em;
    color: var(--text-muted);
    background: rgba(8,8,8,.65);
    border: 1px solid var(--border);
    padding: 6px 14px;
    backdrop-filter: blur(6px);
    transition: color .2s, border-color .2s;
    z-index: 3;
    text-transform: uppercase;
}
.forum-hero-back:hover { color: var(--gold); border-color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   META BAR — barra contesto sotto l'hero
═══════════════════════════════════════════════════════════ */
.forum-meta-bar {
    background: rgba(15,15,15,.97);
    border-bottom: 1px solid var(--border);
    padding: 12px clamp(20px, 4vw, 56px);
    display: flex; align-items: center; gap: 18px;
    flex-wrap: wrap;
    font-family: 'minor-headers', serif;
    font-size: .78rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-muted);
    max-width: 1400px;
    margin: 0 auto;
}
.forum-meta-bar .meta-item { display: flex; align-items: center; gap: 6px; }
.forum-meta-bar .meta-item i { color: var(--gold); font-size: .9rem; }
.forum-meta-bar .meta-item b {
    color: var(--gold);
    font-weight: normal;
    font-family: 'base-text', Georgia, serif;
    letter-spacing: 0;
    font-size: .92rem;
}
.forum-meta-bar .meta-spacer { flex: 1; }
.forum-meta-bar .meta-action {
    color: var(--text-muted);
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .2em;
    padding: 4px 10px;
    border: 1px solid var(--border-dim);
    transition: all .2s;
    cursor: pointer;
    background: transparent;
    text-transform: uppercase;
}
.forum-meta-bar .meta-action:hover { color: var(--gold); border-color: var(--gold); }
.forum-meta-bar .meta-action.primary { color: var(--gold); border-color: var(--gold); }
.forum-meta-bar .meta-action.primary:hover { background: var(--gold); color: var(--bg-void); }

/* Pallino tondo notifica per i bottoni meta-action (menzioni, seguiti) */
.meta-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    color: var(--bg-void);
    font-family: 'base-text', Georgia, serif;
    font-size: .68rem;
    font-weight: bold;
    letter-spacing: 0;
    text-transform: none;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    margin-left: 6px;
    line-height: 1;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════
   BREADCRUMB
═══════════════════════════════════════════════════════════ */
.forum-breadcrumb {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px clamp(20px, 4vw, 56px) 0;
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.forum-breadcrumb a { color: var(--text-muted); }
.forum-breadcrumb a:hover { color: var(--gold); }
.forum-breadcrumb .sep { margin: 0 8px; opacity: .5; color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   BODY WRAPPER
═══════════════════════════════════════════════════════════ */
.forum-body {
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(20px, 3vh, 36px) clamp(20px, 4vw, 56px) 64px;
}

/* ═══════════════════════════════════════════════════════════
   SECTION HEADER — riusato dal negozio
═══════════════════════════════════════════════════════════ */
.section-header {
    font-family: 'minor-headers', serif;
    font-size: .82rem;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: var(--gold);
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin: 28px 0 16px;
    display: flex; align-items: center; gap: 12px;
}
.section-header:first-child { margin-top: 0; }
.section-header i { font-size: 1rem; opacity: .8; }
.section-header::after {
    content: ''; flex: 1; height: 1px;
    background: var(--gold-dim);
}
.section-header .count {
    color: var(--text-muted);
    font-family: 'base-text', Georgia, serif;
    font-size: .82rem;
    letter-spacing: 0;
    text-transform: none;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   FORUM LIST GRID  (elenco.php)
═══════════════════════════════════════════════════════════ */
.forum-list {
    display: grid;
    grid-template-columns:
        40px                    /* icona */
        minmax(220px, 2fr)      /* nome + descrizione */
        80px                    /* # thread */
        80px                    /* # post */
        minmax(220px, 1.4fr);   /* ultimo post */
    gap: 0;
    width: 100%;
    background: var(--bg-deep);
}
.forum-list-header { display: contents; }
.forum-list-row    { display: contents; }

.forum-list .hcell {
    padding: 10px 12px;
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: rgba(8,8,8,.6);
    display: flex; align-items: center;
}
.forum-list .hcell-num { justify-content: center; }

.forum-list .cell {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,.03);
    display: flex; align-items: center;
    transition: background .15s;
    min-height: 56px;
}
.forum-list-row:hover > .cell {
    background: rgba(255,255,255,.02);
}
.forum-list-row.has-update > .cell:first-child {
    box-shadow: inset 3px 0 0 var(--gold);
}
.forum-list-row.is-closed > .cell {
    opacity: .55;
}

.cell-icon {
    justify-content: center;
    color: var(--gold);
    opacity: .7;
    font-size: 1.1rem;
}
.cell-icon i { transition: opacity .2s; }
.forum-list-row:hover .cell-icon i { opacity: 1; }

.cell-forum-name { flex-direction: column; align-items: flex-start; gap: 4px; }
.cell-forum-name .name {
    font-family: 'minor-headers', serif;
    font-size: .98rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-main);
    transition: color .2s;
}
.forum-list-row:hover .cell-forum-name .name { color: var(--gold-light); }
.cell-forum-name .desc {
    font-size: .85rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
}

.cell-num {
    justify-content: center;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 1rem;
}

.cell-last {
    flex-direction: column; align-items: flex-start; gap: 2px;
    font-size: .85rem; color: var(--text-muted);
    overflow: hidden;
}
.cell-last .lp-line {
    display: flex; align-items: baseline; gap: 6px;
    max-width: 100%;
    overflow: hidden;
}
.cell-last .lp-prefix {
    font-family: 'minor-headers', serif;
    font-size: .65rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--text-faint);
    flex: 0 0 auto;
}
.cell-last .last-author {
    color: var(--text-main);
    font-family: 'minor-headers', serif;
    font-size: .75rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.cell-last .last-title {
    color: var(--gold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    font-style: italic;
}
.cell-last .lp-when {
    font-size: .75rem;
    opacity: .7;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   QUALIFICHE/RUOLI — colori da liste_responsive.css
═══════════════════════════════════════════════════════════ */
.role-admin     { color: #00B4FF; }
.role-dm        { color: #b52010; }
.role-staff     { color: #a0fe96; }
.role-leader    { color: #80FF00; }
.role-narratore { color: #FBBE09; }
.role-png       { color: #366366; font-style: italic; }
.role-gestore   { color: #808080; }
.role-pg        { color: var(--text-main); }

/* ═══════════════════════════════════════════════════════════
   THREAD LIST  (index.php)
═══════════════════════════════════════════════════════════ */
.thread-list {
    display: grid;
    grid-template-columns:
        44px                     /* status icon */
        minmax(360px, 3fr)       /* discussione */
        72px                     /* risposte */
        72px                     /* accessi */
        minmax(220px, 1.5fr);    /* ultimo intervento */
}
.thread-list-header { display: contents; }
.thread-row         { display: contents; }

.thread-list .hcell {
    padding: 12px 14px;
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: rgba(8,8,8,.6);
    display: flex; align-items: center;
}
.thread-list .hcell-num { justify-content: center; }
.thread-list .hcell-last { padding-left: 18px; }

.thread-list .cell {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    display: flex; align-items: center;
    min-height: 80px;
    transition: background .15s;
}
.thread-row:hover > .cell { background: rgba(255,255,255,.025); }

/* Discussioni con aggiornamenti non letti — bordo gold */
.thread-row.has-update > .cell:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.thread-row.has-update .thread-title { color: var(--text-main); font-weight: 500; }

/* Default (letta) — titolo più tenue */
.thread-row .thread-title { color: rgba(232,224,208,.62); font-weight: 400; }

/* Sticky */
.thread-row.is-sticky > .cell {
    background: linear-gradient(to right, rgba(201,168,76,.06), rgba(201,168,76,.02) 80%);
}
.thread-row.is-sticky:hover > .cell {
    background: linear-gradient(to right, rgba(201,168,76,.1), rgba(201,168,76,.04) 80%);
}

/* Locked */
.thread-row.is-locked > .cell { opacity: .5; }
.thread-row.is-locked .thread-title { color: var(--text-muted); }

.cell-status {
    justify-content: center;
    font-size: 1.4rem;
    color: var(--text-muted);
}
.cell-status .icon-flame  { color: #c97a3a; filter: drop-shadow(0 0 6px rgba(201,122,58,.5)); }
.cell-status .icon-folder { color: var(--text-muted); opacity: .5; }
.cell-status .icon-folder-update { color: var(--gold); opacity: .9; filter: drop-shadow(0 0 4px rgba(201,168,76,.4)); }
.cell-status .icon-lock   { color: var(--text-faint); }
.cell-status .icon-pin    { color: var(--gold); transform: rotate(35deg); }
.cell-status .icon-poll   { color: var(--gold); opacity: .8; }

.cell-thread {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
}
.cell-thread .thread-title {
    font-family: 'minor-headers', serif;
    font-size: 1.02rem;
    letter-spacing: .04em;
    line-height: 1.35;
    transition: color .2s;
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.thread-row:hover .thread-title { color: var(--gold-light); }
.cell-thread .thread-meta {
    font-size: .8rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
}
.cell-thread .thread-meta b { font-style: normal; font-weight: normal; }
.cell-thread .thread-flags {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'minor-headers', serif;
    font-size: .62rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.cell-thread .thread-flags i { font-size: .82rem; }
.cell-thread .thread-flags .flag-followed { color: var(--gold); }
.cell-thread .thread-flags .flag-mine { color: #5aaa6e; }
.cell-thread .thread-flags .flag-poll { color: var(--gold-light); }

/* Tag pill */
.tag-pill {
    display: inline-flex; align-items: center;
    font-family: 'minor-headers', serif;
    font-size: .58rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 3px 8px;
    border: 1px solid var(--gold-dim);
    background: var(--gold-glow);
    color: var(--gold);
    line-height: 1;
    flex-shrink: 0;
}
.tag-pill.tag-c4m       { border-color: rgba(155,44,44,.4); color: #c97a7a; background: rgba(155,44,44,.08); }
.tag-pill.tag-filone    { border-color: rgba(0,180,255,.3); color: #6db8d8; background: rgba(0,180,255,.06); }
.tag-pill.tag-narrazione{ border-color: rgba(251,190,9,.3); color: #FBBE09; background: rgba(251,190,9,.06); }
.tag-pill.tag-oneshot,
.tag-pill.tag-one-shot  { border-color: rgba(160,254,150,.3); color: #a0fe96; background: rgba(160,254,150,.05); }
.tag-pill.tag-t4n       { border-color: rgba(201,122,58,.3); color: #c97a3a; background: rgba(201,122,58,.06); }

.cell-replies, .cell-views {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}
.cell-replies .num, .cell-views .num {
    font-size: 1.2rem;
    color: var(--text-main);
    font-family: 'base-text', Georgia, serif;
    line-height: 1;
}
.cell-replies .lbl, .cell-views .lbl {
    font-family: 'minor-headers', serif;
    font-size: .58rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: .7;
}

.cell-lastpost {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-left: 18px;
    border-left: 1px solid var(--border-dim);
    position: relative;
    min-width: 0;
}
.cell-lastpost .lp-author {
    font-family: 'minor-headers', serif;
    font-size: .78rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.cell-lastpost .lp-when {
    font-size: .8rem;
    color: var(--text-muted);
    font-style: italic;
}
.cell-lastpost .lp-jump {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    opacity: .35;
    transition: opacity .2s, transform .2s;
    font-size: 1.1rem;
}
.cell-lastpost .lp-jump:hover {
    opacity: 1;
    transform: translateY(-50%) translateX(2px);
}

/* ═══════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════ */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 4px;
    margin: 32px 0 0;
    font-family: 'minor-headers', serif;
    font-size: .82rem;
    letter-spacing: .1em;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 6px 11px;
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
    transition: all .2s;
    min-width: 32px;
    text-align: center;
}
.pagination a:hover { color: var(--gold); border-color: var(--gold); }
.pagination .current {
    color: var(--gold);
    border-color: var(--gold);
    background: var(--gold-glow);
}
.pagination .gap { border: none; padding: 6px 4px; }
.pagination .nav { color: var(--gold); opacity: .7; }
.pagination .nav:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   ACTION BAR + BTN
═══════════════════════════════════════════════════════════ */
.action-bar {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-dim);
}

.btn {
    font-family: 'minor-headers', serif;
    font-size: .76rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    padding: 8px 18px;
    border: 1px solid var(--gold);
    color: var(--gold);
    background: var(--gold-glow);
    cursor: pointer;
    transition: all .2s;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--gold); color: var(--bg-void); }
.btn-ghost {
    border-color: var(--border);
    color: var(--text-muted);
    background: transparent;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); }
.btn-danger {
    border-color: rgba(155,44,44,.6);
    color: #c97a7a;
    background: rgba(155,44,44,.06);
}
.btn-danger:hover { background: var(--danger); color: var(--text-main); border-color: var(--danger); }
.btn-sm { font-size: .68rem; padding: 5px 12px; letter-spacing: .18em; }

/* Bottoni a fondo thread (Nuovo / Rispondi / Indice) — usano lo stile .meta-action */
.thread-bottom-actions {
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
    background: transparent;
    border: none;
}
.meta-action.is-disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   THREAD VIEW (inside.php) — LAYOUT
═══════════════════════════════════════════════════════════ */
.thread-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 36px;
    align-items: start;
}
@media (max-width: 1024px) {
    .thread-layout { grid-template-columns: 1fr; }
    .thread-toc { display: none; }
}

.thread-posts { min-width: 0; }

/* ── Indice sticky ── */
.thread-toc {
    position: sticky;
    top: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 18px 16px;
    font-family: 'minor-headers', serif;
    font-size: .72rem;
}
.thread-toc-title {
    color: var(--gold);
    letter-spacing: .25em;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-dim);
}
.thread-toc ol {
    list-style: none;
    counter-reset: toc;
    display: flex; flex-direction: column; gap: 6px;
    max-height: 70vh; overflow-y: auto;
    padding-right: 4px;
}
.thread-toc li {
    counter-increment: toc;
    display: flex; align-items: baseline; gap: 8px;
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 8px;
    transition: all .15s;
}
.thread-toc li::before {
    content: counter(toc, decimal-leading-zero);
    color: var(--gold);
    opacity: .5;
    font-variant-numeric: tabular-nums;
    font-size: .68rem;
}
.thread-toc li:hover, .thread-toc li.current {
    border-left-color: var(--gold);
    background: var(--gold-glow);
}
.thread-toc a {
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'base-text', Georgia, serif;
    font-size: .82rem;
    letter-spacing: 0;
    text-transform: none;
    font-style: italic;
}
.thread-toc li:hover a, .thread-toc li.current a { color: var(--text-main); }
.thread-toc-extra {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-dim);
    font-size: .7rem;
    letter-spacing: .15em;
    color: var(--text-muted);
    text-transform: uppercase;
}
.thread-toc-extra a { display: block; padding: 4px 0; }

/* ═══════════════════════════════════════════════════════════
   POST CARD
═══════════════════════════════════════════════════════════ */
.post-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border-dim);
    scroll-margin-top: 80px;
}
.post-card:first-child { padding-top: 8px; }
.post-card.is-mine {
    background: linear-gradient(to right, var(--gold-glow), transparent 60%);
    padding-left: 16px; margin-left: -16px;
}
.post-card.is-locked { opacity: .55; }
.post-card.is-obscured {
    background: rgba(155,44,44,.04);
    border-left: 2px solid var(--red-dim);
    padding-left: 16px; margin-left: -16px;
}

/* Post-card "In evidenza" — primo post di thread featured: stile pergamena */
.post-card.is-featured {
    position: relative;
    background: #e0dace url("../images/featured/natural-paper.png") repeat top;
    color: #2d2418;
    padding: 48px 36px 36px;
    margin: 56px 0 56px;
    border-bottom: none;
    /* Default layout: portrait a sx (200px) + body a dx, banner span sopra entrambi */
    grid-template-areas:
        "banner banner"
        "author body";
}
.post-card.is-featured > .post-card-author { grid-area: author; }
.post-card.is-featured > .post-card-body   { grid-area: body; }
/* Bordi alto/basso "strappati" */
.post-card.is-featured::before,
.post-card.is-featured::after {
    content: '';
    position: absolute;
    left: 0; width: 100%;
    height: 3vw;
    background: #e0dace url("../images/featured/natural-paper.png") repeat top;
    -webkit-mask-image: url("../images/featured/staint-divider.png");
    mask-image: url("../images/featured/staint-divider.png");
    -webkit-mask-position: bottom;
    mask-position: bottom;
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    z-index: -1;
}
.post-card.is-featured::before { top: calc(-3vw + 1px); }
.post-card.is-featured::after  { bottom: calc(-3vw + 2px); transform: rotateX(180deg); }

/* Banner "In Evidenza" sopra al primo post */
.post-featured-banner {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #322825;
    color: #e0dace;
    padding: 4px 24px;
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .35em;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    white-space: nowrap;
    grid-column: 1 / -1;
}
.post-featured-banner::before,
.post-featured-banner::after {
    content: '';
    position: absolute;
    bottom: -6px;
    width: 0; height: 0;
    border-style: solid;
    filter: brightness(.5);
}
.post-featured-banner::before {
    left: -10px;
    border-width: 0 10px 6px 0;
    border-color: transparent #322825 transparent transparent;
}
.post-featured-banner::after {
    right: -10px;
    border-width: 6px 10px 0 0;
    border-color: #322825 transparent transparent transparent;
}

/* Override colori interni per leggibilità su pergamena */
.post-card.is-featured .author-name,
.post-card.is-featured .post-title,
.post-card.is-featured .post-content,
.post-card.is-featured .post-meta,
.post-card.is-featured .post-actions,
.post-card.is-featured .post-content blockquote,
.post-card.is-featured .post-content .quote {
    color: #2d2418;
}
.post-card.is-featured .post-title {
    font-family: 'Ringbearer', 'minor-headers', serif;
    color: #2d2418;
}
.post-card.is-featured .post-content blockquote,
.post-card.is-featured .post-content .quote {
    background: rgba(139, 111, 46, .1);
    border-left-color: rgba(139, 111, 46, .5);
    color: #5a4d35;
}
.post-card.is-featured .post-content em { color: #8b6f2e; }
.post-card.is-featured .post-content strong { color: #1a1410; }
.post-card.is-featured .post-content code,
.post-card.is-featured .post-content pre {
    background: rgba(45, 36, 24, .08);
    color: #2d2418;
}
.post-card.is-featured .post-content a {
    color: #8b6f2e;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}
.post-card.is-featured .post-meta { color: #5a4d35; opacity: .85; }
.post-card.is-featured .post-action {
    border-color: rgba(90, 77, 53, .4);
    color: #2d2418;
}
.post-card.is-featured .post-action:hover {
    background: #2d2418;
    color: #e0dace;
}
/* Reazioni più scure sul fondo chiaro */
.post-card.is-featured .reaction-pill {
    background: rgba(45, 36, 24, .08);
    border-color: rgba(90, 77, 53, .3);
    color: #2d2418;
}
.post-card.is-featured .reaction-pill.is-mine {
    background: rgba(139, 111, 46, .25);
    border-color: rgba(139, 111, 46, .6);
}

/* I banner span sempre tutte le colonne (sennò la grid li considera celle "normali") */
.post-card.is-featured > .post-featured-banner,
.post-card.is-featured > .post-featured-bannerimg {
    grid-area: banner;
}

/* ── Layout reverse: portrait a destra ──
   Uso grid-template-areas per dichiarare esplicitamente la posizione
   dei figli (banner span 2, body, author) ── */
.post-card.is-featured.is-featured-reverse {
    grid-template-columns: 1fr 200px;
    grid-template-areas:
        "banner banner"
        "body   author";
}

/* ── Layout no-image: solo testo, full width.
   Il portrait viene nascosto ma il nome autore + ruolo restano visibili sopra al body. ── */
.post-card.is-featured.is-featured-noimage {
    grid-template-columns: 1fr;
    grid-template-areas:
        "banner"
        "author"
        "body";
}
.post-card.is-featured.is-featured-noimage .post-portrait { display: none; }
.post-card.is-featured.is-featured-noimage .post-card-author {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(58,47,35,.2);
}

/* ── Layout banner: immagine larga sopra, header autore come riga sopra al body ── */
.post-card.is-featured.is-featured-banner {
    grid-template-columns: 1fr;
    grid-template-areas:
        "banner"
        "author"
        "body";
}
.post-card.is-featured.is-featured-banner .post-portrait { display: none; }
.post-card.is-featured.is-featured-banner .post-card-author {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(58,47,35,.2);
}
.post-featured-bannerimg {
    position: relative;
    width: calc(100% + 72px);
    /* Bleed sopra: -48px (annulla padding-top del card) - 3vw (copre lo strappo del container) */
    margin: calc(-48px - 3vw) -36px 24px;
    aspect-ratio: 16 / 5;
    overflow: visible;
}
.post-featured-bannerimg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
/* Strappo sotto al banner-img — usa temp-ripped.png con la pergamena come "fondo strappato" */
.post-featured-bannerimg::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: #e0dace url("../images/featured/natural-paper.png") repeat top;
    -webkit-mask-image: url("../images/featured/temp-ripped.png");
    mask-image: url("../images/featured/temp-ripped.png");
    -webkit-mask-position: bottom;
    mask-position: bottom;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% auto;
    mask-size: 100% auto;
    z-index: 1;
}

@media (max-width: 768px) {
    .post-card.is-featured { padding: 36px 18px 24px; margin: 40px -8px; }
    .post-card.is-featured.is-featured-reverse {
        grid-template-columns: 72px 1fr;
        grid-template-areas:
            "banner banner"
            "author body";
    }
    .post-featured-bannerimg {
        width: calc(100% + 36px);
        margin: calc(-36px - 3vw) -18px 18px;
        aspect-ratio: 16 / 7;
    }
}

@media (max-width: 768px) {
    .post-card {
        grid-template-columns: 72px 1fr;
        gap: 14px;
        padding: 22px 0;
    }
}

/* ── Autore: ritratto PNG trasparente con mask ── */
.post-card-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.post-portrait {
    position: relative;
    width: 100%;
    max-width: 200px;
    aspect-ratio: 550 / 750;
    overflow: hidden;
    /* Stesso pattern della scheda PG: mask PNG con alpha. */
    -webkit-mask-image: url("../images/portrait-mask.png");
    mask-image: url("../images/portrait-mask.png");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    /* Nicchia ambient leggera */
    background: radial-gradient(ellipse at 50% 35%,
    rgba(201,168,76,.05) 0%,
    rgba(201,168,76,.02) 35%,
    rgba(0,0,0,0) 65%);
}
/* Fallback se la mask non c'è ancora — sfumatura inferiore */
@supports not (mask-image: url("../images/portrait-mask.png")) {
    .post-portrait {
        -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 76%, rgba(0,0,0,.6) 90%, rgba(0,0,0,0) 100%);
        mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 76%, rgba(0,0,0,.6) 90%, rgba(0,0,0,0) 100%);
    }
}
.post-portrait img,
.post-portrait video {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: drop-shadow(0 8px 36px rgba(0,0,0,.85)) brightness(.95);
    transition: filter .25s;
}
.post-card:hover .post-portrait img,
.post-card:hover .post-portrait video {
    filter: drop-shadow(0 8px 36px rgba(0,0,0,.85)) brightness(1) saturate(1.05);
}

.author-name {
    margin-top: -10px;
    position: relative;
    z-index: 2;
    font-family: 'minor-headers', serif;
    font-size: 1.05rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 0 2px 14px rgba(0,0,0,.9), 0 0 4px rgba(0,0,0,.7);
    text-align: center;
}
.author-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'minor-headers', serif;
    font-size: .62rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
}
.author-status::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #333;
    flex-shrink: 0;
}
.author-status.status-pronto::before   { background: #5aaa6e; box-shadow: 0 0 6px rgba(90,170,110,.7); }
.author-status.status-occupato::before { background: #c97a3a; box-shadow: 0 0 6px rgba(201,122,58,.5); }
.author-status.status-afk::before      { background: #8a7a3a; box-shadow: 0 0 4px rgba(138,122,58,.4); }
.author-status.status-pronto   { color: #5aaa6e; }
.author-status.status-occupato { color: #c97a3a; }
.author-status.status-afk      { color: #8a7a3a; }

.author-role {
    font-family: 'minor-headers', serif;
    font-size: .62rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 2px 9px;
    border: 1px solid var(--border-dim);
    margin-top: 4px;
}
.author-role.role-dm        { color: #c97a7a; border-color: rgba(155,44,44,.4); background: rgba(155,44,44,.08); }
.author-role.role-staff     { color: #a0fe96; border-color: rgba(160,254,150,.3); }
.author-role.role-narratore { color: #FBBE09; border-color: rgba(251,190,9,.3); }
.author-role.role-admin     { color: #00B4FF; border-color: rgba(0,180,255,.3); }
.author-role.role-leader    { color: #80FF00; border-color: rgba(128,255,0,.3); }

.author-stats {
    font-family: 'minor-headers', serif;
    font-size: .62rem;
    letter-spacing: .15em;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.7;
    text-align: center;
}
.author-stats em { color: var(--gold-light); font-style: normal; }

/* Mobile: avatar inline a sinistra */
@media (max-width: 768px) {
    .post-card-author { align-items: flex-start; gap: 2px; }
    .post-portrait { max-width: 72px; }
    .author-name {
        margin-top: 4px;
        font-size: .82rem;
        letter-spacing: .08em;
        text-shadow: none;
        text-align: left;
    }
    .author-status, .author-role {
        font-size: .58rem;
        letter-spacing: .15em;
        padding: 1px 6px;
    }
    .author-stats { display: none; }
}

/* ── Corpo post ── */
.post-card-body { min-width: 0; }

.post-card-header {
    display: flex; align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-dim);
    flex-wrap: wrap;
}
.post-title {
    font-family: 'Ringbearer', serif;
    font-size: 1.4rem;
    color: var(--text-main);
    line-height: 1.3;
}
.post-title-sub {
    font-family: 'minor-headers', serif;
    font-size: .85rem;
    letter-spacing: .12em;
    color: var(--text-muted);
    text-transform: uppercase;
}
.post-meta {
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex; gap: 12px; align-items: center;
}
.post-permalink {
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    color: var(--gold);
    opacity: .5;
    transition: opacity .2s;
    cursor: pointer;
}
.post-permalink:hover { opacity: 1; }

.post-content {
    font-family: 'Celestia', Georgia, serif;
    font-size: 1.04rem;
    line-height: 1.75;
    color: var(--text-main);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.post-content p { margin: 0 0 1em; }
.post-content p:last-child { margin-bottom: 0; }
.post-content em, .post-content i { color: var(--gold-light); }

/* Allineamento testo da [align=...] */
.post-content .align-left    { text-align: left; }
.post-content .align-center  { text-align: center; }
.post-content .align-right   { text-align: right; }
.post-content .align-justify { text-align: justify; }
.post-content .align-left,
.post-content .align-center,
.post-content .align-right,
.post-content .align-justify { margin: 0 0 1em; }
.post-content h1, .post-content h2, .post-content h3 {
    font-family: 'minor-headers', serif;
    color: var(--gold);
    margin: 1em 0 .5em;
    letter-spacing: .04em;
}
.post-content h1 { font-size: 1.5rem; }
.post-content h2 { font-size: 1.25rem; }
.post-content h3 { font-size: 1.1rem; }
.post-content code {
    font-family: 'Source Code Pro', 'Courier New', monospace;
    background: rgba(8,8,8,.7);
    border: 1px solid var(--border-dim);
    color: var(--gold-light);
    padding: 1px 6px;
    font-size: .9em;
}
.post-content pre {
    font-family: 'Source Code Pro', 'Courier New', monospace;
    background: rgba(8,8,8,.7);
    border: 1px solid var(--border-dim);
    border-left: 2px solid var(--gold);
    padding: 12px 16px;
    margin: 14px 0;
    overflow-x: auto;
    font-size: .9rem;
    color: var(--text-main);
    line-height: 1.5;
}
.post-content pre code { background: none; border: none; padding: 0; }
.post-content img { max-width: 100%; height: auto; margin: 8px 0; border: 1px solid var(--border-dim); }
.post-content iframe { max-width: 100%; margin: 8px 0; border: 1px solid var(--border-dim); }
.post-content hr { border: none; border-top: 1px solid var(--gold-dim); margin: 1.5em 0; }
.post-content ul, .post-content ol { margin: 0 0 1em 1.5em; }
.post-content .emoticon {
    height: 1.4em;
    width: auto;
    vertical-align: text-bottom;
    display: inline-block;
    margin: 0 1px;
    border: 0 !important;
}
.post-content .lightbox-link {
    display: inline-block;
    cursor: zoom-in;
    border: 1px solid transparent;
    transition: border-color .2s;
}
.post-content .lightbox-link:hover { border-color: var(--gold-dim); }

.portrait-placeholder {
    width: 100%;
    height: 100%;
    background: #1a1410;
    color: var(--text-faint);
    font-size: 3rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 28%;
}

/* Overlay "bannato" per i DM che vedono il portrait dei bannati */
.post-portrait { position: relative; }
.portrait-banned-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 6, 6, .5);
    color: rgba(220, 70, 70, .9);
    font-size: 4.5rem;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 0 10px rgba(0,0,0,.8);
    /* Eredita la stessa mask del portrait per non sbordare */
    -webkit-mask-image: var(--portrait-mask, none);
    mask-image: var(--portrait-mask, none);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}
.portrait-banned-overlay i {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.9));
}

/* Tag "[Utente Bannato]" sotto il nome (solo per i DM) */
.author-banned-tag {
    font-family: 'minor-headers', serif;
    font-size: .65rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: rgba(220, 70, 70, .8);
    margin-top: 4px;
    font-style: italic;
}

/* I post di bannati visti dai DM hanno un bordo lievemente rossastro */
.post-card.is-author-banned.dm-view {
    border-left: 2px solid rgba(220, 70, 70, .35);
}
.post-card.is-author-banned.dm-view .post-card-author {
    background: rgba(40, 8, 8, .12);
}

/* BBCode quote */
.post-content .quote, .post-content blockquote {
    background: var(--gold-glow);
    border-left: 2px solid var(--gold-dim);
    padding: 12px 18px;
    margin: 14px 0 14px 24px;
    font-style: italic;
    color: var(--text-muted);
    position: relative;
}
.post-content .quote::before, .post-content blockquote::before {
    content: '\201C';
    position: absolute;
    top: -10px; left: 4px;
    font-family: 'Ringbearer', serif;
    font-size: 2rem;
    color: var(--gold);
    opacity: .4;
    line-height: 1;
}
.post-content .quote .quote-author,
.post-content .quote-named cite {
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    font-style: normal;
    color: var(--gold);
    margin-bottom: 6px;
    display: block;
}
.post-content .quote-named cite::before {
    content: '— ';
    opacity: .6;
}

/* Liste BBCode/Markdown */
.post-content ul, .post-content ol {
    margin: 12px 0 12px 24px;
    padding-left: 18px;
    color: var(--text-main);
}
.post-content ul li, .post-content ol li {
    margin: 4px 0;
    line-height: 1.6;
}
.post-content ul { list-style-type: disc; }
.post-content ol { list-style-type: decimal; }

/* Tabelle markdown */
.post-content .md-table {
    border-collapse: collapse;
    margin: 16px 0;
    width: auto;
    max-width: 100%;
    border: 1px solid var(--gold-dim);
}
.post-content .md-table th,
.post-content .md-table td {
    padding: 8px 14px;
    border: 1px solid var(--border-dim);
    text-align: left;
    font-style: normal;
}
.post-content .md-table thead th {
    background: var(--gold-glow);
    color: var(--gold);
    font-family: 'minor-headers', serif;
    font-size: .75rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    font-weight: normal;
}
.post-content .md-table tbody tr:nth-child(even) {
    background: rgba(201,168,76, .03);
}

/* Spoiler */
.post-content .spoiler {
    background: var(--bg-deep);
    color: var(--bg-deep);
    padding: 0 4px;
    cursor: pointer;
    transition: color .3s;
    user-select: none;
}
.post-content .spoiler.revealed,
.post-content .spoiler:hover { color: var(--text-main); user-select: text; }

/* Lyric (animazione scorrimento) */
.post-content .lyric {
    display: block;
    width: 30%;
    margin: 14px auto;
    height: 200px;
    overflow: hidden;
    text-align: center;
    font-style: italic;
    color: var(--gold-light);
    position: relative;
}
.post-content .lyric-inner {
    position: absolute;
    width: 100%;
    animation: lyric-scroll 30s linear infinite;
}
@keyframes lyric-scroll {
    from { transform: translateY(100%); }
    to   { transform: translateY(-100%); }
}

/* Strikethrough */
.post-content .strike, .post-content s, .post-content del {
    text-decoration: line-through;
    color: var(--danger-text);
}

/* Menzioni */
.mention {
    color: var(--gold);
    background: var(--gold-glow);
    padding: 1px 5px;
    font-family: 'minor-headers', serif;
    font-size: .92em;
    letter-spacing: .04em;
    text-decoration: none;
    transition: background .2s;
}
.mention:hover { background: var(--gold-dim); color: var(--gold-light); }

/* Modificato da */
.modificato-da {
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .15em;
    color: var(--text-muted);
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-dim);
    text-align: right;
    font-style: italic;
}

/* ── Azioni post ── */
.post-actions {
    display: flex; align-items: center; gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-dim);
    flex-wrap: wrap;
}
.post-action {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 5px 12px;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex; align-items: center; gap: 5px;
    text-decoration: none;
}
.post-action:hover { color: var(--gold); border-color: var(--gold); }
.post-action.danger:hover { color: #c97a7a; border-color: rgba(155,44,44,.6); }
.post-action i { font-size: .85rem; }
.post-actions-spacer { flex: 1; }

/* Bottone "segui" stato attivo */
.post-action.follow.is-following {
    color: var(--gold); border-color: var(--gold); background: var(--gold-glow);
}

/* ── Reazioni ── */
.reactions {
    display: flex; align-items: center; gap: 4px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.reaction {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    cursor: pointer;
    transition: all .15s;
    font-size: .85rem;
    color: var(--text-muted);
    font-family: 'base-text', Georgia, serif;
    user-select: none;
}
.reaction:hover { border-color: var(--gold); color: var(--gold); }
.reaction.reacted {
    border-color: var(--gold);
    background: var(--gold-glow);
    color: var(--gold);
}
.reaction-count { font-variant-numeric: tabular-nums; font-size: .78rem; }
.reaction-add {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
    color: var(--text-muted);
    border-style: dashed;
    font-size: .8rem;
    position: relative;
}
.reaction-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: var(--bg-popup);
    border: 1px solid var(--border);
    padding: 8px;
    display: none;
    gap: 4px;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,.7);
    flex-wrap: wrap;
    width: max-content;
    max-width: 280px;
}
.reaction-picker.open { display: flex; }
.reaction-picker button {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 4px;
    font-size: 1.1rem;
    transition: background .15s;
    line-height: 1;
}
.reaction-picker button:hover { background: var(--gold-glow); border-color: var(--gold-dim); }

/* ── Signature ── */
.post-signature {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-dim);
    font-family: 'Celestia', Georgia, serif;
    font-style: italic;
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.5;
    opacity: .75;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Notice oscurato ── */
.notice-obscured {
    background: rgba(155,44,44,.06);
    border: 1px solid rgba(155,44,44,.3);
    border-left: 3px solid var(--danger);
    padding: 16px 20px;
    color: var(--text-muted);
    font-style: italic;
}
.notice-obscured strong {
    color: #c97a7a;
    font-style: normal;
    font-family: 'minor-headers', serif;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════
   POLL DISPLAY (sondaggio in lettura)
═══════════════════════════════════════════════════════════ */
.poll-display {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 18px 22px;
    margin: 20px 0;
}
.poll-display-title {
    font-family: 'minor-headers', serif;
    font-size: .88rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-dim);
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.poll-multi-badge {
    margin-left: auto;
    font-family: 'base-text', Georgia, serif;
    font-size: .65rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    background: var(--gold-glow);
    color: var(--gold);
    border: 1px solid var(--gold-dim);
    padding: 2px 8px;
    font-weight: normal;
}
.poll-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.poll-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border-dim);
    cursor: pointer;
    transition: all .15s;
    position: relative;
    overflow: hidden;
    background: rgba(8,8,8,.3);
}
.poll-option:hover { border-color: var(--gold-dim); background: rgba(255,255,255,.02); }
.poll-option.voted { border-color: var(--gold); background: var(--gold-glow); }
.poll-option input { accent-color: var(--gold); cursor: pointer; }
.poll-option-text { flex: 1; }
.poll-option-pct {
    font-family: 'minor-headers', serif;
    font-size: .78rem;
    color: var(--gold);
    letter-spacing: .1em;
}
.poll-option-bar {
    position: absolute;
    inset: 0 auto 0 0;
    background: var(--gold-glow);
    z-index: 0;
    transition: width .4s;
    pointer-events: none;
}
.poll-option > * { position: relative; z-index: 1; }

.poll-footer {
    display: flex; gap: 8px; align-items: center;
    font-family: 'minor-headers', serif;
    font-size: .7rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.poll-footer .sep { opacity: .4; }
.poll-footer a { color: var(--gold); }
.poll-footer .btn-sm { margin-left: auto; }

/* ═══════════════════════════════════════════════════════════
   EDITOR (crea.php)
═══════════════════════════════════════════════════════════ */
.editor-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0;
    margin-top: 24px;
}
.editor-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-dim);
    background: linear-gradient(180deg, rgba(50,37,35,.4) 0%, transparent 100%);
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.editor-header-title {
    font-family: 'minor-headers', serif;
    font-size: .82rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--gold);
    flex: 1;
}
.editor-header i { color: var(--gold); opacity: .7; }
.editor-header-hint {
    font-family: 'minor-headers', serif;
    font-size: .7rem;
    letter-spacing: .15em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.editor-fields {
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 14px;
}
.field-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    align-items: center;
}
@media (max-width: 600px) {
    .field-row { grid-template-columns: 1fr; gap: 4px; }
}

.field-label {
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.field-input, .field-select, .field-textarea {
    background: rgba(8,8,8,.9);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: 'base-text', Georgia, serif;
    font-size: .98rem;
    padding: 8px 12px;
    outline: none;
    transition: border-color .2s;
    width: 100%;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-dim);
}
.field-select { appearance: none; cursor: pointer; }
.field-select option { background: #0f0f0f; }

.field-checkboxes { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.field-checkboxes label {
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
}
.field-checkboxes input[type=checkbox] { accent-color: var(--gold); cursor: pointer; }

/* ── Toolbar editor ── */
.editor-toolbar {
    display: flex; gap: 4px; flex-wrap: wrap;
    padding: 10px 14px;
    background: rgba(8,8,8,.6);
    border-top: 1px solid var(--border-dim);
    border-bottom: 1px solid var(--border-dim);
}
.tb-btn {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .15s;
    font-family: 'base-text', Georgia, serif;
    font-size: .9rem;
}
.tb-btn:hover { color: var(--gold); border-color: var(--gold); }
.tb-btn.active { color: var(--gold); border-color: var(--gold); background: var(--gold-glow); }
.tb-btn b { font-weight: 700; }
.tb-btn i { font-size: 1rem; font-style: normal; }
.tb-divider { width: 1px; background: var(--border-dim); margin: 4px 6px; }
.tb-spacer { flex: 1; }
.tb-btn-text {
    width: auto; padding: 0 12px;
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
}

/* ── Split editor + preview ── */
.editor-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}
@media (max-width: 768px) {
    .editor-split { grid-template-columns: 1fr; min-height: 300px; }
}

.editor-textarea {
    background: rgba(8,8,8,.4);
    border: none;
    border-right: 1px solid var(--border-dim);
    color: var(--text-main);
    font-family: 'base-text', Georgia, serif;
    font-size: 1rem;
    padding: 18px 22px;
    resize: vertical;
    outline: none;
    line-height: 1.7;
    min-height: 400px;
}
.editor-textarea:focus { background: rgba(8,8,8,.6); }
@media (max-width: 768px) {
    .editor-textarea { border-right: none; border-bottom: 1px solid var(--border-dim); }
}

.editor-preview {
    padding: 18px 22px;
    overflow-y: auto;
    max-height: 600px;
    background: rgba(8,8,8,.2);
}
.editor-preview-label {
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-dim);
}

/* ── Drawer (emoji + sondaggio) ── */
.editor-drawer {
    border-top: 1px solid var(--border-dim);
    padding: 14px 20px;
    background: rgba(8,8,8,.4);
    display: none;
}
.editor-drawer.open { display: block; }
.editor-drawer-title {
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
}
.emoji-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-dim);
    margin-bottom: 12px;
    padding-bottom: 8px;
}
.emoji-tab {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
    padding: 4px 12px;
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .15s;
}
.emoji-tab:hover { border-color: var(--gold-dim); color: var(--gold); }
.emoji-tab.active {
    background: var(--gold);
    color: var(--bg-void);
    border-color: var(--gold);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 4px;
}
.emoji-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all .15s;
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
}
.emoji-btn:hover { border-color: var(--gold-dim); background: var(--gold-glow); }
.emoji-btn-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.poll-builder { display: flex; flex-direction: column; gap: 10px; }
.poll-option-row { display: flex; gap: 8px; align-items: center; }
.poll-option-row .field-input { flex: 1; }
.poll-option-remove {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
    width: 32px; height: 32px;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex; align-items: center; justify-content: center;
}
.poll-option-remove:hover { color: #c97a7a; border-color: rgba(155,44,44,.4); }

/* ── Form actions ── */
.editor-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-dim);
    background: rgba(15,15,15,.6);
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.editor-actions .spacer { flex: 1; }
.char-counter {
    font-family: 'minor-headers', serif;
    font-size: .7rem;
    letter-spacing: .15em;
    color: var(--text-muted);
}
.draft-status {
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .15em;
    color: var(--text-muted);
    text-transform: uppercase;
    display: inline-flex; align-items: center; gap: 6px;
}
.draft-status i { color: var(--gold); opacity: .6; }

/* ═══════════════════════════════════════════════════════════
   MENTION AUTOCOMPLETE
═══════════════════════════════════════════════════════════ */
.mention-suggest {
    position: absolute;
    background: var(--bg-popup);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,.7);
    min-width: 200px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.mention-suggest.open { display: block; }
.mention-suggest-item {
    padding: 8px 14px;
    cursor: pointer;
    font-family: 'minor-headers', serif;
    font-size: .78rem;
    letter-spacing: .08em;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-dim);
    transition: background .15s;
}
.mention-suggest-item:last-child { border-bottom: none; }
.mention-suggest-item:hover,
.mention-suggest-item.selected { background: var(--gold-glow); color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   NOTICES (warning, info, success, error)
═══════════════════════════════════════════════════════════ */
.notice {
    padding: 14px 20px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
    display: flex; align-items: flex-start; gap: 12px;
    font-size: .98rem;
}
.notice i { flex-shrink: 0; margin-top: 2px; font-size: 1rem; }
.notice .notice-content { flex: 1; }
.notice a { text-decoration: underline; }

.notice-info    { background: var(--gold-glow); border-left: 3px solid var(--gold); color: var(--text-main); }
.notice-info    i { color: var(--gold); }
.notice-warn    { background: rgba(201,122,58,.06); border-left: 3px solid #c97a3a; color: #d8a07a; }
.notice-warn    i { color: #c97a3a; }
.notice-error   { background: var(--red-alert); border-left: 3px solid var(--danger); color: var(--danger-text); }
.notice-error   i { color: #c97a7a; }
.notice-success { background: rgba(90,170,110,.06); border-left: 3px solid #5aaa6e; color: #8ec99c; }
.notice-success i { color: #5aaa6e; }

/* ═══════════════════════════════════════════════════════════
   STATUS PAGE (chiuso/privato/ok)
═══════════════════════════════════════════════════════════ */
.status-panel {
    max-width: 580px;
    margin: 60px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: clamp(28px, 5vw, 56px);
    text-align: center;
}
.status-panel.danger { border-color: rgba(155,44,44,.4); }
.status-panel-icon {
    font-size: 2.6rem;
    color: var(--gold);
    opacity: .5;
    margin-bottom: 18px;
}
.status-panel.danger .status-panel-icon { color: var(--danger); }
.status-panel-title {
    font-family: 'Ringbearer', serif;
    font-size: clamp(1.2rem, 2.6vw, 1.8rem);
    color: var(--text-main);
    margin-bottom: 14px;
    line-height: 1.3;
}
.status-panel.danger .status-panel-title { color: #c97a7a; }
.status-panel-desc {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    font-style: italic;
    margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════
   MODAL (segnala, conferma cancella, ecc.)
═══════════════════════════════════════════════════════════ */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 9000;
    padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--bg-popup);
    border: 1px solid var(--border);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,.85);
}
.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-dim);
    background: linear-gradient(180deg, rgba(50,37,35,.5) 0%, transparent 100%);
    display: flex; align-items: center; gap: 10px;
}
.modal-title {
    font-family: 'minor-headers', serif;
    font-size: .82rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--gold);
    flex: 1;
}
.modal-close {
    width: 26px; height: 26px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.modal-close:hover { border-color: var(--gold); color: var(--gold); }
.modal-body { padding: 20px; }
.modal-actions {
    padding: 14px 20px;
    border-top: 1px solid var(--border-dim);
    background: rgba(15,15,15,.6);
    display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
    align-items: center;
}
.modal-actions-right {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-left: auto;
}

/* Modale ampia per image picker */
.modal-wide { max-width: 820px; width: 90vw; }
.modal-wide .modal-body { max-height: 70vh; overflow-y: auto; }

/* ═══════════════════════════════════════════════════════════
   IMAGE PICKER
═══════════════════════════════════════════════════════════ */
.img-picker-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.img-picker-toolbar .btn { cursor: pointer; }
.img-picker-search {
    flex: 1;
    min-width: 180px;
    position: relative;
}
.img-picker-search i {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: .9rem;
}
.img-picker-search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background: var(--bg-deep);
    border: 1px solid var(--border-dim);
    color: var(--text-main);
    font-family: inherit;
    font-size: .85rem;
    transition: border-color .15s;
}
.img-picker-search input:focus {
    outline: none;
    border-color: var(--gold);
}

.img-picker-upload-status {
    padding: 8px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    border: 1px solid var(--border-dim);
}
.img-picker-upload-status.status-loading { background: rgba(201,168,76,.05); color: var(--gold); }
.img-picker-upload-status.status-success { background: rgba(74,150,80,.08); color: #6dcc73; border-color: rgba(74,150,80,.3); }
.img-picker-upload-status.status-error   { background: rgba(155,44,44,.08); color: #d56b6b; border-color: rgba(155,44,44,.3); }

.img-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    min-height: 200px;
    transition: background .15s;
}
.img-picker-grid.drag-over {
    background: var(--gold-glow);
    outline: 2px dashed var(--gold);
    outline-offset: -8px;
}
.img-picker-state {
    grid-column: 1 / -1;
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: .9rem;
}
.img-picker-state i { display: block; font-size: 2rem; margin-bottom: 10px; opacity: .5; }

.img-picker-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all .15s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.img-picker-card:hover {
    border-color: var(--gold-dim);
    transform: translateY(-2px);
}
.img-picker-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-glow);
}
.img-picker-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: #1a1410;
}
.img-picker-fname {
    padding: 6px 8px 2px;
    font-size: .72rem;
    font-family: 'base-text', Georgia, serif;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.img-picker-meta {
    padding: 0 8px 6px;
    font-size: .65rem;
    color: var(--text-faint);
    font-family: 'base-text', Georgia, serif;
}

.img-picker-selected {
    flex: 1;
    color: var(--text-faint);
    font-size: .82rem;
    font-style: italic;
}
.img-picker-selected.has-value {
    color: var(--gold);
    font-style: normal;
}

/* ═══════════════════════════════════════════════════════════
   TOAST (copia link, ecc.)
═══════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--bg-popup);
    border: 1px solid var(--gold);
    border-left: 3px solid var(--gold);
    color: var(--text-main);
    padding: 12px 18px;
    font-family: 'minor-headers', serif;
    font-size: .78rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    z-index: 9999;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.6);
}
.toast.show { opacity: 1; transform: translateX(0); }

/* ═══════════════════════════════════════════════════════════
   LIGHTBOX immagini
═══════════════════════════════════════════════════════════ */
.lightbox-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.92);
    display: none;
    align-items: center; justify-content: center;
    z-index: 9500;
    cursor: zoom-out;
    padding: 30px;
}
.lightbox-backdrop.open { display: flex; }
.lightbox-img {
    max-width: 95vw; max-height: 95vh;
    object-fit: contain;
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,.95);
}

/* ═══════════════════════════════════════════════════════════
   MENTIONS LIST (menzioni.php)
═══════════════════════════════════════════════════════════ */
.mentions-list {
    display: flex; flex-direction: column;
    gap: 8px;
}
.mention-item {
    display: grid;
    grid-template-columns: 44px 1fr 12px;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border-dim);
    background: var(--bg-card);
    text-decoration: none;
    color: inherit;
    transition: all .15s;
    align-items: flex-start;
    position: relative;
}
.mention-item:hover {
    border-color: var(--gold);
    background: rgba(255,255,255,.02);
}
.mention-item.unread {
    border-left: 3px solid var(--gold);
    background: linear-gradient(to right, var(--gold-glow), transparent 60%);
}
.mention-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gold-glow);
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-size: 1.2rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.mention-item.unread .mention-icon {
    background: var(--gold);
    color: var(--bg-void);
    border-color: var(--gold);
}
.mention-body { min-width: 0; }
.mention-header {
    font-family: 'base-text', Georgia, serif;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 4px;
}
.mention-header .mention-author {
    font-family: 'minor-headers', serif;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .9rem;
}
.mention-header .mention-thread {
    font-family: 'minor-headers', serif;
    font-style: italic;
    color: var(--text-main);
}
.mention-snippet {
    color: var(--text-muted);
    font-style: italic;
    font-size: .9rem;
    line-height: 1.5;
    margin: 6px 0;
    padding: 8px 12px;
    background: rgba(8,8,8,.4);
    border-left: 2px solid var(--gold-dim);
}
.mention-meta {
    color: var(--text-muted);
    font-size: .8rem;
    margin-top: 4px;
    display: flex; gap: 12px; flex-wrap: wrap;
}
.mention-badge {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 6px var(--gold);
    align-self: center;
}

/* ═══════════════════════════════════════════════════════════
   FORWARD MODAL (presets)
═══════════════════════════════════════════════════════════ */
.forward-presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    margin-bottom: 8px;
}
.forward-preset {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-muted);
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 8px 12px;
    cursor: pointer;
    transition: all .15s;
    text-align: left;
    display: flex; align-items: center; gap: 8px;
}
.forward-preset:hover { color: var(--gold); border-color: var(--gold); }
.forward-preset.selected {
    background: var(--gold-glow);
    border-color: var(--gold);
    color: var(--gold);
}
.forward-preset i { font-size: .9rem; opacity: .7; }

/* ═══════════════════════════════════════════════════════════
   ADMIN PAGES
═══════════════════════════════════════════════════════════ */
.admin-nav { background: rgba(0, 30, 50, .25); }
.admin-nav .meta-action.primary {
    background: rgba(0, 180, 255, .15);
    border-color: #00B4FF;
    color: #00B4FF;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.admin-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px 24px;
    text-align: center;
    transition: border-color .2s;
}
.admin-stat:hover { border-color: var(--gold-dim); }
.admin-stat.urgent {
    border-color: var(--danger);
    background: rgba(155, 44, 44, .04);
}
.admin-stat-num {
    font-family: 'Ringbearer', serif;
    font-size: 2.2rem;
    color: var(--gold);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
}
.admin-stat.urgent .admin-stat-num {
    color: #c97a7a;
}
.admin-stat-lbl {
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.admin-table {
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.admin-table-row {
    display: grid;
    grid-template-columns: 44px 1fr 32px;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-dim);
    text-decoration: none;
    color: inherit;
    align-items: center;
    transition: background .15s;
}
.admin-table-row:last-child { border-bottom: none; }
.admin-table-row:hover { background: rgba(255,255,255,.02); }
.admin-table-row.handled { opacity: .6; }
.admin-table-row.current {
    background: var(--gold-glow);
    border-left: 3px solid var(--gold);
    padding-left: 15px;
}
.admin-row-status {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    font-size: 1.1rem;
}
.admin-table-row.handled .admin-row-status { color: #5aaa6e; }
.admin-row-body { min-width: 0; line-height: 1.4; }
.admin-row-arrow {
    color: var(--gold);
    opacity: .3;
    transition: opacity .15s, transform .15s;
    font-size: 1.1rem;
}
.admin-table-row:hover .admin-row-arrow {
    opacity: 1; transform: translateX(2px);
}

.admin-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 24px 28px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .admin-stat { padding: 14px 16px; }
    .admin-stat-num { font-size: 1.6rem; }
}

/* Click sul nome PG → apre scheda in popup window (gestito da forum.js) */
.scheda-link {
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s, text-decoration-color .15s;
}
.scheda-link:hover {
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    opacity: .85;
}

/* ═══════════════════════════════════════════════════════════
   FEATURED CAROUSEL — pergamene "in evidenza" da DM
═══════════════════════════════════════════════════════════ */
.featured-section {
    margin: 56px 0;
    padding: 0;
}
.featured-section-header {
    font-family: 'minor-headers', serif;
    font-size: .82rem;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.featured-section-header > span {
    flex: 0 0 auto;
}
.featured-section-header::after {
    content: ''; flex: 1; height: 1px; background: var(--gold-dim);
}
.featured-pager {
    display: flex; align-items: center; gap: 10px;
    flex: 0 0 auto;
}
.featured-pager-btn {
    background: transparent;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .15s;
    font-size: .85rem;
}
.featured-pager-btn:hover { border-color: var(--gold); background: var(--gold-glow); }

/* Bottone pausa: cambia icona quando in pausa */
.featured-pause-btn.is-paused {
    background: var(--gold);
    color: var(--bg-void);
    border-color: var(--gold);
}

.featured-dots { display: flex; gap: 6px; }
.featured-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 1px solid var(--gold-dim);
    background: transparent;
    cursor: pointer;
    transition: all .2s;
    padding: 0;
}
.featured-dot.active {
    background: var(--gold);
    border-color: var(--gold);
    transform: scale(1.2);
}

/* Progress bar countdown */
.featured-progress {
    height: 2px;
    background: var(--border-dim);
    margin-bottom: 18px;
    overflow: hidden;
    border-radius: 1px;
}
.featured-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, var(--gold-dim), var(--gold));
    transition: width .15s linear;
    box-shadow: 0 0 6px rgba(201,168,76,.4);
}
.featured-progress.paused .featured-progress-bar {
    background: linear-gradient(to right, var(--text-faint), var(--text-muted));
    box-shadow: none;
    opacity: .5;
}

/* ── Carosello ── */
.featured-carousel {
    position: relative;
    min-height: 400px;
}
.featured-scroll {
    position: relative;
    width: 100%;
    background: #e0dace url("../images/featured/natural-paper.png") repeat top;
    color: #2d2418;
    box-shadow: 0 0 28px 8px rgba(49,50,50,.4);
    padding: 32px 40px;
    z-index: 0;
    font-family: Georgia, serif;
    margin-top: 56px;          /* spazio per portrait sporgente + bordo strappato */
    margin-bottom: 56px;       /* spazio per bordo strappato in basso */

    /* Stato slide: solo .active visibile */
    display: none;
    opacity: 0;
    transition: opacity .4s ease;
}
.featured-scroll.active {
    display: block;
    opacity: 1;
}

/* Bordi alto e basso "strappati" — mask con staint-divider.png */
.featured-scroll::before,
.featured-scroll::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3vw;
    background: #e0dace url("../images/featured/natural-paper.png") repeat top;
    -webkit-mask-image: url("../images/featured/staint-divider.png");
    mask-image: url("../images/featured/staint-divider.png");
    -webkit-mask-position: bottom;
    mask-position: bottom;
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    z-index: -1;
}
.featured-scroll::before {
    top: calc(-3vw + 1px);
}
.featured-scroll::after {
    bottom: calc(-3vw + 2px);
    box-shadow: 0 0 0 1px #e0dace, 0 0 0 1px #e0dace inset;
    transform: rotateX(180deg);
}

/* Banner "Annuncio in evidenza" sopra */
.featured-scroll-banner {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #322825;
    color: #e0dace;
    padding: 4px 24px;
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .35em;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    white-space: nowrap;
}
.featured-scroll-banner::before,
.featured-scroll-banner::after {
    content: '';
    position: absolute;
    bottom: -6px;
    width: 0; height: 0;
    border-style: solid;
    filter: brightness(.5);
}
.featured-scroll-banner::before {
    left: -10px;
    border-width: 0 10px 6px 0;
    border-color: transparent #322825 transparent transparent;
}
.featured-scroll-banner::after {
    right: -10px;
    border-width: 6px 10px 0 0;
    border-color: #322825 transparent transparent transparent;
}

/* Wrap: layout grid */
.featured-wrap {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    align-items: start;
}
.featured-wrap.reverse {
    grid-template-columns: 1fr 220px;
}
.featured-wrap.reverse .featured-portrait { order: 2; }
.featured-wrap.reverse .featured-content  { order: 1; }
.featured-wrap.no-image {
    grid-template-columns: 1fr;
}
.featured-wrap.no-image .featured-portrait { display: none; }

/* Variante banner orizzontale */
.featured-wrap.banner-image {
    grid-template-columns: 1fr;
}
.featured-wrap.banner-image .featured-portrait {
    position: relative;
    width: calc(100% + 80px);                             /* sborda di 40px per lato sul padding del container */
    /* Bleed sopra: -32px (annulla padding-top) - 3vw (copre strappo container) */
    margin: calc(-32px - 3vw) -40px 24px;
    aspect-ratio: 16 / 5;
    height: auto;
    overflow: visible;
}
.featured-wrap.banner-image .featured-portrait img {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    top: 0;
    display: block;
    /* Override della portrait-mask: per il banner orizzontale niente mask sull'img,
       lo strappo lo fa il ::after sotto */
    -webkit-mask-image: none;
    mask-image: none;
    /* No drop-shadow: rovinerebbe l'effetto strappato */
    filter: none;
}
/* Strappo sotto al banner-img del carosello */
.featured-wrap.banner-image .featured-portrait::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: #e0dace url("../images/featured/natural-paper.png") repeat top;
    -webkit-mask-image: url("../images/featured/temp-ripped.png");
    mask-image: url("../images/featured/temp-ripped.png");
    -webkit-mask-position: bottom;
    mask-position: bottom;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% auto;
    mask-size: 100% auto;
    z-index: 1;
}

/* Portrait — sporge dall'alto (come dialog-box.scss) */
.featured-portrait {
    position: relative;
    width: 220px;
    aspect-ratio: 4 / 5;
}
/* Fallback se la mask non c'è — sfumatura inferiore (come post) */
@supports not (mask-image: url("../images/portrait-mask.png")) {
    .featured-portrait img {
        -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 76%, rgba(0,0,0,.6) 90%, rgba(0,0,0,0) 100%);
        mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 76%, rgba(0,0,0,.6) 90%, rgba(0,0,0,0) 100%);
    }
}
.featured-portrait img {
    position: absolute;
    top: -70px;
    left: 0; right: 0;
    width: 100%;
    height: calc(100% + 70px);
    object-fit: cover;
    object-position: center top;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,.5));
    /* Stessa mask PNG dei portrait nei post — forma identica */
    -webkit-mask-image: url("../images/portrait-mask.png");
    mask-image: url("../images/portrait-mask.png");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

/* Contenuto */
.featured-content { min-width: 0; }
.featured-meta {
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: #5a4d35;
    margin-bottom: 6px;
}
.featured-title {
    font-family: 'Ringbearer', 'minor-headers', serif;
    font-weight: 600;
    font-size: 1.6rem;
    color: #2d2418;
    margin: 0 0 16px;
    line-height: 1.25;
    position: relative;
    padding-bottom: 14px;
    letter-spacing: 0;
}
.featured-title::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: linear-gradient(to right, #5a4d35, transparent 70%);
}
.featured-author {
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #8b6f2e;
    margin-bottom: 14px;
}
.featured-author::before { content: '— '; opacity: .6; }
.featured-body {
    font-family: 'Celestia', Georgia, serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #2d2418;
    max-height: 175px;
    overflow: hidden;
    position: relative;
    transition: max-height .4s ease;
}
.featured-body.expanded { max-height: 4000px; }
.featured-body:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(to bottom, rgba(224,218,206,0), #e0dace 90%);
    pointer-events: none;
}
.featured-body p { margin: 0 0 1em; }
.featured-body p:first-child { margin-top: 0; }
.featured-body p:last-child  { margin-bottom: 0; }
.featured-body em { color: #8b6f2e; font-style: italic; }
.featured-body strong { color: #1a1410; font-weight: 700; }

/* Azioni della pergamena */
.featured-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(58,47,35,.2);
    flex-wrap: wrap;
}
.featured-btn {
    background: transparent;
    border: 1px solid #5a4d35;
    color: #2d2418;
    font-family: 'minor-headers', serif;
    font-size: .72rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    padding: 8px 16px;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.featured-btn:hover {
    background: #2d2418;
    color: #e0dace;
}
.featured-btn.primary {
    background: #2d2418;
    color: #e0dace;
    border-color: #2d2418;
}
.featured-btn.primary:hover {
    background: #8b6f2e;
    border-color: #8b6f2e;
}
.featured-btn-danger {
    background: transparent;
    border-color: rgba(155, 44, 44, .5);
    color: #9b2c2c;
    padding: 8px 12px;
}
.featured-btn-danger:hover {
    background: #9b2c2c;
    border-color: #9b2c2c;
    color: #e0dace;
}
.featured-spacer { flex: 1; }
.featured-meta-side {
    font-family: 'minor-headers', serif;
    font-size: .65rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #5a4d35;
}

/* Mobile */
@media (max-width: 768px) {
    .featured-scroll { padding: 22px 22px; }
    .featured-wrap, .featured-wrap.reverse {
        grid-template-columns: 100px 1fr;
        gap: 16px;
    }
    .featured-wrap.banner-image { grid-template-columns: 1fr; }
    .featured-wrap.banner-image .featured-portrait {
        width: calc(100% + 44px);
        margin: calc(-22px - 3vw) -22px 18px;
        aspect-ratio: 16 / 8;
    }
    .featured-portrait { width: 100px; }
    .featured-portrait img { top: -40px; height: calc(100% + 40px); }
    .featured-title { font-size: 1.2rem; }
    .featured-body { font-size: .92rem; max-height: 240px; }
    .featured-actions { gap: 8px; }
    .featured-btn { padding: 6px 12px; font-size: .65rem; letter-spacing: .15em; }
    .featured-meta-side { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.forum-footer {
    background: var(--bg-deep);
    border-top: 1px solid var(--border);
    padding: 18px clamp(20px, 4vw, 56px);
    text-align: center;
    margin-top: 40px;
    font-family: 'minor-headers', serif;
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.forum-footer a { color: var(--gold); }
.forum-footer .footer-home {
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
}
.forum-footer .footer-home:hover {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — collassi grid → card layout
═══════════════════════════════════════════════════════════ */
@media (max-width: 800px) {
    /* Forum list → card */
    .forum-list { display: block; }
    .forum-list-header { display: none; }
    .forum-list-row {
        display: grid;
        grid-template-columns: 36px 1fr;
        grid-template-areas:
            "icon name"
            ".    last"
            ".    nums";
        gap: 4px 10px;
        padding: 14px 12px;
        border-bottom: 1px solid var(--border-dim);
    }
    .forum-list .cell {
        border: none;
        padding: 0;
        min-height: auto;
        background: transparent !important;
        box-shadow: none !important;
    }
    .forum-list-row.has-update { box-shadow: inset 3px 0 0 var(--gold); }
    .forum-list-row > .cell-icon { grid-area: icon; align-self: start; padding-top: 4px; }
    .forum-list-row > .cell-forum-name { grid-area: name; }
    .forum-list-row > .cell-last { grid-area: last; margin-top: 4px; }
    .forum-list-row > .cell-num.cell-threads,
    .forum-list-row > .cell-num.cell-posts {
        grid-area: nums;
        justify-content: flex-start;
        font-size: .82rem;
        gap: 4px;
        align-items: baseline;
        display: inline-flex;
    }
    .forum-list-row > .cell-num.cell-threads::before {
        content: 'Thread:';
        color: var(--text-muted);
        margin-right: 4px;
        font-size: .72rem;
        letter-spacing: .1em;
        text-transform: uppercase;
    }
    .forum-list-row > .cell-num.cell-posts::before {
        content: 'Post:';
        color: var(--text-muted);
        margin: 0 4px 0 12px;
        font-size: .72rem;
        letter-spacing: .1em;
        text-transform: uppercase;
    }

    /* Thread list → card */
    .thread-list { display: block; }
    .thread-list .hcell { display: none; }
    .thread-row {
        display: grid;
        grid-template-columns: 36px 1fr;
        grid-template-areas:
            "stat title"
            ".    flags"
            ".    last";
        gap: 4px 10px;
        padding: 14px 12px;
        border-bottom: 1px solid var(--border-dim);
        min-height: 0;
    }
    .thread-list .cell {
        border: none; padding: 0; min-height: auto;
        background: transparent !important;
        box-shadow: none !important;
    }
    .thread-row.has-update { box-shadow: inset 3px 0 0 var(--gold); }
    .thread-row.is-sticky { background: linear-gradient(to right, rgba(201,168,76,.06), transparent 80%); }
    .thread-row > .cell-status {
        grid-area: stat;
        align-self: start; padding-top: 4px;
        font-size: 1.2rem;
    }
    .thread-row > .cell-thread { grid-area: title; }
    .thread-row > .cell-replies, .thread-row > .cell-views { display: none; }
    .thread-row > .cell-lastpost {
        grid-area: last;
        margin-top: 8px;
        padding: 8px 0 0;
        border-top: 1px solid rgba(255,255,255,.04);
        border-left: none;
        flex-direction: row; gap: 12px;
        flex-wrap: wrap;
    }
    .thread-row > .cell-lastpost::before {
        content: '↳';
        color: var(--gold); opacity: .5;
        font-size: 1rem;
    }
    .cell-lastpost .lp-jump { display: none; }
}