/* PrimeXM website styling for Zensical's modern theme.
   Fonts and brand colors match the Hugo redesign; code keeps Roboto Mono. */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/primexm/geist-400.woff2") format("woff2");
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/primexm/geist-500.woff2") format("woff2");
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/primexm/geist-600.woff2") format("woff2");
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/primexm/geist-700.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/primexm/inter-variable.woff2") format("woff2");
}

:root {
  --md-text-font: "Geist", "Roboto";
  --pxm-navy: #040714;
  --pxm-blue: #91c5eb;
  --pxm-heading-font: "Inter", "Geist", "Roboto", sans-serif;
  --pxm-radius: .6rem;
}

body[data-md-color-scheme="default"][data-md-color-primary] {
  color-scheme: light;
  --md-default-fg-color: #181c2d;
  --md-default-fg-color--light: #596578;
  --md-default-fg-color--lighter: #64748b;
  --md-default-fg-color--lightest: #e2eaf3;
  --md-default-bg-color: #fff;
  --md-primary-fg-color: #235e99;
  --md-primary-fg-color--light: #679ad1;
  --md-primary-fg-color--dark: #183d67;
  --md-accent-fg-color: #235e99;
  --md-accent-fg-color--transparent: #235e9914;
  --md-typeset-color: #181c2d;
  --md-typeset-a-color: #235e99;
  --md-code-bg-color: #f2f6fb;
  --md-code-fg-color: #24344b;
  --pxm-surface: #f6f9fd;
  --pxm-surface-active: #ebf5ff;
  --pxm-border: #dce5ef;
  --pxm-muted: #596578;
  /* PrimeXM GUI highlight palette, with contrast for small headings. */
  --pxm-section-heading: hsl(219, 54%, 50%);
}

body[data-md-color-scheme="slate"][data-md-color-primary] {
  color-scheme: dark;
  --md-hue: 225;
  --md-default-fg-color: #d5dbe6;
  --md-default-fg-color--light: #a6b2c7;
  --md-default-fg-color--lighter: #8b9bb6;
  --md-default-fg-color--lightest: #263148;
  --md-default-bg-color: #0b1020;
  --md-primary-fg-color: #91c5eb;
  --md-primary-fg-color--light: #c9dcef;
  --md-primary-fg-color--dark: #679ad1;
  --md-accent-fg-color: #b2d0ee;
  --md-accent-fg-color--transparent: #91c5eb18;
  --md-typeset-color: #d5dbe6;
  --md-typeset-a-color: #91c5eb;
  --md-code-bg-color: #121b2e;
  --md-code-fg-color: #d5e4f4;
  --pxm-surface: #101829;
  --pxm-surface-active: #1a2b43;
  --pxm-border: #263148;
  --pxm-muted: #a6b2c7;
  --pxm-section-heading: hsl(215, 100%, 75%);
}

/* A consistent dark brand header in both reading modes. */
.md-header {
  color: #d5dbe6;
  background: var(--pxm-navy);
  border-bottom: 1px solid #ffffff12;
  box-shadow: none;
}

.md-header__inner {
  height: 3.8rem;
  padding-inline: .8rem;
}

.md-header__button.md-logo img {
  width: auto;
  height: 1.8rem;
  filter: brightness(0) invert(1);
}

.md-header__title {
  padding-left: 1rem;
  margin-left: .6rem;
  font-size: .8rem;
  font-weight: 500;
  border-left: 1px solid #ffffff26;
}

.md-header__source:not(:has(.md-source)) {
  display: none;
}

.md-header__button:hover {
  color: var(--pxm-blue);
  opacity: 1;
}

.md-header .md-search__button {
  color: #d5dbe6;
  background-color: #ffffff06;
  border: 1px solid #ffffff24;
  border-radius: 999px;
}

.md-header .md-search__button:hover {
  background-color: #ffffff12;
  border-color: #91c5eb80;
}

.md-header .md-search__button::before {
  background-color: currentColor;
}

.md-header .md-search__button::after {
  color: #b2c2d8;
  background: #ffffff10;
}

/* Keep the document tree familiar, with quieter dividers and clear selection. */
.md-sidebar {
  font-size: .72rem;
}

.md-nav__title {
  color: var(--md-default-fg-color);
  font-weight: 600;
}

.md-nav__link {
  transition: color .15s ease, background-color .15s ease;
}

.md-nav--primary .md-nav__item .md-nav__link--active {
  color: var(--md-typeset-a-color);
  background: var(--pxm-surface-active);
  border-radius: .35rem;
}

/* Keep index links and their expand controls visually in the same row. */
.md-nav--primary .md-nav__container {
  align-items: stretch;
  gap: 0;
  border-radius: .35rem;
}

.md-nav--primary .md-nav__container > label.md-nav__link {
  align-items: center;
}

.md-nav--primary .md-nav__container:has(> .md-nav__link--active) {
  color: var(--md-typeset-a-color);
  background: var(--pxm-surface-active);
}

.md-nav--primary .md-nav__item .md-nav__container > .md-nav__link--active {
  background: transparent;
}

