@charset "UTF-8";
/* ==========================================================================
   UECF.NET Web Book — 20th Anniversary Souvenir (2017)
   Pure CSS3, mobile-first, no frameworks.

   Contents
     1.  Design tokens (light + dark)
     2.  Reset and base elements
     3.  Reading progress bar
     4.  Sticky site header
     5.  Primary navigation
     6.  Search overlay
     7.  Breadcrumb
     8.  Layout shell
     9.  Table of contents sidebar
     10. Landing page (index)
     11. Chapter reading view
     12. Facsimile pages and photo galleries
     13. Lightbox
     14. Pager (previous / next)
     15. Scroll-to-top
     16. Footer
     17. Utilities, motion and print
   ========================================================================== */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  /* Brand palette — anchored on the UECF.NET theme colour #101B31 and the
     maroon / gold of the printed souvenir cover. */
  --navy-900: #0b1220;
  --navy-800: #101b31;
  --navy-700: #1b2c4e;
  --navy-600: #274070;
  --gold-600: #8a6d28;
  --gold-500: #a4863c;
  --gold-400: #c8a24a;
  --gold-300: #d9ba6b;
  --maroon-600: #7b1220;

  /* Semantic tokens — light theme */
  --bg: #ffffff;
  --bg-alt: #f6f7fa;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --text: #1b2333;
  --text-muted: #56607a;
  --heading: #101b31;
  --line: #e2e6ee;
  --line-strong: #c9d0dd;
  --brand: #101b31;
  --brand-contrast: #ffffff;
  --accent: #8a6d28;
  --accent-soft: #fbf5e6;
  --link: #1d4e9b;
  --link-hover: #14356b;
  --mark-bg: #ffe9a8;
  --mark-text: #4a3708;
  --shadow-sm: 0 1px 2px rgba(16, 27, 49, .07), 0 2px 8px rgba(16, 27, 49, .06);
  --shadow-md: 0 4px 12px rgba(16, 27, 49, .10), 0 12px 32px rgba(16, 27, 49, .10);
  --shadow-lg: 0 12px 40px rgba(16, 27, 49, .22);

  /* Metrics */
  --header-h: 60px;
  --measure: 40rem;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --gutter: 1rem;
  --reader-scale: 1;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Palladio,
    "Book Antiqua", Georgia, "Times New Roman", serif;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0e1729;
  --surface: #141d30;
  --surface-2: #1a2439;
  --text: #e4e9f2;
  --text-muted: #9aa6bd;
  --heading: #f2f5fa;
  --line: #253048;
  --line-strong: #33415f;
  --brand: #0b1220;
  --brand-contrast: #f2f5fa;
  --accent: #d9ba6b;
  --accent-soft: #1e2942;
  --link: #8ab4f8;
  --link-hover: #b8d1fb;
  --mark-bg: #6b5510;
  --mark-text: #ffeec2;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .55);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, .66);

  color-scheme: dark;
}

/* Respect the operating-system preference until the reader chooses. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #0b1220;
    --bg-alt: #0e1729;
    --surface: #141d30;
    --surface-2: #1a2439;
    --text: #e4e9f2;
    --text-muted: #9aa6bd;
    --heading: #f2f5fa;
    --line: #253048;
    --line-strong: #33415f;
    --brand: #0b1220;
    --brand-contrast: #f2f5fa;
    --accent: #d9ba6b;
    --accent-soft: #1e2942;
    --link: #8ab4f8;
    --link-hover: #b8d1fb;
    --mark-bg: #6b5510;
    --mark-text: #ffeec2;

    color-scheme: dark;
  }
}

/* ==========================================================================
   2. Reset and base elements
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .6em;
  color: var(--heading);
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.05rem + 1.3vw, 1.9rem); }
h3 { font-size: clamp(1.13rem, 1rem + .6vw, 1.35rem); }

p { margin: 0 0 1.1em; }

a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
  text-underline-offset: .18em;
}

a:hover,
a:focus-visible { color: var(--link-hover); text-decoration-color: currentColor; }

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.2rem 0;
}

mark,
.hit {
  background: var(--mark-bg);
  color: var(--mark-text);
  border-radius: 3px;
  padding: 0 .12em;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: .7rem 1.1rem;
  background: var(--brand);
  color: #fff;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .62rem 1.1rem;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}

.btn:hover { background: var(--surface-2); border-color: var(--accent); color: var(--text); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}

.btn--primary:hover {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: #fff;
}

.btn--gold {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  border-color: var(--gold-600);
  color: #22190a;
}

.btn--gold:hover { filter: brightness(1.06); color: #22190a; }

.btn--ghost { background: transparent; }

.btn--icon {
  min-width: 44px;
  padding: .5rem;
  border-radius: var(--radius-sm);
}

.btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   3. Reading progress bar
   ========================================================================== */

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 90;
  background: transparent;
  pointer-events: none;
}

.progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  transition: width .1s linear;
}

/* ==========================================================================
   4. Sticky site header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--navy-800);
  color: #fff;
  border-bottom: 3px solid var(--gold-500);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: .55rem;
  max-width: 78rem;
  margin: 0 auto;
  padding: .45rem var(--gutter);
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}

.brand__mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600));
  color: #1b1405;
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: .62rem;
  letter-spacing: .01em;
}

.brand__text { min-width: 0; line-height: 1.15; }

.brand__title {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.02rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__sub {
  display: block;
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--gold-300);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-tools { display: flex; align-items: center; gap: .3rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}

.icon-btn:hover { background: rgba(255, 255, 255, .16); border-color: var(--gold-400); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-expanded="true"] { background: var(--gold-500); border-color: var(--gold-500); color: #1b1405; }

.search-trigger {
  display: none;
  align-items: center;
  gap: .5rem;
  height: 42px;
  padding: 0 .75rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .78);
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
  min-width: 15rem;
}

.search-trigger:hover { background: rgba(255, 255, 255, .14); border-color: var(--gold-400); }
.search-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.search-trigger kbd {
  margin-left: auto;
  padding: .1rem .38rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: .72rem;
}

@media (min-width: 60rem) {
  .search-trigger { display: inline-flex; }
  .search-trigger + .icon-btn--search { display: none; }
}

/* ==========================================================================
   5. Primary navigation
   ========================================================================== */

.site-nav {
  display: none;
  background: var(--navy-700);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.site-nav.is-open { display: block; }

.site-nav__list {
  max-width: 78rem;
  margin: 0 auto;
  padding: .4rem var(--gutter) .7rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.site-nav__list a {
  display: block;
  padding: .62rem .5rem;
  color: #e8edf7;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
}

.site-nav__list a:hover,
.site-nav__list a:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; }
.site-nav__list a[aria-current="page"] { background: var(--gold-500); color: #1b1405; font-weight: 600; }

@media (min-width: 60rem) {
  .site-nav { display: block !important; }
  .site-nav__list { flex-direction: row; gap: .25rem; padding-top: .25rem; padding-bottom: .25rem; }
  .nav-toggle { display: none; }
}

/* ==========================================================================
   6. Search overlay
   ========================================================================== */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  padding: 1rem;
  background: rgba(9, 14, 26, .62);
  backdrop-filter: blur(3px);
}

.search-overlay.is-open { display: block; }

.search-panel {
  max-width: 44rem;
  margin: 3vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.search-panel__head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--line);
}

.search-panel__head svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--text-muted); stroke-width: 2; }

#search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  padding: .45rem 0;
}

#search-input:focus { outline: none; }

.search-close {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: .3rem .55rem;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.search-meta {
  padding: .45rem .95rem;
  font-size: .8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}

.search-results {
  list-style: none;
  margin: 0;
  padding: .35rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.search-results li { margin: 0; }

.search-results a {
  display: block;
  padding: .62rem .7rem;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
}

.search-results a:hover,
.search-results li.is-active a { background: var(--surface-2); }

.search-results .sr-title {
  display: block;
  font-weight: 600;
  font-size: .96rem;
  color: var(--heading);
}

.search-results .sr-part {
  display: block;
  font-size: .74rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .1rem;
}

.search-results .sr-snippet {
  display: block;
  font-size: .87rem;
  color: var(--text-muted);
  margin-top: .18rem;
}

.search-empty { padding: 1.4rem .95rem; color: var(--text-muted); font-size: .92rem; }

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .2rem .95rem 1rem;
}

.search-suggestions button {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 999px;
  padding: .3rem .7rem;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}

.search-suggestions button:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   7. Breadcrumb
   ========================================================================== */

.breadcrumb {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  font-size: .84rem;
}

.breadcrumb ol {
  max-width: 78rem;
  margin: 0 auto;
  padding: .55rem var(--gutter);
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}

.breadcrumb li { display: flex; align-items: center; gap: .3rem; color: var(--text-muted); }
.breadcrumb li + li::before { content: "›"; color: var(--line-strong); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--link); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }

