/* ==========================================================================
   Rojadirecta board — forum layer
   --------------------------------------------------------------------------
   The board is a different product from the main site, so it may look like
   one: this is a classic phpBB-shaped board (category bands, forum rows with
   topic/post counts and a last-post column, topic lists, post blocks with the
   author in a left-hand profile column).

   It is written from the same design tokens as the rest of the site — the red
   #d20808 bands, the #cfcfcf strips, the #e7e8ed / #d5d8e0 greys and the
   Verdana/Arial stack all come from :root in css/rojadirecta.css. Nothing here
   redefines a token; it only uses them, which is what keeps the board part of
   the same family without being a pixel copy of the main page or of phpBB.

   Every rule is scoped under `body.forum-body`, a class only the forum's own
   pages carry, so this file cannot reach the main site even if it is loaded by
   accident. tools/compare.js proves the main page still measures 1:1.

   Structure:
     1. Shell overrides (wider window, block content)
     2. Board index (categories, forum rows)
     3. Topic list
     4. Post view
     5. Pagination
     6. Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Shell
   --------------------------------------------------------------------------
   A board needs more width than the main page's 775px window: four columns of
   board furniture in 766px is unreadable. The window is widened and the
   two-column homepage grid is replaced with one block column, scoped to the
   forum so the measured 1:1 layout of the rest of the site is untouched.
   -------------------------------------------------------------------------- */

body.forum-body .window {
  width: 960px;
  text-align: left;
}

body.forum-body .content {
  display: block;
  width: auto;
  height: auto;
  margin: 8px 10px 14px;
  padding: 0;
}

body.forum-body .topnav__link--here {
  font-weight: 700;
  color: var(--c-red);
}

.forum {
  font: 12px/1.5 var(--f-body);
  color: var(--c-text);
}

.forum__title {
  margin: 0 0 4px;
  color: var(--c-red);
  font: 700 22px/1.25 var(--f-ui);
}

.forum__desc {
  margin: 0 0 6px;
  color: var(--c-text);
  font-size: 12px;
}

.forum__stats {
  margin: 0 0 12px;
  padding: 5px 8px;
  background: var(--c-head);
  border: 1px solid var(--c-head-alt);
  color: var(--c-text-dim);
  font-size: 11px;
}

.forum__note {
  margin: 14px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--c-head);
  color: var(--c-text-dim);
  font-size: 11px;
  font-style: italic;
}

.crumbs {
  margin: 0 0 8px;
  color: var(--c-text-dim);
  font: 11px var(--f-plain);
}

.crumbs a { color: var(--c-text-nav); }

/* --------------------------------------------------------------------------
   2. Board index
   --------------------------------------------------------------------------
   The phpBB pattern: a red category band, then a table of forums with the
   forum name and description on the left and the topic count, post count and
   last post on the right.
   -------------------------------------------------------------------------- */

.cat { margin: 0 0 14px; }

.cat__head {
  margin: 0;
  padding: 3px 6px;
  background: var(--c-red);
  color: var(--c-white);
  font: 700 12px var(--f-ui);
  text-align: left;
}

.cat__body {
  border: 1px solid var(--c-head-alt);
  border-top: 0;
  background: var(--c-window);
}

/* Both tables are wide by nature (four columns of board furniture). On a
   narrow screen they scroll sideways inside this wrapper rather than dragging
   the whole page sideways with them. */
.tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.flist,
table.tlist {
  width: 100%;
  border-collapse: collapse;
}

table.flist th,
table.tlist th {
  padding: 4px 6px;
  background: var(--c-head-alt);
  border-bottom: 1px solid var(--c-window);
  color: var(--c-text);
  font: 700 11px var(--f-ui);
  text-align: left;
}

.flist__row td,
.tlist__row td {
  padding: 6px;
  border-top: 1px solid var(--c-head-alt);
  vertical-align: top;
}

/* phpBB stripes its rows with the light grey; the darker grey is the header. */
.flist__row--alt td { background: var(--c-head); }

.flist__name,
.tlist__name {
  color: var(--c-text);
  font: 700 12px var(--f-body);
}

