/* The shared CSS of both sites. The build adds the wrap rules of checks/wrap.css after it.
   1 change of layout: below 720px the page takes its phone layout. */

@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/source-sans-3-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/source-sans-3-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/source-sans-3-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Code Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/source-code-pro-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Source Code Pro'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/source-code-pro-latin-500-normal.woff2) format('woff2'); }

:root {
  --text: #31333f;
  --grey: #5a5d6a;
  --line: #dcdfe6;
  --soft: #e6e8ee;
  --red: #d92d2d;
  --blue: #1b32d1;
  --orange: #ffe2bd;
  --band: #f7f8fa;
  --pale: #e8ecfc;
  --band2: #f2f4f9;
  --dark: #31333f;
  --dark-text: #c9cbd3;
  --teal: #0f766e;
  --amber: #a16207;
  --purple: #7c3aed;
  --orange-i: #c2410c;
  --pink: #be185d;
  --sky: #0369a1;
  --green: #137a3a;
  --sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Source Code Pro', ui-monospace, Menlo, Consolas, monospace;
  /* The side space of the pubstad.com boards: 120px at 1440, never under 40px, 24px on a phone. */
  --side: max(40px, calc((100% - 1200px) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #ffffff; color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; overflow-wrap: break-word; }
h1, h2, h3, h4, p, ul, ol, figure, pre, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
code, kbd, pre { font-family: var(--mono); }

/* Every link and button shows a visible outline when it has the keyboard focus. */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
.btn-red:focus-visible, .btn-blue:focus-visible { outline-color: var(--text); }
.dark a:focus-visible, .dark button:focus-visible { outline-color: #ffffff; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 8px 14px; background: #ffffff; border: 1px solid var(--line); }
.skip:focus { top: 12px; }

/* ----- buttons. Buttons side by side have the same width. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; border: 1px solid var(--line); background: #ffffff; color: var(--text); cursor: pointer; }
.btn-red { background: var(--red); border-color: var(--red); color: #ffffff; }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #ffffff; }
.btn .icon { flex: 0 0 auto; }
/* A quiet label in the place of a button: no link, no hover, no pointer. It keeps the size of the button next to it. */
.btn-soon { background: var(--band); border-color: var(--soft); color: var(--grey); font-weight: 400; cursor: default; }
.btn-soon-dark { background: transparent; border-color: #5a5d6a; color: #c9cbd3; }

/* ----- a filled square that holds a number */
.sq { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: var(--sq, 22px); height: var(--sq, 22px); background: var(--blue); color: #ffffff; font-family: var(--mono); font-size: calc(var(--sq, 22px) * 0.52); font-weight: 500; line-height: 1; }

/* ----- the top bars */
/* The bar stays in view while the page scrolls, on the page background with its bottom line. --bar is its height,
   and every section and every target of a link keeps that much room above it, so the bar never hides a heading. */
:root { --bar: 64px; }
html:has(.top-pubstad) { --bar: 72px; }
html:has(.top-protocol0) { --bar: 64px; }
section, [id] { scroll-margin-top: var(--bar); }
.top { position: sticky; top: 0; z-index: 20; background: #ffffff; display: flex; align-items: center; border-bottom: 1px solid var(--soft); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.top-nav { display: flex; }
.top-nav a { text-decoration: none; white-space: nowrap; }
.top-nav a[aria-current="page"] { font-weight: 600; }
.menu { display: none; }

.top-pubstad { height: 72px; gap: clamp(20px, 2.5vw, 36px); padding: 0 var(--side); }
.top-pubstad .brand-name { font-size: 18px; font-weight: 700; }
.top-pubstad .top-nav { gap: clamp(16px, 1.95vw, 28px); font-size: 15px; }
.top-pubstad .top-end { margin-left: auto; }
.top-pubstad .top-btn { width: 150px; }

.top-protocol0 { height: 64px; gap: clamp(14px, 2.2vw, 32px); padding: 0 clamp(24px, 2.8vw, 40px); border-bottom-color: var(--line); }
.top-protocol0 .brand-name { font-size: 17px; font-weight: 500; }
.top-protocol0 .version { font-size: 12.5px; color: var(--green); padding: 3px 8px; background: #f0f2f6; white-space: nowrap; }
.top-protocol0 .top-nav { margin-left: auto; gap: clamp(14px, 1.8vw, 26px); font-size: 15px; align-self: stretch; }
.top-protocol0 .top-nav a { display: flex; align-items: center; }
.top-protocol0 .top-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--blue); }
.top-gh { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; text-decoration: none; white-space: nowrap; }
.top-protocol0 .top-btn { width: 140px; height: 38px; }

/* ----- the footers */
.foot { color: var(--grey); }
.foot a { color: var(--text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-pubstad .foot-in { display: flex; flex-wrap: wrap; gap: 32px 64px; padding: 44px var(--side) 52px; font-size: 14px; }
.foot-pubstad .foot-title { font-weight: 600; margin-bottom: 6px; color: var(--text); }
.foot-pubstad .foot-col > div { line-height: 1.9; white-space: nowrap; }
.foot-pubstad .foot-col a { color: var(--grey); text-decoration: none; }
.foot-pubstad .foot-col a:hover { text-decoration: underline; }
.foot-pubstad .foot-side { margin-left: auto; flex: 1 1 260px; max-width: 320px; }
.foot-pubstad .foot-side .foot-links { margin-top: 6px; }
.foot-pubstad.foot-short .foot-in { display: block; padding: 36px var(--side) 44px; }
.foot-pubstad.foot-short .foot-links { margin-top: 6px; }
.phone-only { display: none; }

.foot-protocol0 { border-top: 1px solid var(--line); }
.foot-protocol0 .foot-in { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; padding: 28px clamp(24px, 2.8vw, 40px) 36px; font-size: 13.5px; }
.foot-protocol0 .foot-line2 { margin-top: 4px; }
.foot-protocol0 .foot-licence { margin-top: 4px; }
.foot-protocol0 .foot-links { flex-wrap: nowrap; white-space: nowrap; }

/* ----- code blocks */
figure.code { position: relative; border: 1px solid var(--line); background: #ffffff; }
figure.code pre { overflow-x: auto; padding: 20px 20px; font-size: 13px; line-height: 1.7; tab-size: 2; }
figure.code figcaption { padding: 10px 20px 0; font-size: 13px; color: var(--grey); }
figure.code .k { color: var(--blue); }
figure.code .s { color: var(--green); }
figure.code .c { color: var(--grey); }
figure.code .copy { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12.5px; background: #ffffff; border: 1px solid var(--line); color: var(--grey); cursor: pointer; }
figure.code .copy:hover { color: var(--text); }
figure.code.out { background: var(--band); }
figure.code.out pre { padding-top: 6px; }

/* ----- the phone layout */
@media (max-width: 719px) {
  :root { --side: 24px; }
  .top-nav, .top-end, .top-btn, .top-gh, .top .version { display: none; }
  .top-pubstad, .top-protocol0 { height: 56px; padding: 0 24px; gap: 10px; }
  :root, html:has(.top-pubstad), html:has(.top-protocol0) { --bar: 56px; }
  .top-pubstad .brand-name { font-size: 18px; }
  .menu { display: block; margin-left: auto; }
  .menu summary { list-style: none; cursor: pointer; padding: 6px; margin-right: -6px; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; display: flex; flex-direction: column; padding: 8px 24px 16px; background: #ffffff; border-bottom: 1px solid var(--line); font-size: 16px; }
  .menu-list a { padding: 10px 0; text-decoration: none; white-space: nowrap; }
  .menu-list a[aria-current="page"] { font-weight: 600; }

  .foot-pubstad .foot-in { display: block; padding: 32px 24px 40px; font-size: 13.5px; }
  .foot-pubstad .foot-col { display: none; }
  .foot-pubstad .foot-side { margin-left: 0; max-width: none; }
  .foot-pubstad .foot-links { flex-direction: column; gap: 4px; }
  .phone-only { display: inline; }
  .foot-protocol0 .foot-in { display: block; padding: 24px 24px 36px; font-size: 13px; }
  .foot-protocol0 .foot-line2 { display: none; }
  .foot-protocol0 .foot-links { flex-direction: column; gap: 8px; margin-top: 8px; white-space: normal; }
  figure.code pre { padding: 16px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}

/* ----- the text of files of the repository (markdown): tables in a box of their own, and the wrap rules on
   every tag that holds text, so no line ends with 1 word alone. */
td, th, li, a, dd, dt, figcaption, label, blockquote { text-wrap-style: pretty; }
.md-table { overflow-x: auto; max-width: 100%; margin-top: 14px; }
.md-table table { border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.md-table th, .md-table td { padding: 8px 12px; border: 1px solid #dcdfe6; text-align: left; vertical-align: top; min-width: 160px; }
.md-table td:not(.nw) { min-width: 240px; }
.nw { white-space: nowrap; }

/* The wrap rules every page uses, so that no heading or line ends with 1 word alone.
   Use the longhand text-wrap-style, because the shorthand text-wrap also resets white-space. */
p, li, div, span { text-wrap-style: pretty; }
h1, h2, h3, h4, .title { text-wrap-style: balance; }
