:root {
  --brand-dark: #143556;
  --brand: #1f4e79;
  --brand-light: #e3edf7;
  --bg: #f1f4f8;
  --text: #222;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: #c00; }

.site-header { max-width: 860px; margin: 0 auto; padding: 18px 16px 8px; }
.logo { font-size: 32px; font-weight: bold; color: var(--brand-dark); }

.card {
  max-width: 860px;
  margin: 8px auto 16px;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(20, 53, 86, 0.14);
}

.hero { text-align: center; padding: 8px 0 12px; }
.slogan { font-size: 30px; line-height: 1.25; margin: 0 0 8px; color: var(--brand-dark); }
.hero-sub { margin: 0; color: #555; }

.testament {
  margin: 28px 0 10px;
  padding: 6px 12px;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
  border-radius: 6px;
}
/* the part in brackets after the title: smaller, not bold, slightly softer white */
.testament small { margin-left: 4px; font-size: 0.75em; font-weight: normal; color: rgba(255, 255, 255, 0.88); }

.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 12px;
}
.book-list a { display: block; padding: 4px 8px; border-radius: 4px; }
.book-list a:hover { background: var(--brand-light); }

.page-title, .chapter-title { color: var(--brand-dark); margin: 0 0 12px; }
.breadcrumb { font-size: 13px; margin-bottom: 8px; }
.version-note { color: #666; font-size: 14px; margin-top: 0; }

.compare { margin: 12px 0; font-size: 15px; }
.compare label { margin-left: 12px; cursor: pointer; }

.chapter-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 16px; }
.chapter-list a {
  min-width: 34px;
  padding: 2px 6px;
  text-align: center;
  border: 1px solid #c9d6e4;
  border-radius: 4px;
  font-size: 14px;
}
.chapter-list a.current { background: var(--brand); border-color: var(--brand); color: #fff; }

.chapter-nav { display: flex; justify-content: space-between; margin: 12px 0; font-size: 15px; }

.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.title-row .chapter-title { margin-bottom: 12px; }
/* Reading settings: gear button and popup on the reading page */
.settings { position: relative; flex: none; }
.settings-button { display: flex; align-items: center; padding: 4px; border: 0; border-radius: 50%; background: none; color: #777; cursor: pointer; }
.settings-button:hover, .settings-button[aria-expanded="true"] { color: var(--brand); background: var(--brand-light); }
.settings-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  width: 230px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #c9d6e4;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-size: 15px;
}
.settings-title { margin: 0 0 8px; font-weight: bold; color: var(--brand-dark); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; cursor: pointer; }
.switch-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 11px;
  background: #bbb;
  cursor: pointer;
  transition: background 0.15s;
}
.switch-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.switch-row input[type="checkbox"]:checked { background: var(--brand); }
.switch-row input[type="checkbox"]:checked::after { transform: translateX(16px); }
.switch-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }

