/* sphinx-pyrocko-theme
 *
 * Same design tokens as the pyrocko.org landing page: Pyrocko palette
 * (whale accent), Lato for text, Inconsolata (scaled) for code, light and
 * dark mode following the system setting.
 */

@import url("basic.css");
@import url("fonts/fonts.css");

/* ---------------------------------------------------------------- tokens */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;          /* code, sidebar */
  --text: #1c1f24;
  --muted: #5b6370;
  --faint: #8a929e;
  --rule: #e4e7eb;
  --rule-strong: #d3d8de;
  --accent: #366ba1;           /* whale */
  --accent-strong: #215587;
  --accent-soft: #e8f1fc;
  --inline-code: #814525;      /* chipmunk-dark: inline code, as in the old theme */
  --sig-bg: #f1f5fb;
  --target-bg: #fbf0d9;        /* lion-light, toned down */

  /* admonitions: palette families */
  --note: #366ba1;             /* whale */
  --note-bg: #f1f6fc;
  --tip: #516200;              /* frog-dark */
  --tip-bg: #f5f8ec;
  --warning: #ab7324;          /* lion-dark */
  --warning-bg: #fcf6ec;
  --danger: #bd182d;           /* ape */
  --danger-bg: #fcf0f0;

  /* guts attribute marker */
  --guts: #ae6946;             /* chipmunk */

  --base-size: 18px;
  --font: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Inconsolata Pyrocko", ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", Menlo, Consolas, monospace;

  --topbar-h: 3.5rem;
  --sidebar-w: 17.5rem;
  --content-w: 54rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --bg-soft: #171b20;
    --text: #e6e9ee;
    --muted: #a0a8b4;
    --faint: #6f7884;
    --rule: #2a3038;
    --rule-strong: #3a414b;
    --accent: #95c2f0;         /* whale-light */
    --accent-strong: #bcdbfb;
    --accent-soft: #1f2b3c;
    --inline-code: #d39c80;    /* chipmunk-light */
    --sig-bg: #18202b;
    --target-bg: #2f2a20;

    --note: #95c2f0;
    --note-bg: #16202c;
    --tip: #c0cf96;
    --tip-bg: #1a2016;
    --warning: #dca048;
    --warning-bg: #261f14;
    --danger: #e27e79;
    --danger-bg: #2a1718;

    --guts: #d39c80;

    color-scheme: dark;
  }

  /* imgmath renders black formulas on transparent background */
  img.math, div.math img { filter: invert(.9); }
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: 1.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--base-size)/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  min-width: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--accent); }

img { max-width: 100%; height: auto; }

code, pre, kbd, samp, tt { font-family: var(--mono); }

/* Lato has 400, 700 and 900 only */
b, strong, th, dt { font-weight: 700; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 100;
  background: var(--bg); padding: .4rem .8rem; border: 1px solid var(--rule);
}
.skip-link:focus { top: .5rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex; align-items: center; gap: 1rem;
  height: 100%; padding: 0 16px;
}
@media (min-width: 720px) { .topbar-inner { padding: 0 24px; } }

.sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; margin-left: -.4rem;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  cursor: pointer;
}
.sidebar-toggle svg { width: 1.4rem; height: 1.4rem; }
.sidebar-toggle:hover { color: var(--text); background: var(--bg-soft); }

.brand {
  display: flex; align-items: center; gap: .5rem; flex: none;
  color: var(--text) !important; font-weight: 700; font-size: 1.1em;
}
.brand:hover { text-decoration: none; }
.brand picture { display: flex; }
/* Pyrocko-style logo files have space around the circle (room for the ring
   of the dark variant): 30px image = 28px circle */
.brand img { width: 30px; height: 30px; }

/* title and version chip, both centred vertically */
.doc-meta {
  display: flex; align-items: center; gap: .75rem; min-width: 0;
  padding-left: 1rem; border-left: 1px solid var(--rule);
}
.doc-title {
  color: var(--muted) !important; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; min-width: 0;
}
.doc-title:hover { color: var(--text) !important; text-decoration: none; }

.version-chip {
  flex: none; padding: .05rem .45rem;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  font-family: var(--mono); font-size: .7em; line-height: 1.5;
  color: var(--muted); white-space: nowrap;
}

