/* ─── Design tokens ─────────────────────────────────────────── */
:root {
    --ink: #1a1a1a;
    --ink-soft: #4a4a4a;
    --ink-faint: #888;
    --rule: #d8d3cb;
    --page-bg: #faf9f7;
    --accent: #2a5298;
    --accent-light: #e8edf8;
    --ff-body: 'Inter', system-ui, sans-serif;
    --ff-display: 'Playfair Display', Georgia, serif;
    --fs-body: 1.0625rem;
    /* 17px */
    --lh-body: 1.8;
    --measure: 68ch;
    /* comfortable reading width */
}

/* ─── Base ──────────────────────────────────────────────────── */
html {
    font-size: 16px;
    background: var(--page-bg);
}

body {
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--ink);
    background: var(--page-bg);
    margin: 0;
}

/* ─── Running header ────────────────────────────────────────── */
#running-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--page-bg);
  border-bottom: 1px solid var(--rule);
  padding: 0.45rem 2rem;
  line-height: 1.5;
  flex-wrap: wrap;
}

#running-header .doc-title {
  font-family: var(--ff-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
}

#running-header .home-link {
  font-family: var(--ff-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

#running-header .home-link:hover {
  color: var(--accent);
}

@media (max-width: 480px) {
  #running-header {
    justify-content: center;
    text-align: center;
  }
  #running-header .doc-title {
    text-align: center;
  }
}

/* ─── Page wrapper ──────────────────────────────────────────── */
#page-content {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 5.5rem 1.5rem 3rem;
    /* top clears fixed header */
}

/* ─── Pagination nav ────────────────────────────────────────── */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--rule);
    flex-wrap: wrap;
}

.pager a,
.pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.6rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--ink-soft);
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.pager a:hover {
    background: var(--accent-light);
    border-color: var(--rule);
    color: var(--accent);
}

.pager .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

#pager-top .pager {
    border-top: none;
    padding-top: 0;
}

#pager-bottom .pager {
    border-top: none;
    padding-top: 0;
}

.pager .ellipsis {
    color: var(--ink-faint);
    border: none;
    cursor: default;
}

.pager .btn-prev,
.pager .btn-next {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    padding: 0 0.9rem;
    border: 1px solid var(--rule);
}

.pager .btn-prev:hover,
.pager .btn-next:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.pager .disabled {
    color: var(--rule);
    cursor: default;
    pointer-events: none;
}

