/* UECF.NET Web Book - Telugu Bible 1881 */

:root {
  --paper: #fdfbf7;
  --paper-2: #f5f0e8;
  --paper-3: #ece5d8;
  --ink: #1f1b16;
  --ink-2: #4a4239;
  --ink-3: #7a6f61;
  --accent: #7f1d1d;
  --accent-2: #a13b2a;
  --gold: #a16207;
  --line: #ded4c3;
  --line-2: #cabfa9;
  --shadow: 0 1px 2px rgba(31, 27, 22, .06), 0 8px 24px rgba(31, 27, 22, .08);
  --shadow-lg: 0 2px 8px rgba(31, 27, 22, .08), 0 24px 56px rgba(31, 27, 22, .16);
  --focus: #1d4ed8;
  --fix-bg: #fdf6e3;
  --fix-line: #e3ca8f;
  --hit: 44px;
  --wrap: 1180px;
  --read: 44rem;
  --radius: 14px;
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --telugu: "Noto Serif Telugu", "Telugu Sangam MN", "Telugu MN", Gautami,
    "Nirmala UI", Pothana2000, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs: 1rem;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #16130f;
  --paper-2: #1e1a15;
  --paper-3: #272119;
  --ink: #f2ece2;
  --ink-2: #cdc3b4;
  --ink-3: #9b9081;
  --accent: #f0a3a3;
  --accent-2: #e8b48f;
  --gold: #e8b923;
  --line: #352d23;
  --line-2: #473c2e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .5), 0 24px 56px rgba(0, 0, 0, .5);
  --focus: #93c5fd;
  --fix-bg: #2b2410;
  --fix-line: #6b551f;
  color-scheme: dark;
}

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

/* Layout rules below set display on these elements, which would otherwise
   defeat the attribute. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs);
  line-height: 1.65;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-2); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius) 0;
  font-family: var(--sans);
  font-weight: 600;
}
.skip:focus { left: 0; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ site header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 3.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  margin-inline-end: auto;
  min-height: var(--hit);
}
.brand .mark {
  display: grid;
  place-items: center;
  width: 2rem; height: 2rem;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  flex: none;
}
.brand .txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand .txt small {
  font-weight: 500;
  font-size: .68rem;
  color: var(--ink-3);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tool {
  display: inline-grid;
  place-items: center;
  min-width: var(--hit);
  min-height: var(--hit);
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-2);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-family: var(--sans);
  font-size: .9rem;
  padding: 0 .6rem;
  transition: background .15s, color .15s, border-color .15s;
}
.tool:hover { background: var(--paper-3); color: var(--ink); }
.tool[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.tool svg {
  width: 1.15rem; height: 1.15rem;
  fill: currentColor; stroke: none;
}

.header-nav { display: flex; gap: .4rem; align-items: center; }
.header-nav .label { display: none; }
@media (min-width: 60rem) {
  .header-nav .label { display: inline; margin-inline-start: .4rem; }
}
/* Small phones: drop the wordmark so all five controls keep a full touch target. */
@media (max-width: 26rem) {
  .brand .txt { display: none; }
  .header-nav { gap: .25rem; }
}

/* --------------------------------------------------------------- progress */
.progress {
  position: fixed; inset-inline: 0; top: 0; height: 3px; z-index: 90;
  background: transparent; pointer-events: none;
}
.progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width .1s linear;
}

/* ------------------------------------------------------------------- hero */
.hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(80rem 30rem at 80% -10%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 60%),
    radial-gradient(60rem 26rem at 5% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%);
}
.hero .grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 58rem) { .hero .grid { grid-template-columns: 1.15fr .85fr; } }

.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 .85rem;
}
.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 .3rem;
  letter-spacing: -.015em;
}
.hero .h1-te {
  font-family: var(--telugu);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  color: var(--ink-2);
  margin: 0 0 1rem;
  line-height: 1.35;
}
.lede {
  font-size: clamp(1.02rem, 1.6vw, 1.16rem);
  color: var(--ink-2); max-width: 40rem;
}

