:root {
  --bible-ink: #1d2925;
  --bible-muted: #66736b;
  --bible-green: #254e3d;
  --bible-green-dark: #18382b;
  --bible-gold: #bf8144;
  --bible-paper: #fbf8f0;
  --bible-line: #e8e0d2;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.bible-site {
  margin: 0;
  color: var(--bible-ink);
  background:
    radial-gradient(ellipse at 4% 24%, rgba(219, 201, 164, .17), transparent 33rem),
    #f2efe7;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.bible-page {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.reader-intro {
  position: relative;
  display: grid;
  min-height: 360px;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  align-items: center;
  gap: clamp(30px, 6vw, 78px);
  padding: 42px 24px 48px;
}

.intro-copy {
  position: relative;
  z-index: 1;
  padding: 4px 0 8px;
}

.eyebrow,
.chapter-kicker,
.commentary-topline {
  color: var(--bible-green);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 20px;
}

.eyebrow span {
  margin-right: 7px;
  color: var(--bible-gold);
}

.reader-intro h1 {
  margin: 0;
  color: #1c342a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5.5vw, 70px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .98;
}

.reader-intro h1 em {
  color: var(--bible-green);
  font-weight: 400;
}

.intro-description {
  max-width: 490px;
  margin: 22px 0 25px;
  color: #4d5b53;
  font-size: 16px;
  line-height: 1.75;
}

.intro-edition {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  color: var(--bible-muted);
  font-size: 12px;
  line-height: 1.6;
}

.intro-edition strong {
  color: var(--bible-ink);
  font-size: 13px;
}

.edition-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--bible-green-dark);
  border: 1px solid #cdb58f;
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
}

.intro-image {
  position: relative;
  height: 285px;
  margin: 0;
  overflow: hidden;
  background: #1d342b;
  box-shadow: 17px 17px 0 rgba(190, 161, 112, .21);
}

.intro-image::after {
  position: absolute;
  inset: 30% 0 0;
  background: linear-gradient(transparent, rgba(10, 25, 19, .72));
  content: "";
}

.intro-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.intro-image figcaption {
  position: absolute;
  z-index: 1;
  right: 20px;
  bottom: 17px;
  left: 20px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.reader-wrap {
  padding: 0 24px 42px;
}

.reader-toolbar {
  display: flex;
  min-height: 82px;
  align-items: flex-end;
  gap: 15px;
  padding: 17px 20px 18px;
  border: 1px solid var(--bible-line);
  border-bottom: 0;
  background: #f8f5ed;
}

.selector-group {
  display: grid;
  min-width: 200px;
  gap: 6px;
}

.selector-group label {
  color: #55635a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.selector-group select {
  min-height: 40px;
  padding: 0 34px 0 11px;
  color: var(--bible-ink);
  border: 1px solid #d4cbbb;
  border-radius: 2px;
  background: #fffefa;
  font: inherit;
  font-size: 14px;
}

.chapter-select-group {
  min-width: 124px;
}

.chapter-navigation {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.chapter-step,
.retry-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  color: var(--bible-green-dark);
  border: 1px solid #bdc7be;
  border-radius: 2px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.chapter-step:hover:not(:disabled),
.retry-button:hover {
  color: #fff;
  border-color: var(--bible-green);
  background: var(--bible-green);
}

.chapter-step:disabled {
  color: #89928b;
  cursor: not-allowed;
  opacity: .58;
}

.bible-page button:focus-visible,
.bible-page select:focus-visible,
.bible-page a:focus-visible,
.verse-button:focus-visible {
  outline: 3px solid #b87937;
  outline-offset: 3px;
}

.reader-status {
  margin: 0;
  padding: 10px 20px;
  color: #53645a;
  border: 1px solid var(--bible-line);
  background: #f8f5ed;
  font-size: 12px;
}

.reader-error {
  padding: 24px;
  color: #692e24;
  border: 1px solid #e3c4b9;
  background: #fff6f1;
}

.reader-error p {
  margin: 6px 0 14px;
}

.retry-button {
  color: #fff;
  border-color: #8f493c;
  background: #8f493c;
}

.reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  align-items: start;
  border: 1px solid var(--bible-line);
  border-top: 0;
  background: var(--bible-paper);
}

.chapter-panel {
  min-width: 0;
  padding: clamp(25px, 4vw, 48px) clamp(22px, 5vw, 66px) 48px;
}

.chapter-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--bible-line);
}

