/* Obi's Track Record — styles
   Palette taken from the source book: ANIDS green band, red headings, lime summary boxes. */
:root {
  --paper: #ffffff;
  --wash: #f3f6f1;
  --ink: #15241b;
  --muted: #55665b;
  --line: #d6dfd5;
  --green: #0f6b37;
  --green-deep: #0a4a26;
  --red: #c4202e;
  --lime: #eef2c6;
  --lime-edge: #d3db8c;
  --focus: #1d5fd1;

  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.4rem, 6vw, 4.6rem);

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 50; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1em; }

h1, h2, h3 {
  font-family: var(--display);
  font-stretch: 75%;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}
h2 { font-size: var(--step-3); font-weight: 800; }
h3 { font-size: var(--step-1); font-weight: 700; font-stretch: 85%; line-height: 1.2; }

/* ---------- Header ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 20;
}
.site-head .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 64px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-stretch: 75%; font-weight: 800;
  font-size: 1.35rem; color: var(--ink); text-decoration: none; line-height: 1;
}
.brand-mark { width: 14px; height: 30px; background: var(--green); border-right: 6px solid var(--red); }
.brand small { display: block; font-family: var(--body); font-stretch: 100%; font-weight: 400; font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 700; font-size: 0.95rem;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--wash); color: var(--green-deep); }
.menu-btn { display: none; }

@media (max-width: 760px) {
  .menu-btn {
    display: inline-flex; margin-left: auto; align-items: center; gap: 8px;
    background: var(--wash); border: 1px solid var(--line); border-radius: 8px;
    padding: 8px 14px; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
  }
  .nav { display: none; width: 100%; flex-direction: column; padding-bottom: 12px; margin-left: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: 8px;
  font-weight: 700; text-decoration: none; font-size: 1rem; border: 2px solid var(--green);
  cursor: pointer; font-family: var(--body);
}
.btn-solid { background: var(--green); color: #fff; }
.btn-solid:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.btn-line { background: #fff; color: var(--green-deep); }
.btn-line:hover { background: var(--wash); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 6vw, 72px) 0 clamp(32px, 5vw, 56px); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-q {
  font-family: var(--display); font-weight: 900; font-style: italic; font-stretch: 62%;
  font-size: clamp(3rem, 9vw, 6.8rem); line-height: 0.88; letter-spacing: -0.015em;
  color: var(--red); margin: 0 0 18px;
}
.hero-q span { display: block; color: var(--green); }
.hero-sub { font-size: var(--step-1); max-width: 36ch; margin: 0 0 24px; }
.hero-meta { color: var(--muted); font-size: var(--step--1); margin: 0 0 14px; }
.hero figure { margin: 0; }
.hero figure img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 35%; border-radius: 4px; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

figcaption, .caption { font-size: var(--step--1); color: var(--muted); margin-top: 8px; line-height: 1.45; }
.cite {
  display: inline-block; font-weight: 700; white-space: nowrap; color: var(--green-deep);
  font-size: 0.85em;
}

/* ---------- Search band ---------- */
.lookup { background: var(--green); color: #fff; padding: clamp(28px, 4vw, 44px) 0; }
.lookup h2 { color: #fff; font-size: var(--step-2); }
.lookup p { margin: 0 0 16px; max-width: 60ch; }
.search-form { display: flex; gap: 10px; max-width: 720px; flex-wrap: wrap; }
.search-form input {
  flex: 1 1 260px; min-height: 52px; font: inherit; font-size: 1.1rem;
  padding: 10px 16px; border-radius: 8px; border: 2px solid transparent; color: var(--ink);
}
.search-form input:focus { outline: 3px solid #ffd84d; outline-offset: 1px; }
.lookup .btn-solid { background: var(--red); border-color: var(--red); }
.lookup .btn-solid:hover { background: #a01824; border-color: #a01824; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 0.95rem; align-items: center; }
.chips a { color: #fff; background: rgba(255,255,255,0.14); padding: 6px 12px; border-radius: 999px; text-decoration: none; }
.chips a:hover { background: rgba(255,255,255,0.28); }

/* ---------- Sections ---------- */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section-alt { background: var(--wash); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head p { margin: 0; color: var(--muted); max-width: 52ch; }

/* ---------- Ledger (numbers) ---------- */
.ledger { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 32px; border-top: 2px solid var(--ink); }
.ledger li { padding: 18px 0 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.ledger .num { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-size: 3.4rem; line-height: 1; color: var(--green); }
.ledger .what { font-weight: 700; line-height: 1.3; font-size: 1.05rem; }
.ledger .cite { margin-top: 2px; }
@media (max-width: 860px) { .ledger { grid-template-columns: repeat(2, 1fr); column-gap: 20px; } .ledger .num { font-size: 2.8rem; } }

/* ---------- Before / after ---------- */
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ba figure { margin: 0; position: relative; }
.ba img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.ba .tag {
  position: absolute; top: 10px; left: 10px; background: var(--red); color: #fff;
  font-weight: 700; padding: 4px 10px; border-radius: 4px; font-size: 0.9rem;
}
.ba figure:last-child .tag { background: var(--green); }
@media (max-width: 640px) { .ba { grid-template-columns: 1fr; } }

/* ---------- Topic tiles ---------- */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.topic {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.topic img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.topic-body { padding: 14px 16px 16px; border-top: 5px solid var(--green); flex: 1; }
.topic h3 { margin: 0 0 4px; font-size: 1.45rem; font-stretch: 75%; font-weight: 800; color: var(--ink); }
.topic p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.topic .count { display: block; margin-top: 10px; font-size: 0.85rem; font-weight: 700; color: var(--green-deep); }
.topic:hover h3 { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Handover ---------- */
.handover { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.money { width: 100%; border-collapse: collapse; font-size: 1rem; }
.money td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.money td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; padding-left: 12px; }
.money tr.total td { border-top: 2px solid var(--ink); border-bottom: none; font-size: 1.15rem; }
.money tr.total td:last-child { color: var(--green); font-family: var(--display); font-stretch: 75%; font-size: 1.8rem; }
.doc-thumb { border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); background: #fff; }
@media (max-width: 860px) { .handover { grid-template-columns: 1fr; } }

/* ---------- Quotes ---------- */
.quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 28px; }
.quote { margin: 0; border-left: 4px solid var(--red); padding: 2px 0 2px 18px; }
.quote p { margin: 0 0 10px; font-size: 1.08rem; }
.quote footer { color: var(--muted); font-size: 0.92rem; }
.quote footer b { color: var(--ink); }

/* ---------- Topic page header (echoes the book's own chapter heads) ---------- */
.chapter-head { padding: clamp(28px, 5vw, 56px) 0 0; }
.crumbs { font-size: var(--step--1); color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.chapter-title {
  font-family: var(--display); font-style: italic; font-weight: 900; font-stretch: 62%;
  color: var(--red); font-size: var(--step-4); line-height: 0.92; margin: 0;
}
.band {
  background: var(--green); color: #fff; font-weight: 700;
  padding: 8px 14px; margin: 10px 0 0; display: inline-block; font-size: 1rem;
}
.chapter-hero { margin: 24px 0 0; }
.chapter-hero img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 4px; }

.chapter-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 960px) { .chapter-grid { grid-template-columns: 1fr; } }

.facts { background: var(--lime); border: 1px solid var(--lime-edge); padding: 20px 22px; border-radius: 4px; }
.facts h2 { font-size: var(--step-1); font-stretch: 85%; margin-bottom: 12px; color: var(--green-deep); }
.facts ul { margin: 0; padding: 0; list-style: none; }
.facts li { padding: 10px 0; border-top: 1px solid var(--lime-edge); line-height: 1.45; }
.facts li:first-child { border-top: none; padding-top: 0; }

/* ---------- Page grid (thumbnails) ---------- */
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.page-card { text-decoration: none; color: var(--muted); font-size: 0.85rem; display: block; }
.page-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border: 1px solid var(--line); background: #fff; border-radius: 3px; }
.page-card:hover img { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.page-card span { display: block; margin-top: 6px; }

/* ---------- Book viewer ---------- */
.viewer { padding: 20px 0 40px; }
.viewer-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.viewer-bar select { font: inherit; min-height: 48px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; max-width: 100%; }
.viewer-bar .pos { font-weight: 700; margin: 0 6px; }
.viewer-stage { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 12px; align-items: center; }
.viewer-stage img { margin: 0 auto; max-height: calc(100vh - 210px); width: auto; max-width: 100%; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 10px rgba(21,36,27,0.08); }
.arrow {
  width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--green); background: #fff; color: var(--green);
  font-size: 1.8rem; cursor: pointer; display: grid; place-items: center; line-height: 1;
}
.arrow:hover { background: var(--green); color: #fff; }
.arrow:disabled { opacity: 0.3; cursor: default; background: #fff; color: var(--green); }
.viewer-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.viewer details { margin-top: 18px; background: var(--wash); padding: 12px 16px; border-radius: 6px; }
.viewer details summary { cursor: pointer; font-weight: 700; }
.viewer details pre { white-space: pre-wrap; font-family: var(--body); font-size: 0.95rem; margin: 10px 0 0; }
@media (max-width: 700px) {
  .viewer-stage { grid-template-columns: 1fr; }
  .viewer-stage .arrow { display: none; }
  .viewer-stage img { max-height: none; }
  .mobile-arrows { display: flex !important; }
}
.mobile-arrows { display: none; gap: 12px; margin-top: 12px; }
.mobile-arrows .btn { flex: 1; }

/* ---------- Search results ---------- */
.results { list-style: none; margin: 0; padding: 0; }
.results li { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.results img { width: 90px; border: 1px solid var(--line); }
.results h3 { margin: 0 0 4px; font-size: 1.25rem; }
.results p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.results mark { background: #ffe58a; color: var(--ink); padding: 0 2px; }
.search-page .search-form input { border: 2px solid var(--line); }
.search-page .search-form input:focus { outline-color: var(--focus); }

/* ---------- Documents ---------- */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.doc { text-decoration: none; color: var(--ink); }
.doc img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border: 1px solid var(--line); }
.doc h3 { margin: 10px 0 4px; }
.doc p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-foot { background: var(--ink); color: #dfe7df; padding: 40px 0; font-size: 0.95rem; }
.site-foot a { color: #fff; }
.site-foot .wrap { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.site-foot p { margin: 0 0 10px; max-width: 64ch; }
@media (max-width: 760px) { .site-foot .wrap { grid-template-columns: 1fr; } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(10, 20, 14, 0.94); z-index: 100; display: none; flex-direction: column; }
.lightbox.open { display: flex; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: #fff; }
.lb-top .pos { font-weight: 700; flex: 1; }
.lb-top a, .lb-top button { color: #fff; }
.lb-close { background: none; border: 2px solid #fff; border-radius: 8px; min-height: 44px; padding: 6px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.lb-stage { flex: 1; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; padding: 0 8px 16px; min-height: 0; }
.lb-stage img { max-height: calc(100vh - 90px); max-width: 100%; margin: 0 auto; background: #fff; }
.lb-stage .arrow { background: rgba(255,255,255,0.1); color: #fff; border-color: #fff; }
@media (max-width: 700px) { .lb-stage { grid-template-columns: 44px 1fr 44px; } .lb-stage .arrow { width: 44px; height: 44px; font-size: 1.3rem; } }

@media (prefers-reduced-motion: no-preference) {
  .hero-q { animation: rise 0.7s cubic-bezier(.2,.7,.2,1) both; }
  .hero-q span { animation: rise 0.7s 0.18s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media print { .site-head, .lookup, .site-foot { display: none; } }

/* ---------- Hub ---------- */
.hub .wrap { align-items: center; }
.hub .hero-q { font-size: clamp(3.6rem, 11vw, 8.5rem); }
.hub .prose { color: var(--muted); }
.section-card { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.section-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.section-card-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 22px; border-top: 6px solid var(--green); }
.section-card-when { font-weight: 700; color: var(--red); }
.section-card-title { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 2rem; line-height: 1.05; }
.section-card-text { color: var(--muted); margin-bottom: 10px; }
.section-card .btn { align-self: flex-start; }
.section-card:hover .section-card-title { color: var(--green); }

.pager { justify-content: space-between; margin-top: 40px; }
.version { color: #a9b8ab; font-size: 0.85rem; }
.quote .cite { margin-left: 6px; }
.quote { scroll-margin-top: 90px; }

/* ---------- Report form ---------- */
.report-form { max-width: 640px; display: flex; flex-direction: column; gap: 6px; }
.report-form label { font-weight: 700; margin-top: 12px; }
.report-form .hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.report-form input, .report-form select, .report-form textarea {
  font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
.report-form input:focus, .report-form select:focus, .report-form textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.report-form .btn { margin-top: 18px; align-self: flex-start; }
.report-form .btn:disabled { opacity: 0.6; cursor: progress; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { padding: 14px 16px; border-radius: 6px; font-weight: 700; }
.form-msg.ok { background: var(--lime); border: 1px solid var(--lime-edge); color: var(--green-deep); }
.form-msg.err { background: #fde8ea; border: 1px solid #f2b8bf; color: #8a1520; }
.viewer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- Anambra: the printed book ---------- */
.book-hero .wrap { grid-template-columns: 1.2fr 0.8fr; }
.book-hero .band { margin: 0 0 16px; }
.book { margin: 0; justify-self: center; max-width: 400px; width: 100%; }
.book a { display: block; }
.hero .book img {
  width: 100%; height: auto; aspect-ratio: auto; object-fit: fill; border-radius: 3px 8px 8px 3px;
  border-left: 10px solid #3a4d97;
  box-shadow: 0 1px 2px rgba(15, 25, 50, 0.25), 0 12px 24px rgba(15, 25, 50, 0.18), 0 30px 60px rgba(15, 25, 50, 0.18);
}
.hero .book a:hover img, .hero .book a:focus-visible img { box-shadow: 0 1px 2px rgba(15, 25, 50, 0.25), 0 16px 30px rgba(15, 25, 50, 0.24), 0 36px 70px rgba(15, 25, 50, 0.22); }
.book figcaption { text-align: center; }
.book-facts { margin: 0 0 24px; padding: 0; display: grid; gap: 6px; }
.book-facts div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.book-facts dt { font-weight: 700; color: var(--muted); }
.book-facts dd { margin: 0; }
.book-hero .caption a { color: var(--green-deep); }
@media (max-width: 860px) {
  .book-hero .wrap { grid-template-columns: 1fr; }
  .book { max-width: 230px; order: -1; }
  .book-facts div { grid-template-columns: 1fr; gap: 0; }
}
