/* FestIn docs theme — dashboard chrome (dark) + light reading surface.
   Navigation (header, tabs, sidebars, footer) keeps the ops-console dark.
   The article body uses a very light warm grey for readability: prose,
   tables, code and screenshots sit on light. */

/* readability: bigger base, no hairline weights anywhere */
html {
  --md-text-font-size: 16px;
}
.md-typeset {
  font-size: 0.86rem;
  line-height: 1.7;
}
.md-typeset p,
.md-typeset li {
  font-weight: 400;
}
.md-typeset a {
  font-weight: 500;
}
.md-nav__link,
.md-tabs__link {
  font-weight: 500;
}

/* headings: solid 700 — Material's default 300 reads hairline */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  font-weight: 700;
}

:root {
  --festin-bg: #141518;
  --festin-panel: #1a1c20;
  --festin-panel2: #202329;
  --festin-line: #2b2f36;
  --festin-ink: #e8e6df;
  --festin-muted: #8f9299;
  --festin-accent: #ffb454;
  --festin-accent-dark: #c77b18;
  --festin-critical: #ff5c57;
  --festin-high: #ff9f43;
  --festin-medium: #ffd166;
  --festin-low: #7bd88f;
  --festin-info: #6ea8fe;

  /* reading surface — very light warm grey */
  --paper: #f5f4f0;
  --paper-line: #d8d5cd;
  --paper-ink: #26251f;
  --paper-muted: #6b6a63;
  --paper-code-bg: #ecebe5;
}
/* scheme variable sets — apply on html AND body (Material sets the attr
   on both; the article surface stays paper in every scheme) */
[data-md-color-scheme="festin-dark"] {
  --md-default-bg-color: var(--festin-bg);
  --md-default-fg-color: var(--festin-ink);
  --md-default-fg-color--light: var(--festin-ink);
  --md-default-fg-color--lighter: var(--festin-muted);
  --md-default-fg-color--faint: var(--festin-muted);
  --md-typeset-color: var(--festin-ink);
  --md-typeset-a-color: var(--festin-accent);
  --md-primary-fg-color: var(--festin-panel);
  --md-primary-bg-color: var(--festin-bg);
  --md-accent-fg-color: var(--festin-accent);
  --md-code-bg-color: #111214;
  --md-code-fg-color: var(--festin-ink);
  --md-footer-bg-color: var(--festin-panel);
  --md-footer-fg-color: var(--festin-muted);
  --md-admonition-bg-color: var(--festin-panel);
}
/* dark body painted directly — no var indirection, immune to palette.css
   :root { --md-default-bg-color: #fff } cascade quirks */
body[data-md-color-scheme="festin-dark"] {
  background: var(--festin-bg);
}
/* the article surface stays paper in every scheme */
body .md-main,
body .md-content {
  background: var(--paper);
}
/* ---------- chrome: dark like the dashboard (both schemes) ---------- */

/* header + tabs stay dark */
.md-header {
  background: var(--festin-bg) !important;
  border-bottom: 1px solid var(--festin-line);
  box-shadow: none;
}
.md-tabs {
  background: var(--festin-bg) !important;
  border-bottom: 1px solid var(--festin-line);
  box-shadow: none;
}
.md-tabs__link {
  color: var(--festin-muted) !important;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0;
}
.md-tabs__link--active,
.md-tabs__link:hover {
  color: var(--festin-accent) !important;
}

/* sidebars: paper tone, desktop only. On mobile Material turns
   --primary into a slide-out drawer — never force sticky/height there. */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary,
  .md-sidebar--secondary {
    background: var(--paper);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 0;
    margin: 0;
  }
  .md-sidebar--primary {
    border-right: 1px solid var(--paper-line);
  }
  .md-sidebar--secondary {
    border-left: 1px solid var(--paper-line);
  }
  .md-sidebar .md-sidebar__scrollwrap {
    background: var(--paper);
    margin: 0;
    padding: 20px 0 20px 14px;
  }
  .md-sidebar--secondary .md-sidebar__scrollwrap {
    padding: 20px 0 20px 16px;
  }
}
/* mobile drawer: paper surface, dark text — matches the reading area */
/* mobile drawer: source-repo badge dark like the header, not blue */
.md-source {
  background: var(--festin-bg) !important;
  border-radius: 0;
}
.md-source:hover {
  background-color: var(--festin-panel2) !important;
}
.md-source__repository {
  color: var(--festin-ink) !important;
}
.md-source__facts {
  color: var(--festin-muted) !important;
}
.md-source__icon {
  color: var(--festin-ink) !important;
}