/* ==========================================================================
   8. Layout shell
   ========================================================================== */

.shell {
  max-width: 78rem;
  margin: 0 auto;
  padding: 1.4rem var(--gutter) 3rem;
}

.shell--reader { display: block; }

@media (min-width: 64rem) {
  .shell--reader {
    display: grid;
    grid-template-columns: 17.5rem minmax(0, 1fr);
    gap: 2.2rem;
    align-items: start;
  }
}

/* ==========================================================================
   9. Table of contents sidebar
   ========================================================================== */

.toc-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.4rem;
  overflow: hidden;
}

.toc-panel__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .8rem .9rem;
  border: 0;
  background: var(--surface-2);
  color: var(--heading);
  font: inherit;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
}

.toc-panel__head .chev {
  margin-left: auto;
  transition: transform .2s ease;
  flex: 0 0 auto;
}

.toc-panel__head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.toc-panel__head svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.toc-panel__body { padding: .5rem .55rem .8rem; }
.toc-panel__body[hidden] { display: none; }

.toc-part {
  margin: .7rem 0 .25rem;
  padding: 0 .5rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.toc-list { list-style: none; margin: 0; padding: 0; }

.toc-list a {
  display: flex;
  gap: .5rem;
  padding: .4rem .5rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.35;
  border-left: 3px solid transparent;
}

.toc-list a:hover { background: var(--surface-2); }

.toc-list a[aria-current="page"],
.toc-list a.is-current {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--heading);
  font-weight: 600;
}

.toc-list .num {
  flex: 0 0 1.6rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
  padding-top: .1rem;
}

.toc-list a.is-bookmarked .num::after { content: "★"; color: var(--gold-500); margin-left: .12rem; }

@media (min-width: 64rem) {
  .toc-panel {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    max-height: calc(100vh - var(--header-h) - 3rem);
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
  }
  .toc-panel__body { overflow-y: auto; }
}

/* ==========================================================================
   10. Landing page
   ========================================================================== */

.hero {
  background:
    radial-gradient(1100px 460px at 78% -12%, rgba(200, 162, 74, .28), transparent 62%),
    linear-gradient(160deg, var(--navy-800), var(--navy-700) 58%, var(--maroon-600));
  color: #f4f7fc;
  border-bottom: 4px solid var(--gold-500);
}

.hero__inner {
  max-width: 78rem;
  margin: 0 auto;
  padding: 2.2rem var(--gutter) 2.6rem;
  display: grid;
  gap: 1.8rem;
}

@media (min-width: 52rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 15.5rem) minmax(0, 1fr);
    gap: 2.6rem;
    align-items: center;
    padding-block: 3rem 3.4rem;
  }
}

.hero__cover {
  justify-self: center;
  max-width: 15.5rem;
  width: 100%;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .3);
}

.hero__eyebrow {
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin: 0 0 .55rem;
  font-weight: 700;
}

.hero h1 { color: #fff; margin-bottom: .35rem; }

.hero__author {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: #dfe6f2;
  margin: 0 0 1rem;
}

.hero__desc { color: #cfd8e8; max-width: 44rem; }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  list-style: none;
  margin: 1.2rem 0 1.5rem;
  padding: 0;
}

.hero__stats li {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .84rem;
  color: #eef2f9;
}

.hero__stats b { color: var(--gold-300); font-weight: 700; }

.hero__actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.section { margin: 2.6rem 0; }
.section__title { display: flex; align-items: baseline; gap: .7rem; margin-bottom: 1rem; }
.section__title h2 { margin: 0; }

.section__title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.lede {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: var(--measure);
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem 1.1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.card__part {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .3rem;
}

.card__title { font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem; color: var(--heading); margin-bottom: .35rem; }
.card__desc { font-size: .88rem; color: var(--text-muted); margin: 0 0 .7rem; }
.card__meta { margin-top: auto; font-size: .78rem; color: var(--text-muted); display: flex; gap: .8rem; flex-wrap: wrap; }

.contents-list { list-style: none; margin: 0; padding: 0; }

.contents-part {
  margin: 1.5rem 0 .5rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--heading);
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--gold-400);
}

.contents-list li a {
  display: flex;
  gap: .8rem;
  align-items: baseline;
  padding: .55rem .6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px dotted var(--line);
}

