/* SEO-CONTENT: the stylesheet of the static pages (/how-to-play, /pieces, /faq, /about, SEO-RANK's /12x12-chess,
   /chess-variant-camel-elephant, /new-chess-game, and SEO-COMPARE's /large-chess-variants). On-system styling as the
   legal pages: the app's font and tokens, light/dark by the device, and legal-theme.js applies the app's own appearance
   choice ([data-theme]). Phone-first; nothing here is shared with the app's styles.css. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-var.woff2") format("woff2");
  font-weight: 400 800; font-display: swap;
}
:root {
  --bg:#E8EBF2; --ink:#1C2033; --muted:#5D6480; --line:#AEB6CB;
  --sq-light:#D3DAEA; --sq-dark:#56658F; --frame:#98A1BC; --accent:#F0A824; --on-accent:#1C2033;
  color-scheme: light dark;
}
/* the app's appearance choice wins (legal-theme.js sets [data-theme]); "system" follows the device */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg:#11131F; --ink:#EEF1F8; --muted:#A3ABC8; --line:#3E4C70; --frame:#0D0F1C; }
}
:root[data-theme="dark"] { --bg:#11131F; --ink:#EEF1F8; --muted:#A3ABC8; --line:#3E4C70; --frame:#0D0F1C; color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

body {
  background: var(--bg); color: var(--ink); max-width: 32em; margin: 0 auto; padding: 16px 16px 64px;
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.6;
}
/* R16-UI-14 (the round-16 UI audit: up to 87 characters a line on a desktop; counted on the drawn lines, 105): the text
   column is 32em, about 70 characters of this face a line (68ch would be about 87: a "0" is wider than the average
   letter), inside the 65 to 75 a line reads best at. LEARN-LINKS (the owner, 2026-11-09: on a desktop the text hugged the
   left of a 760px page under a full-width header, the right side empty): the page is the text column's width, so the
   header, the text and the footer share one width at every size; from 1024px wide the page's sections and Play now stand
   beside the text (.side, below), and the header and the footer span both */
main { max-width: 32em; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 24px 0 12px; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 2em 0 .5em; }
h2 .letter { font-size: .8em; color: var(--muted); font-weight: 600; margin-left: .35em; }
p, li { margin: 0 0 .9em; text-wrap: pretty; }   /* R16 polish 1: no one-word last lines */
h1, h2, h3 { text-wrap: balance; }
a { color: inherit; }
b { font-weight: 700; }
.lead { font-size: 1.08rem; }
.muted { color: var(--muted); }
code { background: rgba(127,127,127,.18); padding: 0 .3em; border-radius: 4px; }

/* the header: the game's icon and name go home; the four pages and Play beside them */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.brand img { width: 36px; height: 36px; border-radius: 8px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; font-size: .95rem; }
.top nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
/* R16-UI-12 (the round-16 UI audit: "FAQ" 29x32, "Play" 32x32): each page link a 44x44 target */
.top nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.top nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) { .top nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; } }
.top nav a.play { color: var(--ink); font-weight: 700; }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); }
footer p { margin: 0 0 .5em; }
footer a { white-space: nowrap; }   /* SEO-RANK: a link never breaks across lines ("New chess game" at 390 px) */

