/* Site theme: deep navy background (#010736), signal red (#D9361E)
 * accents/headers, white body text. Applies to the slate (dark) scheme,
 * which is the only scheme enabled in mkdocs.yml. */

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #0F0E0E;
  --md-default-fg-color: #ffffff;
  --md-typeset-color: #ffffff;

  --md-primary-fg-color: #FF0000;
  --md-primary-fg-color--dark: #a82815;
  --md-primary-bg-color: #ffffff;

  --md-accent-fg-color: #d9361e;
  --md-typeset-a-color: #d9361e;

  --md-code-bg-color: #0b1440;
  --md-code-fg-color: #ffffff;

  /* Frosted-glass recipe shared by the top bar and the content panels
   * (tables and fenced code blocks) below: the site navy at 0.6
   * alpha, a hairline white border and a backdrop blur. Kept as
   * variables so every glass surface drifts together. */
  --glass-tint: rgba(15, 14, 14, 0.6);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-blur: blur(14px) saturate(160%);
}

/* ------------------------------------------------------------------ *
 * Full-page base color for the site.                                  */
body {
  background-color: #0F0E0E;
}

/* Section headers in signal red — weighted to Sulphur Point's Bold
 * (700) face. The font only ships 300/400/700, and Material's default
 * heading weights (400/500) would otherwise resolve to the regular cut. */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3, 
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  color: #d9361e;
  font-weight: 700;
}

.md-typeset a {
  color: #d9361e;
}

/* Active/hover nav states in red (overrides remaining theme blue):
 * sidebar links, active section titles, header tabs, footer links. */
.md-nav__link--active,
.md-nav__item--active > .md-nav__link,
.md-nav__link:hover,
.md-nav__link:focus,
.md-tabs__link--active,
.md-tabs__link:hover,
.md-tabs__link:focus,
.md-footer__link:hover {
  color: #ff0000;
}

/* Top bar in a frosted-glass finish: translucent charcoal (the site's
 * #0F0E0E at 0.6 alpha) with a backdrop blur, so scrolled pages smear
 * softly underneath. Scoped to the slate scheme (the only one enabled)
 * for extra specificity, so it also overrides the theme's scrolled
 * drop shadow (.md-header--shadow) and keeps the bar flat glass. */
[data-md-color-scheme="slate"] .md-header {
  background: var(--glass-tint);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: none;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* Topbar logo as an oversized circular avatar.
 * Default is a 1.2rem-high image with its natural rectangle; this crops
 * dp.jpg into a ~2rem circle (object-fit instead of squashing). Scoped
 * to the header button only — the nav-drawer logo (< 76.25em) is a
 * separate .md-nav__title .md-logo element and is left untouched. */
.md-header__button.md-logo {
  margin: 0;
  padding: 0;
  height: 2rem;
  width: 2rem;
}

.md-header__button.md-logo img {
  height: 2rem;
  width: 2rem;
  border-radius: 50%;
  object-fit: cover;
}

/* Same, with specificity matching the theme's own rules so the override
 * wins for the active page/section in the sidebar and the right-hand
 * table of contents. */
.md-nav__item .md-nav__link--active,
.md-nav__item .md-nav__link--active code,
.md-nav__item .md-nav__link:hover,
.md-nav__item .md-nav__link:focus,
.md-nav--secondary .md-nav__link--active {
  color: #ff0000;
}

/* Excalidraw diagrams (mkdocs-excalidraw).
 * The plugin renders each drawing as <excalidraw-renderer><div><img></div></excalidraw-renderer>.
 * That tag is an unknown element, so it defaults to display:inline — a tall
 * image then overflows its line box and visually overlaps the next diagram.
 * Block display + a width cap keeps every diagram in its own row and stops
 * wide drawings from overflowing the content column. */
.md-typeset excalidraw-renderer {
  display: block;
  margin: 1.2rem 0;
}

.md-typeset excalidraw-renderer div {
  display: block;
}

.md-typeset excalidraw-renderer img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* ------------------------------------------------------------------ *
 * Content panels + inline code chips.                                 *
 * Fenced code blocks and tables use the top bar's frosted-glass       *
 * recipe (shared --glass-* vars: navy at 0.6 alpha + backdrop blur +  *
 * hairline white border). Inline code gets its own transparent chip.  *
 * Scoped to the slate scheme and .md-typeset with matching spec so    *
 * Material's own backgrounds (var(--md-code-bg-color) on `code`,      *
 * var(--md-default-bg-color) on tables) are overridden everywhere.    *
 * ------------------------------------------------------------------ */

/* Inline code — markdown highlights in single backticks. Material's
 * opaque navy fill is dropped for a see-through chip: a hairline white
 * outline hugging the glyphs. The sliver of vertical padding keeps the
 * border from clipping ascenders/descenders, and the theme's
 * `box-decoration-break: clone` still borders wrapped chips per line. */
[data-md-color-scheme="slate"] .md-typeset :not(pre) > code {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 0.05em 0.2941176471em;
}

/* Fenced code blocks. Material paints the navy fill on the inner <code>
 * (not <pre>), so the glass tint + border + blur go there and get
 * rounded the same 8px as the panels below. Behind code the blur just
 * softens whatever little detail passes under the panel (it is degrade-
 * graceful: without blur the 0.6-alpha tint still reads as glass). */
[data-md-color-scheme="slate"] .md-typeset pre > code {
  background-color: var(--glass-tint);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* Tables. Material fills the table with the opaque page navy and a
 * near-black border; swap both for the glass look. `overflow: hidden`
 * + the larger radius clip the row fills into rounded corners. */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) {
  background-color: var(--glass-tint);
  border: 0.05rem solid var(--glass-border);
  border-radius: 8px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* Row hover: Material's inset box-shadow repaints an opaque navy hairline
 * that would glow through the translucent panel — use a quiet white
 * lift instead. */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}
