:root {
  --bg: #fbfaf7; --fg: #1d1c1a; --muted: #77736b; --rule: #e4e0d6; --accent: #8a3b12; --hl: #f3eedf;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="paper"]) { --bg: #171614; --fg: #e9e6df; --muted: #9a958a; --rule: #33302a; --accent: #e0a070; --hl: #24221d; }
}
:root[data-theme="dark"] { --bg: #171614; --fg: #e9e6df; --muted: #9a958a; --rule: #33302a; --accent: #e0a070; --hl: #24221d; }
:root[data-theme="paper"] { --bg: #f3ead6; --fg: #33291b; --muted: #75654c; --rule: #d9cbab; --accent: #8a4510; --hl: #ebdfc3; }

/* site header, as the Bochart reader */
header.site { max-width: none; padding: 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }
header.site .bar { max-width: 1100px; margin: 0 auto; padding: .7rem 16px; display: flex; flex-wrap: wrap;
  gap: .4rem 1.5rem; align-items: baseline; justify-content: space-between; }
header.site .brand { color: var(--fg); text-decoration: none; font-weight: 600; }
header.site .brand span { color: var(--muted); font-weight: 400; }
header.site nav { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; }
header.site nav a { text-decoration: none; }
header.site nav a[aria-current] { text-decoration: underline; }
header.site label.theme { color: var(--muted); font-size: .9rem; }
header.site select { font: inherit; background: var(--hl); color: var(--fg); border: 1px solid var(--rule); border-radius: 5px; padding: .1rem .3rem; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.6 "Noto Serif", Georgia, serif; }
header, main, footer, article { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
article { max-width: 760px; }
header.chapter, header.intro { padding-top: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
h1 { font-size: 1.9rem; margin: .2em 0 .1em; }
h2 { font-size: 1.25rem; margin: 1.8em 0 .5em; }
a { color: var(--accent); }
.crumb, .meta, .sub, .sub-he { margin: .3em 0; }
.crumb, .meta { font-size: .88rem; color: var(--muted); }
.sub { font-size: 1.1rem; }
main { padding-top: 14px; padding-bottom: 40px; }

.blk { position: relative; margin: 0 0 1.1em; }
.blk.saying { margin-bottom: .55em; }
.blk.verse { margin-bottom: 0; }
.blk.verse.gap { margin-top: 1em; }
.blk.verse + .blk.prose { margin-top: 1.1em; }
.sn { position: absolute; left: -2px; top: 2px; font-size: .7rem; color: var(--muted);
  font-family: system-ui, sans-serif; display: none; }
.row { display: grid; grid-template-columns: 2.4rem 1fr 1fr; grid-template-areas: "ln en he"; column-gap: 18px;
  align-items: start; padding: 2px 4px; border-radius: 3px; }
.row .ln { grid-area: ln; } .row .en { grid-area: en; } .row .he { grid-area: he; }
.row:hover, .row:target { background: var(--hl); }
.row p { margin: 0; }
.ln { font: .68rem/2.3 system-ui, sans-serif; color: var(--muted); text-decoration: none;
  text-align: right; opacity: .55; }
.he { font-family: "Noto Serif Hebrew", "SBL Hebrew", "Times New Roman", serif;
  font-size: 1.15rem; line-height: 1.7; text-align: right; }
[lang="he"] { font-family: "Noto Serif Hebrew", "SBL Hebrew", serif; }
.verse .en { font-style: italic; }
.verse .row { padding-left: 4px; }
.ref { color: var(--muted); font-size: .82em; font-style: normal; }
.warn { font: .7rem system-ui, sans-serif; color: var(--accent); text-decoration: none;
  vertical-align: super; margin-left: 3px; }
.notes { padding-left: 1.1em; }
.notes li { margin: .5em 0; }
.he-inline { font-size: 1.1rem; }
footer { border-top: 1px solid var(--rule); padding-bottom: 50px; }

table { border-collapse: collapse; width: 100%; font-size: .93rem; margin: .6em 0 1.2em; }
th, td { text-align: left; vertical-align: top; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--rule); }
th { font: 600 .78rem system-ui, sans-serif; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cta { display: inline-block; margin: .4em 0 1em; padding: 9px 16px; border: 1px solid var(--accent);
  border-radius: 4px; text-decoration: none; }
.tablewrap { overflow-x: auto; }

@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; grid-template-areas: "he" "en"; padding: 6px 2px; border-bottom: 1px solid var(--rule); }
  .ln { display: none; }
  .en { margin-top: 4px; }
}

/* "About this text": closed by default */
details.about { margin: .5em 0 .2em; }
details.about summary { cursor: pointer; color: var(--muted); font: .85rem system-ui, sans-serif; }
details.about summary:hover { color: var(--accent); }
details.about[open] summary { margin-bottom: .3em; }

/* scan thumbnails under the chapter heading, as the Bochart reader */
.scans { display: flex; gap: .6rem; overflow-x: auto; padding: .5rem 0 .3rem; }
.scans a { flex: 0 0 auto; text-align: center; text-decoration: none; font: .78rem system-ui, sans-serif; color: var(--muted); }
.scans a:hover { color: var(--accent); }
.scans img { display: block; width: 80px; height: auto; border: 1px solid var(--rule); background: #fff; margin-bottom: 2px; }

/* paragraph links (the ¶ at the end of each paragraph), as the Bochart reader */
a.anchor { color: var(--muted); text-decoration: none; opacity: .35; padding-left: .2rem; }
.blk:hover a.anchor, a.anchor:focus { opacity: 1; }
section.blk:target { background: var(--hl); border-radius: 4px; }
section.blk { scroll-margin-top: 12px; } .row { scroll-margin-top: 12px; }

/* chapter navigation: all chapters on the left, previous / next on the right */
nav.crumb { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; }
nav.crumb .pn a { margin-left: .8rem; }
/* the Hebrew title on its own line */
.sub-he { font-family: "Noto Serif Hebrew", serif; font-size: 1.15rem; text-align: right; color: var(--fg); }
@media (max-width: 720px) {
  header.site .bar { justify-content: flex-start; }
  header.site .brand span { display: none; }
  header.site .bar { padding: .5rem 16px; gap: .2rem 1rem; }
  nav.crumb .pn a { margin-left: 0; margin-right: .8rem; }
}

/* where a printed page starts, with a link to its scan (as the Bochart reader) */
a.pb { font: .72rem system-ui, sans-serif; color: var(--accent); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--rule); border-radius: 3px; padding: 0 .25rem; vertical-align: .1em; unicode-bidi: isolate; direction: ltr; }
a.pb:hover { background: var(--hl); }