.topnav { display: flex; gap: 1.5rem; margin-left: auto; flex: none; }
.topnav a { color: var(--muted) !important; }
.topnav a:hover { color: var(--text) !important; text-decoration: none; }

@media (max-width: 719px) {
  .doc-meta { display: none; }
  .topnav { gap: 1rem; font-size: .92em; }
}

/* ------------------------------------------------------------ page layout */

.page { display: flex; align-items: flex-start; min-height: calc(100vh - var(--topbar-h)); }

.main {
  flex: 1 1 auto; min-width: 0;
  padding: 1.5rem 16px 4rem;
}
@media (min-width: 720px) { .main { padding: 2rem 40px 4rem; } }

.main > * { max-width: var(--content-w); margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------- sidebar */

.side-nav {
  position: sticky; top: var(--topbar-h);
  flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  border-right: 1px solid var(--rule);
  background: var(--bg);
  font-size: .9em; line-height: 1.45;
  scrollbar-width: thin;
}
.side-nav-inner { padding: 1.25rem 1.25rem 3rem; }

:root[data-sidebar="closed"] .side-nav { display: none; }

.sidebar-search { margin: 0 0 1.25rem; }
.sidebar-search input {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--rule-strong);
  border-radius: 6px; padding: .4rem .6rem;
}
.sidebar-search input::placeholder { color: var(--faint); }

.sidebar-toc p.caption {
  margin: 1.2rem 0 .4rem; font-size: .78em; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
}
.sidebar-toc p.caption:first-child { margin-top: 0; }

.sidebar-toc ul { list-style: none; margin: 0; padding: 0; }
.sidebar-toc ul ul { padding-left: .9rem; border-left: 1px solid var(--rule); margin: .15rem 0 .35rem .15rem; }
.sidebar-toc li { margin: 0; }
.sidebar-toc a {
  display: block; padding: .2rem .5rem; border-radius: 4px;
  color: var(--text) !important;
  overflow-wrap: anywhere;
}
.sidebar-toc a:hover { background: var(--bg-soft); text-decoration: none; }
.sidebar-toc .toctree-l1 > a { font-weight: 700; margin-top: .35rem; }
.sidebar-toc .toctree-l2 > a, .sidebar-toc .toctree-l3 > a, .sidebar-toc .toctree-l4 > a { color: var(--muted) !important; }
.sidebar-toc li.current > a { color: var(--text) !important; }
.sidebar-toc a.current { background: var(--accent-soft); color: var(--accent-strong) !important; font-weight: 700; }
.sidebar-toc code { font-size: 1em; background: none; padding: 0; }
.sidebar-toc code .pre { white-space: normal; }

.side-nav-backdrop { display: none; }

@media (max-width: 1023px) {
  .side-nav {
    position: fixed; left: 0; top: var(--topbar-h); z-index: 25;
    width: min(85vw, var(--sidebar-w)); height: calc(100vh - var(--topbar-h));
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: none; display: block !important;
  }
  :root[data-drawer="open"] .side-nav { transform: none; box-shadow: 0 0 24px rgba(0, 0, 0, .2); }
  .side-nav-backdrop {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 20;
    background: rgba(0, 0, 0, .25);
  }
  .side-nav-backdrop[hidden] { display: none; }
}
@media (prefers-reduced-motion: reduce) { .side-nav { transition: none; } }

/* ----------------------------------------------------------- breadcrumbs */

.breadcrumbs { margin-bottom: 1.5rem; font-size: .88em; color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem .4rem; }
.breadcrumbs li + li::before { content: "›"; margin-right: .4rem; color: var(--faint); }
.breadcrumbs a { color: var(--muted) !important; }
.breadcrumbs a:hover { color: var(--accent) !important; }
.breadcrumbs [aria-current] { color: var(--text); }
.breadcrumbs code { font-size: 1em; }

/* -------------------------------------------------------------- headings */

div.body, article.body { min-width: 0; max-width: var(--content-w); }