@media screen and (max-width: 76.1875em) {
  .md-sidebar--primary {
    background: var(--paper);
  }
  .md-sidebar--primary .md-sidebar__scrollwrap {
    background: var(--paper);
    margin: 0;
  }
  .md-sidebar--primary .md-nav__title {
    color: var(--paper-ink) !important;
  }
}
.md-sidebar .md-nav__link {
  color: var(--paper-muted) !important;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  margin: 2px 8px 0 0 !important;
  padding: 4px 10px 4px 12px !important;
  line-height: 1.5;
  box-shadow: none !important;
}
.md-sidebar .md-nav__item--active > .md-nav__link,
.md-sidebar .md-nav__link:hover {
  color: var(--festin-accent-dark) !important;
}
.md-sidebar .md-nav__item--active > .md-nav__link {
  background: transparent !important;
  box-shadow: inset 2px 0 0 var(--festin-accent-dark) !important;
}
.md-nav__title {
  color: var(--paper-ink) !important;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: transparent !important;
  box-shadow: none !important;
}
/* TOC ("Table of contents") title bar in the secondary sidebar */
.md-sidebar--secondary .md-nav__title {
  background: transparent !important;
  color: var(--paper-muted) !important;
  font-size: 0.7rem;
}
.md-nav__icon::after {
  color: var(--paper-muted) !important;
}

/* footer stays dark */
.md-footer {
  background: var(--festin-panel) !important;
  border-top: 1px solid var(--festin-line);
}

/* search = dashboard input (dark, inside dark header) */
.md-search__input {
  background: var(--festin-panel2) !important;
  border: 1px solid var(--festin-line);
}
.md-search__input + .md-search__icon {
  color: var(--festin-muted) !important;
}
.md-search__overlay {
  background: rgba(20, 21, 24, 0.85) !important;
}

/* header logo sizing (hex mark) */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 34px;
  width: auto;
}
.md-header__button.md-logo {
  padding: 0.3rem;
}
.md-header__button {
  color: var(--festin-muted) !important;
}
.md-header__button:hover {
  color: var(--festin-accent) !important;
}

/* ---------- THE ARTICLE: light reading surface ---------- */

.md-main {
  background: var(--paper);
}
.md-main__inner {
  background: transparent;
}

/* the article column itself */
.md-content {
  background: var(--paper);
  border-left: 1px solid var(--festin-line);
  box-shadow: none;
}

/* text colors on the light surface */
.md-typeset {
  color: var(--paper-ink);
}
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--paper-ink);
}
.md-typeset h1 {
  font-size: 1.55em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--festin-accent);
  padding-bottom: 0.4em;
}
.md-typeset h2 {
  font-size: 1.08em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--paper-muted);
  border-bottom: 1px solid var(--paper-line);
  padding-bottom: 0.3em;
}
.md-typeset h3 {
  font-size: 0.98em;
  color: var(--paper-ink);
}

/* links inside the article: amber readable on light */
.md-typeset a {
  color: var(--festin-accent-dark);
}
.md-typeset a:hover {
  color: var(--festin-accent);
}

