/**
 * CrossWord — assets/css/tanakh.css
 * @version 2.2.1  (M3: tighter word boxes so the frequency underline sits close to Hebrew words; tab bar no longer scrolls vertically)
 *
 * Hebrew / Aramaic (Tanakh) presentation. Loaded on every page but inert unless the text is Hebrew
 * ([lang="hbo"], [lang="arc"], .heb). Right-to-left layout, the self-hosted Ezra SIL font (SIL Open Font License 1.1,
 * unmodified — see assets/fonts/ezra-sil/Licenses.txt), pointing levels, Qere/Ketiv and edition markers, Aramaic badge.
 * Design tokens come from main.css; no new colours are introduced beyond a muted accent for edition markers.
 */

@font-face {
  font-family: 'Ezra SIL';
  src: url('/assets/fonts/ezra-sil/SILEOT.ttf?v=2.51') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:lang(hbo), :lang(arc), .heb {
  font-family: 'Ezra SIL', 'SBL Hebrew', 'Ezra SIL SR', 'Noto Serif Hebrew', 'Times New Roman', serif;
  font-feature-settings: 'kern' 1, 'liga' 1;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

/* ── Reader ─────────────────────────────────────────────────────────────── */
.passage-text.heb {
  direction: rtl;
  text-align: right;
}
.passage-text.heb .verse-text {
  font-size: 1.5em;
  line-height: 1.6;               /* the frequency underline sits on each word box, so the box is kept close to the letters */
  unicode-bidi: isolate;
}
.passage-text.heb .word-token {
  unicode-bidi: isolate;
  display: inline-block;
  line-height: 1.55;              /* room for points above and below and for cantillation marks, without a gap before the underline */
  margin: 0.35em 0.12em;          /* the space between lines lives outside the word box */
  padding: 0 0.08em;
}
/* the verse number sits on the right (start side) in RTL; actions stay on the far side */
.passage-text.heb .verse-block { direction: rtl; }
.passage-text.heb .verse-number { text-align: left; direction: ltr; }
.passage-text.heb .verse-alt {
  display: block;
  font-family: var(--font-body, sans-serif);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-muted, #6b6b6b);
  direction: ltr;
  white-space: nowrap;
}

/* the word-study tab bar had a 1px vertical overflow (tab margin-bottom -1px) that showed a vertical scrollbar next to the horizontal one */
.sheet-tabs { overflow-y: hidden; }

/* Aramaic: a quiet marker on every word and a badge where a run begins */
.heb-word[lang="arc"] { border-bottom: 2px dotted var(--gold-dark, #8a6a1f); }
.arc-badge {
  display: inline-block;
  font-family: var(--font-body, sans-serif);
  font-size: 0.55rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: #6b5114;                    /* white on this is 7.5:1 (the gold token is too light for text) */
  border-radius: 8px;
  padding: 0 6px;
  margin: 0 4px;
  vertical-align: middle;
  direction: ltr;
}

/* Qere (read) with a Ketiv (written) variant: small mark; Ketiv-only placeholders in light brackets */
.qk-mark, .wt-mark {
  font-family: var(--font-body, sans-serif);
  font-size: 0.5em;
  vertical-align: super;
  color: #6b5114;
  margin: 0 1px;
  direction: ltr;
}
.ketiv-only {
  display: inline-block;
  margin: 0 0.12em;
  font-size: 0.8em;
  opacity: 0.6;
  unicode-bidi: isolate;
}
.ketiv-only::before { content: '\27E8'; }     /* ⟨ */
.ketiv-only::after  { content: '\27E9'; }     /* ⟩ */
.heb-word[data-wt="X"], .heb-word[data-wt="R"], .heb-word[data-wt="V"] { background: rgba(138, 106, 31, 0.1); border-radius: 3px; }

/* Features that arrive with the Hebrew learning milestone (M4): cross-references have no Hebrew data yet */
.corpus-tanakh .xref-btn { display: none; }

/* corpus tag on the recent-passage chips (NT / LXX / HEB) */
.recent-tag { font-size: 0.75em; font-weight: 700; letter-spacing: 0.05em; opacity: 0.9; margin-left: 4px; padding: 0 4px; border: 1px solid currentColor; border-radius: 4px; vertical-align: middle; }

/* Verse reached through the Hebrew/LXX bridge */
.verse-flash { background: rgba(201, 168, 76, 0.25); transition: background 1s; }

/* Display controls row */
.heb-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.8rem;
  padding: 4px 0 8px;
  direction: ltr;
}
.heb-controls label { display: inline-flex; align-items: center; gap: 6px; }
.heb-controls select { min-height: 32px; }
.heb-settings { flex: 1 1 100%; min-width: 0; }
.corpus-tanakh .reader-settings-row { flex-wrap: wrap; }
.heb-legend {
  font-size: 0.72rem;
  color: var(--text-muted, #6b6b6b);
  direction: ltr;
  margin: 0 0 8px;
}
.heb-legend summary { cursor: pointer; }

/* ── Study mode / word-study panel ─────────────────────────────────────── */
.study-verse-text.heb { direction: rtl; text-align: right; font-size: 1.4em; line-height: 2.4; }
.study-verse-text.heb .study-token { display: inline-block; margin: 0 0.15em; text-align: center; unicode-bidi: isolate; }
.heb-cell { font-size: 1.25em; direction: rtl; text-align: right; }

.heb-parts { width: 100%; border-collapse: collapse; margin-top: 8px; }
.heb-parts th, .heb-parts td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border, rgba(0,0,0,.12)); vertical-align: top; font-size: 0.85rem; }
.heb-parts td.heb-part-text { font-size: 1.4rem; direction: rtl; text-align: right; white-space: nowrap; }
.heb-parts .heb-part-kind { text-transform: capitalize; color: var(--text-muted, #6b6b6b); }
.heb-parts .heb-part-expl { display: block; font-size: 0.75rem; color: var(--text-muted, #6b6b6b); margin-top: 2px; }
.heb-note { font-size: 0.78rem; color: var(--text-muted, #6b6b6b); margin: 6px 0; }
.panel-word-form.heb, .panel-lemma.heb { font-size: 1.6rem; direction: rtl; unicode-bidi: isolate; }

@media (max-width: 480px) {
  .passage-text.heb .verse-text { font-size: 1.35em; }
  .heb-parts td.heb-part-text { font-size: 1.25rem; }
}
