/* ============================================================
   BibleTools — Bible circuit (dual-pane: reading + resources)
   Loaded by Bible/lay_Bible.cfm via #Application.CSSURL#bible20260628.css.
   Pairs with js/bible20260628.js.

   Mobile-first. The Lookup + Resources panels are bottom sheets on
   mobile and a static left sidebar on desktop (one DOM instance, no
   duplicate ids). The reading pane shows the chapter (HTMX) with the
   current verse highlighted; a Verse/Chapter toggle isolates the verse.
   Relies on the --bt-* CSS variables defined in responsive20260628.css.
   ============================================================ */

/* ---------- Layout ---------- */
.bt-bible{ display:block; }
.bt-bible-main{ min-width:0; }

/* ---------- Reading pane ---------- */
.bt-reading{ border:1px solid var(--bt-line,#e3e3e3); border-radius:14px; overflow:hidden; margin-bottom:18px; }
.bt-reading-head{ display:flex; align-items:center; gap:10px 12px; flex-wrap:wrap; padding:12px 14px; border-bottom:1px solid var(--bt-line,#e3e3e3); background:#fff; }
.bt-reading-ref{ font-family:Georgia,"Times New Roman",serif; font-size:1.25rem; font-weight:700; line-height:1.2; flex:1 1 100%; }
.bt-reading-version{ padding:6px 9px; border:1px solid var(--bt-line,#e3e3e3); border-radius:7px; font-size:.85rem; }
.bt-toggle{ display:inline-flex; border:1px solid var(--bt-line,#e3e3e3); border-radius:8px; overflow:hidden; }
.bt-toggle button{ border:none; background:#fff; cursor:pointer; padding:7px 12px; font-size:.8rem; font-weight:600; color:#6b6b6b; font-family:inherit; }
.bt-toggle button.active{ background:#000; color:#fff; }
.bt-compare{ font-size:.85rem; }

.bt-bible-chapter{ height:320px; overflow-y:auto; padding:6px 12px 0; }
.bt-bible-chapter table{ width:100%; }
.bt-bible-chapter tr.current-verse td{ background-color:#fffde7; }
/* Verse mode: collapse the chapter to just the highlighted verse */
.bt-bible-chapter.bt-mode-verse{ height:auto; max-height:none; overflow:visible; }
.bt-bible-chapter.bt-mode-verse tr[id^="verse-"]{ display:none; }
.bt-bible-chapter.bt-mode-verse tr.annot-row{ display:none; }
.bt-bible-chapter.bt-mode-verse tr.current-verse{ display:table-row; }
.bt-bible-copyright{ margin-top:12px; padding:8px 14px 10px; font-size:.78em; color:#888; border-top:1px solid #e0e0e0; }

/* ---------- Mobile resource selector → opens the Resources sheet ---------- */
.bt-res-selector-wrap{ margin-bottom:20px; }
.bt-res-selector{ width:100%; display:flex; align-items:center; gap:12px; text-align:left; cursor:pointer; border:1px solid var(--bt-line,#e3e3e3); border-radius:12px; background:#fff; padding:11px 14px; box-shadow:0 1px 4px rgba(0,0,0,.05); font-family:inherit; }
.bt-res-selector:hover{ border-color:var(--bt-accent,#0488cd); }
.bt-rs-icon{ width:34px; height:34px; flex:0 0 auto; border-radius:8px; background:#f7f7f7; display:flex; align-items:center; justify-content:center; color:var(--bt-accent,#0488cd); }
.bt-rs-icon svg{ width:18px; height:18px; }
.bt-rs-text{ display:flex; flex-direction:column; min-width:0; }
.bt-rs-label{ font-size:.68rem; text-transform:uppercase; letter-spacing:.08em; color:#6b6b6b; }
.bt-rs-value{ font-weight:700; font-size:1.02rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bt-rs-caret{ margin-left:auto; color:#6b6b6b; font-size:1.1rem; flex:0 0 auto; }

/* ---------- Selected-resource (commentary) content ---------- */
.bt-option-content{ margin-bottom:24px; }
/* Keep legacy commentary images/tables (e.g. Barnes data tables) responsive */
.bt-option-content img{ max-width:100%; height:auto; }
@media (max-width:919px){
  .bt-option-content table{ display:block; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
}

/* ---------- Lookup + Resources panels ---------- */
/* Mobile: bottom sheets. Desktop: static sidebar blocks (see media query). */
.bt-sheet-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.5); opacity:0; visibility:hidden; transition:opacity .25s ease; z-index:80; }
.bt-sheet-overlay.open{ opacity:1; visibility:visible; }
.bt-panel{ position:fixed; left:0; right:0; bottom:0; z-index:90; background:#fff; border-radius:18px 18px 0 0; transform:translateY(100%); transition:transform .3s cubic-bezier(.22,1,.36,1); max-height:82vh; overflow-y:auto; box-shadow:0 -8px 40px rgba(0,0,0,.2); }
.bt-panel.open{ transform:translateY(0); }
.bt-panel-grip{ width:42px; height:5px; background:#d4d4d4; border-radius:3px; margin:10px auto 4px; }
.bt-panel-head{ display:flex; align-items:center; justify-content:space-between; padding:6px 18px 12px; border-bottom:1px solid var(--bt-line,#e3e3e3); position:sticky; top:0; background:#fff; }
.bt-panel-head h3{ margin:0; font-size:1.05rem; }
.bt-panel-close{ background:none; border:none; font-size:26px; line-height:1; color:#6b6b6b; cursor:pointer; }
.bt-panel-body{ padding:16px 18px 24px; }
.bt-panel-body img{ max-width:100%; height:auto; }

/* ---------- Verse lookup form (dsp_VerseInput) ---------- */
.bt-lookup{ margin:0; }
.bt-field{ margin-bottom:14px; }
.bt-field-label{ display:block; font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:#6b6b6b; margin-bottom:6px; }
.bt-input{ width:100%; padding:11px 12px; font-size:16px; border:1px solid var(--bt-line,#e3e3e3); border-radius:8px; }
.bt-hint{ font-size:12px; color:#6b6b6b; margin:6px 0 0; }
.bt-or{ display:flex; align-items:center; gap:10px; color:#6b6b6b; font-size:12px; text-transform:uppercase; letter-spacing:.06em; margin:14px 0; }
.bt-or::before, .bt-or::after{ content:""; flex:1; height:1px; background:var(--bt-line,#e3e3e3); }
.bt-selects{ display:flex; flex-direction:column; gap:8px; }
.bt-selects-row{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.bt-select{ width:100%; padding:10px 8px; font-size:15px; border:1px solid var(--bt-line,#e3e3e3); border-radius:8px; background:#fff; }
.bt-btn{ display:inline-block; cursor:pointer; border:none; color:#fff; background:linear-gradient(#2eaef0,#0488cd); padding:11px 22px; border-radius:8px; font-size:15px; font-weight:600; box-shadow:inset 0 1px 1px 0 #9fcee7, 0 2px 0 -1px rgba(0,0,0,.2); font-family:inherit; }
.bt-btn:hover{ background:linear-gradient(#0488cd,#2eaef0); }
.bt-btn-block{ width:100%; margin-top:14px; }

/* ---------- Resource list (dsp_VerseResources) — grouped, V3 panel look ---------- */
.bt-res-group{ margin-bottom:20px; }
.bt-res-group:last-child{ margin-bottom:0; }
.bt-res-group h4{ margin:0 0 8px; font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color:#6b6b6b; }
.bt-res-group ul{ list-style:none; margin:0; padding:0; }
.bt-res-group li{ padding:9px 0; border-bottom:1px solid #f2f2f2; }
.bt-res-group li:last-child{ border-bottom:none; }
.bt-res-group a{ font-size:.92rem; color:var(--bt-accent,#0488cd); text-decoration:none; }
.bt-res-group a:hover{ text-decoration:underline; }
.bt-res-group a.active{ font-weight:700; color:#1a1a1a; text-decoration:none; }
.bt-res-group a.active::before{ content:"\25B8 "; color:var(--bt-accent,#0488cd); }

/* ---------- Mobile bottom action bar ---------- */
.bt-action-bar{ position:fixed; left:0; right:0; bottom:0; z-index:55; display:flex; background:#fff; border-top:1px solid var(--bt-line,#e3e3e3); box-shadow:0 -3px 14px rgba(0,0,0,.06); }
.bt-action-bar button{ flex:1; border:none; background:none; cursor:pointer; padding:10px 6px 9px; display:flex; flex-direction:column; align-items:center; gap:3px; font-size:11px; color:#6b6b6b; font-weight:600; font-family:inherit; }
.bt-action-bar button svg{ width:22px; height:22px; }

/* Leave room for the fixed action bar on mobile */
@media (max-width:919px){
  body{ padding-bottom:64px; }
}

/* ============================================================
   DESKTOP (>= 920px): two-column; panels become a static sidebar
   ============================================================ */
@media (min-width:920px){
  .bt-bible{ display:grid; grid-template-columns:290px 1fr; gap:24px; align-items:start; }
  .bt-bible-side{ position:sticky; top:120px; display:flex; flex-direction:column; gap:26px; }

  .bt-panel{ position:static; transform:none; box-shadow:none; border-radius:0; max-height:none; overflow:visible; background:none; z-index:auto; }
  .bt-panel-grip, .bt-panel-close{ display:none; }
  .bt-panel-head{ position:static; padding:0 0 8px; }
  .bt-panel-head h3{ font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; color:#6b6b6b; }
  .bt-panel-body{ padding:12px 0 0; }

  .bt-res-selector-wrap, .bt-action-bar, .bt-sheet-overlay{ display:none; }
}
