/* ==========================================================================
 * formicarium.it · phpbb-adapter.css
 *
 * Adapter prosilver: applica la palette + tipografia bacheca al forum.
 * Caricato DOPO style.css (single source) e DOPO prosilver core CSS.
 *
 * Tutto il design viene da style.css. Qui SOLO override engine-specific:
 *  - banner phpBB duplicato nascosto (la topnav formicarium lo sostituisce)
 *  - navbar/headerbar/time eliminate dal flow normale
 *  - body usa var(--bg-page) della bacheca
 *  - .forumbg/.bg1/.bg2/.bg3 riskinnate con var bacheca
 *  - link/heading/button → palette bacheca
 *  - input/textarea dark/light coordinated
 * ========================================================================== */

/* === Banner phpBB duplicato (logo+sitename) — nascosto ================== */
#site-description { display: none !important; }
.site_logo, a#logo { display: none !important; }

/* === Box bianco navbar (FAQ/ISCRIVITI/INDICE) — nascosto ================ */
body#phpbb #page-header .headerbar,
body#phpbb #page-header .navbar { display: none !important; }
body#phpbb p.time, body#phpbb .time { display: none !important; }

/* === Body: palette + tipografia bacheca ================================ */
body#phpbb {
  background-color: var(--bg-page) !important;
  background-image: none !important;
  color: var(--txt) !important;
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  line-height: 1.55 !important;
}
[data-color-scheme="default"] body#phpbb,
html[data-color-scheme="default"] body#phpbb {
  background-image: url("/static/theme/Page-BgTexture.jpg") !important;
}
#wrap, #page-body, #page-footer {
  background: transparent !important;
  color: var(--txt);
}
body#phpbb #page-body {
  margin-top: 8px !important;
  padding-top: 0 !important;
  max-width: var(--maxw-content);
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 16px;
  padding-right: 16px;
}

/* === Forum group containers (.forumbg, .forabg) — card-like ============ */
.forumbg, .forabg {
  background: var(--bg-card) !important;
  background-image: none !important;
  border: 1px solid var(--bdr) !important;
  border-radius: 3px !important;
  margin-top: 8px !important;
  padding: 0 !important;
  box-shadow: var(--shadow-card);
}
.forabg ul.topiclist,
.forumbg ul.topiclist {
  background: transparent !important;
  background-image: none !important;
}

/* === Headers tabella (Forum, Argomenti, Ultimo messaggio) ============== */
.forumbg .header, .forabg .header,
.forumbg table.table1 thead th,
.forabg table.table1 thead th,
thead tr th {
  background: linear-gradient(to bottom, var(--dark-3), var(--dark-1)) !important;
  color: var(--gold) !important;
  border-bottom: 2px solid var(--gold) !important;
  text-shadow: none !important;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.forumbg table.table1 thead th a,
.forabg table.table1 thead th a,
.forumbg .header a, .forabg .header a,
thead tr th a { color: var(--gold) !important; }
.forumbg table.table1 thead th a:hover,
.forabg table.table1 thead th a:hover { color: var(--gold-soft) !important; }

/* === Righe forum (li.row) — alternate ================================= */
li.row, ul.topiclist li.row {
  background-color: var(--bg-card) !important;
  border-top-color: var(--bdr-soft) !important;
  border-bottom-color: var(--bdr-soft) !important;
}
li.row:hover, ul.topiclist li.row:hover {
  background-color: var(--bg-row-hover) !important;
}
li.row strong { color: var(--txt) !important; }
.bg1 { background-color: var(--bg-card) !important; }
.bg2 { background-color: var(--bg-card-alt) !important; }
.bg3 { background-color: var(--bg-row-alt) !important; }

/* === Titoli forum / topic ============================================= */
a.forumtitle, a.topictitle {
  color: var(--txt) !important;
  font-weight: 700;
  font-family: var(--font-display);
}
a.forumtitle:hover, a.topictitle:hover {
  color: var(--rust) !important;
}

/* === Link body / panel / topiclist ==================================== */
body#phpbb #page-body a:not(.button):not(.forumtitle):not(.topictitle),
body#phpbb .panel a:not(.button) {
  color: var(--gold-text);
}
[data-color-scheme="slate"] body#phpbb #page-body a:not(.button):not(.forumtitle):not(.topictitle),
[data-color-scheme="slate"] body#phpbb .panel a:not(.button),
html[data-color-scheme="slate"] body#phpbb #page-body a:not(.button):not(.forumtitle):not(.topictitle),
html[data-color-scheme="slate"] body#phpbb .panel a:not(.button) {
  color: var(--gold-soft);
}
body#phpbb #page-body a:hover,
body#phpbb .panel a:hover { color: var(--rust); }
/* :visited: senza override il browser applica UA default (viola/grigio).
   Mantieni stesso colore del default state per leggibilità della lista. */