.audio-bar { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.ver-name { font-weight: bold; color: var(--brand-dark); }
.audio-bar audio { flex: 1; max-width: 360px; }
.parallel th audio { display: block; width: 100%; max-width: 300px; margin-top: 4px; }
.audio-missing { display: block; font-size: 12px; font-weight: normal; font-style: italic; color: #888; }
.audio-bar .audio-missing { display: inline; }
audio { height: 36px; }

.verse { display: grid; grid-template-columns: 2.2em 1fr; margin: 0 0 6px; font-size: 18px; scroll-margin-top: 12px; }
.verse .vnum { align-self: stretch; padding-top: 0.35em; }
.verse .vpanel { grid-column: 2; margin-left: 0; }
.vnum {
  display: inline-block;
  min-width: 1.6em;
  font-size: 0.75em;
  font-weight: bold;
  vertical-align: super;
}
/* The number is drawn by CSS (data-n) rather than written as text, so read-aloud tools and copy/paste skip it */
.vnum::before { content: attr(data-n); }
.vnum.open { color: #c00; }
.vlabel { display: none; font-weight: bold; color: var(--brand-dark); }

/* "Verse Numbers: off" - each number becomes a thin vertical bar in the margin, like the rule beside a printed Bible.
   The bar is still the button that opens the verse panel; its clickable area is wider than the line. */
.vn-off .verse { grid-template-columns: 1.6em 1fr; margin-bottom: 4px; }
.vn-off .vnum, .vn-off .parallel .vnum {
  position: relative;
  font-size: 0;
  line-height: 0;
  min-width: 0;
  vertical-align: baseline;
  padding: 0;
}
.vn-off .vnum::before { content: none; }
.vn-off .parallel .vnum { position: absolute; inset: 0; }

/* One continuous line down the margin. It is drawn on the whole verse (text + its open panel), not on the bar,
   so it never breaks between verses; the verse under the pointer or with an open panel is drawn darker. */
.vn-off .verse { position: relative; margin-bottom: 0; padding-bottom: 6px; }
.vn-off .verse::before,
.vn-off .parallel td:first-child::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #b7c8dc;
}
.vn-off .verse:has(.vnum:hover)::before,
.vn-off .verse:has(.vnum:focus-visible)::before,
.vn-off .verse:has(.vnum.open)::before,
.vn-off .parallel tr:has(.vnum:hover) td:first-child::before,
.vn-off .parallel tr:has(.vnum:focus-visible) td:first-child::before,
.vn-off .parallel tr:has(.vnum.open) td:first-child::before,
.vn-off .parallel tr:has(.vnum.open) + tr.vpanel td:first-child::before { background: var(--brand); }
.vn-off .parallel td:first-child { position: relative; width: 1.6em; padding: 0; border-bottom: 0; }
.vn-off .vlabel { display: block; }

/* The verse a link jumped to (the #v16 in the address) stays highlighted until a verse number is clicked (see verse.js) */
/* Illustrations: every picture has the same size (the image is cropped to fit); the verses beside it flow around it.
   The "Illustrations" setting hides them. */
.illustration { float: right; width: 180px; height: 225px; margin: 4px 0 10px 16px; }
.illustration a { display: block; width: 100%; height: 100%; }
.illustration img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); background: #eee; }
.verses::after { content: ""; display: block; clear: both; }
.parallel td .illustration { width: 120px; height: 150px; margin: 2px 0 8px 12px; }
.il-off .illustration { display: none; }
@media (max-width: 640px) {
  .illustration { width: 110px; height: 138px; margin-left: 10px; }
  .parallel td .illustration { width: 80px; height: 100px; margin-left: 8px; }
}

/* Section headings from the chapter outline (above the verse each one starts); the "Section headings" setting hides them */
.sh-off .section-title, .sh-off .parallel tr.section-row { display: none; }
.section-title, .story-title { margin: 20px 0 6px; font-size: 17px; line-height: 1.35; color: var(--brand-dark); }
/* .story-title is the heading of Today's Story and of the passage page it links to; the "Section headings" setting does not hide it */
.verses > .story-title:first-child { margin-top: 8px; }
.verses > .section-title:first-child { margin-top: 8px; }
.parallel tr.section-row td { padding: 14px 8px 2px; border-bottom: 0; }
.parallel tr.section-row .section-title { margin: 0; }
.vn-off .parallel tr.section-row td { width: auto; padding: 14px 8px 2px; }
.vn-off .parallel tr.section-row td::before { content: none; }

.verse.target-verse { background: #fff3b0; border-radius: 4px; }
.parallel tr.target-verse td { background: #fff3b0; }

.vpanel {
  margin: 4px 0 10px 1.6em;
  padding: 8px 12px;
  background: #f3f6fa;
  border-left: 3px solid #8fb0d1;
  font-size: 15px;
}
.vpanel p { margin: 4px 0; }
.ver-label {
  display: inline-block;
  min-width: 2.8em;
  font-weight: bold;
  color: #800000;
  font-size: 13px;
}
.tsk-word { font-style: italic; }
.tsk-line { line-height: 1.8; }

.parallel { width: 100%; border-collapse: collapse; font-size: 16px; }
.parallel th { text-align: left; border-bottom: 2px solid var(--brand); padding: 4px 8px; color: var(--brand-dark); }
.parallel td { vertical-align: top; padding: 6px 8px; border-bottom: 1px solid #e1e8f0; }
.parallel td.vn, .parallel th.vn { width: 2.5em; }
.parallel .vpanel { background: transparent; border: 0; margin: 0; padding: 0; }
.parallel tr.vpanel td { background: #f3f6fa; }

.tsk-layer {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  font-size: 15px;
}
.tsk-close { float: right; border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: #900; }
.tsk-pop p { margin: 6px 0; }

.search-form { display: flex; gap: 6px; }
.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid #9db6d0;
  border-radius: 6px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS Safari from zooming on focus */
}
.search-form select, .search-form button {
  padding: 8px 10px;
  border: 1px solid #9db6d0;
  border-radius: 6px;
  font: inherit;
  font-size: 15px;
  background: #fff;
}
.search-form button { background: var(--brand); border-color: var(--brand); color: #fff; cursor: pointer; }
.search-form button:hover { background: var(--brand-dark); }
.search-form select[name="s"] { max-width: 11em; }
.search-form.compact { margin-top: 8px; }
.search-form.big { margin: 14px auto 0; max-width: 640px; }
.search-form.big input[type="search"] { padding: 11px 14px; font-size: 17px; }

.daily-verse { max-width: 640px; margin: 26px auto 4px; padding: 0 8px; text-align: center; }
.daily-verse blockquote { margin: 0; font-size: 19px; font-style: italic; line-height: 1.55; color: #333; }
.daily-verse figcaption { margin-top: 8px; font-size: 14px; }

.passage-title { margin: 22px 0 8px; color: var(--brand-dark); font-size: 22px; }
.passage-ver { margin-left: 6px; font-size: 13px; font-weight: normal; color: #666; }
.passage-block { margin-bottom: 26px; }
.chapter-divider { margin: 10px 0 6px; padding-top: 6px; border-top: 1px solid #e1e8f0; font-size: 14px; font-weight: bold; color: var(--brand-dark); }
.read-chapter { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
a.button { display: inline-block; padding: 7px 16px; background: var(--brand); color: #fff; border-radius: 6px; font-size: 15px; }
a.button:hover { background: var(--brand-dark); color: #fff; }

.in-light .testament { background: #2f7d4f; } /* the bars have three colours: Old/New Testament navy, Today's Story amber, this green */
.light-list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 17px; }
.light-list li { display: flex; align-items: baseline; gap: 8px; margin: 6px 0; }
.light-head { flex: none; }
/* first words of the verse: one line, shortened with an ellipsis when the window is narrow; hidden on phones */
.light-snippet { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: #666; }
@media (max-width: 640px) { .light-snippet { display: none; } }
.today-story .testament { background: #9a5b00; } /* amber, so "today" stands out from the green Old/New Testament bars */
.today-story .verses { margin-top: 12px; }
.story-more { margin: 6px 0 0; font-size: 14px; }

.notice { color: #a00; font-weight: bold; }
.search-help { margin-top: 20px; color: #444; }
.search-help h2 { font-size: 17px; margin: 0 0 6px; color: var(--brand-dark); }
.search-help li { margin: 4px 0; }
.result-count { margin: 16px 0 8px; color: #444; }
/* Keyword results: the result number opens the verse panel, like a verse number on the reading page */
.result { display: grid; grid-template-columns: 2.6em 1fr; margin: 0 0 10px; line-height: 1.6; }
.rnum { align-self: start; padding-top: 0.35em; font-size: 0.75em; font-weight: bold; color: var(--brand-dark); }
.rnum::before { content: attr(data-n); }
.rnum.open { color: #c00; }
.result .ref { font-weight: bold; margin-right: 4px; }
.result .vpanel { grid-column: 2; margin: 6px 0 4px; }
.vlabel-show, .vn-off .vlabel-show { display: block; }
mark { background: #fff2a8; padding: 0 1px; border-radius: 2px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 4px; }
.pager a, .pager .current { padding: 3px 10px; border: 1px solid #c9d6e4; border-radius: 4px; }
.pager .current { background: var(--brand); border-color: var(--brand); color: #fff; }

.site-footer { max-width: 860px; margin: 0 auto; padding: 8px 16px 32px; text-align: center; font-size: 14px; color: #666; }
.site-footer nav a { margin: 0 10px; }

@media (max-width: 640px) {
  .search-form { flex-wrap: wrap; }
  .search-form input[type="search"] { flex: 1 0 100%; }
  .search-form select[name="s"] { flex: 1 0 100%; width: 100%; min-width: 0; max-width: none; }
  .card { margin: 8px 8px 16px; padding: 16px; border-radius: 8px; }
  .slogan { font-size: 24px; }
  .logo { font-size: 26px; }
  .verse { font-size: 17px; }
  .parallel { font-size: 14px; }
  .parallel td { padding: 4px; }
  .vpanel { margin-left: 0; }
}
