/* UECF.NET Orthodox Study Bible (NKJV) — stylesheet
   Self-contained: base layout/behavior matches the UECF.NET KJV Study Bible
   edition, with an Orthodox-appropriate deep-blue + gold palette below.
   (Previously this file only held palette overrides and @imported the KJV
   edition's stylesheet; it is now fully self-contained so this folder can
   be deployed on its own.) */

:root{
  --ink:#101B31;
  --ink-soft:#2C3E60;
  --gold:#C79A3D;
  --gold-soft:#E4C685;
  --maroon:#8B3A42;
  --teal:#2F5D62;
  --cream:#FAF6EC;
  --cream-dim:#F0E7D5;
  --line:#E2D8C0;
  --font-display:'Fraunces', serif;
  --font-body:'Source Sans 3', system-ui, -apple-system, sans-serif;
  --font-scripture:'Merriweather', Georgia, serif;

  --bg:var(--cream);
  --bg-panel:#ffffff;
  --bg-panel-alt:var(--cream-dim);
  --text:var(--ink);
  --text-soft:var(--ink-soft);
  --border:var(--line);
  --scripture-size:1.08rem;
  --scripture-line:1.85;

  /* Orthodox palette: deep blue + gold (instead of the KJV edition's maroon) */
  --accent:#0B4F6C;
  --accent-soft:#E0B95A;
  --link:var(--accent);
  --dropcap-color:var(--accent);
  --highlight-bg:#F4EED7;
}

:root[data-theme="dark"]{
  --bg:#0B1220;
  --bg-panel:#141F35;
  --bg-panel-alt:#101A2E;
  --text:#EAEAF2;
  --text-soft:#B9C2D8;
  --border:#2B3A5A;

  --accent:#6FB2D3;
  --accent-soft:#C79A3D;
  --link:#9AD0F0;
  --highlight-bg:#2A2620;
  --dropcap-color:#6FB2D3;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0B1220;
    --bg-panel:#141F35;
    --bg-panel-alt:#101A2E;
    --text:#EAEAF2;
    --text-soft:#B9C2D8;
    --border:#2B3A5A;

    --accent:#6FB2D3;
    --accent-soft:#C79A3D;
    --link:#9AD0F0;
    --highlight-bg:#2A2620;
    --dropcap-color:#6FB2D3;
  }
}

*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html{-webkit-text-size-adjust:100%; overscroll-behavior-y:contain;}
body{
  margin:0;
  font-family:var(--font-body);
  color:var(--text);
  background:var(--bg);
  line-height:1.5;
  overscroll-behavior-y:contain;
}
h1,h2,h3{font-family:var(--font-display); color:var(--text); margin:0 0 .5em;}
a{color:var(--link); text-decoration:none;}
a:hover{text-decoration:underline;}
button{font-family:inherit;}
.sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}
.skip-link{
  position:absolute; left:-999px; top:0; background:var(--gold); color:var(--ink);
  padding:10px 16px; z-index:200; font-weight:600; border-radius:0 0 6px 0;
}
.skip-link:focus{left:0;}
:focus-visible{outline:3px solid var(--gold); outline-offset:2px;}

