/* bible.riteandrubric.com — Βιβλος in the Rite & Rubric family */
@font-face {
  font-family: "Gentium";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url(../assets/fonts/Gentium-Regular.ttf) format("truetype");
}
@font-face {
  font-family: "Gentium";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url(../assets/fonts/Gentium-Italic.ttf) format("truetype");
}
@font-face {
  font-family: "Gentium";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url(../assets/fonts/Gentium-Bold.ttf) format("truetype");
}
@font-face {
  font-family: "Ezra SIL";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url(../assets/fonts/EzraSIL-Regular.ttf) format("truetype");
}

:root {
  --paper: #faf6ec;
  --card: #fffdf6;
  --ink: #2b2117;
  --rubric: #8e1b1b;
  --gold: #8a6d2f;
  --line: #e2d8c0;
  --muted: #7a6a52;
  --link: #6e3434;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191510;
    --card: #211c14;
    --ink: #e8e0cf;
    --rubric: #e09c9c;
    --gold: #d4b46a;
    --line: #3c3424;
    --muted: #ab9c80;
    --link: #d9a9a9;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 1.06rem;
  line-height: 1.62;
}
a { color: var(--link); }

header.site {
  border-bottom: 3px double var(--gold);
  padding: 1.1rem 1rem 0.9rem;
  text-align: center;
}
header.site .brand {
  font-family: "Gentium", serif;
  font-variant: small-caps;
  letter-spacing: 0.12em;
  font-size: 1.7rem;
  color: var(--ink);
  text-decoration: none;
}
header.site .tagline {
  margin: 0.35rem 0 0;
  color: var(--gold);
  font-style: italic;
  font-size: 1.05rem;
}
nav.site {
  margin-top: 0.5rem;
  font-size: 0.92rem;
}
nav.site a {
  margin: 0 0.7rem;
  text-decoration: none;
  font-variant: small-caps;
  letter-spacing: 0.06em;
}
nav.site a:hover { text-decoration: underline; }

main { max-width: 44rem; margin: 0 auto; padding: 1.2rem 1.2rem 4rem; }
main.reader { max-width: 96rem; padding-left: 1rem; padding-right: 1rem; }

h2.section {
  text-align: center;
  font-variant: small-caps;
  font-weight: normal;
  letter-spacing: 0.1em;
  margin: 2rem 0 0.4rem;
  font-size: 1.25rem;
}
p.litext { margin: 0.55rem 0; text-align: justify; }
p.litext::first-line { letter-spacing: 0.01em; }

/* passage navigation (NET-style book : chapter : verse) */
.passage-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.6rem;
  margin: 0.75rem 0;
  padding: 0.55rem 0.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
}
.passage-nav-top {
  border-top: 3px solid var(--gold);
}
.passage-nav-bottom {
  margin-top: 1.5rem;
  border-bottom: 3px solid var(--gold);
}
.nav-btn {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  font: inherit;
  font-size: 1.55rem;
  line-height: 1;
  color: var(--ink);
  background: color-mix(in srgb, var(--card) 88%, var(--gold) 12%);
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  cursor: pointer;
}
.nav-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--card) 75%, var(--gold) 25%);
  border-color: var(--gold);
}
.nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.ref-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem 0.35rem;
  min-width: 0;
}
.ref-picker select {
  font: inherit;
  font-family: Georgia, serif;
  font-size: 0.98rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  padding: 0.35rem 0.45rem;
}
.ref-book {
  min-width: 10.5rem;
  max-width: 18rem;
}
.ref-ch,
.ref-vs {
  min-width: 3.25rem;
  width: auto;
  text-align: center;
}
.ref-sep {
  color: var(--muted);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 0.05rem;
}
.passage-cite {
  flex: 1 1 auto;
  margin: 0;
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
  color: var(--ink);
  min-width: 0;
}
@media (max-width: 540px) {
  .passage-nav {
    flex-wrap: wrap;
    padding: 0.5rem 0.35rem;
  }
  .ref-picker {
    order: 3;
    flex: 1 1 100%;
  }
  .ref-book {
    flex: 1 1 100%;
    max-width: none;
  }
}

