/* ═══════════════════════════════════════════════════════════
   engine/css/layers.css — Study layer content styles
   Covers: cross-references, keywords, context, original
   language, locked state, get-access modal, parallel versions.
═══════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────
   CROSS REFERENCES
─────────────────────────────────────── */
.xref-group { margin: 0; }

.xref-group__keyword {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin: 14px 0 6px;
  padding: 0;
}

.xref {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.xref-group:first-child .xref:first-child { border-top: none; }

.xref__ref {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--nwm-accent);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.xref__ref:hover { opacity: 0.85; }

.xref__text {
  display: block;
  margin-top: 3px;
  line-height: 1.5;
  color: var(--text-2);
}

.xref-source {
  margin-top: 16px;
  font-size: 0.75em;
  color: var(--text-3);
}

.xref-empty {
  color: var(--text-3);
  font-style: italic;
}

.dsb-xrefs__divider {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 20px 0 16px;
}

.dsb-xrefs__heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 8px;
}

/* ───────────────────────────────────────
   STUDY NOTES
─────────────────────────────────────── */
.notes-empty {
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
}

/* ───────────────────────────────────────
   KEYWORDS
─────────────────────────────────────── */
.kword-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.kword-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px 9px;
  font: inherit;
  font-size: 0.85em;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.kword-chip:hover {
  background: var(--accent-soft);
  border-color: var(--nwm-accent);
  color: var(--text);
}

.kword-chip.is-selected {
  background: var(--nwm-accent);
  border-color: var(--nwm-accent);
  color: #fff;
}

.kword-detail__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.kword-detail__left {
  display: inline;
}

.kword-detail__lemma {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--text);
}

.kword-detail__translit {
  font-size: 0.85em;
  font-style: italic;
  color: var(--text-3);
}

.kword-detail__strongs {
  font-size: 0.8em;
  color: var(--text-3);
  flex-shrink: 0;
}

.kword-detail__gloss {
  color: var(--text-2);
  line-height: 1.5;
}

.kword-empty {
  color: var(--text-3);
  font-style: italic;
}

.kword-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.kword-section-label {
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
  margin-bottom: 6px;
}

.kword-article {
  font-size: 0.85em;
  line-height: 1.6;
  color: var(--text-1);
}

.kword-article p {
  margin: 0 0 0.7em;
}

.kword-article p:last-child {
  margin-bottom: 0;
}

/* ───────────────────────────────────────
   CONTEXT TAB
─────────────────────────────────────── */
.context-empty {
  color: var(--text-3);
  font-style: italic;
}