.pager-info {
    text-align: center;
    font-size: 0.78rem;
    color: var(--ink-faint);
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

/* ─── Copyright footer ──────────────────────────────────────── */
#page-footer {
    border-top: 1px solid var(--rule);
    padding: 1.25rem 1.5rem;
    max-width: var(--measure);
    margin: 0 auto 2rem;
    font-size: 0.78rem;
    color: var(--ink-faint);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
       CONTENT COMPONENTS — examples below
    ═══════════════════════════════════════════════════════════════ */

/* ─── (2) Main title / subtitle ────────────────────────────── */
.pg-title {
    font-family: var(--ff-display);
    font-size: clamp(2rem, 5vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
    margin: 0 0 0.4rem;
}

.pg-subtitle {
    font-size: 1.15rem;
    color: var(--ink-soft);
    font-weight: 400;
    /* margin: 0 0 2.5rem; */
    line-height: 1.5;
}

.pg-byline {
    font-size: 1.15rem;
    text-align: left;
    color: var(--ink-soft);
    font-weight: 400;
    /* margin: 0 0 2.5rem; */
    line-height: 1.5;
}

.section-title {
    font-family: var(--ff-display);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.25;
    /* margin: 2.5rem 0 0.25rem; */
    color: var(--ink);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--ink-soft);
    font-weight: 500;
    letter-spacing: 0.02em;
    /* margin: 0 0 1.25rem; */
}

.section-subtitle2 {
    font-size: 1rem;
    color: var(--ink-soft);
    font-weight: 300;
    letter-spacing: 0.02em;
    margin: 0 0 1.25rem;
}

p.justified {
    text-align: justify;
    text-align-last: left;
    hyphens: auto;
    text-indent: 1.5em;
}

p.justified.no-indent {
    text-indent: 0;
}

/* ─── (3a) Image centered ────────────────────────────────────── */
.img-center {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 3px;
}

.img-caption-center {
    display: block;
    text-align: center;
    font-size: 0.82rem;
    color: var(--ink-faint);
    margin-top: -1.25rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* ─── (3b) Image centered at the bottom of the page's body ────────────────────────────────────── */
.img-bottom {
    display: block;
    max-width: 100%;
    height: auto;
    margin: auto auto 2rem;
    border-radius: 3px;
}

/* ─── (4) Block quotation ───────────────────────────────────── */
.blockquote-styled {
    /* border-left: 3px solid var(--accent); */
    padding: 0.75rem 0 0.75rem 1.5rem;
    margin: 1rem 0 0.25rem;
}

.blockquote-styled p {
    font-family: var(--ff-display);
    font-style: italic;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    margin: 0;
}

.blockquote-source {
    font-size: 0.82rem;
    color: var(--ink-faint);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.blockquote-source::before {
    content: "— ";
}

/* ─── (5) Float images with text wrap ──────────────────────── */
figure.img-float-left,
figure.img-float-right {
    display: table;
    /* shrink-wraps to the widest child */
    margin-bottom: 1rem;
}

figure.img-float-left {
    float: left;
    margin-right: 1.75rem;
}

figure.img-float-right {
    float: right;
    margin-left: 1.75rem;
}

figure.img-float-left img,
figure.img-float-right img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}

figure.img-float-left figcaption,
figure.img-float-right figcaption {
    display: table-caption;
    caption-side: bottom;
    font-size: 0.8rem;
    color: var(--ink-faint);
    font-style: italic;
    line-height: 1.4;
    text-align: center;
    padding-top: 0.35rem;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ─── (6) Footnotes ─────────────────────────────────────────── */
.footnote-marker,
.endnote-marker {
    font-size: 0.7em;
    vertical-align: super;
    line-height: 0;
    color: var(--accent);
    font-weight: 600;
}

.footnotes-section {
    border-top: 1.5px solid var(--ink);
    width: 100%;
    min-width: 200px;
    margin-top: 3rem;
    padding-top: 0.75rem;
}

.footnotes-section ul {
    list-style: none;
    padding-left: 1.5rem;
    margin: 0;
}

.footnotes-section li {
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.55;
    margin-bottom: 0.4rem;
    text-indent: -1.25rem;
}

/* ─── (7) Endnotes ──────────────────────────────────────────── */
.endnotes-section h2 {
    font-family: var(--ff-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--rule);
}

.endnote {
    display: grid;
    grid-template-columns: 1.8rem 1fr;
    gap: 0 1rem;
    margin-bottom: 0.9rem;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--ink-soft);
}

.endnote-num {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.8rem;
    padding-top: 0.1rem;
}

.endnote-body {
    min-width: 0;
    /* prevents grid blowout */
}

.internal-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

.internal-link:hover {
    text-decoration: underline;
}

/* ─── (8) Bibliography ──────────────────────────────────────── */
.bibliography-section h2 {
    font-family: var(--ff-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--rule);
}

.bib-entry {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.1rem;
    font-size: 0.88rem;
    line-height: 1.65;
    padding-left: 2rem;
    text-indent: -2rem;
}

.bib-entry .bib-authors {
    font-weight: 600;
    color: var(--ink);
}

.bib-entry .bib-title {
    font-style: italic;
}

.bib-entry .bib-pub {
    color: var(--ink-soft);
}

.bib-entry .bib-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

.bib-entry .bib-link:hover {
    text-decoration: underline;
}

.bib-entry .bib-note {
    display: block;
    color: var(--ink-faint);
    font-size: 0.8rem;
    margin-top: 0.15rem;
    font-style: italic;
}

/* ─── Horizontal rule ───────────────────────────────────────── */
hr.section-rule {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 2.5rem 0;
}