:root {
  --ink: #172033;
  --muted: #5f6979;
  --paper: #fffdf8;
  --surface: #ffffff;
  --surface-soft: #f6f1e7;
  --navy: #10233f;
  --navy-2: #173457;
  --gold: #b97816;
  --gold-light: #f4c967;
  --line: #e4ddd0;
  --success: #276749;
  --shadow: 0 18px 50px rgba(30, 37, 50, 0.1);
  --radius: 18px;
  --container: 1160px;
  --reading-width: 820px;
  --scripture-size: 1.16rem;
}

body.dark-theme {
  --ink: #f3efe6;
  --muted: #b8c0ce;
  --paper: #091423;
  --surface: #102033;
  --surface-soft: #172a41;
  --navy: #07101d;
  --navy-2: #183958;
  --gold: #f4c967;
  --gold-light: #ffe5a0;
  --line: #294058;
  --success: #72d5a5;
  --shadow: 0 20px 54px rgba(0, 0, 0, 0.34);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
.button,
.icon-button {
  min-width: 44px;
  min-height: 44px;
}

:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--gold-light);
  color: #101820;
  font-weight: 800;
}

.skip-link:focus {
  transform: none;
}

.container {
  width: min(calc(100% - 32px), var(--container));
  margin-inline: auto;
}

.reading-container {
  width: min(calc(100% - 32px), var(--reading-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: color-mix(in srgb, var(--navy) 94%, transparent);
  color: #fff;
  backdrop-filter: blur(16px);
}

.header-row {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-weight: 850;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
}

.brand small {
  display: block;
  color: #d8e1ec;
  font-size: 0.69rem;
  font-weight: 550;
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 10px 12px;
  border-radius: 10px;
  color: #e9eef5;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button,
.menu-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.menu-button {
  display: none;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 82px 0 76px;
  background: var(--navy);
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("capa-biblia.svg") center / cover no-repeat;
  opacity: 0.34;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(7, 16, 29, 0.98) 0%, rgba(7, 16, 29, 0.82) 55%, rgba(7, 16, 29, 0.42));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.article-header h1 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 7vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero p:not(.eyebrow) {
  max-width: 690px;
  margin: 20px 0 0;
  color: #e5ebf2;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-actions,
.chapter-actions,
.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  border-color: var(--gold-light);
  background: var(--gold-light);
  color: #172033;
}

.button-ghost {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.search-panel {
  margin-top: -32px;
  position: relative;
  z-index: 4;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-form input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}

.section {
  padding: 68px 0;
}

.section-soft {
  background: var(--surface-soft);
}

.section-header {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-header h2,
.content-card h2,
.article-body h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 4vw, 2.55rem);
  line-height: 1.15;
}

.section-header p,
.muted {
  color: var(--muted);
}

.testament-grid,
.feature-grid,
.book-grid,
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.feature-grid,
.article-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.testament-card,
.content-card,
.feature-card,
.book-card,
.article-card,
.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(30, 37, 50, 0.06);
}

.testament-card,
.content-card,
.feature-card,
.article-card,
.notice {
  padding: 26px;
}

.testament-card {
  position: relative;
  overflow: hidden;
}

.testament-card::after {
  content: attr(data-books);
  position: absolute;
  right: 18px;
  bottom: -18px;
  color: color-mix(in srgb, var(--gold) 13%, transparent);
  font-family: Georgia, serif;
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
}

.testament-card h2,
.feature-card h3,
.book-card h2,
.article-card h2,
.article-card h3 {
  margin: 0;
  line-height: 1.2;
}

.testament-card p,
.feature-card p,
.article-card p {
  color: var(--muted);
}

.card-link {
  position: relative;
  z-index: 2;
  color: var(--gold);
  font-weight: 850;
}

.theme-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.theme-tags a,
.theme-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.theme-tags a:hover {
  color: var(--ink);
  border-color: var(--gold);
}

.theme-tags-inline {
  margin-top: 18px;
}

.theme-list {
  display: grid;
  gap: 14px;
}

.theme-list-home {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-card,
.theme-mini-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(30, 37, 50, 0.06);
}

.theme-card a,
.theme-mini-card {
  display: grid;
  grid-template-columns: 156px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px;
  text-decoration: none;
}

.theme-card img,
.theme-mini-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: var(--surface-soft);
  object-fit: cover;
}

.theme-card small,
.theme-mini-card .eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.theme-card strong,
.theme-mini-card h3 {
  display: block;
  margin: 0 0 4px;
  font-size: clamp(1.02rem, 2.2vw, 1.25rem);
  line-height: 1.18;
}

.theme-card em,
.theme-mini-card p {
  display: block;
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.section-more {
  margin: 24px 0 0;
}

.verse-topic-list {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: verse-topic;
}

.verse-topic-list li {
  counter-increment: verse-topic;
}

.verse-topic-list a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-decoration: none;
}

.verse-topic-list a::before {
  content: counter(verse-topic);
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--gold);
  color: #101820;
  font-weight: 900;
}

.verse-topic-list strong {
  display: block;
  color: var(--ink);
}

.verse-topic-list span {
  display: block;
  color: var(--muted);
}

.explanation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.explanation-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(30, 37, 50, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.explanation-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.explanation-card a {
  display: block;
  min-height: 100%;
  color: var(--ink);
  text-decoration: none;
}

.explanation-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-soft);
  object-fit: cover;
}