.md-nav__item--section > .md-nav__link {
  color: var(--pxm-muted);
  font-weight: 600;
}

/* Desktop group labels are headings; the same rows expand on mobile. */
@media screen and (min-width: 76.25em) {
  .md-nav--primary .md-nav__item--section:has(> label.md-nav__link) {
    margin-top: 1.1rem;
    padding-top: .2rem;
    border-top: 0;
  }

  .md-nav--primary .md-nav__item--section > label.md-nav__link {
    margin-bottom: .25rem;
    color: var(--pxm-section-heading);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
    cursor: default;
  }

  .md-nav--primary .md-nav__list .md-nav__item--section > .md-nav > .md-nav__list {
    margin-left: .55rem;
  }
}

.md-nav--secondary {
  border-left-color: var(--pxm-border);
}

.md-path {
  color: var(--pxm-muted);
  font-size: .65rem;
}

.md-typeset {
  font-size: .8rem;
  line-height: 1.7;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--md-default-fg-color);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.md-typeset h1 {
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  margin-bottom: 1.25rem;
}

.md-typeset h2 {
  font-family: var(--pxm-heading-font);
  font-size: 1.4rem;
  margin-top: 2rem;
}

.md-typeset h3 {
  font-size: 1.08rem;
}

.md-typeset a:not([class]):hover {
  text-decoration: underline;
  text-underline-offset: .18em;
}

.md-typeset hr {
  border-color: var(--pxm-border);
}

.md-typeset pre > code {
  border: 1px solid var(--pxm-border);
  border-radius: .4rem;
}

.md-typeset :not(pre) > code {
  padding: .12em .35em;
  border-radius: .2rem;
}

.md-typeset table:not([class]) {
  min-width: 100%;
  font-size: .72rem;
  line-height: 1.6;
  border: 1px solid var(--pxm-border);
  border-radius: .4rem;
  box-shadow: none;
}

.md-typeset table:not([class]) th {
  color: var(--md-default-fg-color);
  font-weight: 600;
  background: var(--pxm-surface-active);
  border-bottom: 1px solid var(--pxm-border);
}

.md-typeset table:not([class]) td {
  border-top-color: var(--pxm-border);
}

.md-typeset table:not([class]) tbody tr:hover {
  background: var(--pxm-surface);
}

.md-typeset .admonition,
.md-typeset details {
  border-radius: .4rem;
  box-shadow: none;
}

.md-typeset .tabbed-labels {
  border-bottom-color: var(--pxm-border);
}

.md-typeset .md-button {
  padding: .55em 1.2em;
  font-family: var(--pxm-heading-font);
  font-weight: 500;
  border-width: 1px;
  border-radius: .4rem;
}

.md-typeset .md-button--primary {
  color: #181c2d;
  background: linear-gradient(120deg, #dceafa, #b2d0ee);
  border-color: #b2d0ee;
}

.md-typeset .md-button--primary:hover {
  color: #040714;
  background: #c9dcef;
}

.vimeo-video-container {
  background: var(--pxm-surface);
  border: 1px solid var(--pxm-border);
  border-radius: var(--pxm-radius);
}

.pxm-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  max-width: 100%;
  min-height: 7.5rem;
  padding: .8rem;
  color: var(--pxm-muted);
  font-size: .7rem;
  line-height: 1.5;
  text-align: center;
  background: var(--pxm-surface);
  border: 1px solid var(--pxm-border);
  border-radius: var(--pxm-radius);
}

.pxm-video-placeholder strong {
  color: var(--md-default-fg-color);
  font-weight: 500;
}

.pxm-video-placeholder .md-button {
  font-size: .65rem;
}

.vimeo-video-container > .pxm-video-placeholder {
  position: absolute;
  inset: 0;
  min-height: 0;
}

.md-footer,
.md-footer-meta {
  --md-default-fg-color: #d5dbe6;
  --md-default-fg-color--light: #a6b2c7;
  --md-typeset-a-color: #d5dbe6;
  --md-accent-fg-color: var(--pxm-blue);
  color: #d5dbe6;
  background: var(--pxm-navy);
}

:where(a, button, summary, input):focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 4px;
}

.md-header :focus-visible,
.md-footer :focus-visible {
  outline-color: var(--pxm-blue);
}

@media (max-width: 59.984375em) {
  .md-header__inner {
    height: 3.2rem;
    padding-inline: .4rem;
  }

  .md-header__title {
    padding-left: 0;
    margin-left: .4rem;
    border-left: 0;
  }

  .md-nav--primary .md-nav__title[for="__drawer"] {
    color: #d5dbe6;
    background: var(--pxm-navy);
  }

  .md-nav--primary .md-logo img {
    width: auto;
    height: 2rem;
    filter: brightness(0) invert(1);
  }
}

@media (max-width: 44.984375em) {
  .vimeo-video-container,
  .vimeo-video-container:only-child {
    min-width: 0;
    width: 100%;
    padding-bottom: 56.25%;
  }

  .vimeo-content {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