.stats {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: clamp(1.25rem, 4vw, 2.75rem); padding: 0; margin: 1.75rem 0;
}
.stats div { font-family: var(--sans); }
.stats b {
  display: block; font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 800; line-height: 1.1; color: var(--ink);
}
.stats span {
  font-size: .76rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}

.cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--hit); padding: .7rem 1.35rem;
  border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff;
  font-family: var(--sans); font-weight: 650; font-size: .95rem;
  text-decoration: none; cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:hover { color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.btn svg {
  width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.cover-card {
  margin: 0; padding: 0; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg); background: var(--paper-2);
  border: 1px solid var(--line);
}
.cover-card img { display: block; width: 100%; }

/* --------------------------------------------------------------- sections */
.section { padding: clamp(2.5rem, 6vw, 4.25rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section h1, .section h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0 0 .4rem; letter-spacing: -.01em;
}
.section .sub { color: var(--ink-3); margin: 0 0 2rem; font-size: .98rem; }

/* ------------------------------------------------------------ toc listing */
.testament-head {
  display: flex; align-items: baseline; gap: .75rem;
  margin: 2.25rem 0 1rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--line-2);
}
.testament-head:first-of-type { margin-top: 0; }
.testament-head h3 { margin: 0; font-size: 1.15rem; letter-spacing: .01em; }
.testament-head .te { font-family: var(--telugu); color: var(--ink-3); font-size: 1rem; }
.testament-head .count {
  margin-inline-start: auto; font-family: var(--sans);
  font-size: .8rem; color: var(--ink-3);
}

.chapter-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}
.chapter-card {
  display: flex; gap: .9rem; align-items: flex-start;
  padding: .9rem 1rem; min-height: var(--hit);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); color: inherit; text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
}
.chapter-card:hover {
  border-color: var(--accent); background: var(--paper);
  box-shadow: var(--shadow); transform: translateY(-2px); color: inherit;
}
.chapter-card .num {
  flex: none; display: grid; place-items: center;
  width: 2.35rem; height: 2.35rem; border-radius: 9px;
  background: var(--paper-3); color: var(--accent);
  font-family: var(--sans); font-weight: 750; font-size: .9rem;
}
.chapter-card .body { min-width: 0; }
.chapter-card .name { display: block; font-weight: 650; line-height: 1.3; }
.chapter-card .te {
  display: block; font-family: var(--telugu); color: var(--ink-2);
  font-size: 1.02rem; line-height: 1.45; margin-top: .1rem;
}
.chapter-card .meta {
  display: block; font-family: var(--sans); font-size: .76rem;
  color: var(--ink-3); margin-top: .35rem;
}

/* ------------------------------------------------------------ reader page */
.reader { display: block; padding-bottom: 4rem; }

.breadcrumbs {
  font-family: var(--sans); font-size: .82rem; color: var(--ink-3);
  padding: 1rem 0 .25rem;
}
.breadcrumbs ol {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: .4rem; margin: 0; padding: 0;
}
.breadcrumbs li + li::before {
  content: "/"; margin-inline-end: .4rem; color: var(--line-2);
}
.breadcrumbs a { color: var(--ink-3); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }

.chapter-head {
  padding: .5rem 0 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem;
}
.chapter-head .kicker {
  font-family: var(--sans); font-size: .75rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); font-weight: 700;
}
.chapter-head h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem); margin: .35rem 0 .2rem; line-height: 1.15;
}
.chapter-head .te-title {
  font-family: var(--telugu); font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--ink-2); margin: 0 0 .6rem; line-height: 1.4;
}
.chapter-head .meta { font-family: var(--sans); font-size: .85rem; color: var(--ink-3); }

.pagebar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin: 0 0 1.5rem; font-family: var(--sans); font-size: .85rem;
}
.pagebar .spacer { margin-inline-start: auto; }

.page-block {
  margin: 0 0 3rem; padding-bottom: 2rem;
  border-bottom: 1px dashed var(--line);
  scroll-margin-top: 5.5rem;
}
.page-block:last-child { border-bottom: 0; }

