:root {
  --page-bg: #31362f;
  --panel-bg: #ece3cf;
  --panel-alt: #d6c9ae;
  --line: #a99a7a;
  --text: #201c17;
  --muted: #575147;
  --accent: #9c7e43;
  --accent-deep: #645233;
  --shadow: rgba(7, 8, 6, 0.3);
  --content-width: 76rem;
  --radius: 1.25rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(186, 175, 120, 0.18), transparent 28%),
    linear-gradient(180deg, #465046 0%, var(--page-bg) 100%);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.7;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-deep);
  text-decoration-color: rgba(91, 64, 38, 0.35);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.site-header {
  position: static;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 0 1.25rem;
  padding: 0.95rem 1rem;
  background: rgba(236, 227, 207, 0.92);
  border: 1px solid rgba(169, 154, 122, 0.72);
  border-top: none;
  border-radius: 0 0 1.1rem 1.1rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 0.5rem 1.5rem var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.95rem;
  object-fit: cover;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.14);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.88rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
}

.masthead {
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(169, 154, 122, 0.54);
  border-radius: calc(var(--radius) + 0.35rem);
  box-shadow: 0 1rem 2.5rem var(--shadow);
}

.masthead-image {
  width: 100%;
  height: min(28vw, 18rem);
  object-fit: cover;
}

.intro-panel,
.wide-section,
.feedback-note {
  background: rgba(236, 227, 207, 0.95);
  border: 1px solid rgba(169, 154, 122, 0.66);
  border-radius: var(--radius);
  box-shadow: 0 1rem 2rem rgba(7, 8, 6, 0.22);
}

.intro-panel {
  margin-bottom: 1.75rem;
  padding: 2rem 2rem 2.15rem;
}

.intro-panel,
.wide-section,
.feedback-note,
.study-section,
.article-body,
.study-card,
.article-hero,
.library-rail,
.kb-topbar,
.kb-nav,
.kb-content,
.kb-results,
.book-group {
  width: 100%;
  max-width: none;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0 0 1rem;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.25rem);
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.15rem);
}

.lead {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.article-hero {
  margin-bottom: 1.75rem;
  padding: 2rem;
  background: rgba(236, 227, 207, 0.95);
  border: 1px solid rgba(169, 154, 122, 0.66);
  border-radius: var(--radius);
  box-shadow: 0 1rem 2rem rgba(7, 8, 6, 0.22);
}

.article-subtitle {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.article-meta {
  margin: 0 0 1rem;
  color: var(--accent-deep);
  font-size: 0.95rem;
  font-weight: 700;
}

.article-hero-copy {
  width: 100%;
  max-width: none;
}

.intro-panel > h1,
.intro-panel > h2,
.intro-panel > p,
.wide-section > h1,
.wide-section > h2,
.wide-section > p,
.feedback-note > h1,
.feedback-note > h2,
.feedback-note > p,
.study-section > h1,
.study-section > h2,
.study-section > p,
.article-hero > h1,
.article-hero > h2,
.article-hero > p,
.article-hero-copy p,
.study-card > h1,
.study-card > h2,
.study-card > p,
.kb-content > h1,
.kb-content > h2,
.kb-content > p,
.kb-results > h1,
.kb-results > h2,
.kb-results > p {
  width: 100%;
  max-width: none;
}

.article-hero-copy p {
  color: var(--text);
}

.article-hero-copy p + p {
  margin-top: 1rem;
}

.passage-version + .passage-version {
  margin-top: 1.25rem;
}

.passage-version h2 {
  margin: 0 0 0.7rem;
  font-size: 1.2rem;
}

.article-hero .passage-version blockquote {
  margin: 0;
  padding: 1rem 1.1rem 1rem 1.2rem;
  background: var(--panel-alt);
  border-left: 0.3rem solid var(--accent);
  border-radius: 0 1rem 1rem 0;
  color: var(--accent-deep);
}

.article-hero .passage-version blockquote p {
  margin: 0;
}

.passage-version blockquote p + p {
  margin-top: 0.9rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(17rem, 0.95fr);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.75rem;
}

.content-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.article-layout {
  display: block;
  margin-bottom: 1.75rem;
}

.library-panel {
  display: grid;
  gap: 1.25rem;
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.library-content {
  display: grid;
  gap: 1.5rem;
}

.library-rail {
  position: sticky;
  top: 1.25rem;
  padding: 1.35rem 1.25rem;
  background: rgba(236, 227, 207, 0.95);
  border: 1px solid rgba(169, 154, 122, 0.66);
  border-radius: var(--radius);
  box-shadow: 0 1rem 2rem rgba(7, 8, 6, 0.22);
}

.library-rail-nav {
  display: grid;
  gap: 0.4rem;
}

.library-rail-nav a {
  padding: 0.65rem 0.8rem;
  border-radius: 0.9rem;
  text-decoration: none;
  color: var(--text);
}

.library-rail-nav a:hover {
  background: rgba(156, 126, 67, 0.12);
}

.library-rail-nav a[aria-current="page"] {
  background: var(--accent-deep);
  color: #f7f1e3;
}

.library-panel > h2 {
  color: #f7f1e3;
}

.library-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.library-heading h2 {
  color: #f7f1e3;
  margin-bottom: 0;
}

.library-heading-link {
  color: #f7f1e3;
  font-weight: 700;
  white-space: nowrap;
  text-decoration-color: rgba(247, 241, 227, 0.55);
}

.library-heading-link:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.85);
}

.expand-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.text-button {
  padding: 0;
  border: none;
  background: none;
  color: #f7f1e3;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(247, 241, 227, 0.55);
  text-underline-offset: 0.18em;
}

.text-button:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.85);
}

