:root {
  /* Site palette, harmonized around the base tea green (千歳緑).
     Roughly a 70 / 25 / 5 split: base for primary UI (links, headings,
     nav), main as a warm supporting tone, accent for small CTAs/pops. */

  /* Base (70%) — deep tea green (千歳緑) */
  --md-primary-fg-color: #366E4C;
  --md-primary-fg-color--light: #729A82;
  --md-primary-fg-color--dark: #264D35;
  --md-primary-fg-color--transparent: #366e4c1f;

  /* Main (25%) — Rikyucha (利休茶), a warm olive-gold that pairs with tea green */
  --md-accent-fg-color: #A59564;
  --md-accent-fg-color--transparent: #a595641a;
  --site-main-color--light: #CBC2A5;
  --site-main-color--dark: #706544;

  /* Accent (5%) — Kaki-iro (柿色), for CTAs and small highlights only */
  --site-accent-color: #ED6D3D;
  --site-accent-color--dark: #C1512A;

  /* Inline <code> — vivid green so module names like nvhpc-nompi stand out. */
  --spec-inline-code-color: #148C3D;
}

/* Header and footer bars — kept a fixed tea-green tone in both schemes,
   rather than following the lighter slate-mode primary variant, so the
   brand bar stays consistent and legible with white text/icons. */
.md-header {
  background-color: var(--md-primary-fg-color);
  color: rgb(255, 255, 255);
}

.md-header--shadow {
  box-shadow: 0 0.05rem 0 rgba(0, 0, 0, 0.2);
}

/* The search pill has a low-opacity fill meant for a neutral header;
   on a solid green header that reads as barely-there, so give it a
   solid light background of its own. */
.md-header .md-search__button {
  background-color: rgba(255, 255, 255, 0.92);
  color: rgb(33, 33, 33);
}

/* Only the bottom copyright strip is colored — the prev/next nav row
   above it stays on the default background so the two rows read as
   one footer instead of two different greens stacked together. */
.md-footer-meta {
  background-color: var(--md-primary-fg-color);
  color: rgb(255, 255, 255);
}

.md-footer-meta .md-copyright,
.md-footer-meta .md-copyright__highlight {
  color: rgb(255, 255, 255);
}

/* Material's own footer link rule (html .md-footer-meta.md-typeset
   a:not(:focus, :hover)) outranks a plain ".md-footer-meta a", so
   match its specificity here instead of reaching for !important. */
html .md-footer-meta.md-typeset a:not(:focus, :hover) {
  color: rgb(255, 255, 255);
}

.md-typeset {
  color: rgb(33, 33, 33);
  font-size: 0.825rem;
  line-height: 1.45;
  --spec-table-border: #A59564;
  --spec-table-head-bg: #A59564;
  --spec-code-bg: rgb(241, 239, 234);
  --spec-code-fg: rgb(0, 0, 0);
  --spec-slurm-directive-color: var(--site-accent-color--dark);
}

[data-md-color-scheme="slate"] .md-typeset {
  color: rgb(255, 255, 255);
  --spec-table-border: #A59564;
  --spec-table-head-bg: #A59564;
  --spec-code-bg: rgb(24, 21, 14);
  --spec-code-fg: rgb(255, 255, 255);
  --spec-slurm-directive-color: var(--site-accent-color);
}

[data-md-color-scheme="default"] {
  /* Material sets --md-typeset-a-color on [data-md-color-scheme] (body), which
     beats a :root (html) override, so the link color must be set at this scope. */
  --md-typeset-a-color: #1F6EB2;
}

[data-md-color-scheme="slate"] {
  --md-accent-fg-color: var(--site-main-color--light);
  --md-accent-fg-color--transparent: #cbc2a526;
  --md-primary-fg-color--transparent: #729a822e;
  --md-typeset-a-color: #85AFD4;
  --spec-inline-code-color: #3FCB70;
}

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  margin: 0.3rem 0 0;
  border: 1px solid var(--spec-table-border);
  border-collapse: collapse;
  background: var(--md-default-bg-color);
  font-size: 0.75rem;
}

.md-typeset table:not([class]) :is(th, td) {
  padding: 0.25rem 0.42rem;
  border: 1px solid var(--spec-table-border);
  vertical-align: middle;
  line-height: 1.6;
}

.md-typeset table:not([class]) th {
  background: var(--spec-table-head-bg);
  color: #fff;
  font-weight: 700;
  min-width: 0;
}

/* --spec-table-head-bg and --spec-table-border are the same color, so
   without this the dividers between header cells vanish into the
   background. Only the inner divider is touched — the outer table
   border (top/left/right) is left alone so it stays flush with the
   border around the body rows below it. */
.md-typeset table:not([class]) th:not(:last-child) {
  border-right-color: rgba(255, 255, 255, 0.4);
}

.md-typeset table:not([class]) tbody tr:hover {
  background: transparent;
  box-shadow: none;
}

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) tbody tr:hover td {
  background: var(--md-default-bg-color);
}

.md-typeset table:not([class]) :is(th, td):first-child {
  width: 1%;
  white-space: nowrap;
}

