/* ClearPrep Beta documentation. Typography and colour per STYLE.md: the console's own faces
   (Inter for text, Fraunces for the article title) and the console's OKLCH tokens. Fonts are
   self-hosted; nothing is fetched from a font CDN. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --cp-font-text: "Inter Variable", Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --cp-font-display: "Fraunces Variable", Fraunces, Georgia, "Times New Roman", serif;
  --cp-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --cp-background: oklch(0.965 0.012 85);
  --cp-surface: oklch(0.99 0.006 85);
  --cp-text: oklch(0.27 0.06 262);
  --cp-primary: oklch(0.34 0.08 262);
  --cp-muted: oklch(0.5 0.03 262);
  --cp-border: oklch(0.88 0.012 80);
  --cp-gold: oklch(0.78 0.14 82);
  --cp-gold-deep: oklch(0.62 0.13 74);
  --cp-gold-soft: oklch(0.94 0.055 88);
  --cp-verified: oklch(0.48 0.1 160);
  --cp-blocking: oklch(0.58 0.18 20);

  --md-text-font: var(--cp-font-text);
  --md-code-font: var(--cp-font-mono);
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: var(--cp-primary);
  --md-primary-fg-color--light: oklch(0.44 0.08 262);
  --md-primary-fg-color--dark: oklch(0.27 0.06 262);
  --md-primary-bg-color: oklch(0.975 0.01 85);
  --md-accent-fg-color: var(--cp-gold-deep);
  --md-default-bg-color: var(--cp-background);
  --md-default-fg-color: var(--cp-text);
  --md-default-fg-color--light: var(--cp-muted);
  --md-default-fg-color--lighter: oklch(0.7 0.02 262);
  --md-default-fg-color--lightest: var(--cp-border);
  --md-typeset-a-color: var(--cp-primary);
  --md-code-bg-color: oklch(0.94 0.012 85);
  --md-footer-bg-color: var(--cp-primary);
}

[data-md-color-scheme="slate"] {
  --cp-background: oklch(0.21 0.03 262);
  --cp-surface: oklch(0.25 0.03 262);
  --cp-text: oklch(0.93 0.01 85);
  --cp-primary: oklch(0.18 0.03 262);
  --cp-muted: oklch(0.72 0.02 262);
  --cp-border: oklch(0.34 0.03 262);
  --cp-gold: oklch(0.8 0.13 82);
  --cp-gold-deep: oklch(0.72 0.13 78);
  --cp-gold-soft: oklch(0.32 0.05 85);
  --md-primary-fg-color: var(--cp-primary);
  --md-accent-fg-color: var(--cp-gold);
  --md-default-bg-color: var(--cp-background);
  --md-default-fg-color: var(--cp-text);
  --md-default-fg-color--light: var(--cp-muted);
  --md-typeset-a-color: var(--cp-gold);
  --md-code-bg-color: oklch(0.27 0.03 262);
}

/* Type scale (STYLE.md §2). Material sets the root at 125 % = 20 px, so sizes below are
   written in px-equivalent rem: 0.75rem = 15 px body, 1.4rem = 28 px article title. */
.md-typeset {
  font-size: 0.75rem;
  line-height: 1.55;
}
.md-typeset h1 {
  font-family: var(--cp-font-display);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--md-default-fg-color);
  margin-bottom: 0.5em;
}
.md-typeset h2 {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}
.md-typeset h3 {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.35;
}
.md-typeset p,
.md-typeset li {
  max-width: 72ch;
}
.md-typeset code {
  font-size: 0.675rem;
}
.md-typeset table:not([class]) {
  font-size: 0.7rem;
  line-height: 1.45;
  background: var(--cp-surface);
}
.md-typeset table:not([class]) th {
  background: var(--cp-gold-soft);
  color: var(--md-default-fg-color);
  font-weight: 600;
}
.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  padding: 0.55em 0.8em;
}
.md-typeset .admonition {
  font-size: 0.7rem;
}

/* Summary under the title. */
.cp-summary {
  font-size: 0.75rem;
  color: var(--md-default-fg-color);
  margin: 0 0 1.4em;
  padding-bottom: 0.8em;
  border-bottom: 1px solid var(--cp-border);
}
/* A figure: the screenshot, then its caption. */
/* Figures are shown large: the page has no right-hand table of contents, the content column
   is wide, and build/annotate.py crops each figure to its labelled region. */
.md-sidebar--secondary { display: none !important; }
figure.cp-figure {
  width: auto;       /* Material gives figures fit-content; the figure takes the whole column */
  max-width: none;
  margin: 1.2rem 0 1.6rem;
  padding: 0.6rem;
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: 6px;
}
figure.cp-figure p {
  max-width: none;   /* the Markdown block wraps the image in a paragraph; no 72ch cap here */
  margin: 0;
}
figure.cp-figure img {
  display: block;
  width: auto;        /* a figure is shown at its own pixel size, never enlarged */
  max-width: 100%;    /* and shrinks only when the column is narrower */
  margin: 0 auto;
  border: 1px solid var(--cp-border);
  border-radius: 4px;
}
figure.cp-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.65rem;
  line-height: 1.45;
  color: var(--cp-muted);
  text-align: left;
  max-width: none;
}
figure.cp-figure figcaption strong {
  color: var(--md-default-fg-color);
}

