/* Tabbed Study panel (cross-refs + bookmarks + notes + more) — loaded with scripture volumes */


.xref-study-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule-light);
  background: var(--bg-deep);
  position: sticky;
  top: 0;
  z-index: var(--z-raised);
}
.xref-study-tab {
  flex: 1;
  min-width: 72px;
  padding: 8px 6px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-family: 'David Libre', Georgia, serif;
  font-size: 0.82em;
  cursor: pointer;
}
.xref-study-tab.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--here) 12%, transparent);
  color: var(--accent);
  font-weight: 600;
}
.xref-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.xref-pane.active {
  display: flex;
}
#xref-pane-bookmarks,
#xref-pane-notes,
#xref-pane-more {
  padding: 12px 16px 24px;
  gap: 10px;
}
.study-pane-hint {
  font-size: 0.85em;
  color: var(--ink-light);
  line-height: 1.45;
  margin: 0;
}
.study-pane-sub {
  font-size: 0.8em;
  color: var(--ink-light);
  margin: 8px 0 0;
  line-height: 1.4;
}
.study-pane-status {
  font-size: 0.8em;
  color: var(--ink-light);
  margin: 0;
}
.study-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.study-btn-row-stack {
  flex-direction: column;
}
.study-btn-row button {
  flex: 1;
  min-width: 100px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--bg-deep);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9em;
  cursor: pointer;
}
.study-btn-row button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--here) 10%, transparent);
}
.xf-bookmark-item {
  border: 1px solid var(--rule-light);
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
}
.xf-bookmark-item:first-of-type { margin-top: 4px; }
.xf-bookmark-item:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--here) 8%, transparent);
}
.xf-bookmark-item .xf-bm-title { font-size: 0.95em; color: var(--ink); }
.xf-bookmark-item .xf-bm-heb {
  font-family: 'David Libre', serif;
  font-size: 1.05em;
  color: var(--accent);
  margin-top: 4px;
  direction: rtl;
}

body.dark-mode .xref-study-tabs {
  background: #252525;
  border-bottom-color: #444;
}
body.dark-mode .xref-study-tab {
  background: #1f1f1f;
  color: var(--ink);
}
body.dark-mode .study-btn-row button {
  background: #252525;
  border-color: #444;
}

@media (max-width: 600px) {
  .xref-study-tab { min-width: 64px; font-size: 0.76em; padding: 7px 4px; }
}

/* Interlinear-only policy: referenced verses always render as Hebrew interlinear,
   never as plain English text (site-wide kill switch for legacy render paths). */
.xref-ref-english { display: none !important; }

/* ── Panel chrome matches the rest of the site ──────────────────────────────
   The header and tab row are chrome, like the top bar, the footer dock and the
   nav drawer's search bar — navy with cream labels and brown-gold accents. They were reading as plain beige
   because they inherited the parchment --bg meant for the reading surface.
   The pane below stays parchment: the cross-references render as Hebrew
   interlinear, which is designed against that background.                    */


#xref-panel .xref-panel-header h3 { color: var(--on-chrome); }

#xref-panel .xref-panel-close:hover {
  background: color-mix(in srgb, var(--here-chrome) 18%, transparent);
  color: var(--on-chrome);
  opacity: 1;
}

.xref-study-tabs {
  background: var(--chrome);
  border-bottom: 1px solid color-mix(in srgb, var(--here-chrome) 28%, transparent);
  gap: 8px;                 /* adjacent touch targets need 8px between them */
  padding: 8px 10px;
}
.xref-study-tab {
  min-height: 44px;         /* iOS 44pt minimum */
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--here-chrome) 50%, transparent);
  color: var(--on-chrome);
}
.xref-study-tab:hover { background: color-mix(in srgb, var(--here-chrome) 14%, transparent); }
.xref-study-tab.active {
  background: var(--here-chrome);
  border-color: var(--here-chrome);
  color: var(--on-action-button-fill);
  font-weight: 650;
}


/* Dark mode keeps the same relationship, one step deeper */
body.dark-mode #xref-panel .xref-panel-header,
body.dark-mode .xref-study-tabs {
  background: var(--chrome);
  border-bottom-color: color-mix(in srgb, var(--here-chrome) 28%, transparent);
}
body.dark-mode .xref-study-tab {
  background: transparent;
  border-color: color-mix(in srgb, var(--here-chrome) 45%, transparent);
  color: var(--on-chrome);
}
body.dark-mode .xref-study-tab.active {
  background: var(--here-chrome);
  color: var(--on-action-button-fill);
}

@media (pointer: coarse) {
  .xref-study-tab { min-height: 48px; }   /* Android 48dp */
}
