/* Mighty Lamb — Hebrew/Greek word study, lexicon, people & places (uses reader.css tokens) */

.heb, [lang="he"] { font-family: "Noto Serif Hebrew", "SBL Hebrew", "Ezra SIL", serif; }
.grk, [lang="grc"] { font-family: "Gentium Book Plus", "Gentium Plus", "Source Serif 4", serif; }

/* ---------- toolbar toggle ---------- */
.orig-btn { font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.orig-btn .orig-btn__label { font-family: var(--ui-font); font-weight: 600; font-size: 0.85rem; margin-left: 0.3rem; }
.orig-btn[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
@media (max-width: 560px) { .orig-btn .orig-btn__label { display: none; } }

/* ---------- interlinear ---------- */
.il-intro {
  font-family: var(--ui-font); font-size: 0.92rem; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem;
  padding: 0.6rem 0.85rem; margin: 0 0 1.2rem;
}
.il-verse { margin: 0 0 1.4rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.il-verse:last-child { border-bottom: 0; }
.il-verse.is-target { background: rgba(201, 162, 75, 0.12); border-radius: 0.5rem; padding: 0.6rem; }
.il-eng { margin: 0 0 0.6rem; }
.il-eng .vnum { margin-right: 0.25rem; }
.il-words { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.il-words[dir="rtl"] { justify-content: flex-start; }
.il-w {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.05rem;
  min-width: 3.2rem; padding: 0.35rem 0.5rem 0.3rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 0.5rem;
  color: var(--ink); cursor: pointer; font: inherit; line-height: 1.25; text-align: center;
}
.il-w:hover, .il-w:focus-visible { border-color: var(--gold); outline: none; box-shadow: var(--shadow); }
.il-w.is-active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(22, 62, 120, 0.25); }
html[data-theme="dark"] .il-w.is-active { border-color: #8AB4E8; }
.il-o { font-size: 1.35em; line-height: 1.35; }
.il-o.heb { font-size: 1.5em; }
.il-t { font-family: var(--ui-font); font-size: 0.72em; color: var(--ink-soft); font-style: italic; }
.il-e { font-family: var(--ui-font); font-size: 0.78em; font-weight: 600; }
.il-s { font-family: var(--ui-font); font-size: 0.66em; color: var(--link); letter-spacing: 0.02em; }
.il-w.is-variant { border-style: dashed; }
.il-w.is-variant .il-s::after { content: " *"; }
.il-note { font-family: var(--ui-font); font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.4rem; }
.il-legend { font-family: var(--ui-font); font-size: 0.82rem; color: var(--ink-soft); margin-top: 1rem; }

/* ---------- word panel (side drawer / bottom sheet) ---------- */
.wpanel[hidden] { display: none; }
.wpanel {
  position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(27rem, 100%);
  background: var(--card); color: var(--ink); border-left: 1px solid var(--line);
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column;
  font-family: var(--ui-font);
}
.wpanel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.7rem 1rem; border-bottom: 1px solid var(--line);
}
.wpanel__head h2 { margin: 0; font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; }
.wpanel__body { overflow-y: auto; padding: 1rem 1.1rem 2rem; flex: 1; }
@media (max-width: 760px) {
  .wpanel { top: auto; left: 0; width: 100%; max-height: 72vh; border-left: 0; border-top: 1px solid var(--line);
    border-radius: 1rem 1rem 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.2); }
}

.wp-word { font-size: 2rem; line-height: 1.3; margin: 0 0 0.1rem; }
.wp-word.heb { font-size: 2.3rem; }
.wp-sub { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0.6rem; }
.wp-sub strong { color: var(--ink); }
.wp-grammar { font-size: 0.88rem; background: var(--paper); border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.45rem 0.65rem; margin: 0.4rem 0 0.9rem; }
.wp-grammar b { color: var(--ink-soft); font-weight: 600; }
.wp-parts { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.9rem; }
.wp-part {
  font: inherit; font-size: 0.82rem; padding: 0.2rem 0.6rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.wp-part.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.wp-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.9rem 0; }
.btn-pill {
  display: inline-block; font: inherit; font-size: 0.88rem; font-weight: 600; text-decoration: none;
  padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--blue); color: var(--link); background: transparent;
}
.btn-pill:hover { background: var(--blue); color: #fff; }
html[data-theme="dark"] .btn-pill { border-color: #8AB4E8; }

/* ---------- lexicon entry ---------- */
.lx-head { margin-bottom: 0.6rem; }
.lx-lemma { font-size: 2rem; line-height: 1.3; }
.lx-lemma.heb { font-size: 2.3rem; }
.lx-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; align-items: baseline; color: var(--ink-soft); font-size: 0.95rem; }
.lx-translit { font-style: italic; }
.lx-strong { font-weight: 700; color: var(--link); }
.lx-gloss { font-family: var(--display-font); font-size: 1.35rem; margin-top: 0.2rem; color: var(--ink); }
.lx-def { font-family: var(--scripture-font); font-size: 1rem; line-height: 1.65; }
.lx-def .heb, .lx-def .grk { font-size: 1.1em; }
.lx-count { font-size: 0.92rem; color: var(--ink-soft); margin: 0.8rem 0 0.3rem; }
.lx-label { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin: 1.2rem 0 0.4rem; font-weight: 700; }

/* ---------- tool pages (lexicon, people) ---------- */
.tool-wrap { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.tool-title { font-family: var(--display-font); color: var(--blue); font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0.2rem 0 0.3rem; }
html[data-theme="dark"] .tool-title { color: #9DBCE8; }
.tool-lede { color: var(--ink-soft); margin: 0 0 1.2rem; max-width: 42rem; }
.search-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.search-input {
  flex: 1; min-width: 14rem; font: inherit; font-size: 1.05rem; padding: 0.65rem 0.9rem;
  border: 1px solid var(--line); border-radius: 0.6rem; background: var(--card); color: var(--ink);
}
.search-input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.chip {
  font: inherit; font-size: 0.88rem; padding: 0.3rem 0.8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.result a {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.2rem 0.9rem; align-items: baseline;
  padding: 0.65rem 0.9rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem;
  text-decoration: none; color: var(--ink);
}
.result a:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.result .r-main { font-size: 1.3rem; }
.result .r-main.heb { font-size: 1.45rem; }
.result .r-gloss { font-weight: 600; }
.result .r-sub { grid-column: 2; color: var(--ink-soft); font-size: 0.88rem; }
.result .r-n { color: var(--ink-soft); font-size: 0.82rem; white-space: nowrap; }
.result .r-tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.back-link { display: inline-block; margin-bottom: 1rem; font-weight: 600; text-decoration: none; }
.entry-card { background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem; padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.occ-book { border-top: 1px solid var(--line); padding: 0.45rem 0; }
.occ-book summary { cursor: pointer; font-weight: 600; }
.occ-book summary .muted { font-weight: 400; }
.occ-refs { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; padding: 0.4rem 0 0.2rem; font-size: 0.92rem; }
.related { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ai-note { font-size: 0.8rem; color: var(--ink-soft); font-style: italic; }
.family { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; font-size: 0.97rem; }
.family dt { color: var(--ink-soft); font-weight: 600; }
.family dd { margin: 0; }
.family dd a { margin-right: 0.5rem; }
.forms { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.forms th, .forms td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.forms th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.map-frame { width: 100%; height: 280px; border: 1px solid var(--line); border-radius: 0.6rem; margin-top: 0.5rem; }
.credit { font-size: 0.85rem; color: var(--ink-soft); }
.article p { margin: 0 0 0.8em; }
@media (max-width: 560px) {
  .result a { grid-template-columns: 1fr auto; }
  .result .r-sub { grid-column: 1 / -1; }
  .family { grid-template-columns: 1fr; }
  .forms .hide-sm { display: none; }
}
.chapter-body .para.is-target, .chapter-body .poem-line.is-target { background: rgba(201, 162, 75, 0.16); border-radius: 0.3rem; }
.lx-lemma[dir="rtl"], .wp-word[dir="rtl"] { text-align: left; }

/* ---------- word study v2: tappable KJV words + inline card ---------- */
:root { --ws-chip: rgba(22, 62, 120, 0.06); --ws-accent: #C2457A; --ws-pill-bg: rgba(26, 78, 150, 0.12); }
html[data-theme="dark"] { --ws-chip: rgba(255, 255, 255, 0.06); --ws-accent: #E879A8; --ws-pill-bg: rgba(138, 180, 232, 0.16); }
.ws-intro { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-family: var(--ui-font); color: var(--ink-soft); margin: 0 0 1.2rem; }
.ws-intro p { margin: 0; }
.ws-badge { font-family: var(--ui-font); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; padding: 0.2rem 0.65rem; border-radius: 999px; background: var(--ws-chip); border: 1px solid var(--line); color: var(--ink); }
.ws-verse { margin: 0 0 1.1rem; }
.ws-verse.is-target .ws-text { background: rgba(201, 162, 75, 0.12); border-radius: 0.4rem; }
.ws-text { margin: 0; line-height: 2.15; }
.ws-text .vnum { margin-right: 0.3rem; }
.ws-w {
  font: inherit; color: inherit; background: var(--ws-chip); border: 2px solid transparent; border-radius: 0.4rem;
  padding: 0 0.22em; margin: 0 0.04em; cursor: pointer; line-height: 1.45;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: currentColor;
}
.ws-w:hover { background: rgba(201, 162, 75, 0.18); }
.ws-w:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.ws-w.is-active { border-color: var(--ws-accent); background: transparent; }
.ws-w.woj, .woj .ws-w { color: var(--red-letter); }
.ws-add { font-style: italic; }
.ws-nd { font-variant: small-caps; }
.ws-card {
  margin: 0.7rem 0 0.4rem; padding: 1rem 1.15rem 1.1rem; border: 1px solid var(--line); border-radius: 0.9rem;
  background: var(--card); font-family: var(--ui-font); box-shadow: var(--shadow);
}
.ws-card[hidden] { display: none; }
.ws-card__top { display: flex; align-items: center; gap: 0.6rem; }
.ws-card__strong { margin: 0; flex: 1; font-size: 1.2rem; font-weight: 600; font-family: var(--ui-font); }
.ws-lang { font-size: 0.85rem; font-weight: 600; color: var(--link); background: var(--ws-pill-bg); padding: 0.2rem 0.7rem; border-radius: 999px; }
.ws-x { font: inherit; background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-size: 1rem; padding: 0.2rem 0.3rem; }
.ws-orig { font-size: 2rem; line-height: 1.35; margin: 0.6rem 0 0; }
.ws-orig.heb { font-size: 2.3rem; text-align: left; }
.ws-sub { margin: 0.1rem 0 0.5rem; color: var(--ink-soft); font-size: 0.95rem; }
.ws-gloss { font-size: 1.35rem; margin: 0 0 0.5rem; color: var(--ink); }
.ws-grammar { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 0.7rem; }
.ws-def { font-size: 0.97rem; }
.ws-def.is-clamped { max-height: 7.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.ws-more { font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--link); background: none; border: 0; padding: 0.3rem 0; cursor: pointer; }
.ws-card .wp-actions { margin-bottom: 0; }

/* ---------- cross-references ---------- */
.ws-vnum { font: inherit; font-size: 0.7em; font-weight: 700; vertical-align: super; line-height: 1; cursor: pointer;
  background: var(--ws-chip); border: 1px solid transparent; border-radius: 0.35rem; padding: 0.05em 0.3em; color: var(--gold); }
html[data-theme="dark"] .ws-vnum { color: #D8B96A; }
.ws-vnum:hover { border-color: var(--gold); }
.ws-vnum.is-active { border-color: var(--ws-accent); }
.xr { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.2rem; }
.ws-card__top + .xr { border-top: 0; margin-top: 0.4rem; }
.xr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.xr-list li { display: grid; gap: 0.1rem; }
.xr-ref { font-weight: 700; text-decoration: none; }
.xr-ref:hover { text-decoration: underline; }
.xr-text { font-family: var(--scripture-font); font-size: 0.95rem; color: var(--ink); line-height: 1.5; }
.xr-more { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.92rem; padding: 0.3rem 0; }
.xr-more[hidden] { display: none; }
.xr-credit { font-size: 0.75rem; color: var(--ink-soft); margin: 0.6rem 0 0; }
