/* BibleVault study-reader page only. Load after theme.css. */

body.study-reading-page {
  --study-ink: #202428;
  --study-muted: #687178;
  --study-paper: #f6f1e7;
  --study-panel: #ffffff;
  --study-line: #d8cfbf;
  --study-accent: #75421f;
  --study-accent-dark: #4b2915;
  --study-accent-soft: #eee0cb;
  --study-quote: #fffaf0;
  --study-confirmed: #17633f;
  --study-confirmed-bg: #ddefe3;
  --study-implied: #245e92;
  --study-implied-bg: #dbeaf7;
  --study-inferred: #7a5513;
  --study-inferred-bg: #f4e7c8;
  --study-speculative: #77385f;
  --study-speculative-bg: #efdbe7;

  margin: 0;
  padding: 0;
  background: var(--study-paper);
  color: var(--study-ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.72;
}

.study-reading-page .top-shell {
  display: block;
}

.study-reading-page .topbar.panel {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  margin: 0;
  padding: 0.85rem max(1rem, calc((100vw - 1180px) / 2));
  border: 0;
  border-bottom: 1px solid var(--study-line);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  background: rgba(255, 250, 240, 0.96);
}

.study-reading-page .brand-inline {
  color: var(--study-accent-dark);
}

.study-reading-page .brand-inline-kicker {
  color: var(--study-accent);
}

.study-reading-page .brand-inline-title {
  color: var(--study-accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
}

.study-reading-page .top-nav a {
  color: var(--study-ink);
  background: transparent;
  border-color: transparent;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.88rem;
}

.study-reading-page .top-nav a:hover,
.study-reading-page .top-nav a:focus-visible {
  color: var(--study-accent-dark);
  border-color: var(--study-line);
  background: var(--study-accent-soft);
}

.study-reading-page .page-shell {
  display: block;
  width: 100%;
}

.bible-study {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.1rem 1.25rem 5rem;
}

.study-header {
  border-bottom: 4px solid var(--study-accent);
  margin-bottom: 1.5rem;
  padding-bottom: 1.35rem;
}

.study-kicker {
  color: var(--study-accent);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.study-header h1,
.study-reading-page .study-main h2,
.study-reading-page .study-main h3,
.study-reading-page .study-main h4,
.study-resource-card h2 {
  color: var(--study-accent-dark);
  line-height: 1.2;
}

.study-header h1 {
  font-size: clamp(2.05rem, 5vw, 3.65rem);
  margin: 0 0 0.85rem;
}

.study-subtitle {
  color: var(--study-muted);
  font-size: 1.14rem;
  line-height: 1.62;
  margin: 0;
  max-width: 830px;
}

.study-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.study-meta > span {
  align-items: center;
  background: #efe8dc;
  border: 1px solid var(--study-line);
  border-radius: 999px;
  color: var(--study-accent-dark);
  display: inline-flex;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.32rem 0.6rem;
}

.study-meta .tier {
  border: 0;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.study-contents {
  background: #fffaf0;
  border: 1px solid var(--study-line);
  border-radius: 6px;
  margin: 0 0 1.8rem;
  padding: 0.75rem 0.95rem;
}

.study-contents summary {
  color: var(--study-accent-dark);
  cursor: pointer;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
}

.study-contents ol {
  columns: 2;
  gap: 2rem;
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
}

.study-contents li {
  break-inside: avoid;
  margin: 0.3rem 0;
}

.study-contents a {
  color: var(--study-accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.study-reading-layout {
  align-items: start;
  display: grid;
  gap: 2.1rem;
  grid-template-columns: minmax(0, 1fr) 270px;
}

.study-reading-page .study-main {
  min-width: 0;
}

.study-section {
  margin-bottom: 3rem;
  scroll-margin-top: 6.5rem;
}

.study-reading-page .study-main h2 {
  border-bottom: 1px solid var(--study-line);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  margin: 0 0 1.25rem;
  padding-bottom: 0.45rem;
}

.study-reading-page .study-main h3 {
  font-size: 1.35rem;
  margin: 2.15rem 0 0.82rem;
}

.study-reading-page .study-main h4 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.65rem;
}

.study-section-body,
.study-section-body p,
.study-section-body li {
  font-size: 1.04rem;
}

.study-section-body p {
  margin: 0 0 1.12rem;
}

.study-section-body ul,
.study-section-body ol {
  margin: 0 0 1.2rem;
  padding-left: 1.5rem;
}

.study-section-body li + li {
  margin-top: 0.42rem;
}

.study-section-body a {
  color: var(--study-accent-dark);
  text-decoration-color: rgba(117, 66, 31, 0.48);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

.study-section-body a:hover,
.study-section-body a:focus-visible {
  color: #8c4e23;
  text-decoration-thickness: 2px;
}

.study-section-body blockquote {
  background: var(--study-quote);
  border-left: 5px solid var(--study-accent);
  margin: 1.5rem 0;
  padding: 1.05rem 1.3rem;
}

.study-section-body blockquote p {
  margin: 0.3rem 0;
}

.study-section-body blockquote p:last-child {
  color: var(--study-muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.study-section-body .scripture-block {
  background: var(--study-quote);
  border-left: 5px solid var(--study-accent);
  margin: 1.5rem 0;
  padding: 1.05rem 1.3rem;
}

.study-section-body .callout {
  background: var(--study-accent-soft);
  border-left: 5px solid var(--study-accent);
  border-radius: 4px;
  margin: 1.5rem 0;
  padding: 1rem 1.18rem;
}

.study-section-body .callout > :last-child {
  margin-bottom: 0;
}

.study-section-body .original-language {
  color: #472718;
  font-size: 1.16rem;
  font-weight: 700;
}

.study-section-body .transliteration {
  color: var(--study-muted);
  font-style: italic;
}

.study-section-body .strongs,
.study-section-body .strongs-link {
  background: #efe8dc;
  border-radius: 3px;
  color: var(--study-accent-dark);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.13rem 0.35rem;
  white-space: nowrap;
}

.study-section-body .strongs-link {
  border: 1px solid #ded3c2;
  text-decoration: none;
}

.study-section-body .passage-link {
  color: #245e48;
  font-weight: 700;
}

.study-section-body .study-crosslink {
  color: #365f89;
  font-weight: 700;
}

.study-section-body .tier,
.study-section-body .confidence-confirmed,
.study-section-body .confidence-strongly-implied,
.study-section-body .confidence-inferred,
.study-section-body .confidence-speculative {
  border-radius: 4px;
  display: inline-block;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 0.24rem 0.48rem;
  text-transform: uppercase;
}

.study-section-body .confirmed,
.study-meta .confidence-confirmed {
  background: var(--study-confirmed-bg);
  color: var(--study-confirmed);
}

.study-section-body .implied,
.study-meta .confidence-strongly-implied {
  background: var(--study-implied-bg);
  color: var(--study-implied);
}

.study-section-body .inferred,
.study-meta .confidence-inferred {
  background: var(--study-inferred-bg);
  color: var(--study-inferred);
}

.study-section-body .speculative,
.study-meta .confidence-speculative {
  background: var(--study-speculative-bg);
  color: var(--study-speculative);
}

.study-section-body table {
  background: var(--study-panel);
  border-collapse: collapse;
  display: block;
  margin: 1.45rem 0;
  max-width: 100%;
  min-width: 640px;
  overflow-x: auto;
  white-space: normal;
  width: 100%;
}

.study-section-body th,
.study-section-body td {
  border: 1px solid var(--study-line);
  padding: 0.78rem;
  text-align: left;
  vertical-align: top;
}

.study-section-body th {
  background: #eee2cf;
  color: var(--study-accent-dark);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.83rem;
  font-weight: 800;
}

.study-section-body tr:nth-child(even) td {
  background: #fcf9f3;
}

.study-section-body details {
  background: var(--study-panel);
  border: 1px solid var(--study-line);
  border-radius: 5px;
  margin: 1.25rem 0;
  padding: 0.8rem 0.95rem;
}

.study-section-body summary {
  color: var(--study-accent-dark);
  cursor: pointer;
  font-family: Inter, Arial, sans-serif;
  font-weight: 800;
}

.study-sidebar {
  min-width: 0;
  position: sticky;
  top: 5.5rem;
}

.study-resource-card {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--study-line);
  border-radius: 6px;
  margin-bottom: 1rem;
  padding: 0.95rem;
}

.study-resource-card h2 {
  border-bottom: 1px solid var(--study-line);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  padding-bottom: 0.55rem;
  text-transform: uppercase;
}

.resource-list,
.resource-pills {
  list-style: none;
  margin: 0;
  padding: 0;
}

.resource-list li + li {
  border-top: 1px solid rgba(216, 207, 191, 0.72);
  margin-top: 0.65rem;
  padding-top: 0.65rem;
}

.resource-list a {
  color: var(--study-accent-dark);
  font-family: Inter, Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.resource-list a:hover {
  text-decoration: underline;
}

.resource-list small {
  color: var(--study-muted);
  display: block;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.73rem;
  line-height: 1.45;
  margin-top: 0.2rem;
}

.resource-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.resource-pills li,
.resource-pills a {
  background: #f5eee3;
  border: 1px solid var(--study-line);
  border-radius: 999px;
  color: var(--study-accent-dark);
  display: inline-flex;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.3rem 0.52rem;
  text-decoration: none;
}

.resource-pills a:hover {
  background: var(--study-accent-soft);
}

.static-pills li {
  cursor: default;
}

.study-reading-page #verse-popup,
.study-reading-page .verse-popup {
  background: #302218;
  border-color: #805437;
  color: #fffaf0;
  font-family: Georgia, "Times New Roman", serif;
}

@media (max-width: 980px) {
  .study-reading-layout {
    grid-template-columns: 1fr;
  }

  .study-sidebar {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }

  .study-resource-card {
    margin: 0;
  }
}

@media (max-width: 700px) {
  .study-reading-page .topbar.panel {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.75rem 1rem;
  }

  .study-reading-page .top-nav {
    gap: 0.25rem;
    width: 100%;
  }

  .study-reading-page .top-nav a {
    font-size: 0.78rem;
    padding: 0.42rem 0.52rem;
  }

  .bible-study {
    padding: 2rem 1rem 4rem;
  }

  .study-header h1 {
    font-size: 2.12rem;
  }

  .study-subtitle {
    font-size: 1.03rem;
  }

  .study-section {
    margin-bottom: 2.5rem;
  }

  .study-section-body,
  .study-section-body p,
  .study-section-body li {
    font-size: 1rem;
  }

  .study-contents ol {
    columns: 1;
  }

  .study-section-body table {
    min-width: 560px;
  }

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