/* Inductor Parser docs skin, modeled on the DELPH-IN site's Minimal Mistakes
   theme (https://delph-in.github.io/docs/matrix/). The modern DocFX template
   loads public/main.css after its own stylesheet, so these rules win at equal
   specificity. We restyle, not restructure: fonts, the teal link palette,
   reading rhythm, dark code blocks, thin-ruled tables, and a left-ruled
   blockquote. DocFX's Bootstrap layout (navbar, left toc, right affix) stays. */

:root {
  /* Minimal Mistakes system font stack and monospace. */
  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Roboto",
    "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;
  --bs-font-monospace: Monaco, Consolas, "Lucida Console", monospace;
  --bs-body-font-size: 1rem;     /* 16px */
  --bs-body-line-height: 1.5;
}

/* Teal link palette (#2f7d95 / hover #235e70). Bootstrap 5.3 reads RGB
   triplets, so set those; light and dark themes get their own contrast. */
:root,
[data-bs-theme="light"] {
  --bs-link-color-rgb: 47, 125, 149;
  --bs-link-hover-color-rgb: 35, 94, 112;
}
[data-bs-theme="dark"] {
  --bs-link-color-rgb: 90, 178, 201;
  --bs-link-hover-color-rgb: 124, 198, 217;
}

body {
  font-family: var(--bs-body-font-family);
  line-height: 1.5;
}

/* Headings: bold, same sans family, a little more air above each section. */
article h1, article h2, article h3,
article h4, article h5, article h6 {
  font-family: var(--bs-body-font-family);
  font-weight: 700;
}
article h2 { margin-top: 1.8rem; }
article h3 { margin-top: 1.4rem; }

/* Declaration bars use Bootstrap's paired theme colors so both the surface
   and text follow the reader's light/dark preference. Long signatures wrap. */
article .api-declaration {
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  border-radius: .35rem;
  padding: .85rem 1rem;
  /* Offset the padding and border so declaration text aligns with body text. */
  margin-inline: calc(-1rem - 1px);
  margin-bottom: 1rem;
  font-family: var(--bs-font-monospace);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
article h3.api-declaration { margin-top: 2.25rem; }
article h1.api-declaration { font-size: 1.35rem; }

[data-bs-theme="dark"] article .api-declaration {
  background-color: #3a4046;
  border-color: #596169;
}

/* Greyer masthead text, like the Minimal Mistakes top bar. */
.navbar .navbar-brand { font-weight: 700; }

/* Tables: thin grey rules with a bold header underline. */
article table {
  border-collapse: collapse;
  width: auto;
  margin: 1.25rem 0;
}
article table th,
article table td {
  border: 1px solid #b6b6b6;
  padding: .4rem .75rem;
}
article table thead th {
  border-bottom: 2px solid #b6b6b6;
}

/* Blockquote: indented with a left rule in the theme's slate grey. */
article blockquote {
  margin: 1.5em 0;
  padding: .25em 0 .25em 1em;
  border-left: .25em solid #6f777d;
  color: var(--bs-secondary-color);
}

/* Inline code: a soft grey chip in the monospace family. */
code { font-family: var(--bs-font-monospace); }
:not(pre) > code {
  background-color: rgba(175, 184, 193, .2);
  padding: .15em .35em;
  border-radius: .25rem;
}

/* Code blocks: the dark Material-style panel the reference site uses. A light
   default color keeps any untokenized text readable; the rest is accenting. */
article pre {
  background-color: #263238;
  border-radius: .3rem;
  padding: 1rem 1.15rem;
}
/* In dark mode use Bootstrap's neutral elevated surface, a subtle low-contrast
   box, instead of the saturated teal panel used on white. */
[data-bs-theme="dark"] article pre {
  background-color: var(--bs-tertiary-bg);
}
article pre > code,
article pre .hljs {
  background: transparent;
  color: #eeffff;
  font-family: var(--bs-font-monospace);
}
/* In dark mode, highlight.js tags the inner <code> with .hljs at runtime, and
   DocFX's "[data-bs-theme=dark] .hljs" rule paints it #1e1e1e. That fill is
   darker than the pre's surface, so the pre's padding shows as a frame around
   the code (the "border" seen only in dark mode). These dark-scoped selectors
   outrank that rule and keep the inner code transparent, so the whole block is
   one flat surface. */
[data-bs-theme="dark"] article pre .hljs,
[data-bs-theme="dark"] article pre > code {
  background: transparent;
  color: inherit;
}
.hljs-comment, .hljs-quote { color: #6a8a96; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in,
.hljs-meta { color: #c792ea; }
.hljs-string, .hljs-attr, .hljs-regexp,
.hljs-addition { color: #c3e88d; }
.hljs-number, .hljs-literal, .hljs-symbol { color: #f78c6c; }
.hljs-title, .hljs-name, .hljs-type,
.hljs-class .hljs-title { color: #82aaff; }
.hljs-attribute, .hljs-variable, .hljs-template-variable { color: #ffcb6b; }

/* Brand: the inductor circuit wordmark with a "Parser" subtitle stacked
   beneath it, right-aligned under the end of the mark. Size the logo by height
   so the wide mark scales cleanly, and flip its dark-grey art to light in dark
   mode for contrast on the navbar. */
.navbar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}
.navbar-brand #logo {
  height: 1.5rem;
  width: auto;
}
.navbar-brand .brand-subtitle {
  /* Negative offset pulls "Parser" up under the wordmark, past the logo's
     transparent bottom padding, so it sits close to the lettering. */
  margin-top: -.35rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
}
[data-bs-theme="dark"] .navbar-brand #logo {
  filter: brightness(0) invert(1);
}