body#phpbb #page-body a:visited:not(.button):not(.forumtitle):not(.topictitle),
body#phpbb .panel a:visited:not(.button) {
  color: var(--gold-text);
}
[data-color-scheme="slate"] body#phpbb #page-body a:visited:not(.button):not(.forumtitle):not(.topictitle),
[data-color-scheme="slate"] body#phpbb .panel a:visited:not(.button),
html[data-color-scheme="slate"] body#phpbb #page-body a:visited:not(.button):not(.forumtitle):not(.topictitle),
html[data-color-scheme="slate"] body#phpbb .panel a:visited:not(.button) {
  color: var(--gold-soft);
}
/* Titoli forum/topic: mantengo color --txt anche visitati */
a.forumtitle:visited, a.topictitle:visited {
  color: var(--txt) !important;
}

/* === Descrizioni / meta / poster / date — dim ========================= */
.forumdesc, .topic-poster, .topic-info,
.responsive-show, .responsive-hide.left-box,
.lastpost, .topics, .posts, .replies, .views,
small, .row .responsive-hide {
  color: var(--txt-dim) !important;
}

/* === Headings H1-H3 phpBB (login/register/posting/ucp) ================ */
body#phpbb h1, body#phpbb h2, body#phpbb h3,
body#phpbb .panel h2, body#phpbb .panel h3,
body#phpbb h2.solo {
  color: var(--gold-text) !important;
  border-bottom: 1px solid var(--bdr) !important;
  background: transparent !important;
  font-family: var(--font-display);
}
[data-color-scheme="slate"] body#phpbb h1,
[data-color-scheme="slate"] body#phpbb h2,
[data-color-scheme="slate"] body#phpbb h3,
[data-color-scheme="slate"] body#phpbb .panel h2,
[data-color-scheme="slate"] body#phpbb .panel h3,
html[data-color-scheme="slate"] body#phpbb h1,
html[data-color-scheme="slate"] body#phpbb h2,
html[data-color-scheme="slate"] body#phpbb h3,
html[data-color-scheme="slate"] body#phpbb .panel h2,
html[data-color-scheme="slate"] body#phpbb .panel h3 {
  color: var(--gold) !important;
}

/* === Form labels (Nome utente:, Password:) — full contrast ============ */
body#phpbb dl.fields1 dt, body#phpbb dl.fields1 dt label,
body#phpbb dl.fields2 dt, body#phpbb dl.fields2 dt label,
body#phpbb dt label,
body#phpbb fieldset dl > dt, body#phpbb fieldset dl > dt label {
  color: var(--txt) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
}
/* Le descrizioni multiline sotto al label ("Il nome utente deve essere..." e
   "La password deve essere lunga...") ereditano da dt — riduco su mobile +
   normal weight per non rubare attenzione al campo input vero. */
body#phpbb dt:not(.label) {
  font-weight: 400 !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
}
body#phpbb dt > label {
  font-weight: 600 !important;
  font-size: 14.5px !important;
  display: block;
  margin-bottom: 4px;
}

/* === Panel paragraphs ("Per eseguire il login...") ==================== */
body#phpbb .panel p, body#phpbb .panel dd,
body#phpbb .panel dt:not(.label),
body#phpbb #page-body p {
  color: var(--txt) !important;
}
body#phpbb .panel small, body#phpbb .small,
body#phpbb input[type="checkbox"] + label,
body#phpbb label.checkbox,
/* phpBB struttura: <label><input type=checkbox> Testo</label> — label WRAPPA
   il checkbox, NON è sibling. Aggiungo selettori per i due casi. */
body#phpbb dl dd label,
body#phpbb fieldset dl dd label {
  color: var(--txt) !important;
}

/* === Select dropdown phpBB (search.php "Cerca nei forum") ============= */
body#phpbb select,
body#phpbb select.inputbox,
body#phpbb select option {
  background: var(--bg-card-alt) !important;
  color: var(--txt) !important;
  border: 1px solid var(--bdr-strong) !important;
  font-family: var(--font-body) !important;
}
body#phpbb select:focus {
  border-color: var(--gold) !important;
  outline: none;
}

/* === Input / textarea ================================================= */
body#phpbb input[type="text"],
body#phpbb input[type="password"],
body#phpbb input[type="email"],
body#phpbb input[type="search"],
body#phpbb textarea,
body#phpbb input.inputbox,
body#phpbb textarea.inputbox,
body#phpbb select.inputbox {
  background: var(--bg-card-alt) !important;
  border: 1px solid var(--bdr-strong) !important;
  color: var(--txt) !important;
  padding: 6px 10px !important;
  border-radius: 3px !important;
  font-family: var(--font-body) !important;
}
body#phpbb input[type="text"]:focus,
body#phpbb input[type="password"]:focus,
body#phpbb input.inputbox:focus,
body#phpbb textarea:focus {
  border-color: var(--gold) !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(204, 179, 97, 0.15);
}

