/* KJV.pub shared visual system: restrained daylight palette and warm, low-glare night mode. */
:root {
  color-scheme: light;
  --canvas: #b5cbd4;
  --paper: #f7f8f3;
  --surface: #eef1ed;
  --surface-raised: #ffffff;
  --soft: #e4edf0;
  --border: #c8d1d0;
  --text: #23313a;
  --muted: #566977;
  --brand: #0d3362;
  --brand-hover: #225b8a;
  --brand-light: #dae8f1;
  --focus: #b47731;
  --shadow: 0 8px 32px rgba(14, 42, 63, .09);
  --highlight: #e3edf5;
  --old-accent: #7c5a25;
  --new-accent: #345d84;
  --old-soft: #f1e8d8;
  --new-soft: #e1edf6;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101c27;
  --paper: #192934;
  --surface: #203340;
  --surface-raised: #273b48;
  --soft: #253e4b;
  --border: #405562;
  --text: #e5e9e5;
  --muted: #b3c2c9;
  --brand: #a9d0ed;
  --brand-hover: #d8ecfc;
  --brand-light: #294655;
  --focus: #dbb37a;
  --shadow: 0 10px 36px rgba(0, 0, 0, .23);
  --highlight: #345063;
  --old-accent: #e6c18e;
  --new-accent: #b6d8f2;
  --old-soft: #3b352e;
  --new-soft: #293f4d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --canvas: #101c27; --paper: #192934; --surface: #203340;
    --surface-raised: #273b48; --soft: #253e4b; --border: #405562;
    --text: #e5e9e5; --muted: #b3c2c9; --brand: #a9d0ed;
    --brand-hover: #d8ecfc; --brand-light: #294655; --focus: #dbb37a;
    --shadow: 0 10px 36px rgba(0, 0, 0, .23); --highlight: #345063;
    --old-accent: #e6c18e; --new-accent: #b6d8f2;
    --old-soft: #3b352e; --new-soft: #293f4d;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; padding: 20px 16px 40px; color: var(--text); font-family: Merriweather, Georgia, serif; line-height: 1.65; }
a { color: var(--brand); text-underline-offset: .18em; }
a:hover { color: var(--brand-hover); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1,h2,h3 { line-height: 1.3; color: var(--brand); }
img { max-width: 100%; height: auto; }
.container { max-width: 1240px; min-height: 70vh; margin: 0 auto; padding: 0 28px 32px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); overflow: clip; }

/* Accessible top navigation without the old checkbox / off-screen span markup. */
.site-nav { display: flex; align-items: center; justify-content: center; gap: 24px; position: relative; border-bottom: 1px solid var(--border); padding: 14px 0; min-height: 70px; font-family: Roboto, Arial, sans-serif; }
.menu { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.menu a { display: block; padding: 9px 13px; border-radius: 8px; color: var(--brand); text-decoration: none; font-size: .89rem; font-weight: 600; letter-spacing: .02em; }
.menu a:hover, .menu a[aria-current="page"] { background: var(--brand-light); }
.mobile-nav-toggle, .theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; background: var(--surface-raised); color: var(--brand); font-family: Roboto, Arial, sans-serif; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.mobile-nav-toggle:hover, .theme-toggle:hover { background: var(--brand-light); }
.mobile-nav-toggle { display: none; }
.theme-symbol { font-size: 1.2em; line-height: 1; }

.title { text-align: center; color: var(--brand); padding: 34px 12px 20px; }
.title .title-kicker { color: var(--muted); font-family: Roboto, Arial, sans-serif; font-weight: 700; letter-spacing: .2em; margin: 0; font-size: .78rem; }
.title h1 { font-size: clamp(3.1rem, 7.5vw, 5.8rem); font-weight: 700; margin: -5px 0 4px; line-height: 1.18; }
.title h3 { margin: 6px 0 2px; font-size: 1.2rem; }
.title p:last-child { margin: 0; color: var(--muted); font-size: .91rem; }
.blurb, .feedback { background: var(--soft); border: 1px solid var(--border); border-radius: 12px; padding: 17px 22px; margin: 12px 0 26px; font-size: .93rem; line-height: 1.7; }
.feedback { text-align: center; margin: 30px 0 4px; }
.feedback a { display: inline-block; margin-left: 8px; font-weight: 700; }
footer { min-height: 10px; }

/* Primary Bible study tools: identical navigation, panels, controls and result rows. */
.read_menu { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 26px auto; font-family: Roboto, Arial, sans-serif; }
.read_menu a { padding: 10px 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-raised); font-size: .84rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.read_menu a:hover, .read_menu a[aria-current="page"] { background: var(--brand-light); border-color: var(--brand); }
main, .readthebible { margin: 24px 0; padding: 27px clamp(16px, 4vw, 38px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
main > h1:first-child { font-size: clamp(1.4rem, 3.4vw, 1.85rem); margin-top: 0; text-align: center; }
main > h2:first-child { margin-top: 0; }
main p { max-width: 86ch; }
main:has(#searchForm), main:has(#topicSearchForm), main:has(#searchbutton) { text-align: center; }
form { max-width: 100%; }
input[type="text"], input[type="search"], input:not([type]), select, textarea { display: inline-block; vertical-align: middle; width: min(100%, 430px); max-width: 100%; min-height: 43px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--surface-raised); font: 1rem Roboto, Arial, sans-serif; }
button[type="submit"], #searchbutton { display: inline-block; vertical-align: middle; padding: 10px 20px; min-height: 43px; border: 1px solid var(--brand); border-radius: 9px; background: var(--brand-light); color: var(--brand); font: 600 .95rem Roboto, Arial, sans-serif; cursor: pointer; }
button[type="submit"]:hover, #searchbutton:hover { background: var(--surface-raised); }
hr { border: 0; border-top: 1px solid var(--border); margin: 25px 0; }
#results, #result { margin: 22px auto 6px; max-width: 980px; }
.searchresult { background: var(--surface-raised); border: 1px solid var(--border); border-radius: 10px; margin: 12px 0; padding: 14px 18px; text-align: left; overflow-wrap: anywhere; }
.searchresult h2, .resulth2, .result_title h2 { font-size: 1.13rem; margin: 0 0 7px; }
.searchresult p { margin: 10px 0 0; }
.result_links, .searchresult > a { font: 500 .9rem Roboto, Arial, sans-serif; }
#chapter-title { text-align: center; margin: 0 0 24px; }
#chapter { max-width: 900px; margin: 0 auto; }
.verse, .verses { padding: 11px 14px; border-radius: 8px; line-height: 1.9; }
.verse:hover, .verses:hover { background: var(--highlight); }
.verse.is-highlighted { background: var(--highlight); border-left: 3px solid var(--brand); }
.verse-options { display: none; margin: 8px 0 0; padding: 8px 12px; border-left: 2px solid var(--border); font: 500 .85rem Roboto, Arial, sans-serif; }
.verse a { color: var(--brand); }
.chlinks { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 22px 0; font: 600 .95rem Roboto, Arial, sans-serif; }
.chlinks a { padding: 4px 8px; }
.tag-cloud { padding: 12px; text-align: center; }
.topic-tag { display: inline-block; margin: 4px 8px; line-height: 1.4; }
#ockjv { display: block; width: min(100%, 600px); margin: 6px auto 22px; border-radius: 8px; }
.contact-form-embed { width: 100%; min-height: 500px; }
.error-message { color: #c14d57; border: 1px solid #ad6670; background: var(--surface-raised); border-radius: 10px; padding: 14px; }

/* Home page: news, daily Scripture, and study tips stay present on small screens. */
.main { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(230px, 1fr); gap: 16px; margin: 28px 0; }
.main_content { min-width: 0; }
.sitenews, .verseoftheday, .main_tips { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; }
.sitenews { margin-bottom: 16px; }
.sitenews h2 { margin-top: 0; font-size: 1.15rem; }
.verseoftheday { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; }
#vod_date { grid-column: 1; font-size: .83rem; color: var(--muted); }
#vod_links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; grid-column: 2; grid-row: 1; font: 500 .84rem Roboto, Arial, sans-serif; }
#vod_title { grid-column: 1 / -1; }
#vod_title h2 { font-size: 1.26rem; margin: 8px 0 0; }
#vod_content { grid-column: 1 / -1; }
#vod_content p { margin: 0; line-height: 1.85; }
.main_tips { font-size: .94rem; line-height: 1.8; }

/* Book index: preserve the Old/New Testament layout and expandable chapter lists. */
#bibleContent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.testament-section { min-width: 0; padding: 18px; border: 1px solid var(--border); background: var(--paper); border-radius: 13px; }
.testament-section.old { --section-accent: var(--old-accent); --section-soft: var(--old-soft); }
.testament-section.new { --section-accent: var(--new-accent); --section-soft: var(--new-soft); }
.testament-title { margin: 0 0 16px; font-size: 1.4rem; color: var(--section-accent); }
.testament-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 13px; align-items: start; }
.book-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-raised); overflow: hidden; }
.book-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; border: 0; background: var(--section-soft); color: var(--section-accent); font: 600 .98rem Merriweather, Georgia, serif; cursor: pointer; text-align: left; }
.book-toggle::after { content: '+'; font: 600 1.2rem Roboto, Arial, sans-serif; }
.book-card.is-open .book-toggle::after { content: '−'; }
.chapter-grid { display: none; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 7px; padding: 12px; }
.book-card.is-open .chapter-grid { display: grid; }
.chapter-link { display: block; padding: 8px 6px; text-align: center; text-decoration: none; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--brand); font: 500 .78rem Roboto, Arial, sans-serif; }
.chapter-link:hover { background: var(--section-soft); }

