/*
 * Re-skins MkDocs Material to match the wireframe site (docs/spec/styles.css):
 * warm-paper surfaces, near-black warm ink, system type, compact sizing, a blue
 * accent, and thin borders. Done entirely by overriding Material's CSS variables
 * plus a few typeset rules, so the theme's behaviour is untouched.
 */

/* ---- Light scheme: the wireframe "paper" look ---------------------------- */
[data-md-color-scheme="default"] {
  --md-default-bg-color: #faf9f5;          /* surface-1 (page)  */
  --md-default-bg-color--light: #f4f3ee;   /* surface-0         */
  --md-default-bg-color--lighter: #f4f3ee;
  --md-default-fg-color: #1a1a17;          /* text-primary      */
  --md-default-fg-color--light: #5f5e5a;   /* text-secondary    */
  --md-default-fg-color--lighter: #a9a79e; /* border-stronger   */
  --md-default-fg-color--lightest: #e3e1d9;/* border            */

  --md-typeset-color: #1a1a17;
  --md-typeset-a-color: #185fa5;           /* text-accent       */

  --md-accent-fg-color: #378add;           /* fill-accent       */
  --md-accent-fg-color--transparent: rgba(55, 138, 221, 0.1);

  /* Header/footer as light paper bars instead of a solid colour block. */
  --md-primary-fg-color: #f4f3ee;
  --md-primary-fg-color--light: #f4f3ee;
  --md-primary-fg-color--dark: #e3e1d9;
  --md-primary-bg-color: #1a1a17;          /* ink on the header */
  --md-primary-bg-color--light: #5f5e5a;

  --md-footer-bg-color: #f4f3ee;
  --md-footer-bg-color--dark: #e3e1d9;
  --md-footer-fg-color: #1a1a17;
  --md-footer-fg-color--light: #5f5e5a;
  --md-footer-fg-color--lighter: #a9a79e;

  --md-code-bg-color: #f4f3ee;
  --md-code-fg-color: #1a1a17;
}

/* ---- Dark scheme: a warm-dark counterpart so the toggle stays coherent --- */
[data-md-color-scheme="slate"] {
  --md-hue: 40;
  --md-default-bg-color: #1a1a17;
  --md-default-bg-color--light: #232320;
  --md-default-fg-color: #f4f3ee;
  --md-default-fg-color--light: #b9b7ad;
  --md-default-fg-color--lighter: #6d6c66;
  --md-default-fg-color--lightest: #3a3a35;

  --md-typeset-color: #f4f3ee;
  --md-typeset-a-color: #6fb1ee;
  --md-accent-fg-color: #6fb1ee;

  --md-primary-fg-color: #232320;
  --md-primary-bg-color: #f4f3ee;
  --md-primary-bg-color--light: #b9b7ad;

  --md-footer-bg-color: #232320;
  --md-code-bg-color: #232320;
  --md-code-fg-color: #f4f3ee;
}

/* ---- Typography: system fonts, compact sizing --------------------------- */
body,
.md-typeset {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.md-typeset {
  font-size: 0.75rem;   /* ~15px at Material's 20px root */
  line-height: 1.6;
}

.md-typeset h1 {
  font-size: 1.4rem;    /* 28px */
  font-weight: 600;
  color: var(--md-default-fg-color);
  letter-spacing: normal;
  margin: 0 0 0.2em;
}

.md-typeset h2 {
  font-size: 1.05rem;   /* 21px */
  font-weight: 600;
  margin: 2.2em 0 0.6em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-typeset h3 {
  font-size: 0.85rem;   /* 17px */
  font-weight: 600;
  margin: 1.6em 0 0.4em;
}

/* Narrower reading column, echoing the wireframe's single centred column. */
.md-content__inner {
  margin-inline: auto;
  max-width: 820px;
}

/* ---- Header/footer: thin rule instead of a drop shadow ------------------ */
.md-header {
  box-shadow: none;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-header--shadow {
  box-shadow: none;
}

/* ---- Tables: crisp bordered grid like table.spec ------------------------ */
.md-typeset table:not([class]) {
  font-size: 0.7rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0;
  box-shadow: none;
}

.md-typeset table:not([class]) th {
  background: var(--md-default-bg-color--light);
  font-weight: 600;
  color: var(--md-default-fg-color);
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  border: 1px solid var(--md-default-fg-color--lightest);
  padding: 6px 9px;
}

/* ---- Code: warm surface, subtle border --------------------------------- */
.md-typeset pre > code {
  border-radius: 8px;
}

.md-typeset :not(pre) > code {
  border: 1px solid var(--md-default-fg-color--lightest);
}
