:root {
  /* Mapped from SAND/UI/Main/Theme.swift */
  --sand-bg: #191a1a;         /* Theme.backgroundColor */
  --sand-surface: #28282a;    /* Theme.toolbarColor */
  --sand-surface-2: #2d2d2e;  /* Theme.selectedTrackBackgroundColor */
  --sand-text: #d8d8d8;       /* Theme.foregroundColor */
  --sand-accent: #0096ff;     /* Theme.accentColor */

  /* Override Material theme font variables so headings and body use Galvji. */
  --md-text-font: "Galvji", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --md-code-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: var(--sand-bg);
  --md-default-bg-color--light: var(--sand-surface);
  --md-default-bg-color--lighter: var(--sand-surface-2);
  --md-default-fg-color: var(--sand-text);
  --md-default-fg-color--light: #c8c8c8;
  --md-default-fg-color--lighter: #a8a8a8;
  --md-primary-fg-color: var(--sand-surface);
  --md-primary-fg-color--light: var(--sand-surface-2);
  --md-accent-fg-color: var(--sand-accent);
  --md-typeset-a-color: var(--sand-accent);
}

/* Match the app's typography: Theme.alternateFont / boldAlternateFont */
body,
input,
button,
select,
textarea,
.md-typeset {
  font-family: "Galvji", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1, h2, h3, h4, h5, h6,
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6,
.md-typeset .admonition-title,
.md-typeset summary,
article#doc-cover h1,
article#doc-cover h2 {
  font-family: "Galvji", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
}

code,
pre,
kbd,
.md-typeset code,
.md-typeset pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* Hide MkDocs footer in app/web export */
.md-footer,
.md-footer-meta {
  display: none !important;
}

/* Hide floating "Back to top" button */
.md-top,
[href="#__top"] {
  display: none !important;
}

/* PDF cover logo: <img> in templates/cover.html.j2 (WeasyPrint often skips empty div + background-image) */
article#doc-cover .wrapper.upper .cover-logo-img {
  display: block;
  margin: 0 auto 1rem;
  max-height: 28vh;
  max-width: 85%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* PDF ToC (mkdocs-with-pdf) — plugin SCSS does not use Material font variables */
article#doc-toc,
article#doc-toc h1,
article#doc-toc ul,
article#doc-toc li,
article#doc-toc li > a {
  font-family: "Galvji", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Content tagged with .screen-only is hidden in the PDF export */
@media print {
  .screen-only {
    display: none !important;
  }
}

/* Larger, more readable typography in exported PDF only */
@media print {
  html,
  body,
  .md-typeset {
    font-size: 11pt !important;
    line-height: 1.45 !important;
  }

  .md-typeset h1 { font-size: 26pt !important; }
  .md-typeset h2 { font-size: 20pt !important; }
  .md-typeset h3 { font-size: 16pt !important; }
  .md-typeset h4 { font-size: 14pt !important; }

  /* mkdocs-with-pdf ToC exact selectors */
  article#doc-toc {
    font-size: 9pt !important;
    line-height: 1.45 !important;
  }

  article#doc-toc > h1 {
    font-size: 16pt !important;
    font-weight: 700 !important;
  }

  article#doc-toc ul,
  article#doc-toc li,
  article#doc-toc li > a {
    font-size: 9pt !important;
    line-height: 1.45 !important;
  }

  /* Override mkdocs-with-pdf heading underlines */
  article h1,
  article h2,
  article h3 {
    border-bottom: none !important;
  }
}