/* ---------- Header ---------- */
.sb-header{background:var(--ink); color:var(--cream); border-bottom:3px solid var(--gold);}
:root[data-theme="dark"] .sb-header{background:#0B1220;}
.sb-header-inner{
  max-width:1400px; margin:0 auto; padding:10px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.sb-brand{display:flex; align-items:center; gap:12px; color:var(--cream);}
.sb-brand img{border-radius:6px; display:block;}
.sb-brand-text{display:flex; flex-direction:column; line-height:1.25;}
.sb-brand-text strong{font-family:var(--font-display); font-size:1.05rem; color:var(--cream);}
.sb-brand-text small{font-size:.72rem; letter-spacing:.08em; text-transform:uppercase; color:var(--gold-soft); font-weight:600;}
.sb-brand-text .sb-brand-edition{font-size:.66rem; letter-spacing:.06em; text-transform:uppercase; color:var(--accent-soft); font-weight:600; opacity:.9;}
.sb-header-nav{display:flex; align-items:center; gap:4px;}
.sb-header-nav a{color:var(--cream); font-size:.9rem; font-weight:600; padding:8px 12px; border-radius:4px;}
.sb-header-nav a:hover{background:rgba(228,198,133,.15); color:var(--gold-soft); text-decoration:none;}

/* ---------- Desktop "Other Bibles" dropdown ---------- */
.sb-other-bibles-menu{position:relative;}
.sb-other-bibles-trigger{
  background:none; border:none; color:var(--cream); font-size:.9rem; font-weight:600;
  padding:8px 12px; border-radius:4px; cursor:pointer; font-family:inherit;
}
.sb-other-bibles-trigger:hover{background:rgba(228,198,133,.15); color:var(--gold-soft);}
.sb-other-bibles-drop{
  display:none; position:absolute; right:0; top:calc(100% + 6px); background:var(--bg-panel);
  border:1px solid var(--border); border-radius:8px; padding:6px; min-width:220px;
  box-shadow:0 10px 30px rgba(0,0,0,.25); z-index:80;
}
.sb-other-bibles-drop.show{display:block;}
.sb-other-bibles-drop a{
  display:block; padding:9px 12px; border-radius:5px; color:var(--text); font-size:.88rem; font-weight:500;
}
.sb-other-bibles-drop a:hover{background:var(--bg-panel-alt); text-decoration:none; color:var(--accent);}
/* Inline block reused inside the mobile "more" sheet -- hidden on desktop */
.sb-other-bibles-sheet{display:none;}

/* ---------- Copyright notice banner ---------- */
.sb-notice{background:var(--gold-soft); color:var(--ink); border-bottom:1px solid var(--gold);}
.sb-notice-inner{
  max-width:1400px; margin:0 auto; padding:8px 20px; display:flex; align-items:center;
  justify-content:space-between; gap:12px; font-size:.85rem;
}
.sb-notice a{color:var(--ink); font-weight:700; text-decoration:underline;}
.sb-notice button{background:none; border:none; color:var(--ink); cursor:pointer; font-size:1rem; line-height:1; padding:4px;}
.sb-notice[hidden]{display:none;}

/* ---------- Mobile app-style top bar (phones only, see media query) ---------- */
.sb-mtop{
  display:none; position:sticky; top:0; z-index:75; background:var(--ink); color:var(--cream);
  align-items:center; gap:10px; padding:10px 14px; padding-top:calc(10px + env(safe-area-inset-top));
  border-bottom:2px solid var(--gold);
}
:root[data-theme="dark"] .sb-mtop{background:#0B1220;}
.sb-mtop-home{
  width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,.08); border:1px solid rgba(228,198,133,.4);
  display:flex; align-items:center; justify-content:center; font-size:1rem; flex:0 0 auto; text-decoration:none;
}
.sb-mtop-home:hover{background:rgba(228,198,133,.18); text-decoration:none;}
.sb-mtop-title{flex:1; min-width:0; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.sb-mtop-title strong{font-family:var(--font-display); font-size:1rem; color:var(--cream); font-weight:600;}
.sb-mtop-more{
  width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,.08); border:1px solid rgba(228,198,133,.4);
  color:var(--cream); font-size:1.2rem; line-height:1; cursor:pointer; flex:0 0 auto;
}
.sb-mtop-more:hover{background:rgba(228,198,133,.18);}

/* ---------- Toolbar ---------- */
.sb-toolbar{
  position:sticky; top:0; z-index:50; background:var(--bg-panel); border-bottom:1px solid var(--border);
  box-shadow:0 2px 8px rgba(16,27,49,.06);
}
.sb-sheet-handle{display:none;}
.sb-toolbar-inner{
  max-width:1400px; margin:0 auto; padding:10px 16px; display:flex; align-items:center;
  gap:8px; flex-wrap:wrap;
}
.sb-select, .sb-input, .sb-btn{
  font-size:.88rem; padding:8px 10px; border-radius:6px; border:1px solid var(--border);
  background:var(--bg-panel); color:var(--text); font-family:var(--font-body);
}
.sb-select{cursor:pointer; min-width:120px;}
.sb-btn{cursor:pointer; font-weight:600; white-space:nowrap;}
.sb-btn:hover{background:var(--bg-panel-alt);}
.sb-btn-quiet{background:transparent; border-color:transparent; color:var(--accent);}
.sb-btn-quiet:hover{background:var(--bg-panel-alt); border-color:var(--border);}
.sb-nav-btns{display:flex; gap:4px;}
.sb-search-wrap{flex:1 1 220px; min-width:180px;}
.sb-search-btn{width:100%; text-align:left; cursor:pointer; color:var(--text-soft);}
.sb-search-btn kbd{
  float:right; font-size:.7rem; border:1px solid var(--border); border-radius:4px; padding:1px 5px;
  background:var(--bg-panel-alt);
}
.sb-tool-group{display:flex; gap:4px;}

/* ---------- App-style bottom tab bar (phones only) ---------- */
.sb-bottom-nav{
  display:none; position:fixed; left:0; right:0; bottom:0; z-index:70;
  background:var(--bg-panel); border-top:1px solid var(--border);
  padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow:0 -4px 16px rgba(16,27,49,.1);
}
.sb-bn-btn{
  background:none; border:none; color:var(--text-soft); font-family:var(--font-body);
  display:flex; flex-direction:column; align-items:center; gap:2px; font-size:.68rem; font-weight:600;
  padding:6px 4px; border-radius:8px; cursor:pointer; flex:1 1 0;
}
.sb-bn-btn .ic{font-size:1.15rem; line-height:1;}
.sb-bn-btn:hover, .sb-bn-btn:active{background:var(--bg-panel-alt); color:var(--text);}
.sb-bn-btn.sb-bn-primary{color:var(--accent);}
.sb-bn-btn.sb-bn-primary .ic{
  background:var(--accent); color:#fff; width:38px; height:38px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; margin-bottom:1px;
}

/* Mobile slide-up "more" sheet backdrop */
.sb-sheet-backdrop{
  display:none; position:fixed; inset:0; background:rgba(16,27,49,.5); z-index:59;
}
.sb-sheet-backdrop.show{display:block;}

/* ---------- Layout ---------- */
.sb-layout{
  max-width:1400px; margin:0 auto; padding:20px 16px 60px;
  display:grid; grid-template-columns:230px minmax(0,1fr) 280px; gap:22px; align-items:start;
}
.sb-side, .sb-notes-panel-col{position:sticky; top:70px; max-height:calc(100vh - 90px); overflow-y:auto;}
.sb-side h2{font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color:var(--accent); margin:0 0 8px;}
.sb-book-list{display:flex; flex-direction:column; gap:1px; margin-bottom:6px;}
.sb-book-list button{
  text-align:left; background:none; border:none; padding:6px 8px; border-radius:4px; cursor:pointer;
  color:var(--text-soft); font-size:.86rem;
}
.sb-book-list button:hover{background:var(--bg-panel-alt); color:var(--text);}
.sb-book-list button.active{background:var(--accent); color:#fff; font-weight:600;}
.sb-chapter-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(34px,1fr)); gap:5px;}
.sb-chapter-grid button{
  padding:6px 0; border-radius:4px; border:1px solid var(--border); background:var(--bg-panel);
  color:var(--text); font-size:.82rem; cursor:pointer;
}
.sb-chapter-grid button:hover{background:var(--bg-panel-alt);}
.sb-chapter-grid button.active{background:var(--accent); border-color:var(--accent); color:#fff; font-weight:700;}

.sb-main{min-width:0; background:var(--bg-panel); border:1px solid var(--border); border-radius:10px; padding:26px 30px 40px;}
.sb-chapter-head .kicker{font-size:.78rem; text-transform:uppercase; letter-spacing:.1em; color:var(--accent); font-weight:700; margin:0;}
.sb-chapter-head h1{font-size:1.9rem; margin:4px 0 14px;}
.sb-chapter-nav{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:18px; flex-wrap:wrap;}

.sb-book-intro{
  background:var(--bg-panel-alt); border:1px solid var(--border); border-left:4px solid var(--accent);
  border-radius:6px; padding:18px 20px; margin-bottom:20px; font-size:.95rem; line-height:1.7; color:var(--text-soft);
  white-space:pre-line;
}

.sb-scripture{font-family:var(--font-scripture); font-size:var(--scripture-size); line-height:var(--scripture-line); color:var(--text);}
.loading-msg{color:var(--text-soft); font-style:italic;}
.sb-superscription{font-style:italic; color:var(--text-soft); margin-bottom:1em; font-size:.92em;}
.sb-verse{cursor:pointer; border-radius:3px; padding:1px 2px; scroll-margin-top:90px;}
.sb-verse:hover{background:var(--bg-panel-alt);}
.sb-verse.active{background:var(--highlight-bg);}
.sb-verse-num{
  font-family:var(--font-body); font-weight:700; font-size:.72em; color:var(--accent);
  vertical-align:super; margin-right:2px; user-select:none;
}
.sb-verse.has-note .sb-verse-num::after{content:"·"; color:var(--teal); font-size:1.3em; margin-left:1px;}

/* ---------- Notes panel ---------- */
.sb-notes-panel{background:var(--bg-panel); border:1px solid var(--border); border-radius:10px; padding:18px;}
.sb-notes-panel h2{font-size:1rem; margin-bottom:12px;}
.sb-notes-empty{color:var(--text-soft); font-size:.88rem; font-style:italic;}
.sb-note-entry{border-bottom:1px solid var(--border); padding:10px 0; font-size:.88rem; line-height:1.6;}
.sb-note-entry:last-child{border-bottom:none;}
.sb-note-entry .ref{font-weight:700; color:var(--accent); display:block; margin-bottom:3px;}
.sb-note-entry .heading{font-weight:700; font-style:italic; color:var(--teal); display:block; margin-bottom:4px;}
.sb-note-entry.highlighted{background:var(--highlight-bg); margin:0 -10px; padding:10px; border-radius:6px; border-bottom-color:transparent;}

/* ---------- Verse actions popover ---------- */
.sb-verse-actions{
  position:fixed; display:none; gap:4px; background:var(--ink); border-radius:8px; padding:6px; z-index:60;
  box-shadow:0 6px 20px rgba(0,0,0,.3);
}
.sb-verse-actions.show{display:flex;}
.sb-verse-actions button{
  background:none; border:none; color:var(--cream); font-size:.8rem; padding:6px 10px; border-radius:5px; cursor:pointer;
}
.sb-verse-actions button:hover{background:rgba(255,255,255,.12);}

/* ---------- Search modal ---------- */
.sb-modal{
  position:fixed; inset:0; background:rgba(16,27,49,.55); z-index:100;
  display:flex; align-items:flex-start; justify-content:center; padding:8vh 16px;
}
.sb-modal[hidden]{display:none;}
.sb-modal-panel{
  background:var(--bg-panel); border-radius:10px; width:min(640px,100%); max-height:76vh;
  display:flex; flex-direction:column; box-shadow:0 20px 60px rgba(0,0,0,.35);
}
.sb-modal-field{display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid var(--border);}
.sb-modal-field input{flex:1; border:none; outline:none; font-size:1.05rem; background:transparent; color:var(--text);}
.sb-modal-status{padding:8px 16px; font-size:.8rem; color:var(--text-soft); margin:0;}
.sb-modal-results{list-style:none; margin:0; padding:0 8px 8px; overflow-y:auto;}
.sb-modal-results li{padding:10px 8px; border-radius:6px; cursor:pointer; font-size:.88rem;}
.sb-modal-results li:hover, .sb-modal-results li.sel{background:var(--bg-panel-alt);}
.sb-modal-results .ref{font-weight:700; color:var(--accent); display:block; font-size:.78rem; margin-bottom:2px;}
.sb-modal-results mark{background:var(--gold-soft); color:var(--ink); border-radius:2px;}

/* ---------- Misc ---------- */
.sb-to-top{
  position:fixed; right:18px; bottom:18px; width:42px; height:42px; border-radius:50%;
  background:var(--ink); color:var(--cream); border:none; cursor:pointer; font-size:1.1rem;
  box-shadow:0 4px 14px rgba(0,0,0,.25); display:none; z-index:40;
}
.sb-to-top.show{display:block;}
.sb-footer{
  text-align:center; padding:26px 16px 50px; color:var(--text-soft); font-size:.82rem;
  border-top:1px solid var(--border); margin-top:20px;
}
.sb-footer p{margin:4px 0;}
.sb-footer-other{font-size:.78rem;}
.sb-footer-other a{color:var(--accent); font-weight:600;}

/* ---------- Responsive ---------- */
@media (max-width: 1080px){
  .sb-layout{grid-template-columns:1fr;}
  .sb-side, .sb-notes-panel-col{
    position:static; max-height:none; display:none; margin-bottom:16px;
  }
  .sb-side.open, .sb-notes-panel-col.open{display:block;}
  .sb-main{padding:20px 16px 30px;}
}
@media (max-width: 640px){
  .sb-toolbar-inner{gap:6px;}
  .sb-select{min-width:100px; flex:1 1 auto;}
  .sb-search-wrap{order:5; flex-basis:100%;}
  .sb-chapter-head h1{font-size:1.5rem;}
  .sb-nav-btns{order:4;}
}

/* ---------- Phone "app mode": hide the full church header, replace the
   toolbar with a slide-up sheet, add a native-style bottom tab bar, and
   turn the book list / notes panel into slide-in drawers. ---------- */
@media (max-width: 780px){
  .sb-header{display:none;}
  .sb-mtop{display:flex;}
  .sb-bottom-nav{display:flex;}
  .sb-other-bibles-sheet{
    display:flex; flex-direction:column; gap:2px; padding-top:10px; margin-top:6px;
    border-top:1px solid var(--border);
  }
  .sb-other-bibles-label{
    font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--text-soft);
    font-weight:700; padding:4px 4px 2px;
  }
  .sb-other-bibles-sheet a{padding:9px 6px; border-radius:6px; font-weight:600; color:var(--accent);}
  .sb-other-bibles-sheet a:hover{background:var(--bg-panel-alt); text-decoration:none;}

  /* Toolbar becomes a slide-up bottom sheet instead of a sticky top bar */
  .sb-toolbar{
    position:fixed; top:auto; bottom:0; left:0; right:0; z-index:60;
    border-radius:16px 16px 0 0; border:1px solid var(--border); border-bottom:none;
    box-shadow:0 -10px 30px rgba(0,0,0,.25);
    max-height:78vh; overflow-y:auto;
    transform:translateY(105%); transition:transform .25s ease;
    padding-bottom:env(safe-area-inset-bottom);
  }
  .sb-toolbar.mobile-open{transform:translateY(0);}
  .sb-sheet-handle{
    display:block; width:40px; height:4px; border-radius:99px; background:var(--border);
    margin:10px auto 2px;
  }
  .sb-toolbar-inner{flex-direction:column; align-items:stretch; padding:8px 16px 18px;}
  .sb-toolbar-inner > *{order:0;}
  .sb-toolbar-inner .sb-select, .sb-toolbar-inner .sb-input, .sb-toolbar-inner .sb-search-btn{width:100%;}
  .sb-nav-btns{display:grid; grid-template-columns:1fr 1fr;}
  .sb-search-wrap{margin:2px 0;}
  .sb-tool-group{display:grid; grid-template-columns:1fr 1fr; margin-top:2px;}
  .sb-tool-group .sb-btn{width:100%;}

  /* Book list & study notes become slide-in drawers over the content */
  .sb-side, .sb-notes-panel-col{
    position:fixed !important; top:0; bottom:0; z-index:65; width:86vw; max-width:360px;
    max-height:none; margin:0; background:var(--bg-panel);
    padding:16px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow:0 0 30px rgba(0,0,0,.3);
    transition:transform .25s ease;
  }
  .sb-side{left:0; transform:translateX(-105%);}
  .sb-side.open{transform:translateX(0);}
  .sb-notes-panel-col{right:0; transform:translateX(105%);}
  .sb-notes-panel-col.open{transform:translateX(0);}
  .sb-notes-panel{border:none; padding:0; height:100%; overflow-y:auto;}

  .sb-layout{padding-bottom:78px;}
  .sb-footer{padding-bottom:calc(78px + env(safe-area-inset-bottom));}
  .sb-to-top{bottom:calc(78px + env(safe-area-inset-bottom) + 10px);}
}

/* ---------- Print ---------- */
@media print{
  .sb-header, .sb-mtop, .sb-notice, .sb-toolbar, .sb-bottom-nav, .sb-side, .sb-notes-panel-col,
  .sb-to-top, .sb-footer, .sb-verse-actions, .sb-chapter-nav, .sb-sheet-backdrop{display:none !important;}
  .sb-layout{display:block; padding:0;}
  .sb-main{border:none; padding:0;}
}