.body h1, .body h2, .body h3, .body h4, .body h5, .body h6 {
  font-weight: 700; line-height: 1.25; letter-spacing: -.01em;
  margin: 2.2em 0 .6em; color: var(--text);
}
.body h1 { font-size: 2.1em; font-weight: 900; margin-top: 0; }
.body h2 { font-size: 1.55em; padding-top: 1.2em; border-top: 1px solid var(--rule); }
.body h3 { font-size: 1.25em; }
.body h4 { font-size: 1.08em; }
.body h5, .body h6 { font-size: 1em; }
.body section:first-of-type > h2:first-child { border-top: 0; padding-top: 0; }

.body h1 code, .body h2 code, .body h3 code, .body h4 code { font-size: .95em; }

a.headerlink {
  visibility: hidden; margin-left: .35em; padding: 0 .2em;
  color: var(--faint) !important; font-weight: 400; text-decoration: none;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink,
h4:hover > a.headerlink, h5:hover > a.headerlink, h6:hover > a.headerlink,
dt:hover > a.headerlink, caption:hover > a.headerlink,
p.caption:hover > a.headerlink, div.code-block-caption:hover > a.headerlink,
figcaption:hover > a.headerlink {
  visibility: visible;
}
a.headerlink:hover { color: var(--accent) !important; }

/* ----------------------------------------------------------------- prose */

.body p { margin: 0 0 1em; }
.body ul, .body ol { padding-left: 1.4em; margin: 0 0 1em; }
.body li > p { margin-bottom: .4em; }
.body li > p:only-child { margin-bottom: .2em; }
.body ul.simple > li, .body ol.simple > li { margin-bottom: .25em; }
.body dl { margin: 0 0 1em; }
.body dd { margin-left: 1.5em; }
.body hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.body blockquote { margin: 0 0 1em; padding-left: 1em; border-left: 3px solid var(--rule); color: var(--muted); }
.body .rubric { font-weight: 700; margin-top: 1.5em; }

.body section:target > h1, .body section:target > h2, .body section:target > h3,
.body section:target > h4, .body dt:target, .body span:target ~ h2,
.body span:target ~ h3 {
  background: var(--target-bg); border-radius: 4px;
}

.highlighted { background: var(--target-bg); border-radius: 2px; }

/* ------------------------------------------------------------------ code */

code.literal, .body code.docutils {
  font-size: .95em;
  color: var(--inline-code);
  overflow-wrap: anywhere;
}
/* references and code in headings, signatures, breadcrumbs: own colour */
.body a code.docutils, .body code.xref, .body h1 code.docutils, .body h2 code.docutils,
.body h3 code.docutils, .body h4 code.docutils, .breadcrumbs code.docutils,
.prev-next code.docutils, dt code.docutils {
  background: none; padding: 0; color: inherit;
}
/* basic.css sets references in bold */
code.xref, a code { font-weight: 400; }
a:hover code { text-decoration: underline; }

div[class*="highlight-"] { margin: 0 0 1.2em; }
div.highlight { position: relative; border-radius: 6px; }
div.highlight pre {
  margin: 0; padding: .75rem 1rem;
  border: 1px solid var(--rule); border-radius: 6px;
  font-size: .92em; line-height: 1.5;
  overflow-x: auto; scrollbar-width: thin;
  tab-size: 4;
}
.body pre { font-size: .92em; line-height: 1.5; }

.copy-button {
  position: absolute; top: .45rem; right: .45rem;
  display: inline-flex; padding: .3rem; border: 0; border-radius: 5px;
  background: var(--bg-soft); color: var(--faint); cursor: pointer;
  opacity: 0; transition: opacity .15s;
}
.copy-button svg { width: 1rem; height: 1rem; }
div.highlight:hover .copy-button, .copy-button:focus-visible { opacity: 1; }
.copy-button:hover { color: var(--text); }
.copy-button.done { color: #869a37; opacity: 1; }
@media (hover: none) { .copy-button { opacity: .8; } }

div.code-block-caption {
  font-size: .88em; color: var(--muted); padding: .4rem 0 .3rem;
}
div.literal-block-wrapper { margin: 0 0 1.2em; }
div.literal-block-wrapper div[class*="highlight-"] { margin: 0; }

span.linenos, td.linenos .normal { color: var(--faint); padding-right: .8em; }

/* ------------------------------------------------------- API descriptions */

dl.py, dl.c, dl.cpp, dl.js, dl.std { margin: 0 0 1.4em; }

dl.py > dt, dl.c > dt, dl.cpp > dt, dl.js > dt {
  font-family: var(--mono); font-weight: 400; font-size: .97em;
  line-height: 1.45;
}

/* top level classes and functions: signature box */
dl.py:not(.attribute):not(.gattribute):not(.method):not(.property):not(.classmethod):not(.staticmethod) > dt {
  background: var(--sig-bg);
  border-left: 3px solid var(--accent);
  padding: .45rem .75rem .45rem 3.25rem; text-indent: -2.5rem;
  border-radius: 0 4px 4px 0;
}
/* members: lighter */
dl.py.method > dt, dl.py.attribute > dt, dl.py.property > dt,
dl.py.classmethod > dt, dl.py.staticmethod > dt {
  border-top: 1px solid var(--rule);
  padding: .4rem 0 .1rem 2.5rem; text-indent: -2.5rem;
}

dl.py > dt em.property { color: var(--muted); font-style: normal; }
dt .sig-prename, dt .descclassname { color: var(--muted); }
dt .sig-name, dt .descname { font-weight: 700; color: var(--text); font-size: 1em; }
dt .sig-paren { color: var(--muted); }
dt em.sig-param { font-style: normal; }
dt em.sig-param .n:first-child { color: var(--text); }
dt .default_value, dt em.sig-param .o + .default_value { color: var(--muted); }
dt .sig-return { color: var(--muted); }
/* [source] links (sphinx.ext.viewcode), at the right of the signature */
dt .viewcode-link, dt a.reference.internal > .viewcode-link {
  float: right; margin-left: .8em;
  font-family: var(--font); font-size: .8em; color: var(--faint);
}
dt a:hover > .viewcode-link { color: var(--accent); }
dt a.reference.internal { text-indent: 0; }

dl.py > dd, dl.c > dd, dl.cpp > dd, dl.js > dd { margin: .5rem 0 0 1.5rem; }
dl.py > dd > p:first-child { margin-top: .2rem; }

/* Guts properties: one compact row per attribute, name left, type line and
   help text right. */

dl.py.gattribute {
  display: grid; grid-template-columns: minmax(13rem, max-content) minmax(0, 1fr);
  column-gap: 1.25rem; align-items: baseline;
  margin: 0; padding: .35rem 0;
  border-top: 1px solid var(--rule);
}
dl.py.gattribute + dl.py.gattribute { border-top-style: dotted; }
dl.py.gattribute > dt {
  font-size: .95em; white-space: nowrap; padding: 0;
  background: none; border: 0; text-indent: 0;
}
dl.py.gattribute > dt em.property { color: var(--guts); }
dl.py.gattribute > dt em.property .pre { font-size: .8em; }
dl.py.gattribute > dd { margin: 0; min-width: 0; }
dl.py.gattribute > dd > p { margin: 0 0 .3em; }
dl.py.gattribute > dd > p:first-child { color: var(--muted); font-size: .92em; }
dl.py.gattribute > dd > p:first-child em { font-style: normal; color: var(--faint); }
dl.py.gattribute > dd > p:first-child code { background: none; padding: 0; }
@media (max-width: 599px) {
  dl.py.gattribute { grid-template-columns: minmax(0, 1fr); }
  dl.py.gattribute > dd { padding-left: 1.2rem; }
}

/* Parameters / Returns / Raises */
dl.field-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem 1.25rem; margin: .8rem 0 1rem; }
dl.field-list > dt {
  font-family: var(--font); font-weight: 700; font-size: .85em;
  color: var(--muted); padding: .1rem 0 0; background: none; border: 0; text-indent: 0;
}
dl.field-list > dt::after { content: none; }
dl.field-list > dd { margin: 0; }
dl.field-list > dd > ul { list-style: none; padding: 0; margin: 0; }
dl.field-list > dd > ul > li { margin-bottom: .4em; }
dl.field-list > dd p { margin: 0 0 .3em; }
dl.field-list strong { font-family: var(--mono); font-weight: 700; }
dl.field-list em { color: var(--muted); }
@media (max-width: 599px) {
  dl.field-list { grid-template-columns: minmax(0, 1fr); }
}

/* autosummary and other tables of objects */
table.autosummary td:first-child { white-space: nowrap; }
table.autosummary td { vertical-align: top; }
table.autosummary p { margin: 0; }

/* ------------------------------------------------------------ admonitions */

div.admonition, div.topic, aside.topic, div.seealso, div.versionadded,
div.versionchanged, div.deprecated, aside.sidebar {
  margin: 1.2em 0; padding: .7rem 1rem;
  border: 1px solid var(--rule); border-left: 3px solid var(--note);
  border-radius: 0 6px 6px 0;
  background: var(--note-bg);
}
div.admonition > :last-child, div.topic > :last-child, aside.topic > :last-child,
div.seealso > :last-child { margin-bottom: 0; }
p.admonition-title, p.topic-title {
  font-weight: 700; margin: 0 0 .3em; color: var(--note);
}
p.admonition-title::after { content: none; }

div.admonition.tip, div.admonition.hint, div.admonition.important {
  border-left-color: var(--tip); background: var(--tip-bg);
}
div.admonition.tip > .admonition-title, div.admonition.hint > .admonition-title,
div.admonition.important > .admonition-title { color: var(--tip); }

div.admonition.warning, div.admonition.caution, div.admonition.attention,
div.deprecated {
  border-left-color: var(--warning); background: var(--warning-bg);
}
div.admonition.warning > .admonition-title, div.admonition.caution > .admonition-title,
div.admonition.attention > .admonition-title { color: var(--warning); }

div.admonition.danger, div.admonition.error {
  border-left-color: var(--danger); background: var(--danger-bg);
}
div.admonition.danger > .admonition-title, div.admonition.error > .admonition-title { color: var(--danger); }

div.versionadded, div.versionchanged, div.deprecated {
  padding: .3rem .8rem; background: none;
}
span.versionmodified { font-weight: 700; font-style: normal; }
div.versionadded > :last-child, div.versionchanged > :last-child, div.deprecated > :last-child { margin-bottom: 0; }

div.topic, aside.topic { background: none; border-left-color: var(--rule-strong); }
aside.sidebar { float: none; width: auto; margin: 1.2em 0; background: var(--bg-soft); border-left-color: var(--rule-strong); }

/* ---------------------------------------------------------------- tables */

table.docutils {
  border-collapse: collapse; margin: 1em 0 1.5em; font-size: .94em;
  font-variant-numeric: tabular-nums;
  display: block; max-width: 100%; overflow-x: auto;
  border: 0;
}
table.docutils th, table.docutils td {
  padding: .4rem .8rem .4rem 0; border: 0; border-bottom: 1px solid var(--rule);
  text-align: left; vertical-align: top;
}
table.docutils td:last-child, table.docutils th:last-child { padding-right: 0; }
table.docutils thead th { border-bottom: 1px solid var(--rule-strong); font-weight: 700; }
table.docutils td p, table.docutils th p { margin: 0 0 .3em; }
table.docutils td p:last-child, table.docutils th p:last-child { margin-bottom: 0; }
table.docutils caption { caption-side: bottom; text-align: left; color: var(--muted); font-size: .9em; padding-top: .4rem; }
table.field-list, table.footnote, table.citation { display: table; }

/* --------------------------------------------------------------- figures */

figure, div.figure { margin: 1.5em 0; }
figure img, div.figure img { display: block; }
figure.align-center img, div.figure.align-center img { margin: 0 auto; }
figcaption, p.caption { color: var(--muted); font-size: .9em; margin-top: .5rem; }
figcaption p { margin: 0; }
.body img.align-center { display: block; margin-left: auto; margin-right: auto; }
/* floated images (:align: left / right), e.g. logos next to page titles:
   basic.css gives them no bottom margin */
.body img.align-left, .body figure.align-left { margin: 0 1.5em 1.2em 0; }
.body img.align-right, .body figure.align-right { margin: 0 0 1.2em 1.5em; }

div.math { overflow-x: auto; }
img.math { vertical-align: middle; }

/* ------------------------------------------------------- footnotes, misc */

aside.footnote, dl.footnote { font-size: .92em; }
.footnote-reference, .citation-reference { font-size: .8em; vertical-align: super; }
kbd {
  font-size: .88em; padding: .05em .35em; border: 1px solid var(--rule-strong);
  border-bottom-width: 2px; border-radius: 4px; background: var(--bg-soft);
}
abbr[title] { text-decoration: underline dotted; }
.guilabel, .menuselection { font-weight: 700; }

/* search results and indices */
ul.search { list-style: none; padding: 0; }
ul.search li { padding: .6rem 0; border-bottom: 1px solid var(--rule); }
ul.search li p.context { color: var(--muted); font-size: .92em; margin: .2rem 0 0; }
#search-results h2 { border: 0; padding: 0; }
table.indextable td { vertical-align: top; padding-right: 1rem; }
table.indextable ul { padding-left: 1rem; }
table.modindextable td { padding: .2rem .8rem .2rem 0; }
div.modindex-jumpbox, div.genindex-jumpbox {
  border: 0; border-bottom: 1px solid var(--rule); padding: .4rem 0; margin-bottom: 1rem;
}

/* keyword chips: <div class="keywords"><span>...</span></div>, span.tag */
div.keywords { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1.5rem; }
div.keywords span, span.tag {
  display: inline-block; padding: .15rem .65rem;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--bg-soft); color: var(--text); font-size: .9em;
}

