@import url('https://fonts.googleapis.com/css2?family=Alef:wght@400;700&family=Mukta+Malar:wght@200;300;400;500;600;700;800&family=Tinos:ital,wght@0,400;0,700;1,400;1,700&family=Titillium+Web:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700&display=swap');


/* ═══════════════════════════════════════════════════════════════════
   EA Interlinear Reader — reader.css
   Based exactly on hot.css + gnt.css from live site
   ═══════════════════════════════════════════════════════════════════ */


@font-face {
  font-family: 'Ezra SIL';
  src: url('/fonts/SILEOT.ttf') format('truetype');
}


@font-face {
  font-family: 'Mukta Malar';
  src: url('/fonts/MuktaMalar-Regular.ttf') format('truetype');
}


@font-face {
  font-family: 'Titillium Web';
  src: url('/fonts/TitilliumWeb-Regular.ttf') format('truetype');
}


@font-face {
  font-family: 'Tinos';
  src: url('/fonts/Tinos-Regular.ttf') format('truetype');
}


/* ─── Root container ───────────────────────────────────────────────── */


.ea-interlinear-root {
  font-family: 'Mukta Malar', sans-serif;
  font-size: 110%;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  direction: ltr;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}


/* ─── Page title ───────────────────────────────────────────────────── */


.ea-header {
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #dde4ea;
  padding-bottom: 1rem;
  text-align: center !important;
  width: 100%;
}


.ea-page-title {
  font-family: 'Mukta Malar', sans-serif !important;
  font-size: clamp(1.35rem, 3.5vw, 1.5rem) !important;
  font-weight: 700 !important;
  color: #0b6078 !important;
  margin: 0 auto !important;
  text-align: center !important;
  display: block;
  width: 100%;
  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: 1.4 !important;
}


.ea-title-accent {
  color: #1680a9;
}


/* ─── UI chrome — always LTR ───────────────────────────────────────── */


.ea-header,
.ea-book-nav,
.ea-chapter-bar,
.ea-chapter-heading,
.ea-bottom-nav {
  direction: ltr;
  unicode-bidi: embed;
}


/* ─── Book navigation ──────────────────────────────────────────────── */


.ea-book-nav {
  margin-bottom: 0.75rem;
  text-align: center;
}


.ea-testament-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    justify-content: center;
    align-items: center; /* Optional, for vertical centering */
}


.ea-tab {
  font-family: 'Mukta Malar', sans-serif;
  font-size: 0.875rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid #dde4ea;
  border-radius: 6px;
  background: #f7f9fb;
  color: #808b96;
  cursor: pointer;
}


.ea-tab:hover {
  background: powderblue;
  color: #435770;
}


.ea-tab-active {
  background: #1680a9;
  color: #fff;
  border-color: #1680a9;
}


.ea-book-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}


.ea-book-btn {
  font-family: 'Mukta Malar', sans-serif;
  font-size: 0.78rem;
  padding: 3px 7px;
  border: 1px solid #dde4ea;
  border-radius: 4px;
  background: #f7f9fb;
  color: #435770;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
}


.ea-book-btn:hover {
  background: powderblue;
  border-color: #1680a9;
}


.ea-book-active {
  background: #1680a9;
  color: #fff;
  border-color: #1680a9;
}


/* ─── Chapter bar ──────────────────────────────────────────────────── */


.ea-chapter-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  justify-content: center;
}


.ea-chapter-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
}


.ea-ch-btn {
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.78rem;
  width: 28px;
  height: 28px;
  border: 1px solid #dde4ea;
  border-radius: 4px;
  background: #f7f9fb;
  color: #435770;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}


.ea-ch-btn:hover {
  background: powderblue;
}


.ea-ch-active {
  background: #0b6078;
  color: #fff;
  border-color: #0b6078;
}


/* ─── Chapter heading ──────────────────────────────────────────────── */


.ea-chapter-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dde4ea;
  border-top: 1px solid #dde4ea;
  direction: ltr;
}