.context-citations {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.context-word-group {
  display: flex;
  flex-direction: column;
}

.context-word-group + .context-word-group {
  border-top: 1px solid var(--border);
}

.context-word-heading {
  padding: 8px 14px 4px;
  font-weight: 700;
  font-size: calc(var(--text-2, 15px) * var(--nwm-scale, 1));
  color: var(--accent, #b8922a);
}

.context-citation {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px 8px 22px;
  text-align: left;
  font-size: calc(var(--text-2, 15px) * var(--nwm-scale, 1));
  color: var(--text-2);
  border-bottom: 1px solid var(--border-soft, var(--border));
  transition: background 0.12s;
}

.context-word-group .context-citation:last-child {
  border-bottom: none;
}

.context-citation:hover,
.context-citation:focus-visible {
  background: var(--accent-soft, rgba(0,0,0,.05));
  color: var(--text);
}

/* ── Context article modal body ──────── */
.context-article-body {
  font-size: 0.9em;
  line-height: 1.65;
}

.context-article-body .nwm-para,
.context-article-body .nwm-line {
  margin: 0 0 0.75em;
}

.context-article-body .nwm-para:last-child,
.context-article-body .nwm-line:last-child {
  margin-bottom: 0;
}

.context-article-body .nwm-head {
  font-weight: 600;
  margin-bottom: 0.5em;
}

/* ───────────────────────────────────────
   ORIGINAL LANGUAGE LAYER
─────────────────────────────────────── */
.greek-verse {
  font-family: 'Gentium Plus', 'SBL Greek', 'New Athena Unicode', 'Noto Serif', serif;
  font-size: calc(var(--nwm-size, 1rem) * 1.15);
  line-height: 1.9;
  margin: 0 0 10px;
}

.hebrew-verse {
  font-family: 'SBL Hebrew', 'Ezra SIL', 'Frank Ruehl CLM', 'Noto Serif Hebrew', serif;
  font-size: calc(var(--nwm-size, 1rem) * 1.25);
  line-height: 2;
  direction: rtl;
  margin: 0 0 10px;
}

.gword,
.hword {
  cursor: pointer;
  border-radius: 3px;
  padding: 2px 1px 1px;
  transition: background .1s;
}

.gword:hover,
.hword:hover {
  opacity: 0.7;
}

.gword.is-selected,
.hword.is-selected {
  color: var(--nwm-accent);
}

.gparse {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 2px;
}

.gparse-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.gparse-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.gparse-lemma {
  font-size: 1.2em;
  font-weight: 600;
}

.gparse-translit {
  color: var(--text-2);
  font-style: italic;
}

.gparse-strongs {
  color: var(--text-3);
  font-size: 0.8em;
  white-space: nowrap;
  flex-shrink: 0;
}

.gparse-morph {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8em;
  margin-bottom: 6px;
}

.gparse-surface {
  color: var(--nwm-text, #444);
}

.gparse-detail {
  color: var(--text-2);
}

.gparse-pos {
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
}

.gparse-gloss {
  font-weight: 600;
}

.gparse-meaning {
  color: var(--text-2);
  font-size: 0.9em;
  line-height: 1.5;
  margin-top: 4px;
}

.orig-attr {
  color: var(--text-3);
  font-size: 0.8em;
  margin-top: 14px;
}

.orig-empty {
  color: var(--text-3);
  font-style: italic;
}

/* ───────────────────────────────────────
   LOCKED LAYER PROMPT
─────────────────────────────────────── */
.layer-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 32px 20px;
  gap: 12px;
  text-align: center;
}

.layer-locked__logo {
  width: 120px;
  margin-bottom: 4px;
}

.layer-locked__logo--dark  { display: none; }
@media (prefers-color-scheme: dark) {
  .layer-locked__logo--light { display: none; }
  .layer-locked__logo--dark  { display: block; }
}

.layer-locked__thanks {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

.layer-locked__message {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}

.layer-locked__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 240px;
}

.layer-locked__btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.layer-locked__btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.layer-locked__btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.layer-locked__btn--primary:hover {
  background: var(--accent-text);
  border-color: var(--accent-text);
  color: #fff;
}

/* ───────────────────────────────────────
   GET ACCESS MODAL
─────────────────────────────────────── */
.get-access-intro {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.6;
}

.distributor-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.distributor-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s, border-color 0.12s;
}

.distributor-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.distributor-flag {
  font-size: 24px;
  flex-shrink: 0;
}

.distributor-country {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.distributor-arrow {
  color: var(--text-3);
  font-size: 16px;
}

/* ───────────────────────────────────────
   PARALLEL VERSIONS TAB
─────────────────────────────────────── */
.pv-version {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.pv-version:first-child { border-top: none; }

.pv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.pv-label {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.pv-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #b8922a);
  cursor: pointer;
}

.pv-text {
  font-size: var(--text-1, 15px);
  line-height: 1.6;
  color: var(--text);
}
.pv-text.pv-loading {
  color: var(--text-3);
  font-style: italic;
}

.pv-version.pv-unavailable { opacity: 0.45; }
.pv-version.pv-unavailable .pv-check { cursor: not-allowed; }

.pv-compare {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.pv-compare.is-top {
  padding-top: 0;
  border-top: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.pv-diff-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.pv-diff-badge {
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 7px;
}
.pv-diff-del-badge {
  background: color-mix(in srgb, #e74c3c 14%, transparent);
  color: #c0392b;
}
.pv-diff-add-badge {
  background: color-mix(in srgb, #27ae60 14%, transparent);
  color: #27ae60;
}

.pv-diff-arr {
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  line-height: 1.4;
}
.pv-diff-arr:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.pv-diff-note {
  font-size: 13px;
  color: var(--text-3);
  font-style: italic;
  margin: 0;
}

.pv-diff-text {
  font-size: var(--text-1, 15px);
  line-height: 1.7;
  margin: 0;
}

del.pv-diff-del {
  text-decoration: line-through;
  color: #c0392b;
  background: color-mix(in srgb, #e74c3c 10%, transparent);
  padding: 0 2px;
  border-radius: 2px;
}

ins.pv-diff-add {
  text-decoration: none;
  color: #27ae60;
  background: color-mix(in srgb, #27ae60 12%, transparent);
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
}

[data-theme="dark"] del.pv-diff-del {
  color: #e88080;
  background: color-mix(in srgb, #e74c3c 18%, transparent);
}
[data-theme="dark"] ins.pv-diff-add {
  color: #6bcf8a;
  background: color-mix(in srgb, #27ae60 18%, transparent);
}
