/* Theologians Bible — personal study layer (highlights, notes, bookmarks, My Study panel).
 * Shared by newtestament.html and oldtestament.html. Uses the readers' :root vars. */

/* ------------------------------------------------ verse highlight tints */
#verse-list .verse-block.tb-hl-gold  { background: rgba(201, 162, 77, 0.13);  border-left: 3px solid #C9A24D; }
#verse-list .verse-block.tb-hl-blue  { background: rgba(96, 145, 205, 0.13);  border-left: 3px solid #6091cd; }
#verse-list .verse-block.tb-hl-green { background: rgba(116, 165, 116, 0.13); border-left: 3px solid #74a574; }
#verse-list .verse-block.tb-hl-rose  { background: rgba(196, 106, 128, 0.13); border-left: 3px solid #c46a80; }
#verse-list .verse-block.tb-hl-gold,
#verse-list .verse-block.tb-hl-blue,
#verse-list .verse-block.tb-hl-green,
#verse-list .verse-block.tb-hl-rose { padding-left: 0.55rem; border-radius: 0 6px 6px 0; }

/* bookmark + note markers */
.verse-block { position: relative; }
.verse-block.tb-has-bm::after {
  content: "⚑";
  position: absolute; top: 0.1rem; right: 0.25rem;
  font-size: 0.72rem; color: var(--gold, #C9A24D); opacity: 0.9;
  pointer-events: none;
}
.verse-block.tb-has-note .v-num::after {
  content: "✎";
  font-size: 0.62rem; color: var(--gold-dim, #a07d35);
  margin-left: 0.22rem; vertical-align: super;
}

/* ------------------------------------------------ sidebar study bar */
.tb-study-bar {
  margin: 0 0 1.4rem;
  padding: 0.75rem 0.8rem 0.8rem;
  border: 1px solid var(--border-gold, rgba(201,162,77,0.14));
  border-radius: 8px;
  background: var(--gold-faint, rgba(201,162,77,0.07));
}
.tb-study-bar .tb-study-lab {
  font-family: var(--cinzel, serif);
  font-size: 0.55rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--gold-dim, #a07d35);
  display: block; margin-bottom: 0.5rem;
}
.tb-study-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.tb-swatch {
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18); cursor: pointer; padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tb-swatch:hover { transform: scale(1.14); }
.tb-swatch.active { box-shadow: 0 0 0 2px var(--bg, #0a0a0a), 0 0 0 4px var(--gold, #C9A24D); }
.tb-swatch[data-col="gold"]  { background: #C9A24D; }
.tb-swatch[data-col="blue"]  { background: #6091cd; }
.tb-swatch[data-col="green"] { background: #74a574; }
.tb-swatch[data-col="rose"]  { background: #c46a80; }
.tb-swatch[data-col=""] {
  background: transparent; color: var(--text-dim, #a09880);
  font-size: 0.75rem; line-height: 1;
}
.tb-study-btn {
  font-family: var(--cinzel, serif);
  font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: transparent; color: var(--text-dim, #a09880);
  border: 1px solid var(--border-gold, rgba(201,162,77,0.14));
  border-radius: 999px; padding: 0.38rem 0.75rem; cursor: pointer;
  transition: all 0.2s ease;
}
.tb-study-btn:hover { color: var(--gold, #C9A24D); border-color: var(--gold-dim, #a07d35); }
.tb-study-btn.active { color: var(--bg, #0a0a0a); background: var(--gold, #C9A24D); border-color: var(--gold, #C9A24D); }
.tb-study-sep { width: 1px; height: 1.15rem; background: var(--border-gold, rgba(201,162,77,0.2)); margin: 0 0.15rem; }

.tb-note-editor { margin-top: 0.7rem; }
.tb-note-editor[hidden] { display: none; }
.tb-note-editor textarea {
  width: 100%; box-sizing: border-box; min-height: 84px; resize: vertical;
  background: var(--bg-3, #111); color: var(--text, #e8e0d0);
  border: 1px solid var(--border-gold, rgba(201,162,77,0.14)); border-radius: 6px;
  font-family: var(--crimson, serif); font-size: 0.95rem; line-height: 1.55;
  padding: 0.55rem 0.65rem;
}
.tb-note-editor textarea:focus { outline: none; border-color: var(--gold-dim, #a07d35); }
.tb-note-actions { display: flex; gap: 0.45rem; margin-top: 0.45rem; }

.tb-study-sync {
  margin-top: 0.65rem; font-size: 0.72rem; color: var(--text-faint, #5a5040);
  font-style: italic;
}
.tb-study-sync a { color: var(--gold-dim, #a07d35); text-decoration: none; }
.tb-study-sync a:hover { color: var(--gold, #C9A24D); }

/* ------------------------------------------------ floating My Study button
 * Sits in the same right-hand stack as the reader's fixed "Show Commentary"
 * toggle (.sidebar-toggle-btn, bottom 1.1rem), directly above it. */
.tb-study-fab {
  position: fixed; right: 1.1rem; bottom: 4.4rem; z-index: 120;
  display: flex; align-items: center; gap: 0.45rem;
  font-family: var(--cinzel, serif); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--bg-2, #0f0f0f); color: var(--gold, #C9A24D);
  border: 1px solid var(--border-gold, rgba(201,162,77,0.3));
  border-radius: 999px; padding: 0.6rem 0.95rem; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,0,0.55);
  transition: all 0.2s ease;
}
.tb-study-fab:hover { border-color: var(--gold, #C9A24D); transform: translateY(-1px); }
.tb-study-fab .tb-fab-ico { font-size: 0.85rem; }
/* Mobile: the commentary toggle moves to bottom .55rem over the action bar,
 * so stack My Study above both the bar and the toggle. */
body.tb-bar-on .tb-study-fab { right: .55rem; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }

/* ------------------------------------------------ resume chip */
.tb-resume-chip {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 1.2rem; z-index: 1400;
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-2, #0f0f0f);
  border: 1px solid var(--border-gold, rgba(201,162,77,0.3));
  border-radius: 999px; padding: 0.55rem 0.6rem 0.55rem 1rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.55);
  animation: tbChipIn 0.35s ease;
}
@keyframes tbChipIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.tb-resume-chip a {
  font-family: var(--cinzel, serif); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold, #C9A24D); text-decoration: none;
}
.tb-resume-chip button {
  background: transparent; border: none; color: var(--text-faint, #5a5040);
  font-size: 0.8rem; cursor: pointer; padding: 0.1rem 0.3rem;
}
.tb-resume-chip button:hover { color: var(--text, #e8e0d0); }
body.tb-bar-on .tb-resume-chip { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

/* ------------------------------------------------ My Study panel */
.tb-study-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(0,0,0,0.62); backdrop-filter: blur(3px);
  display: flex; justify-content: flex-end;
}
.tb-study-overlay[hidden] { display: none; }
.tb-study-panel {
  width: min(430px, 100vw); height: 100%;
  background: var(--bg-2, #0f0f0f);
  border-left: 1px solid var(--border-gold, rgba(201,162,77,0.2));
  display: flex; flex-direction: column;
  animation: tbPanelIn 0.28s ease;
}
@keyframes tbPanelIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.tb-study-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.1rem 0.8rem;
  border-bottom: 1px solid var(--border-gold, rgba(201,162,77,0.14));
}
.tb-study-head h2 {
  margin: 0; font-family: var(--cinzel, serif); font-weight: 600;
  font-size: 0.85rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold, #C9A24D);
}
.tb-study-close {
  background: transparent; border: none; color: var(--text-dim, #a09880);
  font-size: 1.05rem; cursor: pointer; padding: 0.2rem 0.4rem;
}
.tb-study-close:hover { color: var(--gold, #C9A24D); }
.tb-study-tabs { display: flex; gap: 0.35rem; padding: 0.7rem 1.1rem 0; }
.tb-study-tab {
  font-family: var(--cinzel, serif); font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: transparent; color: var(--text-dim, #a09880);
  border: 1px solid var(--border-gold, rgba(201,162,77,0.14));
  border-radius: 999px; padding: 0.4rem 0.8rem; cursor: pointer;
}
.tb-study-tab[aria-selected="true"] { color: var(--bg, #0a0a0a); background: var(--gold, #C9A24D); border-color: var(--gold, #C9A24D); }
.tb-study-list { flex: 1; overflow-y: auto; padding: 0.9rem 1.1rem 1.2rem; }
.tb-study-empty { color: var(--text-faint, #5a5040); font-style: italic; font-size: 0.9rem; line-height: 1.7; padding: 1rem 0.2rem; }
.tb-study-item {
  position: relative; padding: 0.7rem 1.9rem 0.7rem 0.75rem; margin-bottom: 0.55rem;
  border: 1px solid var(--border, rgba(255,255,255,0.055)); border-radius: 8px;
  background: var(--bg-3, #111);
}
.tb-study-item .tb-item-ref {
  font-family: var(--cinzel, serif); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--gold, #C9A24D); text-decoration: none;
}
.tb-study-item .tb-item-ref:hover { text-decoration: underline; }
.tb-study-item .tb-item-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-right: 0.4rem; vertical-align: baseline; }
.tb-study-item .tb-item-snippet {
  margin-top: 0.3rem; font-size: 0.86rem; line-height: 1.55; color: var(--text-dim, #a09880);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tb-study-item .tb-item-note {
  margin-top: 0.35rem; font-size: 0.86rem; line-height: 1.55; color: var(--text, #e8e0d0);
  border-left: 2px solid var(--gold-dim, #a07d35); padding-left: 0.55rem; white-space: pre-line;
}
.tb-item-del {
  position: absolute; top: 0.45rem; right: 0.45rem;
  background: transparent; border: none; color: var(--text-faint, #5a5040);
  font-size: 0.78rem; cursor: pointer; padding: 0.15rem 0.3rem;
}
.tb-item-del:hover { color: #ff6b6b; }
.tb-study-foot {
  padding: 0.75rem 1.1rem; border-top: 1px solid var(--border-gold, rgba(201,162,77,0.14));
  font-size: 0.74rem; color: var(--text-faint, #5a5040); font-style: italic;
}
.tb-study-foot a { color: var(--gold-dim, #a07d35); text-decoration: none; }
.tb-study-foot a:hover { color: var(--gold, #C9A24D); }

@media (max-width: 640px) {
  .tb-study-fab span.tb-fab-txt { display: none; }
  .tb-study-fab { padding: 0.65rem 0.8rem; }
}

/* ------------------------------------------------ parallel translation rows */
.tb-alt-verse {
  margin: 0.35rem 0 0.1rem;
  padding-left: 0.6rem;
  border-left: 2px solid rgba(201, 162, 77, 0.28);
  font-size: 0.96em;
  line-height: 1.6;
  color: var(--text-dim, #a09880);
}
.tb-alt-label {
  font-family: var(--cinzel, serif);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim, #a07d35);
  margin-right: 0.45rem;
}
.tb-parallel-select { max-width: 170px; }
