/* ==========================================================================
   GRAVIQUEST FORUM  (forum.html, forum-thread.html)
   Almost everything on these pages is an existing part: the chapter label,
   the This Week's Question band, the callout, g-tag, g-soon, g-btn, the
   comment avatar, the Viewpoints tag. This file adds only the layout those
   parts sit in, plus three pieces that mirror an existing one rather than
   invent one:

   .fm-step   the Start Here rail's pill step (.trail__step, topic-rail.css):
              hairline pill, mono number before the name, outlined in the
              accent when chosen. Copied, not imported, because topic-rail.css
              carries the whole rail with it.
   .fm-row    the layer list's row (.lp-layer, landing.css): hairline between
              rows, the surface on hover, with the columns a forum needs.
   .fm-arrow  the rail's round arrow button (.trail__arrow).
   ========================================================================== */

.fm-sec { padding-top: var(--g-space-2xl); }

/* ---- Head ------------------------------------------------------------------ */
.fm-top {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--g-space-md);
  align-items: end; margin-bottom: var(--g-space-lg);
}
.fm-h1 { margin: 0 0 var(--g-space-sm); font-size: var(--g-fs-h1); letter-spacing: var(--g-track-head); line-height: var(--g-lh-head); }
.fm-lead { margin: 0; max-width: 46rem; }
@media (max-width: 640px) { .fm-top { grid-template-columns: minmax(0, 1fr); } .fm-top .g-btn { justify-self: start; } }

.fm-pinned { margin-bottom: var(--g-space-xl); }
.fm-pinned p { max-width: 60ch; }

/* ---- Rooms and search ---------------------------------------------------------- */
.fm-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--g-space-sm);
  flex-wrap: wrap; margin-bottom: var(--g-space-sm);
}
.fm-steps { display: flex; gap: var(--g-space-3xs); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.fm-steps::-webkit-scrollbar { display: none; }
/* Mirrors .trail__step. It is also a .chip, because site.js filters on
   .chip[data-filter]; these rules set it back to the rail's look. */
.chip.fm-step {
  flex: none; display: inline-flex; align-items: baseline; gap: .45em;
  padding: .45rem .8rem; border: 1px solid var(--g-hairline); border-radius: var(--g-radius-pill);
  background: none; color: var(--g-text-muted);
  font: inherit; font-size: var(--g-fs-small); font-weight: var(--g-w-medium);
}
.chip.fm-step span { font-family: var(--g-font-mono); font-size: var(--g-fs-caption); color: var(--g-text-subtle); }
.chip.fm-step:hover { color: var(--g-text); border-color: var(--g-text-subtle); }
.chip.fm-step[aria-pressed="true"] { color: var(--g-text); background: var(--g-surface-raised); border-color: var(--g-accent); }
.chip.fm-step[aria-pressed="true"] span { color: var(--g-accent); }
.fm-find { display: flex; align-items: center; gap: var(--g-space-sm); flex: 0 1 20rem; }
.fm-find .search { flex: 1 1 auto; min-width: 0; }
.fm-find .result-count { flex: none; }

/* ---- Thread rows ----------------------------------------------------------------- */
.fm-rows { list-style: none; margin: 0; padding: 0; }
.fm-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 7rem 4.5rem 4.5rem 4.5rem;
  gap: var(--g-space-sm); align-items: center;
  padding: var(--g-space-md) var(--g-space-2xs);
  border-bottom: 1px solid var(--g-hairline);
  color: inherit; text-decoration: none;
  transition: background-color var(--g-dur) var(--g-ease-orbit);
}
a.fm-row:hover { background: var(--g-surface); }
a.fm-row:focus-visible { outline: 2px solid var(--g-focus); outline-offset: -2px; }
.fm-row--head {
  padding-block: 0 var(--g-space-xs);
  font-family: var(--g-font-mono); font-size: var(--g-fs-caption); color: var(--g-text-subtle);
}
.fm-row__main { display: grid; gap: .3rem; min-width: 0; }
.fm-room { font-family: var(--g-font-mono); font-size: var(--g-fs-caption); letter-spacing: .04em; color: var(--g-accent); }
.fm-row__title { font-size: var(--g-fs-h4); font-weight: var(--g-w-semibold); line-height: 1.3; color: var(--g-text); text-wrap: pretty; }
a.fm-row:hover .fm-row__title { color: var(--g-accent); }
.fm-row__tags { display: flex; gap: var(--g-space-2xs); }
.fm-row__tags .g-tag { align-self: center; }
/* Centred under the column word, not flush to its last letter: a short figure
   flush right sat under the "s" of Replies and read as misaligned (2026-11-18). */
.fm-c-n { text-align: center; font-family: var(--g-font-mono); font-size: var(--g-fs-small); color: var(--g-text-muted); font-variant-numeric: tabular-nums; }
.fm-row--head .fm-c-n { font-size: var(--g-fs-caption); color: var(--g-text-subtle); }
.fm-c-age { color: var(--g-text-subtle); }
.fm-who { display: inline-flex; }
/* The Topic comments' avatar, at row size, overlapped. */
.avatar.fm-av { width: 1.75rem; height: 1.75rem; font-size: .625rem; box-shadow: 0 0 0 2px var(--g-bg); }
.fm-who .fm-av + .fm-av { margin-left: -.45rem; }

@media (max-width: 760px) {
  .fm-row { grid-template-columns: minmax(0, 1fr) 3.5rem 3.5rem; }
  .fm-c-who, .fm-c-views { display: none; }
  .fm-find { flex-basis: 100%; }
}