.contents-list li a:hover { background: var(--surface-2); }
.contents-list .c-num { flex: 0 0 2.1rem; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; font-size: .85rem; }
.contents-list .c-title { flex: 1 1 auto; }
.contents-list .c-time { flex: 0 0 auto; font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.updates { list-style: none; margin: 0; padding: 0; }

.updates li {
  display: flex;
  gap: .9rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}

.updates time {
  flex: 0 0 6.5rem;
  color: var(--accent);
  font-weight: 600;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: .94rem;
}

.callout p:last-child { margin-bottom: 0; }

/* ==========================================================================
   11. Chapter reading view
   ========================================================================== */

.reader { min-width: 0; }

.chapter-head { margin-bottom: 1.6rem; padding-bottom: 1.2rem; border-bottom: 2px solid var(--gold-400); }
.chapter-head__part { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .4rem; }
.chapter-head h1 { margin-bottom: .4rem; }
.chapter-head__author { font-family: var(--font-serif); font-style: italic; color: var(--text-muted); font-size: 1.05rem; margin: 0 0 .8rem; }

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  font-size: .8rem;
  color: var(--text-muted);
  align-items: center;
}

.chapter-meta .dot { color: var(--line-strong); }

.reader-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  padding: .6rem;
  margin-bottom: 1.6rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.reader-tools__label { font-size: .78rem; color: var(--text-muted); margin-right: .1rem; }
.reader-tools .spacer { flex: 1 1 auto; }
.reader-tools .btn { padding: .4rem .7rem; min-height: 38px; font-size: .85rem; }

.prose {
  max-width: var(--measure);
  font-family: var(--font-serif);
  font-size: calc(1.06rem * var(--reader-scale));
  line-height: 1.78;
}

.prose h2 {
  margin-top: 2.2rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--line);
  font-size: calc(1.42rem * var(--reader-scale));
}

.prose h3 { margin-top: 1.8rem; font-size: calc(1.16rem * var(--reader-scale)); }
.prose p { margin: 0 0 1.15em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin-bottom: .4em; }

.prose blockquote {
  margin: 1.5em 0;
  padding: .85em 1.1em;
  border-left: 4px solid var(--gold-400);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.verse-ref {
  color: var(--accent);
  font-weight: 600;
  font-style: normal;
  text-decoration: underline dotted;
  text-underline-offset: .16em;
  white-space: nowrap;
}

.verse-ref:hover { color: var(--link-hover); text-decoration-style: solid; }

.section-block { margin-bottom: 3rem; }
.section-block:last-child { margin-bottom: 1rem; }

.section-block__head {
  margin-bottom: 1.1rem;
  padding: .75rem .95rem;
  background: var(--surface-2);
  border-left: 4px solid var(--gold-400);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.section-block__head h2 { margin: 0; font-size: calc(1.25rem * var(--reader-scale)); }
.section-block__head .sub { display: block; margin-top: .2rem; font-size: .88rem; color: var(--text-muted); font-family: var(--font-sans); font-style: normal; }

.page-marker {
  display: block;
  margin: 2rem 0 1.1rem;
  font-family: var(--font-sans);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px dashed var(--line);
  padding-top: .5rem;
}

/* ==========================================================================
   12. Facsimile pages and photo galleries
   ========================================================================== */

.facsimile { margin: 1.4rem 0 2rem; }

.facsimile figure {
  margin: 0 0 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .55rem;
  box-shadow: var(--shadow-sm);
}

.facsimile img {
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: zoom-in;
}

.facsimile figcaption {
  margin-top: .5rem;
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-sans);
}

.gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  margin: 1.4rem 0 2rem;
}

@media (min-width: 40rem) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
}

.gallery figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .4rem;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease;
}

.gallery figure:hover { transform: translateY(-2px); border-color: var(--accent); }

.gallery img {
  width: 100%;
  aspect-ratio: 595 / 794;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: zoom-in;
}

.gallery figcaption { margin-top: .35rem; font-size: .74rem; color: var(--text-muted); text-align: center; }

/* ==========================================================================
   13. Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  background: rgba(6, 10, 18, .93);
  padding: 1rem;
}

.lightbox.is-open { display: flex; flex-direction: column; }

.lightbox__bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #e6ecf7;
  font-size: .85rem;
  padding-bottom: .6rem;
}

.lightbox__bar .spacer { flex: 1 1 auto; }

.lightbox__bar button {
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border-radius: var(--radius-sm);
  min-width: 42px;
  height: 40px;
  padding: 0 .7rem;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}

.lightbox__bar button:hover { background: rgba(255, 255, 255, .22); }

.lightbox__stage {
  flex: 1 1 auto;
  overflow: auto;
  display: grid;
  place-items: start center;
  -webkit-overflow-scrolling: touch;
}

.lightbox__stage img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  background: #fff;
}

.lightbox.is-zoomed .lightbox__stage img { max-width: none; width: 190%; cursor: grab; }

/* ==========================================================================
   14. Pager
   ========================================================================== */

