/* The guides (guide.html, the Match Coder's; guide-accounts.html, accounts and licences): one reading column on the site's tokens, light by default and dark with the
   device or data-theme, as the rest of the site. Prints to A4 on white paper */

.guide { max-width: 820px; margin: 0 auto; padding: 20px 24px 56px; }
.guide-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.guide-back { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
.guide-back:hover { background: var(--hover); }
.guide-back svg { width: 16px; height: 16px; }
.guide-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12px; font-weight: 700; }
.guide-brand img { width: 24px; height: 24px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }

.guide h1 { margin: 0 0 6px; font-size: 34px; font-style: italic; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.guide-lead { margin: 0 0 18px; color: var(--ink-2); font-size: 15px; text-wrap: pretty; }
.guide h2 { margin: 40px 0 10px; padding-top: 4px; font-size: 22px; font-style: italic; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; scroll-margin-top: 16px; }
.guide h2 .n { display: inline-grid; place-items: center; min-width: 30px; height: 30px; margin-right: 10px; padding: 0 6px; border-radius: 8px; background: var(--lime); color: var(--on-lime); font-size: 15px; font-style: normal; vertical-align: 3px; }
.guide h3 { margin: 22px 0 6px; font-size: 16px; font-weight: 800; scroll-margin-top: 16px; }
.guide p, .guide li { font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.guide p { margin: 0 0 10px; }
.guide ul, .guide ol { margin: 0 0 12px; padding-left: 22px; }
.guide li { margin: 0 0 5px; }
.guide li > ul { margin: 5px 0 0; }
.guide b, .guide strong { font-weight: 700; }
.guide a:not(.guide-back) { text-decoration: underline; text-decoration-thickness: max(1px, 0.065em); text-underline-offset: 0.22em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.guide a:not(.guide-back):hover { text-decoration-color: currentColor; }
.guide kbd { font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--tile); color: var(--ink); box-shadow: inset 0 -1px 0 var(--box-line); white-space: nowrap; }
.guide code { font-size: 13px; }

/* the contents: a card of anchors, two columns where there is room */
.guide-toc { margin: 0 0 8px; padding: 16px 20px; border-radius: var(--radius-lg); background: var(--card); }
.guide-toc h2 { margin: 0 0 8px; padding: 0; font-size: 13px; font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.guide-toc ol { columns: 2; column-gap: 28px; margin: 0; padding-left: 22px; }
.guide-toc li { margin: 0 0 4px; break-inside: avoid; font-size: 14px; }
.guide-toc a { text-decoration-color: transparent !important; }
.guide-toc a:hover { text-decoration-color: currentColor !important; }

/* "What's new": the release notes, in a card */
.guide-new { padding: 4px 20px 10px; border-radius: var(--radius-lg); background: var(--card); }
.guide-new h2 { margin-top: 18px; }
.guide-when { margin: -4px 0 10px; color: var(--ink-3); font-size: 13px; font-weight: 600; }

/* a note to keep in mind */
.guide-note { margin: 12px 0; padding: 12px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--lime) 22%, var(--card)); }
.guide-note.warn { background: color-mix(in srgb, var(--red) 12%, var(--card)); }
.guide-note p:last-child, .guide-note ul:last-child { margin-bottom: 0; }

/* the screenshots: the whole width of the column, with a line round them; offline without them, the caption and
   the alt text still say what they show */
.guide figure { margin: 14px 0 18px; }
.guide figure img { width: 100%; height: auto; border-radius: var(--radius-sm); background: var(--tile); box-shadow: 0 0 0 1px var(--box-line); }
.guide figure.narrow img { width: min(100%, 560px); }
.guide figcaption { margin-top: 6px; color: var(--ink-3); font-size: 13px; line-height: 1.4; text-wrap: pretty; }

/* tables: the roles and the keys */
.guide-table { width: 100%; margin: 8px 0 16px; border-collapse: collapse; overflow: hidden; border-radius: var(--radius); background: var(--card); font-size: 14px; }
.guide-table th, .guide-table td { padding: 8px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.45; }
.guide-table thead th { border-top: 0; color: var(--ink-3); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.guide-table td:first-child { white-space: nowrap; }
.guide-table .yes { color: var(--live); font-weight: 800; }
.guide-table .no { color: var(--ink-3); }
.guide-table th[scope="rowgroup"] { padding-top: 12px; background: var(--tile); color: var(--ink); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.guide-wide { overflow-x: auto; }

.guide-foot { margin-top: 40px; color: var(--ink-3); font-size: 13px; }

/* a screenshot narrower than the column (a small dialog, a corner of the screen) keeps its own size */
.guide figure.small img { width: auto; max-width: 100%; }

/* the accounts guide: who's who (PSA, then the clubs with their licence, people and laptop places), the facts under
   it, the one activation step and the key in its own type. Every box draws its line inside itself (an inset shadow)
   and the columns may shrink (minmax(0, 1fr)), so no line or corner falls outside the column, where a page's edge
   cuts it */
.ga-map { margin: 14px 0 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ga-map > *, .ga-club, .ga-facts li { min-width: 0; box-sizing: border-box; }
.ga-psa, .ga-club { padding: 14px 16px; border-radius: var(--radius-lg); background: var(--card); box-shadow: inset 0 0 0 1px var(--box-line); }
.ga-psa { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.ga-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px !important; }
.ga-head b { font-size: 18px; font-style: italic; font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; }
.ga-tag { padding: 2px 9px; border-radius: 999px; background: var(--tile); color: var(--ink-2); font-size: 12px; font-weight: 700; }
.ga-psa .ga-tag { background: var(--lime); color: var(--on-lime); }
.ga-psa ul { margin: 0; padding-left: 20px; columns: 2; column-gap: 24px; }
.ga-psa li { margin: 0 0 3px; font-size: 14px; break-inside: avoid; }
.ga-clubs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.ga-lic { margin: 0 0 8px !important; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--tile); font-size: 13px !important; line-height: 1.4 !important; }
.ga-lic span { display: block; }
.ga-key { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.ga-lic .ga-key { font-size: 13.5px; }
.ga-people { list-style: none; margin: 0 0 6px !important; padding: 0 !important; }
.ga-people li { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; padding: 6px 8px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line); font-size: 13.5px; line-height: 1.3; }
.ga-people li b { font-weight: 700; }
.ga-chip { margin-left: auto; flex: none; padding: 2px 8px; border-radius: 999px; background: var(--tile); color: var(--ink-3); font-size: 12px; font-weight: 700; white-space: nowrap; }
.ga-chip.on { background: color-mix(in srgb, var(--lime) 45%, var(--card)); color: var(--ink); }
.ga-chip.no { background: color-mix(in srgb, var(--red) 16%, var(--card)); color: var(--red); }
.ga-places { margin: 0 !important; color: var(--ink-3); font-size: 13px !important; }
.ga-facts { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 0 0 14px !important; padding: 0 !important; }
.ga-facts li { margin: 0; padding: 10px 14px; border-radius: var(--radius); background: var(--card); font-size: 14px; line-height: 1.45; }
.ga-step { margin: 8px 0 12px; padding: 12px 16px 4px; border-radius: var(--radius); background: color-mix(in srgb, var(--lime) 22%, var(--card)); }
.ga-locks td:first-child { white-space: normal; width: 30%; }

@media screen and (max-width: 760px) {
  .guide { padding: 14px 16px 40px; }
  .ga-clubs, .ga-facts { grid-template-columns: minmax(0, 1fr); }
  .ga-psa ul { columns: 1; }
  .guide h1 { font-size: 28px; }
  .guide h2 { margin-top: 32px; font-size: 20px; }
  .guide-toc h2 { margin: 0 0 8px; font-size: 13px; }
  .guide-new h2 { margin-top: 16px; }
  .guide p, .guide li { font-size: 15px; }
  .guide-toc { padding: 14px 16px; }
  .guide-toc ol { columns: 1; }
  .guide-new { padding: 2px 16px 8px; }
  .guide-brand span { display: none; }
  .guide-table { font-size: 13.5px; }
  .guide-table th, .guide-table td { padding: 7px 9px; }
  .guide-table td:first-child { white-space: normal; }
}

@media print {
  @page { size: A4; margin: 14mm 15mm 16mm; }
  /* light paper whatever the device or the setting: these beat the dark rules */
  :root:not(#guide-print) {
    color-scheme: light;
    --page: #ffffff; --card: #ffffff; --tile: #f0f0f3; --ink: #0b0b0c; --ink-2: #3a3a3e; --ink-3: #6e6e73;
    --line: #e5e5ea; --box: #f0f0f3; --box-line: #d9d9de; --live: #3d7a0a; --red: #e5484d;
  }
  html, body { background: #fff !important; }
  .guide { max-width: none; padding: 0; }
  .guide-top { margin-bottom: 8px; }
  .guide-back { padding: 0; background: none; }
  .guide-back svg { display: none; }
  .guide h1 { font-size: 26pt; }
  .guide h2 { margin-top: 18pt; font-size: 16pt; break-after: avoid; page-break-after: avoid; }
  .guide-toc h2 { margin: 0 0 6pt; font-size: 9pt; }
  .guide-new h2 { margin-top: 10pt; }
  .guide h3 { break-after: avoid; page-break-after: avoid; }
  .guide p, .guide li { font-size: 10.5pt; line-height: 1.45; orphans: 3; widows: 3; }
  .guide-toc, .guide-new { padding: 0; border-radius: 0; }
  .guide-toc { padding: 8pt 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .guide-new { border-bottom: 1px solid var(--line); padding-bottom: 6pt; }
  .guide-note { border: 1px solid var(--box-line); }
  .guide figure { break-inside: avoid; page-break-inside: avoid; }
  .guide figure img { width: 88%; }
  .guide figure.narrow img { width: 62%; }
  .guide-table { break-inside: auto; font-size: 9.5pt; border: 1px solid var(--line); }
  .guide-table tr { break-inside: avoid; page-break-inside: avoid; }
  .guide-table tr:has(th[scope="rowgroup"]) { break-after: avoid; page-break-after: avoid; }
  .guide a { text-decoration: none !important; }
  /* the accounts guide: each part on a new page; the map on white with lines, not a black block */
  .guide-accounts h2.part { break-before: page; page-break-before: always; margin-top: 0; }
  .guide figure.small img { width: auto; max-width: 70%; }
  .ga-map, .ga-club, .ga-facts li, .ga-step { break-inside: avoid; page-break-inside: avoid; }
  .ga-psa { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
  .ga-psa .ga-tag { box-shadow: inset 0 0 0 1px var(--ink); }
  .ga-facts li, .ga-step { box-shadow: inset 0 0 0 1px var(--box-line); }
  /* a hair inside the page's edge, which the PDF cuts a pixel or two early */
  .ga-map, .ga-facts { padding-left: 1mm !important; padding-right: 1mm !important; }
  .ga-psa li, .ga-people li, .ga-facts li { font-size: 9.5pt; }
  .ga-facts { gap: 6px; }
  .ga-facts li { padding: 7px 12px; line-height: 1.35; }
}