.flist__name:hover,
.tlist__name:hover { color: var(--c-hover); }

.flist__desc {
  margin: 2px 0 0;
  color: var(--c-text-dim);
  font-size: 11px;
}

.flist__num,
.tlist__num {
  width: 62px;
  color: var(--c-text);
  font: 11px var(--f-body);
  text-align: center;
  white-space: nowrap;
}

.flist__last,
.tlist__last {
  width: 220px;
  font-size: 11px;
}

.flist__last-title,
.tlist__last-title {
  display: block;
  color: var(--c-text-nav);
  font-size: 11px;
}

.flist__last-title:hover,
.tlist__last-title:hover { color: var(--c-hover); }

.flist__last-meta,
.tlist__last-meta {
  display: block;
  margin-top: 1px;
  color: var(--c-text-dim);
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   3. Topic list
   -------------------------------------------------------------------------- */

.tlist__meta {
  display: block;
  margin-top: 2px;
  color: var(--c-text-dim);
  font-size: 10px;
}

.tlist__meta b { color: var(--c-text-nav); }

/* Sticky and locked markers, as phpBB prints them before the topic title. */
.badge {
  display: inline-block;
  margin-right: 3px;
  padding: 0 3px;
  background: var(--c-red);
  color: var(--c-white);
  font: 700 9px/14px var(--f-plain);
  text-transform: uppercase;
  vertical-align: 1px;
}

.badge--locked {
  background: var(--c-head-alt);
  color: var(--c-text);
}

.tlist__row--sticky td { background: var(--c-head); }

.tlist__pages:empty { display: none; }

.tlist__pages a {
  display: inline-block;
  margin-right: 2px;
  padding: 0 4px;
  background: var(--c-head-alt);
  color: var(--c-text-nav);
  font: 10px/15px var(--f-plain);
}

.tlist__pages a:hover {
  background: var(--c-red);
  color: var(--c-white);
}

/* --------------------------------------------------------------------------
   4. Post view
   --------------------------------------------------------------------------
   phpBB's post block: author details in a left column, subject line and body
   in the right. The profile column keeps the board's grey so a long thread of
   posts reads as a repeating rhythm rather than a wall of text.
   -------------------------------------------------------------------------- */

.posts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post {
  margin: 0 0 2px;
  border: 1px solid var(--c-head-alt);
  background: var(--c-window);
}

.post__inner { display: flex; }

.post__profile {
  flex: 0 0 150px;
  width: 150px;
  padding: 6px;
  background: var(--c-head);
  border-right: 1px solid var(--c-head-alt);
  font-size: 10px;
  color: var(--c-text-dim);
}

.post__user {
  display: block;
  color: var(--c-red);
  font: 700 12px var(--f-body);
  overflow-wrap: break-word;
}

.post__rank {
  display: block;
  margin-bottom: 4px;
  color: var(--c-text-dim);
  font: italic 10px var(--f-plain);
}

.post__joined,
.post__count,
.post__location { display: block; line-height: 15px; }

.post__joined b,
.post__count b,
.post__location b { color: var(--c-text); }

.post__signature {
  display: block;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--c-head-alt);
  color: var(--c-text-dim);
  font: italic 10px/1.4 var(--f-body);
}

.post__main {
  flex: 1 1 auto;
  min-width: 0;
}

.post__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 6px;
  background: var(--c-head);
  border-bottom: 1px solid var(--c-head-alt);
  font-size: 11px;
}

.post__subject {
  font-weight: 700;
  color: var(--c-text);
  overflow-wrap: break-word;
}

.post__date {
  flex: 0 0 auto;
  color: var(--c-text-dim);
  font-size: 10px;
  white-space: nowrap;
}

.post__nr { color: var(--c-text-nav); }

.post__body {
  padding: 8px 8px 10px;
  font-size: 13px;
  overflow-wrap: break-word;
}

.post__body p { margin: 0 0 8px; }

.post__body p:last-child { margin-bottom: 0; }

