@charset "UTF-8";

:root {
  color-scheme: light;
  --navy: #08243f;
  --navy-soft: #123b5c;
  --ink: #15212b;
  --muted: #5a6873;
  --paper: #f3f1eb;
  --surface: #fffefa;
  --line: #d8d7d0;
  --blue: #1d608f;
  --blue-pale: #eaf3f8;
  --gold: #bf8c3f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 8%, rgba(29, 96, 143, 0.1), transparent 28rem),
    var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: calc(var(--global-nav-height, 0px) + 10px);
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--navy);
  border-radius: 6px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 10;
  top: var(--global-nav-height, 0px);
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(24px, calc((100vw - 1320px) / 2));
  color: white;
  background: rgba(8, 36, 63, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
}

.site-header a {
  text-decoration: none;
}

.site-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-header nav {
  display: flex;
  gap: 22px;
  font-size: 0.92rem;
}

.site-header nav a {
  color: #d9e7f2;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: white;
}

.book-layout {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding: 52px 0 76px;
}

.cover-panel {
  position: sticky;
  top: calc(var(--global-nav-height, 0px) + 100px);
}

.book-cover {
  display: block;
  width: 100%;
  height: auto;
  background: var(--navy);
  border: 1px solid rgba(8, 36, 63, 0.2);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(8, 36, 63, 0.2);
}

.cover-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-top: 18px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--navy);
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(8, 36, 63, 0.14);
  outline: none;
}

.button-primary {
  color: white;
  background: var(--navy);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--navy-soft);
}

.button-secondary {
  color: var(--navy);
  background: transparent;
}

.chapter-panel {
  min-width: 0;
  padding-top: 12px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.lede {
  max-width: 720px;
  margin: 22px 0 30px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.6;
}

.chapter-tools {
  margin: 0 0 18px;
  padding: 18px;
  background: rgba(255, 254, 250, 0.78);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.chapter-tools label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.search-row {
  display: flex;
  gap: 8px;
}

input[type="search"] {
  min-width: 0;
  flex: 1;
  min-height: 46px;
  padding: 10px 13px;
  color: var(--ink);
  background: white;
  border: 1px solid #b9c1c7;
  border-radius: 7px;
  font: inherit;
}

input[type="search"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 96, 143, 0.14);
  outline: none;
}

#clear-search {
  padding-inline: 15px;
  color: var(--navy);
  background: var(--blue-pale);
  border: 1px solid #b8cbd8;
  border-radius: 7px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.search-status {
  min-height: 1.25em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.chapter-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
}

.chapter-jumps a {
  padding: 7px 10px;
  color: var(--navy);
  background: var(--blue-pale);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.chapter-jumps a:hover,
.chapter-jumps a:focus-visible {
  background: #d7eaf5;
  outline: none;
}

.toc {
  display: grid;
  gap: 8px;
}

.toc-divider {
  scroll-margin-top: 90px;
  margin: 32px 0 8px;
  padding-bottom: 9px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc-divider:first-child {
  margin-top: 0;
}

.toc a {
  position: relative;
  display: block;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.toc0 {
  padding: 15px 46px 15px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.toc0::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: 17px;
  color: var(--blue);
  font-family: Arial, Helvetica, sans-serif;
  transform: translateY(-50%);
}

.toc0:hover,
.toc0:focus-visible {
  background: #fff;
  border-color: #8aa9bd;
  transform: translateX(3px);
  outline: none;
}

.toc1 {
  margin-left: 20px;
  padding: 8px 13px 8px 28px;
  color: var(--muted);
  border-left: 2px solid #c6d8e3;
  font-size: 0.92rem;
  line-height: 1.35;
}

.toc1::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 12px;
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateY(-50%);
}

.toc1:hover,
.toc1:focus-visible {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.6);
  outline: none;
}

.toc.is-filtering .toc-divider {
  display: none;
}

[hidden] {
  display: none !important;
}

footer {
  padding: 25px 24px 45px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .book-layout {
    width: min(760px, calc(100% - 34px));
    grid-template-columns: 1fr;
    gap: 46px;
    padding-top: 34px;
  }

  .cover-panel {
    position: static;
    width: min(440px, 100%);
    margin-inline: auto;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 60px;
    padding: 12px 17px;
  }

  .site-header nav {
    gap: 12px;
    font-size: 0.82rem;
  }

  .book-layout {
    width: min(100% - 24px, 760px);
  }

  .search-row {
    align-items: stretch;
  }

  .toc0 {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
