/*
 * ClaimWarden public site: the one stylesheet every page links.
 *
 * Plain CSS with system fonts, no scripts and nothing fetched from another
 * host, so the pages work under a Content-Security-Policy of
 * style-src 'self' (an inline <style> or style="" would be refused there).
 * Colours are tokens on :root with a dark set under prefers-color-scheme;
 * the two theme-color metas in each page repeat --bg for the browser chrome.
 */
:root {
  --bg: #fbfaf7;
  --fg: #1d1f22;
  --muted: #5c6168;
  --accent: #1f6f50;
  --accent-ink: #ffffff;
  --accent-soft: #e6f1ec;
  --line: #e4e1da;
  --surface: #ffffff;
  --warn: #9a6a00;
  --warn-soft: #fff3c4;
  --warn-ink: #5a4500;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141618;
    --fg: #e8e6e1;
    --muted: #a3a7ad;
    --accent: #5cc49a;
    --accent-ink: #0b2a1e;
    --accent-soft: #18261f;
    --line: #2a2d31;
    --surface: #1b1e21;
    --warn: #d9a93f;
    --warn-soft: #2b2414;
    --warn-ink: #f0dca4;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

/* Keyboard focus is always visible, in both themes. */
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* The skip link sits off screen until a keyboard user tabs to it. */
.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* Header: the mark and name, then the main navigation, wrapping on phones. */
.masthead { border-bottom: 1px solid var(--line); }
.masthead .wrap,
.colophon .wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
}
.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.brand svg { width: 28px; height: 28px; flex: none; }
.brand .shield { fill: var(--accent); }
.brand .clock { fill: none; stroke: var(--accent-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.masthead ul,
.colophon ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}
.masthead nav a { color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--accent); text-decoration: underline; }
.masthead nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }

/* Reading column. The landing page is a little wider for the plan cards. */
main {
  display: block;
  flex: 1 0 auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}
main.wide { max-width: 880px; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 1.15rem; line-height: 1.35; margin: 32px 0 8px; }
h3 { font-size: 1rem; margin: 0 0 4px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }
.muted, .meta { color: var(--muted); }
.meta { font-size: .92rem; margin-bottom: 24px; }
.lead { font-size: 1.1rem; color: var(--muted); }
code {
  font: .9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--accent-soft);
  color: var(--fg);
  padding: 1px 5px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

/* Release status on the landing page. */
.status {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--warn);
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-size: .9rem;
  font-weight: 600;
}

/* Boxes: the draft banner on legal pages, warnings, and short summaries. */
.draft, .caution, .summary {
  border-radius: 6px;
  padding: 12px 16px;
  margin: 0 0 24px;
}
.draft { border: 1px solid var(--warn); border-left-width: 6px; background: var(--warn-soft); }
.draft p { color: var(--warn-ink); }
.caution { border-left: 4px solid var(--warn); background: var(--surface); }
.summary { border-left: 4px solid var(--accent); background: var(--accent-soft); }
.draft p:last-child, .caution p:last-child, .summary p:last-child { margin-bottom: 0; }

/* An unfinished value the owner still has to supply. */
.todo { background: var(--warn-soft); color: var(--warn-ink); padding: 0 4px; border-radius: 3px; }

/* Tables scroll sideways inside their own box, never the whole page. */
.table-wrap { overflow-x: auto; margin: 8px 0 16px; }
table { border-collapse: collapse; width: 100%; }
caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
td ul { margin: 0; }

/* Plan cards on the landing page: one column on phones, two side by side. */
.plans {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 600px) { .plans { grid-template-columns: 1fr 1fr; } }
.plans > li {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.plans ul { margin: 8px 0 0; }

/* Questions and answers on the support page. */
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
details > :not(summary) { margin-top: 10px; }

/* Footer: the legal and help links, the operator and the contact address. */
.colophon {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .92rem;
}
.colophon .wrap { padding-bottom: 32px; }
.colophon ul { margin-bottom: 10px; }
.colophon p { margin: 0; }

@media (max-width: 480px) {
  main { padding-top: 28px; }
  h1 { font-size: 1.6rem; }
}

/* Printed pages: no navigation, black on white, and link targets spelled out. */
@media print {
  .skip, .masthead nav, .colophon nav { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  main a[href^="http"]::after, main a[href^="mailto:"]::after { content: " (" attr(href) ")"; }
  main a[href^="/"]::after { content: " (https://claimwarden.drbyte.org" attr(href) ")"; }
  .draft, .caution, .summary, .status { background: none; border-color: #000; color: #000; }
  .draft p { color: #000; }
  .table-wrap { overflow: visible; }
}