.ea-chapter-title {
  flex: 1;
  text-align: center;
  margin: 0 !important;
  line-height: 1.5 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}


/* English — Titillium Web, muted */


.ea-chapter-title .ea-title-en {
  font-family: 'Titillium Web', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #435770;
  margin-right: 0.4em;
}


/* Tamil — Mukta Malar, teal */


.ea-chapter-title .ea-title-tam {
  font-family: 'Mukta Malar', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1680a9;
  margin-right: 0.4em;
}


/* Hebrew — Alef, teal */


.ea-chapter-title .ea-title-heb {
  font-family: 'Alef', serif;
  font-size: 1.6rem;
  font-weight: 500;
  color: #435770;
  direction: rtl;
  unicode-bidi: embed;
}


/* Greek — Tinos, teal */


.ea-chapter-title .ea-title-grk {
  font-family: 'Tinos', serif;
  font-size: 1.6rem;
  font-weight: 500;
  color: #435770;
}


.ea-nav-arrow {
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.1rem 0.5rem;
  background: none;
  border: 1px solid #dde4ea;
  border-radius: 6px;
  color: #1680a9;
  cursor: pointer;
}


.ea-nav-arrow:hover {
  background: powderblue;
}


/* ─── Content area ─────────────────────────────────────────────────── */


.ea-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}


/* ─── Verse block ──────────────────────────────────────────────────── */


.ea-verse-block {
  padding: 0.9rem 0;
  border-bottom: 1px solid #dde4ea;
  position: relative;
}


/* ─── Words row — from live site: inline-block, word-spacing ───────── */


.ea-words-row {
  display: block;        /* NOT flex — matches live site .tt1 inline-block */
  text-align: right;     /* RTL Hebrew right-aligned */
  padding: 0.2rem 0 0.5rem;
  line-height: 2.2;
  direction: rtl;
}


.ea-words-row.ea-ltr {
  text-align: left;
  direction: ltr;
}


/* ─── Word token — matches live .tt1 exactly ───────────────────────── */


.ea-word-wrap {
  position: relative;
  display: inline-block;
  word-spacing: 4px;
}


.ea-word-wrap:hover {
  background-color: powderblue;
}


/* RTL (Hebrew): space between words */


.ea-rtl .ea-word-wrap + .ea-word-wrap {
  margin-right: 14px;
}


/* RTL maqqef: suppress space after maqqef-bearing word */


.ea-rtl .ea-word-maqqef + .ea-word-wrap {
  margin-right: 0 !important;
}


/* LTR (Greek): space between words */


.ea-ltr .ea-word-wrap + .ea-word-wrap {
  margin-left: 14px;
}


/* ─── Word text — matches live heb{} and grk{} exactly ────────────── */


.ea-word-heb {
  font-family: 'Ezra SIL';
  font-size: 150%;
  color: #0b6078;
  cursor: pointer;
  border-bottom: 1px dotted #0b6078;
}


.ea-word-grk {
  font-family: 'Tinos', serif;
  font-size: 130%;
  color: #0b6078;
  cursor: pointer;
  border-bottom: 1px dotted #0b6078;
}


.ea-word-heb:hover,
.ea-word-grk:hover {
  background-color: powderblue;
}


.ea-word-active {
  background-color: powderblue;
}



/* ─── Verse number system (UPDATED: flex + baseline aligned) ──────────────────────── */

.ea-verse-num-row {
  display: flex;
  align-items: baseline;
  width: 100%;
  margin-bottom: 0.15rem;
  padding: 0 0.25rem;
  line-height: 1;
}

/* Hebrew / RTL → number right aligned */
.ea-rtl .ea-verse-num-row {
  justify-content: flex-end;
}

/* Greek / LTR → number left aligned */
.ea-ltr .ea-verse-num-row {
  justify-content: flex-start;
}

/* Verse number styling */
.ea-verse-num {
  color: #435770;
  font-family: 'Mukta Malar', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}