.library-browse-link {
  margin: 0.25rem 0 0;
  font-weight: 700;
}

.library-browse-link a {
  color: #f7f1e3;
  text-decoration-color: rgba(247, 241, 227, 0.55);
}

.library-browse-link a:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.85);
}

.content-column {
  display: grid;
  gap: 1.25rem;
}

.study-section,
.article-body,
.study-card {
  background: rgba(236, 227, 207, 0.95);
  border: 1px solid rgba(169, 154, 122, 0.66);
  border-radius: var(--radius);
  box-shadow: 0 1rem 2rem rgba(7, 8, 6, 0.22);
}

.study-section,
.article-body {
  padding: 1.75rem 1.8rem;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2,
.prose h3 {
  margin-top: 2rem;
}

.prose-divider {
  margin: 1.6rem 0;
  border: none;
  border-top: 1px solid var(--line);
}

.prose-list {
  padding-left: 1.2rem;
}

.study-section p:last-child,
.wide-section p:last-child,
.feedback-note p:last-child,
.article-body p:last-child,
.study-card p:last-child {
  margin-bottom: 0;
}

.study-section blockquote,
.article-body blockquote {
  margin: 1.3rem 0 0;
  padding: 1rem 1.1rem 1rem 1.2rem;
  background: var(--panel-alt);
  border-left: 0.3rem solid var(--accent);
  border-radius: 0 1rem 1rem 0;
  color: var(--accent-deep);
}

.study-section blockquote p,
.article-body blockquote p {
  margin: 0;
}

.study-section blockquote span,
.article-body blockquote span,
.closing-verse span {
  color: var(--muted);
  font-size: 0.95rem;
}

.study-link-list li + li {
  margin-top: 0.55rem;
}

.study-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.study-spotlight {
  margin-bottom: 0.25rem;
  padding: 2rem 2.1rem;
  color: var(--text);
  background: linear-gradient(180deg, rgba(236, 227, 207, 0.98), rgba(226, 214, 187, 0.96));
  border: 1px solid rgba(169, 154, 122, 0.72);
  border-radius: calc(var(--radius) + 0.1rem);
  box-shadow: 0 1.2rem 2.4rem rgba(7, 8, 6, 0.24);
}

.study-spotlight .eyebrow {
  color: var(--accent);
}

.study-spotlight h2 {
  font-size: clamp(2rem, 3.3vw, 2.8rem);
  margin-bottom: 0.7rem;
}

.study-spotlight h2 a {
  color: inherit;
  text-decoration: none;
}

.study-spotlight-subtitle {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.study-spotlight p:not(.eyebrow):not(.study-spotlight-subtitle) {
  max-width: 60rem;
  font-size: 1.07rem;
}

.study-spotlight .study-card-link {
  color: var(--accent-deep);
}

.book-group {
  background: rgba(236, 227, 207, 0.95);
  border: 1px solid rgba(169, 154, 122, 0.66);
  border-radius: var(--radius);
  box-shadow: 0 1rem 2rem rgba(7, 8, 6, 0.22);
  padding: 1rem 1.2rem;
}

.book-group summary {
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
}

.book-passages {
  margin-top: 0.9rem;
}

.study-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.study-card h2 {
  font-size: 1.45rem;
  margin-bottom: 0.65rem;
}

.study-card h2 a {
  text-decoration: none;
  color: inherit;
}

.study-card-subtitle {
  color: var(--muted);
  font-size: 0.98rem;
}

.study-card-link {
  display: inline-block;
  margin-top: auto;
  padding-top: 1rem;
  font-weight: 700;
}

.wide-section,
.feedback-note {
  margin-bottom: 1.5rem;
  padding: 1.9rem 2rem;
}

.closing-verse {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-style: italic;
}

.feedback-note {
  background: linear-gradient(180deg, rgba(215, 205, 175, 0.96), rgba(236, 227, 207, 0.95));
}

.kb-guide-note {
  margin-bottom: 0.5rem;
  padding: 1.15rem 1.35rem 1.2rem;
}

.kb-guide-note p {
  margin: 0;
}

.kb-guide-note p + p {
  margin-top: 0.8rem;
}

.kb-shell {
  display: grid;
  gap: 1.25rem;
}

.kb-topbar {
  background: rgba(236, 227, 207, 0.95);
  border: 1px solid rgba(169, 154, 122, 0.66);
  border-radius: var(--radius);
  box-shadow: 0 1rem 2rem rgba(7, 8, 6, 0.22);
}

.scripture-kb-topbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.35rem 1.4rem;
}

.kb-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
}