.pager {
  display: grid;
  gap: .7rem;
  margin: 2.6rem 0 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 40rem) { .pager { grid-template-columns: 1fr 1fr; } }

.pager__link {
  display: flex;
  flex-direction: column;
  gap: .16rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  min-height: 62px;
  justify-content: center;
  transition: border-color .16s ease, background .16s ease;
}

.pager__link:hover { border-color: var(--accent); background: var(--surface-2); color: inherit; }
.pager__link--next { text-align: right; }
.pager__dir { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.pager__title { font-family: var(--font-serif); font-weight: 700; color: var(--heading); font-size: .98rem; line-height: 1.3; }
.pager__link--placeholder { opacity: .45; pointer-events: none; }

.chapter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.4rem 0 0;
}

/* ==========================================================================
   15. Scroll-to-top
   ========================================================================== */

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Resume-reading toast */
.resume {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%) translateY(140%);
  z-index: 75;
  max-width: calc(100vw - 2rem);
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .7rem .6rem 1rem;
  background: var(--navy-800);
  color: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  font-size: .87rem;
  transition: transform .28s ease;
}

.resume.is-visible { transform: translateX(-50%); }
.resume a { color: var(--gold-300); font-weight: 600; }
.resume button { border: 0; background: transparent; color: rgba(255, 255, 255, .7); font: inherit; font-size: 1.1rem; cursor: pointer; padding: 0 .4rem; }

/* ==========================================================================
   16. Footer
   ========================================================================== */

.site-footer {
  background: var(--navy-800);
  color: #c9d3e4;
  border-top: 4px solid var(--gold-500);
  font-size: .9rem;
}

.site-footer__inner {
  max-width: 78rem;
  margin: 0 auto;
  padding: 2rem var(--gutter) 1.2rem;
  display: grid;
  gap: 1.6rem;
}

@media (min-width: 46rem) { .site-footer__inner { grid-template-columns: repeat(3, 1fr); } }

.site-footer h2 {
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin: 0 0 .6rem;
  font-family: var(--font-sans);
  font-weight: 700;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: #dbe3f0; text-decoration: none; }
.site-footer a:hover { color: var(--gold-300); text-decoration: underline; }
.site-footer p { margin: 0 0 .45rem; }

.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding: .9rem var(--gutter) 1.6rem;
  text-align: center;
  font-size: .8rem;
  color: #9fadc4;
  max-width: 78rem;
  margin: 0 auto;
}

.site-footer__bottom a { color: #c3cfe2; }

/* ==========================================================================
   17. Utilities, motion and print
   ========================================================================== */

.no-js-hidden { display: none; }
html.js .no-js-hidden { display: revert; }
html.js .js-hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (forced-colors: active) {
  .btn, .card, .pager__link, .toc-panel { border: 1px solid CanvasText; }
}

@media print {
  .site-header, .site-nav, .breadcrumb, .reader-tools, .toc-panel,
  .pager, .to-top, .progress, .search-overlay, .site-footer, .resume,
  .chapter-actions, .lightbox { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .shell { max-width: none; padding: 0; }
  .prose { max-width: none; font-size: 11pt; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #444; }
  .section-block { break-inside: avoid; }
}

/* --- original-page disclosure ---------------------------------------------
   Lets a reader compare the web transcription with the printed souvenir page. */

.orig {
  margin: .4rem 0 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.orig > summary {
  padding: .6rem .9rem;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text-muted);
  list-style: none;
  border-radius: var(--radius);
}

.orig > summary::-webkit-details-marker { display: none; }
.orig > summary::before { content: "▸ "; color: var(--accent); font-weight: 700; }
.orig[open] > summary::before { content: "▾ "; }
.orig > summary:hover { color: var(--accent); background: var(--surface-2); }
.orig[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.orig .facsimile { margin: .8rem; }
.orig .facsimile figure { border: 0; box-shadow: none; padding: 0; }

/* --- [hidden] must win over the display values set above ------------------- */
[hidden] { display: none !important; }