/* === Buttons phpBB ==================================================== */
body#phpbb input[type="submit"],
body#phpbb input[type="button"],
body#phpbb input[type="reset"],
body#phpbb button[type="submit"],
body#phpbb .button, body#phpbb .button1,
body#phpbb .button2, body#phpbb .button3 {
  background: rgba(204, 179, 97, 0.18) !important;
  background-image: none !important;
  border: 1px solid var(--gold) !important;
  color: var(--txt) !important;
  padding: 8px 18px !important;
  border-radius: 3px !important;
  font-weight: 600 !important;
  font-family: var(--font-meta) !important;
  text-shadow: none !important;
  box-shadow: none !important;
  cursor: pointer;
}
body#phpbb input[type="submit"]:hover,
body#phpbb .button:hover {
  background: var(--gold) !important;
  color: var(--dark-1) !important;
}

/* === action-bar (Nuovo argomento + paginazione) — dark/light vars ===== */
body#phpbb .action-bar,
body#phpbb .action-bar.top,
body#phpbb .action-bar.bottom {
  background: var(--bg-card-alt) !important;
  background-image: none !important;
  border: 1px solid var(--bdr) !important;
  color: var(--txt) !important;
  padding: 6px 10px !important;
  border-radius: 3px !important;
}
body#phpbb .action-bar a { color: var(--gold-text) !important; }
body#phpbb .pagination li a {
  background: var(--bg-card) !important;
  color: var(--gold-text) !important;
  border-color: var(--bdr-strong) !important;
}
body#phpbb .pagination li a:hover {
  background: rgba(204, 179, 97, 0.20) !important;
  color: var(--txt) !important;
}
body#phpbb .pagination li.active span {
  background: var(--gold) !important;
  color: var(--dark-1) !important;
  border-color: var(--gold) !important;
}

/* === stat-block (CHI E IN LINEA, STATISTICHE) ========================= */
body#phpbb .stat-block,
body#phpbb .stat-block.online-list,
body#phpbb .stat-block.statistics,
body#phpbb #birthdays-list {
  background: var(--bg-card) !important;
  background-image: none !important;
  border: 1px solid var(--bdr) !important;
  border-radius: 3px !important;
  color: var(--txt) !important;
  padding: 12px 16px !important;
}
body#phpbb .stat-block h3 {
  color: var(--gold-text) !important;
  border-bottom: 1px solid var(--bdr) !important;
  padding-bottom: 6px;
  margin-bottom: 6px;
}
body#phpbb .stat-block p { color: var(--txt-dim) !important; }
body#phpbb .stat-block strong { color: var(--txt) !important; }

/* === Panel + post containers ========================================== */
body#phpbb .panel, body#phpbb .post,
body#phpbb dl.details, body#phpbb dl.faq,
body#phpbb .codebox, body#phpbb .quotebox {
  background: var(--bg-card) !important;
  border: 1px solid var(--bdr) !important;
  color: var(--txt) !important;
  border-radius: 3px;
}
body#phpbb .postprofile {
  background: var(--bg-card-alt) !important;
  border-color: var(--bdr) !important;
  color: var(--txt) !important;
}
body#phpbb .post .content { color: var(--txt) !important; }

/* === Agreement / panel / FAQ text — prosilver hardcoda #333 invisibile in dark
   .content ha color: #333333 da colours.css linea 376. Lo override per tutti
   i contesti panel non-post (registration agreement, ucp profile, faq, ecc.). */
body#phpbb .content,
body#phpbb .postbody,
body#phpbb .agreement,
body#phpbb .agreement-text,
body#phpbb dl.faq dt {
  color: var(--txt) !important;
}

/* === Footer phpBB (sempre dark, accent oro) =========================== */
#page-footer {
  color: var(--cream) !important;
  background: var(--dark-1) !important;
  border-top: 3px solid var(--gold);
  padding: 18px 16px;
  margin-top: 36px;
}
#page-footer a { color: var(--gold-soft); }
#page-footer a:hover { color: var(--gold); }
#page-footer .copyright { color: var(--txt-muted); }

/* === Icone forum (read/unread) — visibili su dark e light ============ */
.row .icon,
dl.row-item dt .list-inner .icon {
  filter: brightness(1.2) saturate(0.85);
}
[data-color-scheme="slate"] .row .icon,
[data-color-scheme="slate"] dl.row-item dt .list-inner .icon,
html[data-color-scheme="slate"] .row .icon,
html[data-color-scheme="slate"] dl.row-item dt .list-inner .icon {
  filter: brightness(1.6) saturate(0.7);
}
