/* Supplement theme main.css (do not replace it — a same-named static/css/main.css shadows the theme). */

/* Readable main column ~70% of viewport (Bootstrap 5 layout) */
@media (min-width: 992px) {
  .container:not(.container-fluid) {
    max-width: none;
    width: 100%;
  }

  .container[role="main"] .row > .col-md-10.offset-md-1 {
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 70vw !important;
    max-width: 70vw !important;
  }
}

/*
 * Site-wide sans-serif (Beautiful Hugo sets body to Lora by default).
 * Matches hugo.toml [params] customtextFontFamily.
 */
body {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.see-also-item-subtitle,
.archive-item-subtitle {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* WarmDesk link in main menu */
.navbar-custom .nav-link img.nav-menu-warmdesk-logo {
  display: inline-block;
  vertical-align: middle;
  height: 22px;
  width: auto;
  max-width: none;
  margin: -2px 8px 0 0;
}

/* Drawer TOC aligns with navbar controls on the right */
.toc-panel {
  left: auto !important;
  right: 0 !important;
  border-right: none !important;
  border-left: 1px solid #e0e0e0 !important;
  transform: translateX(100%) !important;
}

.toc-panel.toc-open {
  transform: translateX(0) !important;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .toc-panel.toc-open {
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.55) !important;
}

[data-theme="dark"] .toc-panel {
  border-left-color: #444 !important;
  border-right: none !important;
}

/*
 * Inline code ( prose ) — AsciiDoctor uses paragraph > p > code; keep chip style separate from blocks.
 * Do NOT inherit / strip color from pre blocks: Rouge / console expects readable tokens (#go, etc.).
 */
[data-theme="dark"] div.paragraph p code,
[data-theme="dark"] div.dlist dd p code,
[data-theme="dark"] .hdlist td code {
  font-family: 'Source Code Pro', monospace;
  background-color: #2d2d2d;
  color: #fbb;
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

[data-theme="dark"] pre.highlight,
[data-theme="dark"] pre.rouge.highlight,
[data-theme="dark"] pre.rouge {
  background-color: var(--dark-code-block-bg, #0d1117);
  color: var(--dark-code-block-fg, #e6edf3);
  border-radius: 4px;
}

[data-theme="dark"] pre.rouge code,
[data-theme="dark"] pre.highlight code,
[data-theme="dark"] pre:not(.chroma) > code:not(.hljs) {
  font-family: 'Source Code Pro', monospace;
  color: var(--dark-code-block-fg, #e6edf3) !important;
  background-color: transparent !important;
  padding: 0;
  border-radius: 0;
}

/*
 * Rogue (AsciiDoctor + source-highlighter=rouge) — console / shell tokens on dark BG.
 */
[data-theme="dark"] pre.rouge .go {
  color: #79c0ff !important;
}

[data-theme="dark"] pre.rouge .gp,
[data-theme="dark"] pre.rouge .x {
  color: #7ee787 !important;
}

[data-theme="dark"] pre.rouge .gs {
  font-weight: 600;
  color: #e6edf3 !important;
}

[data-theme="dark"] pre.rouge .nb {
  color: #ffa657 !important;
}

[data-theme="dark"] pre.rouge .k,
[data-theme="dark"] pre.rouge .kc {
  color: #ff7b72 !important;
}

[data-theme="dark"] pre.rouge .s,
[data-theme="dark"] pre.rouge .s1,
[data-theme="dark"] pre.rouge .s2 {
  color: #a5d6ff !important;
}

[data-theme="dark"] pre.rouge .nf {
  color: #d2a8ff !important;
}

[data-theme="dark"] pre.rouge .m,
[data-theme="dark"] pre.rouge .mi,
[data-theme="dark"] pre.rouge .mo {
  color: #79c0ff !important;
}

[data-theme="dark"] pre.rouge .c,
[data-theme="dark"] pre.rouge .c1,
[data-theme="dark"] pre.rouge .cm,
[data-theme="dark"] pre.rouge .ch,
[data-theme="dark"] pre.rouge .cp {
  color: #8b949e !important;
  font-style: italic;
}

[data-theme="dark"] pre.rouge .nv,
[data-theme="dark"] pre.rouge .vc {
  color: #ffa657 !important;
}

[data-theme="dark"] pre.rouge .o,
[data-theme="dark"] pre.rouge .p {
  color: #c9d1d9 !important;
}

/* KaTeX wide equations */
.katex-display > .katex {
  overflow-x: auto;
  overflow-y: hidden;
}