/* ---- A thread ---------------------------------------------------------------- */
.fm-crumb { margin: 0 0 var(--g-space-sm); font-family: var(--g-font-mono); font-size: var(--g-fs-caption); color: var(--g-text-subtle); }
.fm-crumb a { color: var(--g-text-muted); text-decoration: none; }
.fm-crumb a:hover { color: var(--g-text); }
.fm-thead { margin-bottom: var(--g-space-md); }
.fm-h1--thread { font-size: var(--g-fs-h2); max-width: 26ch; text-wrap: balance; }
.fm-thead__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--g-space-sm); margin: 0; font-size: var(--g-fs-small); color: var(--g-text-muted); }

.fm-thread {
  display: grid; grid-template-columns: minmax(0, 44rem) minmax(0, 15rem);
  gap: var(--g-space-2xl); align-items: start;
}
.fm-post { padding-block: var(--g-space-lg); border-top: 1px solid var(--g-hairline); scroll-margin-top: 6rem; }
.fm-post:first-child { border-top: 0; padding-top: 0; }
.fm-post__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--g-space-sm); align-items: center; }
.fm-post__who { display: flex; align-items: center; flex-wrap: wrap; gap: var(--g-space-2xs); font-size: var(--g-fs-small); }
.fm-post__who b { color: var(--g-text); font-weight: var(--g-w-semibold); }
.fm-post__who .g-tag { align-self: center; }
.fm-post__to { color: var(--g-text-subtle); }
.fm-post__head time { font-family: var(--g-font-mono); font-size: var(--g-fs-caption); color: var(--g-text-subtle); }
.fm-post__body { margin: var(--g-space-sm) 0 0 calc(2.4rem + var(--g-space-sm)); font-family: var(--g-font-read); line-height: var(--g-lh-body); color: var(--g-text-muted); }
.fm-post__body p { margin: 0 0 var(--g-space-sm); }
.fm-post__body p:last-child { margin-bottom: 0; }
.fm-post__body .fm-stance { font-family: var(--g-font); color: var(--g-accent); margin-bottom: var(--g-space-2xs); }
.fm-post__acts { display: flex; gap: var(--g-space-3xs); margin: var(--g-space-xs) 0 0 calc(2.4rem + var(--g-space-sm) - .75rem); }
.fm-post__n { margin-left: .45em; font-family: var(--g-font-mono); color: var(--g-text-subtle); }
.fm-answer { margin-top: var(--g-space-md); }

/* The aside stays beside the posts while they scroll. */
.fm-aside { position: sticky; top: 6.5rem; display: grid; gap: var(--g-space-lg); }
.fm-step-nav { display: flex; align-items: center; gap: var(--g-space-2xs); }
.fm-count { margin-right: auto; font-family: var(--g-font-mono); font-size: var(--g-fs-caption); color: var(--g-text-subtle); }
/* Mirrors .trail__arrow. */
.fm-arrow {
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  border: 1px solid var(--g-hairline); border-radius: 50%;
  background: var(--g-surface); color: var(--g-text);
  transition: border-color var(--g-dur) var(--g-ease-orbit), opacity var(--g-dur) var(--g-ease-orbit);
}
.fm-arrow:hover { border-color: var(--g-text-subtle); }
.fm-arrow[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.fm-arrow .g-ic { width: 1rem; height: 1rem; }
.fm-arrow__up { transform: rotate(-90deg); }
.fm-arrow__down { transform: rotate(90deg); }

/* The facts, as the layer grid's hairline cells. */
.fm-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0;
  border-top: 1px solid var(--g-hairline); border-left: 1px solid var(--g-hairline);
}
.fm-facts div { padding: var(--g-space-sm); border-right: 1px solid var(--g-hairline); border-bottom: 1px solid var(--g-hairline); }
.fm-facts dt { font-family: var(--g-font-mono); font-size: var(--g-fs-caption); color: var(--g-text-subtle); }
.fm-facts dd { margin: .2rem 0 0; font-family: var(--g-font-mono); font-size: var(--g-fs-h4); color: var(--g-text); font-variant-numeric: tabular-nums; }
.fm-aside__label { margin: 0 0 var(--g-space-2xs); font-family: var(--g-font-mono); font-size: var(--g-fs-caption); color: var(--g-text-subtle); }
.fm-people { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--g-space-2xs); font-size: var(--g-fs-small); color: var(--g-text-muted); }
.fm-people li { display: flex; align-items: center; gap: var(--g-space-2xs); }
.fm-people .fm-av { box-shadow: none; }

.fm-more { margin-top: var(--g-space-3xl); }
.fm-more__h { margin: 0 0 var(--g-space-md); font-size: var(--g-fs-h3); }

@media (max-width: 960px) {
  .fm-thread { grid-template-columns: minmax(0, 1fr); }
  .fm-aside { position: static; order: -1; grid-template-columns: minmax(0, 1fr); }
  .fm-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fm-step-nav, .fm-talk { display: none; }
}
@media (max-width: 560px) {
  .fm-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fm-post__body, .fm-post__acts { margin-left: 0; }
}

/* Hulse and Taylor have pictures (the paper cast sheet's front view, cropped
   to the body); everyone else keeps initials. The picture fills the same
   disc the initials sit on. */
img.avatar { display: block; padding: 0; object-fit: cover; background: var(--g-surface-hover); }
/* Pulsar is the mark itself, cut out of the cast sheet's paper tile along
   its own edge, set inside the same disc as everyone else and at the same
   size, so a row of avatars reads as one row. Its disc is Cosmos Blue in
   both themes: the paper mark is drawn to sit on the brand anchor, and a
   theme-following surface would wash it out on light. */
img.avatar.is-mark { padding: .45rem; object-fit: contain; background: var(--g-cosmos-blue); }
img.avatar.fm-av.is-mark { padding: .3rem; }