.md-typeset .spec-table,
.md-typeset__table {
  margin-bottom: 0;
}

.md-typeset .spec-table table td:not(:first-child) {
  text-align: right;
}

.md-typeset h1 {
  font-size: 2em;
  margin: 0 0 0.5em;
}

.md-typeset h1:not(:first-of-type) {
  margin-top: 1em;
}

.md-typeset h2 {
  font-size: 1.35em;
  border-left: 7px solid var(--md-primary-fg-color);
  padding-left: 0.35em;
  margin-top: 1.5em;
}

.md-typeset h3 {
  border-bottom: 2px solid rgb(0, 0, 0);
  padding-bottom: 0.1em;
  margin-top: 0.8em;
  margin-bottom: 0.5em;
}

[data-md-color-scheme="slate"] .md-typeset h3 {
  border-bottom-color: rgb(255, 255, 255);
}

.md-typeset :is(h1, h2, h3) + p {
  margin-top: 0.35em;
}

.md-typeset p {
  text-align: justify;
  text-justify: inter-character;
}

.md-typeset :is(ul, ol) li {
  margin-top: 0.2em;
  margin-bottom: 0.2em;
}

.md-typeset .admonition p,
.md-typeset details p {
  font-size: 1.2em;
}

.md-typeset .text-marker {
  background: rgba(237, 109, 61, 0.32);
  font-weight: 700;
  padding: 0.0em 0.12em;
}

[data-md-color-scheme="slate"] .md-typeset .text-marker {
  background: rgba(237, 143, 102, 0.3);
}

.md-typeset .notice-warning {
  color: var(--site-accent-color--dark);
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-typeset .notice-warning {
  color: var(--site-accent-color);
}

.md-typeset .chat-window p {
  margin: 0.35rem 0 0.8rem;
}

.md-typeset .chat-page-actions {
  display: flex;
  margin: 0 0 0.8rem;
}

.md-typeset .askdona-chat-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 620px;
  border: 1px solid var(--spec-table-border);
  border-radius: 0.25rem;
  background: #fff;
}

.md-typeset .action-button {
  margin: 0.1rem 0 0.2rem;
}

.md-typeset .action-button,
.md-typeset .chat-return-link {
  padding: 0.45em 0.8em;
  border-radius: 0.28rem;
}

.md-typeset .action-button {
  background-color: var(--md-primary-fg-color);
  border-color: var(--md-primary-fg-color);
  color: rgb(255, 255, 255) !important;
}

.md-typeset .action-button:is(:hover, :focus) {
  background-color: var(--md-primary-fg-color--dark);
  border-color: var(--md-primary-fg-color--dark);
}

.md-typeset .language-bash.highlight pre {
  border: 1px solid var(--spec-table-border);
  background: var(--spec-code-bg);
}

.md-typeset .language-bash.highlight code {
  background: transparent;
}

.md-typeset pre > code {
  padding: 0.55em 0.8em;
}

.md-typeset code {
  color: var(--spec-code-fg);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.77rem;
}

.md-typeset :not(pre) > code {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: var(--spec-inline-code-color);
  font-weight: 700;
  margin: 0;
  padding: 0;
}

[data-md-color-scheme="slate"] .md-typeset :not(pre) > code {
  color: var(--spec-inline-code-color);
}

.md-typeset .highlight :is(.c1, .nv) {
  color: var(--spec-slurm-directive-color);
}

.md-typeset .highlight :is(.c1, .ch) {
  font-style: normal;
}

.md-typeset .highlight .ch {
  color: green;
}

.md-typeset .highlight :is(.m, .mi, .mf) {
  color: var(--spec-code-fg);
}

.md-nav .md-nav__link {
  padding-top: 0.04rem;
  padding-bottom: 0.04rem;
}

/* Left-hand TOC/nav uses the base color, not the main/accent color */
.md-nav--primary .md-nav__item .md-nav__link--active {
  color: var(--md-primary-fg-color);
  background: var(--md-primary-fg-color--transparent);
}

.md-nav--primary > .md-nav__list > .md-nav__item--current-language {
  margin-top: 0;
}

.md-nav--primary > .md-nav__list > .md-nav__item--current-language > .md-nav__link {
  display: none;
}

.md-nav--secondary .md-nav__link {
  font-size: 0.7rem;
}

/* Integrated TOC: list <h2> and <h3> only. Two levels of nested .md-nav inside
   the TOC means <h4> or deeper, which on pages like compile.md are per-language
   variants (C / C++ / Fortran) repeated under every section — they bloat the
   sidebar without helping navigation. The headings keep their anchors, so
   direct links to them still work. */
.md-nav--secondary .md-nav .md-nav {
  display: none;
}

.md-nav code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: inherit;
}

.md-nav :not(pre) > code {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: var(--spec-inline-code-color);
  font-weight: 700;
  margin: 0;
  padding: 0;
}

[data-md-color-scheme="slate"] .md-nav :not(pre) > code {
  color: var(--spec-inline-code-color);
}

[dir="ltr"] .md-nav--integrated > .md-nav__list > .md-nav__item--active .md-nav--secondary {
  border-left: 2px solid var(--md-primary-fg-color);
}