/* lists of rules, tables */
ul.rules { padding-left: 1.2em; }
ul.rules li { margin-bottom: .7em; }
table { border-collapse: collapse; width: 100%; max-width: 480px; margin: 0 0 1em; font-size: .95rem; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
th { font-weight: 700; }
thead th { color: var(--muted); font-weight: 600; font-size: .85rem; }
/* SEO-COMPARE: the large variants side by side, four columns that wrap at a phone's width; the cells read from the top,
   our own row in the ink's weight */
table.variants { max-width: none; font-size: .9rem; }
table.variants th, table.variants td { vertical-align: top; padding: 6px 8px; }
table.variants tbody th { font-weight: 600; }
table.variants tr.ours th, table.variants tr.ours td { font-weight: 700; }
/* at a phone's width the four columns fit the text column (390 and 320 wide): tighter cells, long names hyphenated */
@media (max-width: 480px) {
  table.variants { font-size: .85rem; }
  table.variants th, table.variants td { padding: 6px 4px; hyphens: auto; -webkit-hyphens: auto; }
  table.variants th:first-child { padding-left: 0; }
}
/* the smallest phones (320): a smaller face and tighter cells, so the longest word of each column still fits whole;
   one longer than its cell would break inside it rather than push the page sideways */
@media (max-width: 359px) {
  table.variants { font-size: .76rem; }
  table.variants th, table.variants td { padding: 6px 3px; overflow-wrap: break-word; }
  table.variants th:first-child { padding-left: 0; }
}
ul.sources { padding-left: 1.2em; font-size: .95rem; }
ul.sources li { margin-bottom: .4em; }

/* diagrams: an excerpt of the board, squares in the app's Classic colours, a dot per move and a ring per capture */
figure { margin: 0 0 1em; }
figcaption { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.diagram { display: block; width: 100%; max-width: 220px; height: auto; border: 2px solid var(--frame); border-radius: 4px; background: var(--sq-light); }
.diagram.wide { max-width: 300px; }
.diagram.start { max-width: 480px; border: 0; background: none; }
/* SEO-RANK: the whole empty board (the 12x12 page's queen) with its coordinates, framed as the starting position is */
.diagram.full { max-width: 400px; border: 0; background: none; }
.diagram.full .board { stroke: var(--frame); stroke-width: .12; }
.diagram .sql { fill: var(--sq-light); }
.diagram .sqd { fill: var(--sq-dark); }
.diagram .board { stroke: none; }
.diagram.start .board { stroke: var(--frame); stroke-width: .12; }
.diagram .dot { fill: var(--accent); stroke: var(--frame); stroke-width: .03; }
.diagram .ring { fill: none; stroke: var(--accent); stroke-width: .09; }
/* LEARN-DIAGRAM-PIECES: the pieces are <symbol>s drawn by <use>. A browser styles a use's copy in the use's own shadow
   tree, where no .diagram is an ancestor: under `.diagram .pw` every disc was the default black, White and Black alike.
   LEARN-REAL-PIECES (the owner, 2026-11-08): the discs are gone; each symbol is the game's default set's own art
   (scripts/learn-pieces.mjs copies it from apps/web/src/assets/cburnett.ts into one sprite per page), which paints
   itself: its fills and strokes are attributes, with no class and no currentColor. So no rule here may reach into a
   symbol, and none may hand a <use> a fill or a stroke to inherit (test/learn-pages.test.ts holds both;
   e2e/features.mjs reads a White and a Black piece's paint). The sprite takes no room in the page. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* the coordinates: files under the board, ranks beside it */
.diagram .coord { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: .34px; font-weight: 600; fill: var(--muted); text-anchor: middle; dominant-baseline: central; }

/* the pieces page: a diagram beside its words once the screen allows */
.piece { margin-top: 1.5em; }
.piece .facts { color: var(--muted); margin-top: -.4em; }
.piece-row { display: grid; gap: 12px 20px; grid-template-columns: 1fr; align-items: start; }
.piece-row figure { margin: 0; }
.piece-row .tip { font-size: .95rem; }
@media (min-width: 560px) {
  .piece-row { grid-template-columns: 220px 1fr; }
  .piece-row figure .wide { max-width: 220px; }
}

/* the FAQ: numbered questions, each a link target */
ol.faq { padding-left: 1.4em; }
ol.faq > li { margin: 0 0 1.6em; }
.faq-q { font-size: 1.1rem; margin: 0 0 .4em; }
.faq-a p { margin: 0 0 .6em; }

/* LEARN-LINKS: Play now and "On this page" (the page's h2s, each its anchor). Hidden on a phone and a tablet, where the
   page stays one column; from 1024px wide a second column beside the text, sticky at the top of the window while the
   text scrolls, Play now first so it never scrolls away (the FAQ's eleven questions can outgrow a short window: the
   column then scrolls on its own). The page's width becomes the text's 32em, a 3rem gap and the column's 16rem,
   centred, so the header above and the footer below span exactly the two. Plain CSS, no script: the lists are written
   in each page's HTML (test/learn-pages.test.ts holds each list to its page's h2s). */
.side { display: none; }
[id] { scroll-margin-top: 16px; }
@media (min-width: 1024px) {
  body { max-width: calc(32em + 3rem + 16rem); display: grid; grid-template-columns: minmax(0, 32em) 16rem; column-gap: 3rem; align-items: start; }
  body > .top, body > footer { grid-column: 1 / -1; }
  body > main { grid-column: 1; grid-row: 2; }
  .side {
    display: flex; flex-direction: column; align-items: flex-start; gap: 24px; grid-column: 2; grid-row: 2;
    position: sticky; top: 0; box-sizing: border-box; max-height: 100vh; overflow-y: auto; padding: 24px 0; font-size: .9rem;
  }
  .toc { align-self: stretch; }
  .toc-h { margin: 0 0 4px; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  .toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
  .toc li { margin: 0; }
  /* each section a 44px target (R16-UI-12's floor for the header's links): one line is 20px and 12px above and below, so
     every entry, one line or three, has the same 24px between its words and the next */
  .toc a { display: block; padding: 12px 0 12px 14px; margin-left: -1px; border-left: 2px solid transparent; line-height: 1.4;
    color: var(--muted); text-decoration: none; }
  .toc a:focus-visible { color: var(--ink); outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 4px; }
  @media (hover: hover) { .toc a:hover { color: var(--ink); border-left-color: var(--line); } }
  /* Play now: the one gold action, as the app's Play is; its ink stays dark on the gold in both appearances */
  .side-play { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 24px; border-radius: 10px;
    background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; }
  .side-play:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  @media (hover: hover) { .side-play:hover { filter: brightness(1.06); } }
}