/* reader controls */
.reader-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 0.8rem 1.2rem;
  margin: 0 0 1rem;
}
.ctl {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.88rem;
}
.ctl-label {
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.ctl select {
  font: inherit;
  font-family: Georgia, serif;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  min-width: 10rem;
}
.btn-add {
  font: inherit;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--gold);
  border-radius: 1rem;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
}
.btn-add:hover { background: color-mix(in srgb, var(--card) 85%, var(--gold) 15%); }

/* scripture columns */
.reader-workspace {
  width: 100%;
}
.parallel-cols {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
}
.reader-workspace:not(.has-study) .parallel-cols {
  max-width: 44rem;
  margin: 0 auto;
}
.reader-workspace.has-study .parallel-cols {
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
}
.reader-workspace.has-study .reader-cols {
  flex: 1 1 55%;
  min-width: 0;
  margin-top: calc(1rem * 1.62 + 0.65rem);
}
.reader-workspace.has-study .study-stack {
  flex: 1 1 45%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.reader-workspace.has-study .study-cols {
  grid-template-columns: 1fr;
}
.study-stack[hidden] { display: none !important; }
.pane-heading {
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-weight: normal;
  font-size: 1rem;
  margin: 0 0 0.65rem;
  color: var(--rubric);
}

/* parallel columns */
.reader-cols {
  display: grid;
  gap: 1rem;
  align-items: stretch;
}
.reader-cols[data-cols="1"] { grid-template-columns: 1fr; }
.reader-cols[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.reader-cols[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.reader-cols[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }

.reader-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.col-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 92%, var(--gold) 8%);
}
.col-head .tr-select {
  flex: 1;
  font: inherit;
  font-size: 0.88rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--ink);
  border: none;
  cursor: pointer;
}
.col-remove {
  flex: none;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.2rem;
}
.col-remove:hover { color: var(--rubric); }

.col-body {
  padding: 0.8rem 0.9rem 1.2rem;
}
.study-col .col-body {
  flex: 1 1 auto;
  min-height: 0;
}
.col-body.grc,
.col-body.la,
:lang(grc),
:lang(la) {
  font-family: "Gentium", serif;
  font-size: 1.02rem;
}
.col-body.la,
:lang(la) {
  font-style: italic;
}
.col-body.heb,
:lang(he) {
  direction: rtl;
  text-align: right;
  font-family: "Ezra SIL", serif;
  font-size: 1.08rem;
}
.col-body.grc sup.vn,
.col-body.la sup.vn,
.col-body.heb sup.vn {
  font-family: inherit;
  font-style: normal;
}
.study-entry .txt,
.study-entry-view .litext,
.study-entry-list .litext {
  font-family: "Gentium", "Ezra SIL", serif;
}
.col-body .verse {
  margin: 0.35rem 0;
  text-align: justify;
  cursor: pointer;
  border-radius: 0.2rem;
  padding: 0.1rem 0.15rem;
  margin-left: -0.15rem;
  margin-right: -0.15rem;
}
.col-body .verse:hover {
  background: color-mix(in srgb, var(--card) 70%, var(--gold) 30%);
}
.col-body .verse.focus {
  background: color-mix(in srgb, var(--card) 55%, var(--gold) 45%);
  outline: 1px solid color-mix(in srgb, var(--gold) 60%, transparent);
}
.col-body .verse.gap { min-height: 1.62em; }
sup.vn {
  color: var(--gold);
  font-size: 0.68em;
  margin-right: 0.28em;
  font-family: Georgia, serif;
}
.missing, .loading {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 2rem 0.5rem;
}