.kb-search,
.kb-select {
  width: 100%;
  padding: 0.8rem 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(169, 154, 122, 0.72);
  border-radius: 0.9rem;
  font: inherit;
}

.kb-browse-btn,
.kb-nav-action-btn {
  padding: 0.8rem 1rem;
  color: #f7f1e3;
  background: var(--accent-deep);
  border: none;
  border-radius: 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.kb-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.scripture-kb-layout .kb-nav,
.scripture-kb-layout .kb-content {
  position: sticky;
  top: 1rem;
}

.kb-nav,
.kb-content,
.kb-results {
  background: rgba(236, 227, 207, 0.95);
  border: 1px solid rgba(169, 154, 122, 0.66);
  border-radius: var(--radius);
  box-shadow: 0 1rem 2rem rgba(7, 8, 6, 0.22);
}

.kb-nav {
  padding: 1.2rem;
}

.kb-nav-controls {
  display: grid;
  gap: 0.75rem;
}

.kb-nav-filter {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.8rem;
  margin-bottom: 0.7rem;
}

.kb-nav-search {
  padding: 0.68rem 0.88rem;
  font-size: 0.96rem;
}

.kb-control-label {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kb-nav-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.kb-nav-action-btn {
  flex: 1 1 auto;
}

.kb-nav-group + .kb-nav-group {
  margin-top: 0.45rem;
}

.kb-nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.52rem 0.72rem;
  color: var(--text);
  background: rgba(214, 201, 174, 0.78);
  border: 1px solid rgba(169, 154, 122, 0.66);
  border-radius: 0.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.kb-nav-list {
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.kb-nav-subgroups {
  display: grid;
  gap: 0.24rem;
}

.kb-nav-subgroup {
  display: grid;
  gap: 0.06rem;
}

.kb-nav-subgroup-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.02rem 0.04rem 0;
  color: var(--accent-deep);
  background: transparent;
  border: none;
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.02em;
}

.kb-nav-subgroup-toggle:hover {
  color: var(--accent);
}

.kb-nav-section-list {
  margin-top: 0;
  padding-left: 0.28rem;
  border-left: 1px solid rgba(169, 154, 122, 0.55);
}

.kb-nav-item + .kb-nav-item {
  margin-top: 0;
}

.kb-nav-item button {
  width: 100%;
  padding: 0.24rem 0.42rem;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 0.75rem;
  font: inherit;
  cursor: pointer;
  text-align: left;
  line-height: 1.32;
}

.kb-section-link {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 0.34rem;
}

.kb-section-range {
  display: inline-grid;
  grid-template-columns: 0.95rem 0.38rem 1.3rem;
  align-items: baseline;
  justify-items: stretch;
  min-width: calc(0.95rem + 0.38rem + 1.3rem);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

.kb-section-verse-start {
  min-width: 0.95rem;
  text-align: right;
  padding-right: 0.02rem;
}

.kb-section-verse-end {
  min-width: 1.3rem;
  text-align: left;
  padding-left: 0.02rem;
}

.kb-section-range-dash {
  width: 0.38rem;
  text-align: center;
}

.kb-section-title-text {
  min-width: 0;
}

.kb-nav-item button:hover,
.kb-nav-item button.is-active {
  color: #f7f1e3;
  background: var(--accent-deep);
}

.kb-content {
  padding: 1.35rem;
  display: grid;
  gap: 1rem;
}

.kb-results {
  display: none;
  padding: 1rem 1.1rem;
}

.kb-results.is-visible {
  display: block;
}

.kb-result-item + .kb-result-item {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(169, 154, 122, 0.66);
}

.kb-result-item {
  cursor: pointer;
}

.kb-result-item h4,
.kb-article-title,
.kb-section-title {
  margin: 0 0 0.45rem;
}

.kb-breadcrumb,
.kb-meta {
  color: var(--muted);
}

.kb-content a,
.kb-results a,
.study-link-list a {
  color: var(--accent-deep);
  text-decoration-color: rgba(91, 64, 38, 0.35);
}

.kb-content a:hover,
.kb-results a:hover,
.study-link-list a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.kb-article-title {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.15;
}

.kb-paragraph {
  margin: 0 0 1rem;
}

.kb-nav-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--content-width));
    padding-top: 0.6rem;
  }

  .site-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    border-top: 1px solid rgba(169, 154, 122, 0.72);
    border-radius: 1.2rem;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .masthead-image {
    height: min(40vw, 14rem);
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .library-layout {
    grid-template-columns: 1fr;
  }

  .scripture-kb-topbar-inner {
    grid-template-columns: 1fr;
  }

  .kb-layout {
    grid-template-columns: 1fr;
  }

  .study-card-grid {
    grid-template-columns: 1fr;
  }

  .library-rail {
    position: static;
  }

  .kb-nav {
    position: static;
  }

  .scripture-kb-layout .kb-nav,
  .scripture-kb-layout .kb-content {
    position: static;
    top: auto;
    max-height: none;
    overflow-y: visible;
  }

  .intro-panel,
  .library-rail,
  .kb-topbar,
  .kb-nav,
  .kb-content,
  .kb-results,
  .study-section,
  .article-body,
  .article-hero,
  .wide-section,
  .feedback-note {
    padding: 1.45rem 1.2rem;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 0.98rem;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    font-size: 0.82rem;
  }

  .site-nav {
    gap: 0.75rem;
    font-size: 0.9rem;
  }

  .kb-nav-actions {
    flex-direction: column;
  }

  .library-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .masthead-image {
    height: 10rem;
  }
}
