/* forum.css — stili pagina Forum (usa i token di hih.css) */

/* intestazione pagina (condivisa) */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap;margin:18px 0 22px}
.page-head-l h1{font-family:var(--fontH);font-weight:700;font-size:30px;letter-spacing:-.02em;margin:0 0 4px;color:var(--text)}
.page-head-l p{margin:0;color:var(--muted);font-weight:600;font-size:14.5px}
.page-head-r{display:flex;align-items:center;gap:11px}
.fsearch{display:flex;align-items:center;gap:8px;height:44px;padding:0 14px;background:var(--surface);border:1px solid var(--border);border-radius:13px;color:var(--faint);box-shadow:var(--shadow-sm)}
.fsearch input{border:none;background:none;outline:none;font-family:var(--fontB);font-size:14px;font-weight:600;color:var(--text);width:200px}
.fsearch input::placeholder{color:var(--faint)}

/* su sfondo stagionale: titolo pagina leggibile su QUALSIASI tema.
   Tono scuro → testo bianco con ombra; tono chiaro → testo scuro con alone chiaro.
   L'alone (text-shadow) stacca il testo dal pattern dello sfondo in entrambi i casi. */
.hih[data-tone="dark"] .page-head-l h1{color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.35),0 2px 14px rgba(0,0,0,.22)}
.hih[data-tone="dark"] .page-head-l p{color:rgba(255,255,255,.92);text-shadow:0 1px 3px rgba(0,0,0,.3)}
.hih[data-tone="light"] .page-head-l h1{color:#15233a;text-shadow:0 1px 2px rgba(255,255,255,.85),0 2px 10px rgba(255,255,255,.5)}
.hih[data-tone="light"] .page-head-l p{color:#33415a;text-shadow:0 1px 2px rgba(255,255,255,.8)}

/* layout */
.forum-layout{display:grid;grid-template-columns:minmax(0,1fr) 316px;gap:20px;align-items:start;padding-bottom:40px}
.forum-main{display:flex;flex-direction:column;gap:20px;min-width:0}
.fside{display:flex;flex-direction:column;gap:20px}

/* categoria */
.fcat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.fcat-h{position:relative;padding:16px 18px 14px 22px}
.fcat-bar{position:absolute;left:0;top:0;bottom:0;width:5px;background:var(--accent)}
.fcat-h h3{font-family:var(--fontH);font-weight:600;font-size:18px;margin:0 0 2px}
.fcat-h p{margin:0;color:var(--muted);font-size:13px;font-weight:600}
.fcat-rows{display:flex;flex-direction:column;border-top:1px solid var(--line)}

/* riga sotto-forum */
.fe-row{display:grid;grid-template-columns:auto minmax(0,1.5fr) auto minmax(0,1.6fr);gap:16px;align-items:center;padding:15px 18px;text-decoration:none;color:inherit;transition:background .14s;border-bottom:1px solid var(--line)}
.fe-row:last-child{border-bottom:none}
.fe-row:hover{background:var(--surface-2)}
.fe-icon{width:50px;height:50px;border-radius:14px;display:grid;place-items:center;background:color-mix(in srgb,var(--accent) 14%,var(--surface));border:1px solid color-mix(in srgb,var(--accent) 22%,transparent)}
.fe-icon img{width:34px;height:34px;image-rendering:pixelated}
.fe-main{min-width:0}
.fe-main h4{font-family:var(--fontH);font-weight:600;font-size:15.5px;margin:0 0 3px}
.fe-main p{margin:0;color:var(--muted);font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fe-stats{display:flex;flex-direction:column;gap:2px;text-align:right;font-size:12px;color:var(--faint);font-weight:600;white-space:nowrap}
.fe-stats b{color:var(--text);font-weight:800}
.fe-last{display:flex;align-items:center;gap:10px;min-width:0}
.fe-last>img{width:36px;height:36px;border-radius:10px;background:var(--surface-2);flex:0 0 auto}
.fe-last b{display:block;font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}
.fe-last small{font-size:11.5px;color:var(--faint);font-weight:700}

/* ultime discussioni */
.flatest .card-h{padding:15px 18px 12px}
.fl-list{list-style:none;margin:0;padding:4px 8px 10px}
.fl-item+.fl-item{border-top:1px solid var(--line)}
.fl-link{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:14px;align-items:center;padding:12px 10px;border-radius:12px;text-decoration:none;color:inherit;transition:background .14s}
.fl-link:hover{background:var(--surface-2)}
.fl-tag{font-size:9.5px;font-weight:800;letter-spacing:.05em;color:#fff;background:var(--accent);padding:4px 8px;border-radius:7px;text-transform:uppercase}
.fl-body{min-width:0}
.fl-body b{display:block;font-size:14.5px;font-weight:700;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fl-body small{font-size:11.5px;color:var(--faint);font-weight:700}
.fl-author{display:flex;align-items:center;gap:7px;font-size:12.5px;font-weight:700;color:var(--muted)}
.fl-author img{width:24px;height:24px;border-radius:7px;background:var(--surface-2)}
.fl-replies{display:flex;flex-direction:column;align-items:center;line-height:1.1;font-size:10.5px;color:var(--faint);font-weight:700;min-width:42px}
.fl-replies b{font-family:var(--fontH);font-weight:600;font-size:16px;color:var(--accent)}

/* sidebar */
.fstat-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:0 16px 16px}
.fstat{display:flex;flex-direction:column;gap:2px;padding:13px;border-radius:13px;background:var(--surface-2);border:1px solid var(--line)}
.fstat b{font-family:var(--fontH);font-weight:600;font-size:21px;color:var(--text);line-height:1}
.fstat small{font-size:11px;color:var(--faint);font-weight:700}
.fstat-on b{color:var(--r4)}
.fstat-on{background:color-mix(in srgb,var(--r4) 12%,var(--surface));border-color:color-mix(in srgb,var(--r4) 24%,transparent)}
.fonline{display:flex;flex-wrap:wrap;gap:7px;padding:0 16px 16px;align-items:center}
.fonline-av img{width:38px;height:38px;border-radius:10px;background:var(--surface-2);object-fit:cover;object-position:center -2px}
.fonline-more{font-size:12px;font-weight:800;color:var(--muted);background:var(--surface-2);border:1px solid var(--line);border-radius:9px;padding:0 10px;height:38px;display:grid;place-items:center}
.ftop{list-style:none;margin:0;padding:0 12px 12px}
.ftop-row{display:flex;align-items:center;gap:10px;padding:9px 8px;border-radius:11px}
.ftop-row:hover{background:var(--surface-2)}
.ftop-rank{width:20px;text-align:center;font-family:var(--fontH);font-weight:600;font-size:14px;color:var(--faint)}
.ftop-av{width:32px;height:32px;border-radius:9px;background:var(--surface-2);flex:0 0 auto}
.ftop-name{flex:1;font-size:13.5px;font-weight:800;color:var(--text);text-decoration:none}
.ftop-name:hover{color:var(--r6)}
.ftop-badge{width:22px;height:22px;image-rendering:pixelated}
.ftop-posts{font-size:12px;font-weight:800;color:var(--faint)}

/* mobile */
.hih[data-mobile="true"] .forum-layout{grid-template-columns:1fr}
.hih[data-mobile="true"] .page-head{flex-direction:column;align-items:stretch}
.hih[data-mobile="true"] .page-head-r{flex-direction:column;align-items:stretch}
.hih[data-mobile="true"] .fsearch input{width:100%}
.hih[data-mobile="true"] .fe-row{grid-template-columns:auto minmax(0,1fr);gap:12px}
.hih[data-mobile="true"] .fe-stats,.hih[data-mobile="true"] .fe-last{display:none}
.hih[data-mobile="true"] .fl-link{grid-template-columns:auto minmax(0,1fr) auto}
.hih[data-mobile="true"] .fl-author{display:none}

/* ============================================================
   LISTA DISCUSSIONI (forum → discussioni → thread)
   ============================================================ */
.dl-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:10px;background:var(--surface);border:1px solid var(--border);border-radius:13px;box-shadow:var(--shadow-sm);padding:10px 16px}
.dl-count{font-size:13px;font-weight:800;color:var(--text)}
.dl-cols{display:grid;grid-template-columns:160px 168px;gap:0;font-size:10.5px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--faint)}
.dl-cols span{text-align:left}
.dl-cols span:first-child{display:none}

.dl-list{display:flex;flex-direction:column;gap:9px;padding-bottom:8px}
.dl-row{display:grid;grid-template-columns:44px minmax(0,1fr) 160px 168px;align-items:center;gap:14px;background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-sm);padding:13px 16px;transition:transform .14s,box-shadow .14s}
.dl-row:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.dl-row.is-pin{background:color-mix(in srgb,var(--r3) 6%,var(--surface));border-color:color-mix(in srgb,var(--r3) 24%,var(--border))}
.dl-icon{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;font-size:18px;color:#fff;background:var(--accent);box-shadow:0 3px 0 color-mix(in srgb,var(--accent),#000 28%);flex:0 0 auto}
.dl-main{min-width:0}
.dl-titlerow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:4px}
.dl-pin{font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--r3);background:color-mix(in srgb,var(--r3) 14%,transparent);border-radius:6px;padding:2px 7px}
.dl-tag{font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--accent);background:color-mix(in srgb,var(--accent) 13%,transparent);border-radius:6px;padding:2px 7px}
.dl-title{font-family:var(--fontH);font-weight:600;font-size:15.5px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
.dl-row:hover .dl-title{color:var(--r6)}
.dl-by{font-size:12.5px;font-weight:600;color:var(--faint)}
.dl-author{font-weight:800}
.dl-author:hover{text-decoration:underline}
.dl-rank{font-size:10px;font-weight:800;color:var(--rk);background:color-mix(in srgb,var(--rk) 12%,transparent);border-radius:5px;padding:1px 6px;margin-left:6px}
.dl-stats{display:flex;flex-direction:column;gap:2px;font-size:12px;font-weight:700;color:var(--muted)}
.dl-stats b{color:var(--text)}
.dl-last{display:flex;align-items:center;gap:9px}
.dl-last img{width:34px;height:34px;border-radius:9px;background:var(--surface-2);object-fit:cover;object-position:center -2px;flex:0 0 auto}
.dl-last div{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.dl-last b{font-size:12.5px;font-weight:800;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dl-last small{font-size:11px;font-weight:700;color:var(--faint)}

.dl-empty{display:flex;flex-direction:column;align-items:center;gap:12px;padding:46px 22px;text-align:center;color:var(--faint)}
.dl-empty p{margin:0;font-weight:700;font-size:14px;color:var(--muted)}

.hih[data-mobile="true"] .dl-cols{display:none}
.hih[data-mobile="true"] .dl-row{grid-template-columns:40px minmax(0,1fr);gap:12px}
.hih[data-mobile="true"] .dl-stats,.hih[data-mobile="true"] .dl-last{display:none}