.page-block > h2 {
  font-family: var(--sans); font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 .85rem; display: flex; align-items: center; gap: .75rem;
}
.page-block > h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.page-block > h2 .te {
  font-family: var(--telugu); text-transform: none;
  letter-spacing: 0; font-size: .95rem; color: var(--ink-2);
}

.spread { display: grid; gap: 1.5rem; align-items: start; grid-template-columns: 1fr; }
/* Grid items default to min-width:auto, which lets the facsimile's intrinsic
   width push the whole reader wider than the screen. */
.spread > * { min-width: 0; }
@media (min-width: 64rem) {
  .spread.side-by-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

figure.scan {
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff; box-shadow: var(--shadow);
}
[data-theme="dark"] figure.scan img { filter: invert(1) hue-rotate(180deg) brightness(.92); }
figure.scan img { display: block; width: 100%; cursor: zoom-in; background: #fff; }
figure.scan figcaption {
  font-family: var(--sans); font-size: .75rem; color: var(--ink-3);
  padding: .5rem .75rem; border-top: 1px solid var(--line); background: var(--paper-2);
  display: flex; gap: .5rem; align-items: center; justify-content: space-between;
}

.transcript {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); padding: 1.1rem 1.25rem;
}
.transcript > header {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-family: var(--sans); font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 .75rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line);
}
.badge {
  font-family: var(--sans); font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; font-weight: 700;
  padding: .18rem .5rem; border-radius: 999px;
  background: var(--paper-3); color: var(--ink-3); border: 1px solid var(--line);
}
.badge.ok { color: #166534; border-color: #86efac; background: #f0fdf4; }
.badge.mid { color: #92400e; border-color: #fcd34d; background: #fffbeb; }
.badge.low { color: #991b1b; border-color: #fca5a5; background: #fef2f2; }
[data-theme="dark"] .badge.ok { color: #86efac; background: #052e16; border-color: #166534; }
[data-theme="dark"] .badge.mid { color: #fcd34d; background: #3b2609; border-color: #92400e; }
[data-theme="dark"] .badge.low { color: #fca5a5; background: #3f1212; border-color: #991b1b; }

/* The transcript is continuous text, not one block per printed line, so each
   verse wraps to the panel instead of keeping the 1881 column's short measure.
   The page's two printed columns become two reading columns while there is
   room for two comfortable measures, and stack below that. */
.te-text, .en-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.15rem;
  color: var(--ink);
  margin: 0;
}
.te-text {
  font-family: var(--telugu);
  font-size: calc(var(--fs) * 1.06);
  line-height: 1.95;
}
.en-text { font-family: var(--serif); line-height: 1.8; }

.te-text > .col, .en-text > .col { min-width: 0; }
.te-text .col-label {
  display: block; font-family: var(--sans); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: .35rem;
}

/* A word whose glyphs were repaired against a reference text. The mark has to
   be quiet enough to read past and clear enough to audit, and it must not sit
   under the baseline, where Telugu hangs its subscript consonants - hence a
   tint rather than an underline. The original reading is present in the markup
   at all times and shown by the panel's Original OCR button. */
.fix .now {
  background: var(--fix-bg); box-shadow: inset 0 0 0 1px var(--fix-line);
  border-radius: 3px; padding: 0 .08em; cursor: help;
}
.fix .was { display: none; color: var(--ink-2); }
.transcript.raw .fix .now { display: none; }
.transcript.raw .fix .was {
  display: inline; background: var(--paper-3);
  box-shadow: inset 0 0 0 1px var(--line-2);
  border-radius: 3px; padding: 0 .08em;
}
.badge.repairs { color: var(--gold); border-color: var(--fix-line); background: var(--fix-bg); }
.raw-toggle { font-size: .68rem; letter-spacing: .06em; }
.raw-toggle[aria-pressed="true"] {
  background: var(--paper-3); border-color: var(--line-2); color: var(--ink);
}

.te-text .v, .en-text .v { margin: 0 0 .55rem; overflow-wrap: break-word; }
.te-text .v:last-child, .en-text .v:last-child { margin-bottom: 0; }

.cols-2 > .col + .col {
  padding-top: 1.15rem; border-top: 1px dotted var(--line-2);
}
@media (min-width: 60rem) {
  .te-text.cols-2, .en-text.cols-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.75rem;
  }
  .cols-2 > .col + .col {
    padding-top: 0; border-top: 0;
    padding-inline-start: 1.75rem; border-inline-start: 1px dotted var(--line-2);
  }
}

.te-text .vn {
  font-family: var(--sans); font-size: .72em; font-weight: 700;
  color: var(--accent); vertical-align: .35em; margin-inline-end: .25em;
}
.en-text .vn {
  font-family: var(--sans); font-size: .72em; font-weight: 700;
  color: var(--accent); vertical-align: .35em; margin-inline-end: .25em;
}

mark, .hit {
  background: color-mix(in srgb, var(--gold) 38%, transparent);
  color: inherit; padding: 0 .12em; border-radius: 3px;
}

/* ------------------------------------------------------------- chapter nav */
.chapter-nav { display: grid; gap: .75rem; margin-top: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 44rem) { .chapter-nav { grid-template-columns: 1fr 1fr; } }
.chapter-nav a {
  display: flex; flex-direction: column; gap: .2rem;
  padding: 1rem 1.15rem; min-height: var(--hit);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.chapter-nav a:hover { border-color: var(--accent); box-shadow: var(--shadow); color: inherit; }
.chapter-nav a.next { text-align: end; grid-column: 2; }
@media (max-width: 43.99rem) { .chapter-nav a.next { grid-column: 1; text-align: start; } }
.chapter-nav .dir {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.chapter-nav .ttl { font-weight: 650; }
.chapter-nav .te { font-family: var(--telugu); color: var(--ink-2); font-size: .98rem; }

/* --------------------------------------------------------------- side TOC */
.toc-drawer {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 16, 12, .55);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.toc-drawer.open { opacity: 1; visibility: visible; }
.toc-drawer .panel {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  width: min(92vw, 26rem); background: var(--paper);
  border-inline-end: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .22s ease;
}
.toc-drawer.open .panel { transform: none; }
.toc-drawer .panel > header {
  display: flex; align-items: center; gap: .5rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--line);
}
.toc-drawer .panel > header strong { font-family: var(--sans); font-size: .95rem; }
.toc-drawer .panel > header .tool { margin-inline-start: auto; }
.toc-drawer nav { overflow-y: auto; padding: .6rem; -webkit-overflow-scrolling: touch; }
.toc-drawer nav a {
  display: flex; gap: .65rem; align-items: baseline;
  padding: .6rem .7rem; min-height: var(--hit);
  border-radius: 9px; text-decoration: none; color: var(--ink-2);
  font-size: .95rem;
}
.toc-drawer nav a:hover { background: var(--paper-2); color: var(--ink); }
.toc-drawer nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); font-weight: 650;
}
.toc-drawer nav a .n {
  font-family: var(--sans); font-size: .75rem; color: var(--ink-3); min-width: 1.6rem;
}
.toc-drawer nav a .te { font-family: var(--telugu); }
.toc-drawer nav .group {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 1rem .7rem .35rem;
}

/* ---------------------------------------------------------------- search */
.search-modal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(20, 16, 12, .55);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
  padding: clamp(.75rem, 5vh, 4rem) 1rem;
  overflow-y: auto;
}
.search-modal.open { opacity: 1; visibility: visible; }
.search-modal .panel {
  width: min(100%, 46rem); margin-inline: auto;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; transform: translateY(-8px); transition: transform .2s;
}
.search-modal.open .panel { transform: none; }
.search-modal .field {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem;
  border-bottom: 1px solid var(--line);
}
.search-modal input[type="search"] {
  flex: 1; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-family: var(--telugu); font-size: 1.1rem;
  padding: .7rem .2rem; min-height: var(--hit); min-width: 0;
}
.search-modal input[type="search"]:focus { outline: none; }
.search-modal .field svg {
  width: 1.2rem; height: 1.2rem; fill: none; stroke: var(--ink-3);
  stroke-width: 2; stroke-linecap: round;
}
.search-status {
  font-family: var(--sans); font-size: .78rem; color: var(--ink-3);
  padding: .6rem .95rem; border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.search-results { list-style: none; margin: 0; padding: .4rem; max-height: 58vh; overflow-y: auto; }
.search-results li + li { border-top: 1px solid var(--line); }
.search-results a {
  display: block; padding: .8rem .85rem; text-decoration: none; color: inherit; border-radius: 9px;
}
.search-results a:hover, .search-results a:focus-visible { background: var(--paper-2); }
.search-results .where {
  font-family: var(--sans); font-size: .74rem; color: var(--accent);
  letter-spacing: .04em; margin-bottom: .2rem;
}
.search-results .snippet {
  font-family: var(--telugu); font-size: .98rem; line-height: 1.7; color: var(--ink-2);
}
.search-tips {
  font-family: var(--sans); font-size: .78rem; color: var(--ink-3);
  padding: .7rem .95rem; border-top: 1px solid var(--line); background: var(--paper-2);
}
kbd {
  font-family: var(--sans); font-size: .72rem; border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 5px; padding: .1rem .35rem;
  background: var(--paper); color: var(--ink-2);
}

/* ------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 140; background: rgba(12, 10, 8, .92);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 96vw; max-height: 88vh; background: #fff;
  box-shadow: var(--shadow-lg); touch-action: pinch-zoom;
}
.lightbox .lb-bar {
  position: absolute; inset-inline: 0; top: 0; display: flex; gap: .5rem;
  padding: .75rem; justify-content: flex-end;
}
.lightbox .lb-cap {
  position: absolute; inset-inline: 0; bottom: 0; text-align: center;
  color: #e7e0d4; font-family: var(--sans); font-size: .82rem; padding: .9rem;
}

/* ------------------------------------------------------------ misc blocks */
.notice {
  border: 1px solid var(--line); border-inline-start: 4px solid var(--gold);
  background: var(--paper-2); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.15rem; margin: 1.5rem 0;
}
.notice h3 { margin: 0 0 .35rem; font-size: 1rem; font-family: var(--sans); }
.notice p { margin: 0; color: var(--ink-2); font-size: .93rem; }

.prose { max-width: var(--read); }
.prose p { margin: 0 0 1rem; }

table.data { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .9rem; }
table.data th, table.data td {
  text-align: start; padding: .6rem .75rem; border-bottom: 1px solid var(--line);
}
table.data th {
  color: var(--ink-3); font-weight: 650; font-size: .78rem;
  letter-spacing: .08em; text-transform: uppercase;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.to-top {
  position: fixed; inset-inline-end: 1rem; bottom: 1rem; z-index: 70;
  width: var(--hit); height: var(--hit); border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-2); box-shadow: var(--shadow); cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, visibility .2s, transform .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top svg {
  width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.site-footer {
  border-top: 1px solid var(--line); background: var(--paper-2);
  padding: 2.5rem 0; margin-top: 3rem;
  font-family: var(--sans); font-size: .88rem; color: var(--ink-3);
}
.site-footer .cols { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 {
  margin: 0 0 .6rem; font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-2);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

/* ----------------------------------------------------------------- print */
@media print {
  .site-header, .to-top, .chapter-nav, .toc-drawer, .search-modal,
  .lightbox, .progress, .pagebar, .site-footer, .skip { display: none !important; }
  html { font-size: 11pt; }
  body { background: #fff; color: #000; }
  .page-block { break-inside: avoid; border-bottom: 1px solid #ccc; }
  figure.scan { break-inside: avoid; border: 1px solid #999; box-shadow: none; }
  .transcript { border: 1px solid #ccc; background: #fff; }
  .spread.side-by-side { grid-template-columns: 1fr; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}

.inline-img { margin: 1rem 0; text-align: center; }
.inline-img img { max-width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); cursor: zoom-in; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin: 1rem 0; }
.two-col .col p { margin: 0 0 .75rem; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
@media print { .spread, .page-block h2 { display: none !important; } }