/* A numbered callout badge referenced in the step text. */
.co {
  display: inline-block;
  min-width: 1.35em;
  height: 1.35em;
  line-height: 1.35em;
  margin: 0 0.1em;
  text-align: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: oklch(0.2 0.05 262);
  background: var(--cp-gold);
  border-radius: 50%;
  vertical-align: 0.1em;
}

/* Result block after a step. */
.result {
  margin: 0.5rem 0 1rem 0;
  padding: 0.5rem 0.8rem;
  border-left: 3px solid var(--cp-gold);
  background: var(--cp-surface);
  font-size: 0.7rem;
  max-width: 72ch;
}
.result strong:first-child {
  color: var(--md-default-fg-color);
}

/* Callouts: four types, one meaning each (STYLE.md §6). */
.md-typeset .admonition.note,
.md-typeset details.note {
  border-color: var(--cp-primary);
}
.md-typeset .note > .admonition-title {
  background-color: oklch(0.94 0.012 262);
}
.md-typeset .note > .admonition-title::before {
  background-color: var(--cp-primary);
}
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: var(--cp-verified);
}
.md-typeset .tip > .admonition-title {
  background-color: oklch(0.93 0.04 160);
}
.md-typeset .tip > .admonition-title::before {
  background-color: var(--cp-verified);
}
.md-typeset .admonition.important,
.md-typeset details.important {
  border-color: var(--cp-gold-deep);
}
.md-typeset .important > .admonition-title {
  background-color: var(--cp-gold-soft);
}
.md-typeset .important > .admonition-title::before {
  background-color: var(--cp-gold-deep);
  -webkit-mask-image: var(--md-admonition-icon--important);
  mask-image: var(--md-admonition-icon--important);
}
.md-typeset .admonition.warning,
.md-typeset details.warning {
  border-color: var(--cp-blocking);
}
.md-typeset .warning > .admonition-title {
  background-color: oklch(0.95 0.03 20);
}
.md-typeset .warning > .admonition-title::before {
  background-color: var(--cp-blocking);
}
:root {
  --md-admonition-icon--important: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>');
}
[data-md-color-scheme="slate"] .md-typeset .note > .admonition-title { background-color: oklch(0.28 0.04 262); }
[data-md-color-scheme="slate"] .md-typeset .tip > .admonition-title { background-color: oklch(0.28 0.04 160); }
[data-md-color-scheme="slate"] .md-typeset .warning > .admonition-title { background-color: oklch(0.3 0.05 20); }

/* Article footer: document identifier, version, revision, status. */
.cp-footer {
  margin-top: 2.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--cp-border);
  font-size: 0.6rem;
  color: var(--cp-muted);
  max-width: none;
}

/* Layout: use the viewport width instead of Material's centred 61 rem grid; narrow sidebars. */
.md-grid {
  max-width: 100%;
}
.md-header__inner.md-grid,
.md-main__inner.md-grid {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}
.md-sidebar {
  width: 11rem;
}
.md-sidebar--secondary {
  width: 10rem;
}
.md-nav--primary .md-nav__title {
  display: none;
}
.md-nav__item .md-nav__link {
  margin-top: 0.3em;
}
.md-content {
  max-width: none;
}
.md-content__inner {
  margin-left: 1.2rem;
  margin-right: 1.2rem;
  padding-top: 0.6rem;
}
.md-content__inner::before {
  height: 0;
}
.md-typeset table:not([class]) {
  display: table;
  width: 100%;
}

/* Navigation: section labels set apart, items indented under a rule, breathing room. */
.md-nav--primary .md-nav__list {
  padding-bottom: 0.2rem;
}
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link {
  margin-top: 0.4rem;
}
.md-nav--primary .md-nav__item--section > .md-nav__link {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cp-muted);
  margin-top: 1.1rem;
  margin-bottom: 0.2rem;
}
.md-nav--primary .md-nav__item--section > .md-nav {
  margin-left: 0.15rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--cp-border);
}
.md-nav--primary .md-nav__item--section .md-nav__item .md-nav__link {
  margin-top: 0.18rem;
  padding: 0.12rem 0;
  font-size: 0.68rem;
  line-height: 1.35;
}
.md-nav--primary .md-nav__link--active {
  font-weight: 600;
}
.md-nav--secondary .md-nav__title {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cp-muted);
}