/* spacing */
.ea-rtl .ea-verse-num { margin-left: 0.6rem; }
.ea-ltr .ea-verse-num { margin-right: 0.6rem; }

/* optical baseline stabilization */
.ea-verse-num-row::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 1em;
  vertical-align: baseline;
}

/* ─── Verse text layers ──────────────────────────────────────────────
 */


.ea-verse-tamil {
  font-family: 'Mukta Malar', sans-serif;
  font-size: 100%;
  color: #1e2a35;
  line-height: 1.75;
  direction: ltr;
}


/* matches live bsb{} exactly */


.ea-verse-english {
  font-family: 'Titillium Web', sans-serif;
  color: #435770;
  font-size: 105%;
  line-height: 1.65;
  direction: ltr;
}


.ea-verse-tvv {
  font-family: 'Mukta Malar', sans-serif;
  font-size: 100%;
  color: #808b96;
  line-height: 1.75;
  direction: ltr;
}


/* ─── Footnotes ────────────────────────────────────────────────────── */


.ea-footnote-marker {
  color: #1680a9;
  font-size: 0.7em;
  cursor: help;
  margin-left: 1px;
  pointer-events: auto !important;
}



.ea-footnotes-block {
  border-top: 1px dashed #dde4ea;
  margin-top: 0.4rem;
  padding-top: 0.35rem;
}


.ea-footnote-item {
  display: flex;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #556575;
  font-family: 'Titillium Web', sans-serif;
  line-height: 1.5;
}


.ea-footnote-key {
  color: #1680a9;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}


/* ─── Word popup — matches live .tt1 .tt2 exactly ──────────────────── */


.ea-word-popup {
  visibility: visible;
  width: 220px;
  background-color: #435770;
  color: #fff;
  font-size: 75%;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1000;
  top: 120%;
  left: 50%;
  margin-left: -110px;
  direction: ltr;
  unicode-bidi: isolate;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}


.ea-word-popup::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #435770 transparent;
}


.ea-popup-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  color: #aab8c4;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}


.ea-popup-close:hover {
  color: #fff;
}


/* Original word large display */


.ea-popup-original {
  font-family: 'Ezra SIL';
  font-size: 200%;
  color: #fff;
  text-align: center;
  margin-bottom: 0.5rem;
  line-height: 1.5;
  direction: rtl;
  unicode-bidi: embed;
}


/* popup rows — label LEFT, value RIGHT */


.ea-popup-rows {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  direction: ltr;
  text-align: left;
}


.ea-popup-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  direction: ltr;
}


.ea-popup-label {
  font-family: 'Mukta Malar', sans-serif;
  font-size: 0.8rem;
  color: #8faabb;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: left;
}


.ea-popup-val {
  color: #fff;
  word-break: break-word;
  text-align: right;
  font-size: 0.85rem;
}


/* matches live tam_translit{} */


.ea-popup-translit-tam {
  font-family: 'Mukta Malar', sans-serif;
  color: #fff;
  font-size: 110%;
}


/* matches live translit{} */


.ea-popup-translit {
  font-family: 'Titillium Web', sans-serif;
  color: #fff;
}


/* matches live parser{} */


.ea-popup-grammar {
  font-family: 'Titillium Web', sans-serif;
  color: #fff;
}


/* matches live lex{} */


.ea-popup-lexeme {
  font-family: 'Ezra SIL';
  font-size: 150%;
  color: #fff;
}


/* Strong's button */


.ea-popup-strongs-btn {
  background: none;
  border: 1px solid #00c8cf;
  border-radius: 4px;
  color: #00c8cf;
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 28px;
  user-select: none;
}


.ea-popup-strongs-btn:hover,
.ea-popup-strongs-open {
  background: #00c8cf;
  color: #fff;
}


.ea-strongs-toggle {
  font-size: 0.6rem;
  opacity: 0.8;
}


/* ─── Strong's panel ───────────────────────────────────────────────── */