.chapter-kicker {
  margin: 0 0 8px;
  font-size: 9px;
}

.chapter-heading-row h2 {
  margin: 0;
  color: #213d30;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: -.03em;
}

.chapter-count {
  padding-bottom: 7px;
  color: #7a857d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  white-space: nowrap;
}

.verse-list {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.verse-item {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0;
  border-left: 2px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
}

.verse-item.is-selected {
  border-left-color: var(--bible-gold);
  background: rgba(219, 203, 173, .22);
}

.verse-button {
  display: inline;
  width: 100%;
  padding: 7px 9px 7px 8px;
  color: #303c34;
  border: 0;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 1.65vw, 18px);
  line-height: 1.85;
  text-align: left;
  cursor: pointer;
}

.verse-button:hover {
  color: var(--bible-green-dark);
  background: rgba(219, 203, 173, .22);
}

.verse-number {
  display: inline-block;
  min-width: 22px;
  margin-right: 5px;
  color: #9a704b;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 10px;
  font-weight: 750;
  text-align: right;
  vertical-align: 3px;
}

.commentary-panel {
  position: sticky;
  top: 20px;
  min-width: 0;
  padding: 34px 27px 25px;
  border-left: 1px solid var(--bible-line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .83), rgba(250, 246, 237, .88)),
    var(--bible-paper);
}

.commentary-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9b6c3e;
  font-size: 9px;
}

.commentary-rule {
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--bible-gold);
}

.commentary-reference {
  margin: 24px 0 8px;
  color: var(--bible-green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.commentary-panel h2 {
  margin: 0 0 14px;
  color: #233c30;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.commentary-text {
  margin: 0;
  color: #4d5a51;
  font-size: 14px;
  line-height: 1.78;
}

.commentary-scope {
  margin-top: 20px;
  padding: 11px 12px;
  color: #6a6255;
  border-left: 2px solid #c49a69;
  background: #f1ebde;
  font-size: 11px;
  line-height: 1.6;
}

.study-image {
  margin: 25px 0 0;
}

.study-image img {
  display: block;
  width: 100%;
  max-height: 144px;
  object-fit: cover;
  object-position: center;
}

.study-image figcaption {
  margin-top: 7px;
  color: #7b837b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-style: italic;
}

.source-note {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  padding: 0 48px 48px;
  color: #58645c;
  font-size: 12px;
  line-height: 1.8;
}

.source-note p {
  margin: 0;
}

.source-note strong {
  color: #283d31;
}

.source-note a {
  color: #315c47;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (max-width: 820px) {
  .bible-page {
    width: min(100% - 30px, 680px);
  }

  .reader-intro {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr);
    gap: 24px;
    padding: 35px 14px 39px;
  }

  .intro-image {
    height: 245px;
  }

  .reader-wrap {
    padding-inline: 14px;
  }

  .reading-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .commentary-panel {
    position: static;
    border-top: 1px solid var(--bible-line);
    border-left: 0;
  }

  .study-image img {
    max-height: 190px;
  }

  .source-note {
    padding-inline: 28px;
  }
}

@media (max-width: 660px) {
  .bible-page {
    width: 100%;
  }

  .reader-intro {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 32px 23px 33px;
  }

  .reader-intro h1 {
    font-size: clamp(43px, 13vw, 59px);
  }

  .intro-description {
    margin: 17px 0 20px;
    font-size: 15px;
  }

  .intro-image {
    height: 210px;
    margin-right: 8px;
  }

  .reader-wrap {
    padding: 0 12px 32px;
  }

  .reader-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(96px, .58fr);
    gap: 13px 10px;
    padding: 15px 13px;
  }

  .selector-group,
  .chapter-select-group {
    min-width: 0;
  }

  .chapter-navigation {
    grid-column: 1 / -1;
    justify-content: space-between;
    margin-left: 0;
  }

  .chapter-step {
    width: 48%;
  }

  .reader-status {
    padding-inline: 13px;
  }

  .chapter-panel {
    padding: 25px 15px 31px;
  }

  .chapter-heading-row {
    margin-bottom: 12px;
  }

  .verse-button {
    padding-block: 6px;
    font-size: 16px;
    line-height: 1.8;
  }

  .commentary-panel {
    padding: 27px 20px 24px;
  }

  .source-note {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 23px 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