.explanation-card span {
  display: grid;
  min-height: 108px;
  place-items: center;
  padding: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  font-weight: 700;
  line-height: 1.28;
  text-align: center;
}

.verse-highlight {
  padding: 34px;
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
}

.verse-highlight blockquote {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.45;
}

.verse-highlight cite {
  display: block;
  margin-top: 18px;
  color: var(--gold-light);
  font-style: normal;
  font-weight: 800;
}

.page-hero,
.article-header {
  padding: 58px 0 38px;
}

.page-hero h1,
.article-header h1 {
  color: var(--ink);
  font-size: clamp(2.1rem, 6vw, 4rem);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--gold);
  font-weight: 750;
}

.book-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.book-card {
  display: block;
  padding: 20px;
  text-decoration: none;
}

.book-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.book-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 10px;
}

.chapter-grid a {
  display: grid;
  min-height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.chapter-grid a:hover {
  border-color: var(--gold);
  background: var(--surface-soft);
}

.chapter-toolbar {
  position: sticky;
  top: 84px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 8px 26px rgba(30, 37, 50, 0.08);
  backdrop-filter: blur(12px);
}

.chapter-toolbar select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

.font-controls {
  display: flex;
  gap: 6px;
}

.font-controls button,
.copy-verse {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.scripture {
  padding-bottom: 36px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--scripture-size);
  line-height: 1.86;
}

.verse {
  position: relative;
  margin: 0;
  padding: 8px 48px 8px 42px;
  border-radius: 10px;
}

.verse:target,
.verse:hover {
  background: var(--surface-soft);
}

.verse-number {
  position: absolute;
  top: 11px;
  left: 10px;
  color: var(--gold);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75em;
  font-weight: 850;
}

.copy-verse {
  position: absolute;
  top: 7px;
  right: 6px;
  min-width: 36px;
  min-height: 36px;
  opacity: 0;
}

.verse:hover .copy-verse,
.copy-verse:focus-visible {
  opacity: 1;
}

.chapter-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 32px 0;
}

.chapter-navigation a {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
}

.chapter-navigation a:last-child {
  text-align: right;
}

.translation-credit {
  margin: 30px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.9rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-cover {
  width: 100%;
  margin: 16px 0 34px;
  border-radius: var(--radius);
  background: var(--navy);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-body {
  font-size: 1.06rem;
}

.article-body h2 {
  margin-top: 38px;
}

.article-body h3 {
  margin-top: 28px;
}

.article-body a {
  color: var(--gold);
  font-weight: 700;
}

.article-body blockquote {
  margin: 26px 0;
  padding: 22px;
  border-left: 5px solid var(--gold);
  background: var(--surface-soft);
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.search-status {
  min-height: 28px;
  margin: 18px 0;
  color: var(--muted);
}

.search-results {
  display: grid;
  gap: 12px;
}

.search-result {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.search-result a {
  color: var(--gold);
  font-weight: 850;
}

.search-result p {
  margin: 6px 0 0;
}

.site-footer {
  margin-top: 70px;
  padding: 54px 0 26px;
  background: var(--navy);
  color: #e7edf5;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 30px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 850;
}

.footer-brand img {
  width: 46px;
}

.footer-grid h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 1rem;
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li + li {
  margin-top: 8px;
}

.footer-grid a {
  color: #d8e1ec;
}

.footer-bottom {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #b9c5d3;
  font-size: 0.86rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .menu-button {
    display: inline-grid;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 16px;
    left: 16px;
    display: none;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: var(--navy);
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: grid;
  }

  .main-nav a {
    min-height: 44px;
  }

  .feature-grid,
  .article-grid,
  .explanation-grid,
  .theme-list-home,
  .book-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .container,
  .reading-container {
    width: min(calc(100% - 22px), var(--container));
  }

  .brand small,
  .header-actions .search-shortcut {
    display: none;
  }

  .hero {
    padding: 62px 0 60px;
  }

  .search-form,
  .testament-grid,
  .feature-grid,
  .article-grid,
  .explanation-grid,
  .theme-list-home,
  .book-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .theme-card a,
  .theme-mini-card {
    grid-template-columns: 104px 1fr;
    gap: 12px;
  }

  .theme-card em,
  .theme-mini-card p {
    font-size: 0.92rem;
  }

  .search-form .button {
    width: 100%;
  }

  .section {
    padding: 48px 0;
  }

  .chapter-toolbar {
    top: 76px;
    align-items: stretch;
    flex-direction: column;
  }

  .chapter-toolbar select {
    width: 100%;
  }

  .font-controls {
    justify-content: flex-end;
  }

  .verse {
    padding-right: 8px;
  }

  .copy-verse {
    position: static;
    display: inline-grid;
    margin-left: 8px;
    opacity: 1;
    vertical-align: middle;
  }

  .chapter-navigation {
    grid-template-columns: 1fr;
  }

  .chapter-navigation a:last-child {
    text-align: left;
  }
}

@media print {
  .site-header,
  .site-footer,
  .chapter-toolbar,
  .chapter-navigation,
  .copy-verse,
  .hero-actions,
  .search-panel {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .scripture {
    font-size: 12pt;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
