/* Elementary Computational Physics — Jupyter Book site theme.
   Matches the notebook header identity defined in ecp/style.py.

   IMPORTANT: the site supports light AND dark mode (the theme toggle / OS
   preference). We therefore do NOT hard-code a text colour on the body — the
   theme already picks a readable colour per mode. We only:
     - apply the series fonts (both modes),
     - brand the *headings* per mode (ink navy in light, warm near-white in dark),
     - colour links with the amber accent (brightened slightly for dark),
     - hide stripped solution-cell inputs.
   This avoids the dark-on-dark contrast problem of hard-coding --ecp-ink. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,900&family=Source+Serif+4:wght@400;600&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --ecp-ink: #16213e;
  --ecp-accent: #c0851a;
  --ecp-accent-bright: #e0a93f;   /* amber for dark backgrounds */
  --ecp-heading-dark: #f3efe3;    /* warm near-parchment for dark mode headings */
}

/* ---- Fonts: both modes ------------------------------------------------- */
.bd-article,
.bd-article p,
.bd-article li {
  font-family: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  font-size: 1.02rem;
  /* no colour here — let the theme set readable body text in light AND dark */
}

.bd-article h1,
.bd-article h2,
.bd-article h3,
.bd-article h4 {
  font-family: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.01em;
}

.bd-article h2 {
  border-bottom: 1px solid var(--pst-color-border, rgba(128, 128, 128, 0.25));
  padding-bottom: 0.25rem;
}

code, pre, .highlight {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
}
.cell_output pre { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; }

/* ---- Brand heading colour: LIGHT mode --------------------------------- */
html[data-theme="light"] .bd-article h1,
html[data-theme="light"] .bd-article h2,
html[data-theme="light"] .bd-article h3,
html[data-theme="light"] .bd-article h4 {
  color: var(--ecp-ink);
}
html[data-theme="light"] .bd-article a { color: var(--ecp-accent); }
html[data-theme="light"] .bd-article a:hover { color: var(--ecp-ink); }

/* ---- Brand heading colour: DARK mode (readable, warm) ----------------- */
html[data-theme="dark"] .bd-article h1,
html[data-theme="dark"] .bd-article h2,
html[data-theme="dark"] .bd-article h3,
html[data-theme="dark"] .bd-article h4 {
  color: var(--ecp-heading-dark);
}
html[data-theme="dark"] .bd-article a { color: var(--ecp-accent-bright); }
html[data-theme="dark"] .bd-article a:hover { color: #ffffff; }

/* ---- Solution-cell visibility ------------------------------------------
   Solution INPUTS are hidden on the public site by tools/strip_solutions.py,
   which replaces the source with a placeholder and adds the `remove-input`
   tag BEFORE the build -- nothing reaches the HTML, so no CSS is needed (and
   CSS `display:none` would be no protection anyway: hidden content still
   ships in the page source). An earlier blanket rule here also suppressed
   every solution cell on the AUTHOR-ONLY solutions build, which shares this
   stylesheet -- hiding exactly the worked solution code that site exists to
   show. Removed 2026-07-03 (same fix as ECP): visibility is decided by the
   pipelines, never by the stylesheet. */

/* ---- Admonitions match the palette ------------------------------------ */
.admonition { border-left-color: var(--ecp-accent) !important; }

/* ---- Figure-caption labels: bold, amber, upright "Fig. N." ------------
   The theme renders the label as <span class="caption-number">Fig. N </span>
   (italic, with a trailing space) ahead of the caption body. We restyle ONLY
   the label span: de-italicise, bold, amber accent (brightened for dark), and
   add the APS/Nature period after the number. Making the span inline-block
   trims its trailing space so the period sits flush ("Fig. 41."), and a small
   right margin restores the gap to the caption text. The caption BODY is left
   exactly as the theme renders it (roman, with inline <em> emphasis intact),
   so we do NOT set font-style on figcaption itself. In-text {numref} links use
   .std-numref (not .caption-number), so they keep reading "Fig. N" with no
   period — which is why the period lives here in CSS, not in numfig_format
   (a numfig_format period would also append to every in-text ref, producing
   "…in Fig. 42.." at sentence ends). */
figcaption .caption-number,
.bd-article figcaption .caption-number {
  display: inline-block;
  margin-right: 0.3em;
  font-weight: 700;
  font-style: normal;
}
figcaption .caption-number::after { content: "."; }
html[data-theme="light"] figcaption .caption-number { color: var(--ecp-accent); }
html[data-theme="dark"] figcaption .caption-number { color: var(--ecp-accent-bright); }
