/* Desktop chrome only, linked only by base_d.html.

   No media queries: the layout was chosen on the server, so these rules only
   ever reach a document that wants them. This mirrors the main site, which
   loads ws_cream_nocache.css everywhere and webstyle.css on desktop alone. */

/* How wide the page runs. Declared once, because the footer lines up with
   the columns above it and two copies of a width drift.

   Wider than the 1120px the two-column layout used, by about the width of
   the rail. A third column inside the old width took its 170px and a gap
   out of the middle one, and the middle one is where the posts are -- which
   made the thing the page is actually for the thing that got smaller. */
:root { --page: 1300px; }

/* Three columns: the recents rail, the page, the site's own navigation.

   Flex rather than grid, because the two outer columns come and go.
   `display: none` on a flex item takes its gap with it; an empty grid track
   keeps both the track and its gap, which is a gutter holding nothing. */
.wrap--split {
  display: flex;
  gap: 24px;
  max-width: var(--page);
}

/* Thin on purpose: it is a way back to somewhere, not a second sidebar. */
.rail { flex: 0 0 170px; }
/* `min-width: 0` or a long word in a topic title pushes the columns apart:
   a flex item's floor is its content, not zero. */
.col { flex: 1 1 auto; min-width: 0; }
.side { flex: 0 0 290px; }

/* The bottom tab bar is mobile-only chrome and base_d.html does not emit it,
   so the space reserved for it goes back. What is fixed here is the top bar,
   so the room for a scrolled-to target moves to the top with it: without
   this, a `#comments` link lands with the heading behind the bar. */
body { padding-bottom: 0; }
html { scroll-padding-bottom: 0; scroll-padding-top: 64px; }

.bar { padding: 0 24px; position: sticky; top: 0; z-index: 2; }
.bar__home, .bar__brand { padding: 14px 0; }
.bar__nav { display: flex; gap: 4px; margin-left: 20px; }

.bar__link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: rgba(255, 255, 255, 0.82);
}

.bar__link:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.bar__link.is-active { background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 600; }
.bar__right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.bar__acct { margin-left: 0; }

/* Each outer column sticks as one piece. Sticking each card instead held
   them all at the same offset, where the later one paints over the one
   above it. `align-self`, because a flex item stretches to the line's
   height by default and something already as tall as the row has nowhere
   to stick to. */
.rail, .side { display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 72px; align-self: flex-start; }

/* A column with nothing in it is not a column.

   The two are decided differently because they are known at different
   times. The sidebar's cards are in the markup, so the column can be asked
   what it contains: `:has()`, Baseline widely available since December
   2023, and where it is missing the column simply stays -- an empty gutter
   rather than a broken page, which is what the pages that override `aside`
   (the communities list, the forms) have had all along.

   The rail holds one card that is the reader's own, so it is empty in the
   markup of every page and filled by talk.js from localStorage. Asking the
   column what it contains would therefore collapse it until talk.js ran and
   then open it, reflowing the post column by its whole width on every page
   a returning reader opens. So it is settled from `<html>` by the inline
   script in head.html, which runs before the first frame -- the same
   arrangement the safe-browse class uses, and for the same reason. */
html:not([data-rail]) .rail { display: none; }
.side:not(:has(> *)) { display: none; }

/* The rail's card is scaled down to match the column: smaller type and
   tighter rows, with no rules between them. At the sidebar's weight it
   would read as the page's second navigation rather than a short list of
   where this reader has just been. */
.rail .card { padding: 10px 12px; }
.rail .card__title { margin-bottom: 6px; font-size: 11px; }
.rail .list li { padding: 4px 0; border-top: 0; }
.rail .list li a { font-size: 13px; }

.page__title { font-size: 27px; }
.topic__title { font-size: 17px; }
/* `inline-size: 100%` for the same reason as `.wrap` in talk.css: body is a
   flex column, and auto inline margins opt an item out of stretching. */
.foot { max-width: var(--page); margin: 24px auto 0; inline-size: 100%; padding: 20px 24px 28px; }

/* The notice lines up with the header above the content rather than running
   edge to edge, which at this width is a banner nobody reads the end of. */
.cookiebar { padding: 12px 24px; }
.cookiebar__text { font-size: 14px; }