/* ------------------------------------------------------ local contents */

/* ".. contents::" as a plain list, like a toctree, not as a box. Headings
   linking back to it (backlinks, the docutils default) look like normal
   headings. */
.body nav.contents {
  float: none; width: auto; margin: 1.2em 0 1.6em; padding: 0;
  border: none; background: none;
}
.body nav.contents p.topic-title {
  margin: 0 0 .4em; font-size: 1em; font-weight: 700; color: var(--text);
}
.body nav.contents ul { margin-top: .15em; margin-bottom: .15em; }
.body a.toc-backref { color: inherit !important; text-decoration: none !important; }

/* ------------------------------------------------------------- subtitles */

/* Title subtitles from the :subtitle: role: hidden where space is short,
   below the name in the page heading, after a dash in tables of contents. */
.side-nav .subtitle, .breadcrumbs .subtitle, .prev-next .subtitle,
.doc-title .subtitle { display: none; }
.body h1 .subtitle {
  display: block; margin-top: .35em;
  font-size: .5em; font-weight: 400; line-height: 1.3; color: var(--muted);
}
.body h1 .subtitle-sep { display: none; }
.body .subtitle { color: var(--muted); }

/* ---------------------------------------------------------------- cards */

/* .. container:: cards, with one ``.. container:: card`` per card. The
   first paragraph of a card is its title. */