/* Song list keeps its original numbering, with a shared palette in both modes. */
#song-list { max-width: 800px; margin: 8px auto; text-align: left; }
.song-row { display: grid; grid-template-columns: 76px minmax(0,1fr); align-items: center; gap: 12px; border-bottom: 1px solid var(--border); padding: 9px 12px; }
.song-number { font: 700 1rem Roboto, Arial, sans-serif; color: var(--brand); }
.song-title { font: 400 1rem Merriweather, Georgia, serif; }

@media (max-width: 1000px) {
  .site-nav { justify-content: space-between; flex-wrap: wrap; }
  .mobile-nav-toggle { display: inline-flex; }
  .menu { display: none; order: 3; width: 100%; flex-direction: column; gap: 2px; align-items: stretch; border-top: 1px solid var(--border); padding-top: 12px; }
  .site-nav.is-open .menu { display: flex; }
  .menu a { padding: 12px 14px; }
  #bibleContent { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { padding: 0; }
  .container { border-radius: 0; padding: 0 16px 26px; box-shadow: none; }
  .title { padding-top: 24px; }
  .blurb, .feedback { padding: 14px 16px; }
  .read_menu { gap: 6px; margin: 22px auto; }
  .read_menu a { padding: 8px 10px; font-size: .78rem; }
  main, .readthebible { padding: 19px 15px; margin: 20px 0; }
  .main { grid-template-columns: 1fr; }
  .sitenews, .verseoftheday, .main_tips { padding: 16px; }
  .testament-grid { grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); }
}
@media (max-width: 520px) {
  #vod_date { grid-column: 1 / -1; }
  #vod_links { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  #vod_title { grid-row: 3; }
  .theme-label { font-size: .8rem; }
  .read_menu a { flex: 1 1 auto; text-align: center; }
  button[type="submit"], #searchbutton { margin-top: 8px; }
  .testament-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