/* Pager at the end of every article (build/pager.py). */
.cp-pager {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 2.2rem 0 0.4rem;
  max-width: none;
}
.cp-pager > p {
  display: contents; /* the Markdown block wraps the two links in a paragraph */
}
.cp-pager a {
  display: inline-flex;
  flex-direction: column;
  min-width: 11rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--cp-border);
  border-radius: 6px;
  background: var(--cp-surface);
  color: var(--md-default-fg-color);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.cp-pager a span {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cp-muted);
  margin-bottom: 0.15rem;
}
.cp-pager__next {
  margin-left: auto;
  text-align: right;
  align-items: flex-end;
  background: var(--md-primary-fg-color) !important;
  color: oklch(0.975 0.01 85) !important;
  border-color: var(--md-primary-fg-color) !important;
}
.cp-pager__next span {
  color: var(--cp-gold) !important;
}
.cp-pager a:hover {
  border-color: var(--cp-gold-deep);
}

/* Coverage table: colour-coded group rows (one tint per group, same lightness and chroma). */
.md-typeset table.cp-groups {
  width: 100%;
  font-size: 0.7rem;
  border-collapse: collapse;
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
}
.md-typeset table.cp-groups th,
.md-typeset table.cp-groups td {
  padding: 0.45em 0.8em;
  border-bottom: 1px solid var(--cp-border);
  text-align: left;
}
.md-typeset table.cp-groups thead th {
  background: var(--cp-gold-soft);
  font-weight: 600;
}
.md-typeset table.cp-groups td:not(:first-child),
.md-typeset table.cp-groups thead th:not(:first-child) {
  text-align: center;
  width: 5.5rem;
}
.md-typeset table.cp-groups tr.cp-group th {
  font-weight: 600;
  color: var(--md-default-fg-color);
  border-left: 4px solid var(--cp-group-accent);
  background: var(--cp-group-tint);
}
.cp-group-1 { --cp-group-tint: oklch(0.94 0.045 85);  --cp-group-accent: oklch(0.62 0.13 74); }  /* wages: gold */
.cp-group-2 { --cp-group-tint: oklch(0.94 0.04 250);  --cp-group-accent: oklch(0.5 0.12 250); }  /* interest, dividends: blue */
.cp-group-3 { --cp-group-tint: oklch(0.94 0.04 160);  --cp-group-accent: oklch(0.48 0.1 160); }  /* other income: green */
.cp-group-4 { --cp-group-tint: oklch(0.94 0.04 300);  --cp-group-accent: oklch(0.5 0.12 300); }  /* partnerships, trusts: violet */
.cp-group-5 { --cp-group-tint: oklch(0.94 0.04 200);  --cp-group-accent: oklch(0.5 0.1 200); }   /* mortgage, education, health: teal */
.cp-group-6 { --cp-group-tint: oklch(0.94 0.04 55);   --cp-group-accent: oklch(0.6 0.16 55); }   /* estimated payments: amber */
.cp-group-7 { --cp-group-tint: oklch(0.94 0.035 20);  --cp-group-accent: oklch(0.58 0.14 20); }  /* stock plans, foreign: rose */
.cp-group-8 { --cp-group-tint: oklch(0.93 0.01 262);  --cp-group-accent: oklch(0.5 0.03 262); }  /* other: slate */
[data-md-color-scheme="slate"] .cp-group-1 { --cp-group-tint: oklch(0.3 0.05 85); }
[data-md-color-scheme="slate"] .cp-group-2 { --cp-group-tint: oklch(0.3 0.05 250); }
[data-md-color-scheme="slate"] .cp-group-3 { --cp-group-tint: oklch(0.3 0.05 160); }
[data-md-color-scheme="slate"] .cp-group-4 { --cp-group-tint: oklch(0.3 0.05 300); }
[data-md-color-scheme="slate"] .cp-group-5 { --cp-group-tint: oklch(0.3 0.05 200); }
[data-md-color-scheme="slate"] .cp-group-6 { --cp-group-tint: oklch(0.3 0.05 55); }
[data-md-color-scheme="slate"] .cp-group-7 { --cp-group-tint: oklch(0.3 0.05 20); }
[data-md-color-scheme="slate"] .cp-group-8 { --cp-group-tint: oklch(0.28 0.02 262); }

/* FAQ: each question is a collapsible block; the question is the heading, the answer opens on selection. */
.md-typeset details.faq {
  border: 1px solid var(--cp-border);
  border-left: 3px solid var(--cp-gold);
  border-radius: 4px;
  background: var(--cp-surface);
  box-shadow: none;
  margin: 0.45em 0;
  font-size: 0.72rem;
}
.md-typeset details.faq > summary {
  padding: 0.55em 2.2em 0.55em 0.9em;
  background: transparent;
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--md-default-fg-color);
}
.md-typeset details.faq > summary::before {
  display: none;
}
.md-typeset details.faq > summary::after {
  right: 0.7em;
  color: var(--cp-muted);
}
.md-typeset details.faq[open] > summary {
  border-bottom: 1px solid var(--cp-border);
}
.md-typeset details.faq > p,
.md-typeset details.faq > ul {
  padding: 0 0.9em;
  margin: 0.6em 0;
}

/* The demo video at the top of the worked example */
figure.cp-video video {
  display: block;
  width: 100%;
  border: 1px solid var(--cp-rule, #d9d4c7);
  border-radius: 6px;
  background: #1f2a44;
}