/* Thanks lists, phpBB's "N users thanked the author". */
.post__thanks {
  margin-top: 8px !important;
  padding: 3px 6px;
  background: var(--c-head);
  border-left: 3px solid var(--c-red);
  color: var(--c-text-dim);
  font-size: 10px;
}

.post--locked .post__body { background: #fbfbfa; }

.post__locked {
  margin-top: 8px !important;
  color: var(--c-red);
  font-size: 11px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   5. Pagination
   -------------------------------------------------------------------------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 4px 6px;
  background: var(--c-head);
  border: 1px solid var(--c-head-alt);
  font: 11px var(--f-body);
}

.pager__label { color: var(--c-text-dim); }

.pager__pages { display: inline-flex; gap: 3px; }

.pager__pages a,
.pager__pages b {
  display: inline-block;
  min-width: 18px;
  padding: 1px 4px;
  background: var(--c-window);
  border: 1px solid var(--c-head-alt);
  color: var(--c-text-nav);
  font-weight: 400;
  text-align: center;
}

.pager__pages a:hover {
  background: var(--c-head-alt);
  color: var(--c-text);
}

.pager__pages b {
  background: var(--c-red);
  border-color: var(--c-red);
  color: var(--c-white);
  font-weight: 700;
}

.pager__step { color: var(--c-text-nav); }

.pager--bottom { margin-bottom: 4px; }

/* --------------------------------------------------------------------------
   6. Responsive
   --------------------------------------------------------------------------
   Below the board's own width the window goes fluid and the four-column
   tables scroll sideways inside their own box rather than squashing the
   topic titles into a column two characters wide. The post block stacks:
   profile first, then the subject and body, which is how phpBB's mobile theme
   does it too.
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  body.forum-body .window { width: 100%; }

  body.forum-body .content { margin: 8px 8px 14px; }

  table.flist,
  table.tlist { min-width: 540px; }

  .flist__last,
  .tlist__last { width: 170px; }

  .post__inner { display: block; }

  .post__profile {
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--c-head-alt);
  }

  .post__joined,
  .post__count,
  .post__location { display: inline-block; margin-right: 10px; }

  .post__head { flex-wrap: wrap; }

  .post__date { white-space: normal; }

  /* The post-number permalink is a control, not prose, so on a touch screen it
     carries the 24px minimum rather than its 11px line box. */
  .post__nr {
    display: inline-block;
    min-height: 24px;
    min-width: 24px;
    padding: 5px 4px 0;
    text-align: center;
  }

  /* Topic titles and page links are the board's only controls, so they carry
     the 24px minimum touch height at these widths. */
  .tlist__name,
  .flist__name {
    display: inline-block;
    min-height: 24px;
    padding: 4px 0 0;
  }

  .tlist__pages a,
  .pager__pages a,
  .pager__pages b {
    display: inline-block;
    min-height: 24px;
    min-width: 24px;
    padding: 4px 6px;
    text-align: center;
  }

  .pager__step {
    display: inline-block;
    min-height: 24px;
    padding: 4px 0 0;
  }

  .flist__last-title,
  .tlist__last-title { min-height: 24px; padding-top: 4px; }
}

@media (max-width: 560px) {
  /* Below this the four columns cannot all be legible at once. The board index
     keeps its last-post column (it is the point of that page) and scrolls;
     the topic list drops it, because the same information is already on the
     topic's own first page and the replies count is what people scan for. */
  table.tlist .tlist__last { display: none; }

  table.tlist { min-width: 0; }

  .flist__num,
  .tlist__num { width: 52px; }

  .pager {
    gap: 4px;
    padding: 4px;
  }
}

/* The thread's link into the articles.
   Every thread is a discussion about where a fixture is free, so the guide that
   answers it is contextually relevant rather than a decorative link. Styled to
   read as part of the thread header, not as navigation chrome. */
.forum__related {
  margin: 0 0 12px;
  padding: 8px 10px;
  background: var(--board-head, #e7e8ed);
  border-left: 3px solid #d20808;
  font-size: 12px;
  line-height: 1.5;
}

.forum__related a {
  font-weight: 700;
  color: #d20808;
}

.forum__related-note {
  display: block;
  color: #555555;
  font-size: 11px;
}