/* study panels */
.study-ctl select { min-width: 11rem; }
.summa-view {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.study-heading {
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-weight: normal;
  font-size: 1.15rem;
  margin: 0 0 1rem;
  color: var(--gold);
}
.study-cols {
  display: grid;
  gap: 1rem;
  align-items: stretch;
}
.study-cols[data-cols="1"] { grid-template-columns: 1fr; }
.study-cols[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.study-cols[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.study-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--rubric);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.study-col .col-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.study-col .col-head { background: color-mix(in srgb, var(--card) 92%, var(--rubric) 8%); }
.study-col .col-body { font-size: 0.95rem; }
.study-entry {
  margin: 0.65rem 0;
  padding-left: 0.5rem;
  border-left: 2px solid color-mix(in srgb, var(--rubric) 35%, transparent);
}
.study-entry.focus {
  border-left-color: var(--rubric);
  background: color-mix(in srgb, var(--card) 88%, var(--rubric) 12%);
}
.study-entry .vr {
  font-variant: small-caps;
  color: var(--rubric);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.study-entry .txt { margin: 0.25rem 0 0; text-align: justify; }
.study-refs { font-size: 0.88rem; color: var(--muted); }
.study-refs li { margin: 0.2rem 0; }
.study-refs a.scripture-ref {
  color: var(--accent, #6b4c2a);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.study-refs a.scripture-ref:hover { text-decoration: underline; }
.study-refs .ref-note { font-style: italic; opacity: 0.85; }
.summa-cite {
  text-align: center;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 1rem;
}
.summa-body {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  padding: 1rem 1.2rem;
  max-width: 44rem;
  margin: 0 auto;
}
.col-body .verse.focus {
  background: color-mix(in srgb, var(--card) 85%, var(--gold) 15%);
  margin-left: -0.3rem;
  padding-left: 0.3rem;
}
footer.site {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
footer.site a { color: var(--muted); }
footer.site nav.site {
  margin: 0 0 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}
footer.site nav.site a { color: var(--link); }

@media (max-width: 52rem) {
  .reader-workspace.has-study .parallel-cols {
    flex-direction: column;
  }
  .reader-workspace.has-study .reader-cols {
    margin-top: 0;
    flex: none;
  }
  .reader-workspace.has-study .study-stack {
    flex: none;
  }
  .reader-cols[data-cols="2"],
  .reader-cols[data-cols="3"],
  .reader-cols[data-cols="4"] {
    grid-template-columns: 1fr;
  }
  .study-cols[data-cols="2"],
  .study-cols[data-cols="3"] {
    grid-template-columns: 1fr;
  }
}

/* study materials page */
.study-intro { text-align: center; margin-bottom: 1.5rem; }
.study-type {
  margin: 2rem 0 0.5rem;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  font-weight: normal;
  font-size: 1.15rem;
  color: var(--gold);
  text-align: center;
}
.study-type-desc {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.8rem;
}
.study-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.study-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  margin: 0.45rem 0;
  padding: 0.65rem 0.85rem;
}
.study-list a.study-link {
  font-variant: small-caps;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
}
.study-list a.study-link:hover { text-decoration: underline; }
.study-list .meta {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.study-reader,
.study-browse,
.study-sections {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.study-reader[hidden],
.study-browse[hidden],
.study-sections[hidden] { display: none !important; }
.study-reader-toolbar .btn-add {
  align-self: center;
  white-space: nowrap;
}
.study-reader-body {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  padding: 1rem 1.1rem;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.55;
}
.study-reader-body .study-entry + .study-entry {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.study-browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  justify-content: center;
}
.study-browse-toolbar select,
.study-browse-toolbar input {
  font: inherit;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  padding: 0.3rem 0.5rem;
}
.study-browse-toolbar input { min-width: 14rem; }
.study-entry-list {
  columns: 2;
  column-gap: 1.2rem;
  font-size: 0.92rem;
}
.study-entry-list a {
  display: block;
  padding: 0.15rem 0;
  text-decoration: none;
}
.study-entry-view {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  padding: 1rem 1.1rem;
  margin-top: 1rem;
}
.study-entry-view h3 {
  margin: 0 0 0.6rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-weight: normal;
  color: var(--rubric);
}
@media (max-width: 40rem) {
  .study-entry-list { columns: 1; }
}