.ea-strongs-panel {
  margin-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 0.6rem;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  text-align: left;
  direction: ltr;
}


.ea-strongs-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}


.ea-strongs-id {
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #00c8cf;
  letter-spacing: 0.05em;
}


.ea-strongs-back {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  color: #aab8c4;
  font-size: 0.72rem;
  padding: 1px 5px;
  cursor: pointer;
  font-family: 'Titillium Web', sans-serif;
}


.ea-strongs-back:hover { color: #fff; }


.ea-strongs-loading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #8faabb;
  font-size: 0.78rem;
  font-family: 'Mukta Malar', sans-serif;
  padding: 0.4rem 0;
}


.ea-strongs-error {
  color: #f87171;
  font-size: 0.78rem;
  font-family: 'Mukta Malar', sans-serif;
}


.ea-strongs-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}


.ea-strongs-para {
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.78rem;
  color: #d0dce6;
  line-height: 1.55;
  text-align: left;
  direction: ltr;
}


/* matches live .hebrewOrGreek{} */


.ea-strongs-para .hebrewOrGreek {
  font-family: 'Ezra SIL' !important;
  font-size: 125%;
  color: #fff;
}


.ea-strongs-para .parts-of-speech {
  color: #8faabb;
  font-size: 0.75rem;
}


.ea-strongs-para .original-in-english {
  color: #b0c4d0;
  font-size: 0.75rem;
}


/* matches live .strongs-link, .cognate-link{} */


.ea-strongs-para a,
.ea-strongs-para .strongs-link,
.ea-strongs-para .cognate-link {
  color: #ff0092;
  cursor: pointer;
  text-decoration: underline;
  pointer-events: auto;
  font-size: 0.75rem;
}


.ea-strongs-para a:hover {
  color: #00c8cf;
}


/* ─── Loading / error / empty ──────────────────────────────────────── */


.ea-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  color: #808b96;
  font-family: 'Mukta Malar', sans-serif;
  font-size: 1rem;
}


.ea-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #dde4ea;
  border-top-color: #1680a9;
  border-radius: 50%;
  animation: ea-spin 0.7s linear infinite;
  flex-shrink: 0;
}


.ea-spinner-sm {
  width: 12px;
  height: 12px;
  border-width: 2px;
}


@keyframes ea-spin {
  to { transform: rotate(360deg); }
}


.ea-error {
  padding: 1rem;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #b91c1c;
  font-family: 'Mukta Malar', sans-serif;
  font-size: 0.9rem;
}


.ea-empty {
  padding: 2rem;
  text-align: center;
  color: #808b96;
  font-family: 'Mukta Malar', sans-serif;
}


/* ─── Bottom nav ───────────────────────────────────────────────────── */


.ea-bottom-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #dde4ea;
}


.ea-nav-btn {
  font-family: 'Titillium Web', sans-serif;
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
  background: #f7f9fb;
  border: 1px solid #dde4ea;
  border-radius: 6px;
  color: #1680a9;
  cursor: pointer;
}


.ea-nav-btn:hover {
  background: powderblue;
  border-color: #1680a9;
}


/* ─── Responsive ───────────────────────────────────────────────────── */


@media (max-width: 640px) {
  .ea-word-heb { font-size: 130%; }
  .ea-word-grk { font-size: 115%; }
  .ea-verse-tamil, .ea-verse-tvv { font-size: 100%; }
  .ea-chapter-title { font-size: 0.95rem; }

  /* Mobile bottom-sheet popup */
  .ea-word-popup {
    position: fixed;
    left: 12px !important;
    right: 12px !important;
    bottom: 0;
    top: auto !important;
    width: auto;
    margin-left: 0;
    border-radius: 12px 12px 0 0;
    max-height: 65vh;
    overflow-y: auto;
    z-index: 9999;
    padding: 16px;
  }
  .ea-word-popup::after {
    display: none; /* hide arrow on mobile */
  }
}