/* inline code + code blocks: light panels like dashboard inputs on paper */
.md-typeset code {
  background: var(--paper-code-bg);
  border: 1px solid var(--paper-line);
  border-radius: 0;
  color: var(--paper-ink);
  padding: 0.1em 0.35em;
}
.md-typeset pre > code {
  background: var(--paper-code-bg) !important;
  border: 1px solid var(--paper-line);
  border-radius: 0;
  color: var(--paper-ink);
  outline: none;
}
.md-typeset pre {
  background: var(--paper-code-bg);
  border: 1px solid var(--paper-line);
  border-radius: 0;
}
.md-typeset pre > code span {
  color: inherit;
}

/* syntax highlighting tuned for the light surface */
.md-typeset .highlight .c,
.md-typeset .highlight .c1,
.md-typeset .highlight .cm,
.md-typeset .highlight .cs,
.md-typeset .highlight .sd,
.md-typeset .highlight .ge {
  color: var(--paper-muted) !important;
  font-style: italic;
}
.md-typeset .highlight .k,
.md-typeset .highlight .kn,
.md-typeset .highlight .kd {
  color: #a14474;
}
.md-typeset .highlight .s,
.md-typeset .highlight .s1,
.md-typeset .highlight .s2,
.md-typeset .highlight .se {
  color: #2f7d5b;
}
.md-typeset .highlight .mi,
.md-typeset .highlight .mf {
  color: #b34a4a;
}
.md-typeset .highlight .o {
  color: var(--paper-ink);
}
.md-typeset .highlight .nb {
  color: #7a5c1e;
}

/* tables: dashboard-style on light */
.md-typeset table:not([class]) {
  font-size: 0.72rem;
  border: 1px solid var(--paper-line);
  background: #fdfcfa;
}
.md-typeset table:not([class]) th {
  background: var(--paper-code-bg);
  color: var(--paper-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  border-bottom: 1px solid var(--paper-line);
}
.md-typeset table:not([class]) td {
  border-bottom: 1px solid var(--paper-line);
  color: var(--paper-ink);
}

/* admonitions: flat panels with amber accent — light surface */
.md-typeset .admonition,
.md-typeset details {
  background: #efede7;
  border: 1px solid var(--paper-line);
  border-left: 2px solid var(--festin-accent);
  border-radius: 0;
  box-shadow: none;
  font-size: 0.72rem;
}
.md-typeset .admonition-title,
.md-typeset summary {
  background: transparent;
  border-bottom: 1px solid var(--paper-line);
  border-radius: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--paper-ink);
}
.md-typeset .admonition-title::before {
  background-color: var(--festin-accent-dark);
}
.md-typeset details[open] > summary {
  border-bottom: 1px solid var(--paper-line);
}

/* screenshots keep their dark frame — give them a 1px border to sit on paper */
.md-typeset img {
  border: 1px solid var(--paper-line);
  border-radius: 0;
}

/* mermaid renders its own colors — keep it flat */
.md-typeset .mermaid {
  background: #fdfdfb;
  border: 1px solid var(--paper-line);
  padding: 12px;
}

/* buttons: flat, bordered, uppercase */
.md-typeset .md-button {
  border: 1px solid var(--paper-line);
  border-radius: 0;
  background: transparent;
  color: var(--paper-ink);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: none;
}
.md-typeset .md-button:hover {
  border-color: var(--festin-accent-dark);
  color: var(--festin-accent-dark);
  background: transparent;
}
.md-typeset .md-button--primary {
  color: var(--festin-accent-dark);
  border-color: var(--festin-accent-dark);
  background: transparent;
}

/* toc sidebar (right) links — same paper treatment */
.md-sidebar--secondary .md-nav__link {
  color: var(--paper-muted) !important;
}
.md-sidebar--secondary .md-nav__link:hover,
.md-sidebar--secondary .md-nav__item--active > .md-nav__link {
  color: var(--festin-accent-dark) !important;
}

/* top "back to top" + scrollbars stay dashboard-toned */
.md-top {
  background: var(--festin-panel) !important;
  border: 1px solid var(--festin-line);
  color: var(--festin-ink) !important;
}

/* ---------- brand ---------- */
.md-header__title {
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--festin-ink) !important;
}
.md-header__title .md-ellipsis {
  color: var(--festin-ink);
}