.body div.cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem; margin: 1.2em 0 1.6em;
}
@media (max-width: 640px) {
  .body div.cards { grid-template-columns: minmax(0, 1fr); }
}
.body div.card {
  padding: .9rem 1.1rem 1rem;
  border: 1px solid var(--rule); border-radius: 6px;
  background: var(--bg);
}
.body div.card > p:first-child {
  margin: 0 0 .4em; font-size: 1.1em; font-weight: 700;
}
.body div.card > p:first-child a { color: var(--text); }
.body div.card > p:first-child a:hover { color: var(--accent); }
.body div.card > p:last-child { margin-bottom: 0; }
.body div.card > p:not(:first-child) { color: var(--muted); font-size: .95em; }

/* ------------------------------------------------------ previous / next */

.prev-next {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
.prev-next a {
  display: flex; flex-direction: column; gap: .15rem;
  padding: .3rem 0;
  color: var(--text) !important;
}
.prev-next a:hover { text-decoration: none; }
.prev-next a:hover .title { text-decoration: underline; }
.prev-next .label { font-size: .78em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.prev-next .title { color: var(--accent); }
.prev-next .next { text-align: right; grid-column: 2; }
.prev-next .label::before { content: "‹ "; }
.prev-next .next .label::before { content: none; }
.prev-next .next .label::after { content: " ›"; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted); font-size: .85em;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; justify-content: center;
  padding: 1.5rem 16px 2rem;
}
.site-footer a { color: var(--muted) !important; }
.site-footer a:hover { color: var(--accent) !important; }

/* ----------------------------------------------------------------- print */

@media print {
  .topbar, .side-nav, .side-nav-backdrop, .prev-next, .copy-button, a.headerlink { display: none !important; }
  .main { padding: 0; }
  body { font-size: 11pt; }
}
