/* tanakh.css - the Tanakh's pages (/tanakh/), the Library's search (/library/) and Learn Hebrew (/hebrew/).
   Prefix tk-. The display switches are classes on <html> set by jewish.js (data-jw-toggle):
     jw-no-nikud     letters only (tanakh.js removes vowels and cantillation from .tk-marks)
     jw-no-taamim    vowels without cantillation (tanakh.js)
     jw-hide-hebrew  English only          jw-hide-english  Hebrew only */

/* the books on /tanakh/ */
.tk-books { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tk-books li a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 10px 12px; border: 1px solid var(--jw-line); border-radius: var(--jw-radius); background: var(--jw-card); color: var(--jw-ink); text-decoration: none; height: 100%; }
.tk-books li a:hover { border-color: var(--jw-accent); }
.tk-books li a .jw-he { color: var(--jw-gold); font-size: 1.2em; }
.tk-books li a small { flex-basis: 100%; color: var(--jw-muted); font-size: .8rem; }
.tk-books li.tk-group { grid-column: 1 / -1; padding: 6px 2px 0; }
.tk-group-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--jw-muted); font-weight: 600; }
.tk-group-h .jw-he { text-transform: none; letter-spacing: 0; color: var(--jw-gold); font-size: 1.15rem; }
.tk-sec h2 .jw-he { color: var(--jw-gold); font-size: 1.05em; }
.tk-sec h2 small { font-family: system-ui, sans-serif; font-size: .8rem; font-weight: 400; }
.tk-list { padding-left: 18px; }
.tk-list li { margin: 0 0 6px; }
.tk-chapters a { min-width: 2.6em; text-align: center; }
.tk-chapters a .jw-he { font-size: .95em; color: var(--jw-muted); }
.tk-chapters a.on .jw-he { color: #fff; }

/* toolbar */
.tk-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-tog[aria-pressed="true"] { background: var(--jw-accent); border-color: var(--jw-accent); color: #fff; }

/* the text: a row per verse, Hebrew right, English left (jw-pair stacks under 720px) */
.tk-text { margin: 8px 0 18px; }
.tk-row { padding: 6px 0; border-bottom: 1px solid var(--jw-line); grid-template-columns: 1fr 1fr; }
.tk-row.tk-open { margin-top: 14px; }
.tk-chapter .tk-row { direction: rtl; }
.tk-chapter .tk-row > .tk-en { direction: ltr; }
.tk-he { font-family: var(--jw-hebrew); font-size: 1.5rem; line-height: 2.05; margin: 0; text-align: right; unicode-bidi: isolate; overflow-wrap: break-word; }
.tk-en { margin: 0; font-family: var(--jw-serif); font-size: 1.04rem; line-height: 1.65; padding-top: .35rem; }
.tk-n { font-family: system-ui, sans-serif; font-size: .72rem; font-weight: 600; color: var(--jw-gold) !important; text-decoration: none; vertical-align: super; padding: 0 2px; }
.tk-he .tk-n { font-family: var(--jw-hebrew); font-size: .8rem; vertical-align: baseline; position: relative; top: -.45em; }
.tk-n:hover { text-decoration: underline; }
.tk-par { font-family: var(--jw-hebrew); color: var(--jw-muted); font-size: .8em; margin: 0 .2em; }
.tk-k { color: var(--jw-muted); }
.tk-q { color: var(--jw-accent-ink); }
.tk-lg { font-size: 1.35em; }
.tk-sm { font-size: .7em; }
.tk-su { position: relative; top: -.45em; font-size: .85em; }
.tk-rn { color: var(--jw-muted); }
.tk-repeat { display: block; color: var(--jw-muted); margin-top: 4px; }
.tk-marker { margin: 16px 0 4px; padding: 6px 10px; border-radius: 8px; background: var(--jw-soft); border: 1px solid var(--jw-line); font-size: .92rem; font-weight: 600; }
.tk-marker .jw-he { color: var(--jw-gold); margin-inline-start: .4em; }
.tk-m-aliyah { font-weight: 500; font-size: .85rem; background: transparent; border-style: dashed; }
.tk-m-haftarah { border-left: 4px solid var(--jw-gold); }

/* one verse */
.tk-verse { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 6px 0 12px; padding: 16px 18px; border-radius: var(--jw-radius); background: var(--jw-soft); border: 1px solid var(--jw-line); }
.tk-big { font-size: 2rem; line-height: 2.1; margin: 0; }
.tk-big-en { font-family: var(--jw-serif); font-size: 1.25rem; line-height: 1.6; margin: 0; }
.tk-version { font-size: .78rem; color: var(--jw-muted); margin: 4px 0 0; }
.tk-com { margin: 0 0 14px; }
.tk-com h3 { margin: 0 0 4px; }

/* switches */
html.jw-hide-hebrew .tk-he, html.jw-hide-hebrew .tk-verse-he { display: none; }
html.jw-hide-english .tk-en, html.jw-hide-english .tk-verse-en { display: none; }
html.jw-hide-hebrew .tk-row, html.jw-hide-english .tk-row { grid-template-columns: 1fr; }
html.jw-hide-hebrew.jw-hide-english .tk-he { display: block; }

/* search (/library/search/) */
.tk-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tk-hits { list-style: none; margin: 0; padding: 0; }
.tk-hit { padding: 12px 0; border-bottom: 1px solid var(--jw-line); }
.tk-hit h3 { font-size: 1rem; margin: 0 0 4px; font-family: var(--jw-serif); }
.tk-hit h3 small { font-family: system-ui, sans-serif; font-weight: 400; color: var(--jw-muted); font-size: .78rem; margin-inline-start: 6px; }
.tk-hit .jw-he-block { font-size: 1.3rem; line-height: 1.9; margin: 0 0 4px; }
.tk-hit p { margin: 0; }
.tk-hit em, .tk-hit mark { background: #fff3b0; color: inherit; font-style: normal; padding: 0 1px; }
html[data-fs-theme="dark"] .tk-hit em, html[data-fs-theme="dark"] .tk-hit mark { background: #5a4a10; }
.tk-passage { margin: 0 0 18px; }
.tk-passage .tk-row:last-child { border-bottom: 0; }
.tk-answer { padding: 14px 16px; border: 1px solid var(--jw-line); border-left: 4px solid var(--jw-accent); border-radius: var(--jw-radius); background: var(--jw-card); margin: 10px 0 16px; }
.tk-answer h2 { font-family: var(--jw-serif); font-size: 1.15rem; margin: 0 0 6px; }
.tk-answer .tk-he { font-size: 1.35rem; }

/* Learn Hebrew (/hebrew/) */
.tk-letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tk-letter { padding: 10px 12px; border: 1px solid var(--jw-line); border-radius: var(--jw-radius); background: var(--jw-card); }
.tk-letter .tk-glyph { display: block; font-family: var(--jw-hebrew); font-size: 2.6rem; line-height: 1.2; text-align: center; }
.tk-letter .tk-glyph small { font-size: .55em; color: var(--jw-muted); margin-inline-start: .3em; }
.tk-letter b { display: block; text-align: center; }
.tk-letter span { display: block; text-align: center; font-size: .82rem; color: var(--jw-muted); }
.tk-vowels td.tk-vg { font-family: var(--jw-hebrew); font-size: 1.9rem; text-align: center; }
.tk-words td.tk-wh { font-family: var(--jw-hebrew); font-size: 1.4rem; white-space: nowrap; }
.tk-drill { padding: 14px 16px; border: 1px solid var(--jw-line); border-radius: var(--jw-radius); background: var(--jw-soft); margin: 0 0 12px; }
.tk-drill .tk-dw { font-family: var(--jw-hebrew); font-size: 2.2rem; line-height: 1.6; }
.tk-drill details { margin-top: 6px; }
.tk-kb { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; max-width: 560px; direction: ltr; margin: 8px 0; }
.tk-kb button { font-family: var(--jw-hebrew); font-size: 1.35rem; padding: 6px 0; border: 1px solid var(--jw-line); border-radius: 6px; background: var(--jw-card); color: var(--jw-ink); cursor: pointer; min-width: 0; }
.tk-kb button:hover { border-color: var(--jw-accent); }
.tk-kb button.tk-wide { grid-column: span 2; font-family: system-ui, sans-serif; font-size: .85rem; }
.tk-kb-out { width: 100%; max-width: 560px; font-family: var(--jw-hebrew); font-size: 1.5rem; padding: 8px 10px; border: 1px solid var(--jw-line); border-radius: 8px; background: var(--jw-card); color: var(--jw-ink); direction: rtl; }
.tk-tr-in { width: 100%; max-width: 560px; font-family: var(--jw-hebrew); font-size: 1.4rem; padding: 8px 10px; border: 1px solid var(--jw-line); border-radius: 8px; background: var(--jw-card); color: var(--jw-ink); direction: rtl; }
.tk-tr-out { font-size: 1.2rem; font-style: italic; min-height: 1.6em; }

@media (max-width: 720px) {
  .tk-chapter .tk-row { direction: ltr; }
  .tk-he { font-size: 1.35rem; }
  .tk-big { font-size: 1.6rem; }
  .tk-kb button { font-size: 1.1rem; }
}
@media print {
  .tk-toolbar, .tk-actions, .tk-chapters { display: none !important; }
}

/* commentaries on a verse page (builder B09's jw_commentaries_on) */
.tk-coms { border: 1px solid var(--jw-line); border-radius: var(--jw-radius); padding: 8px 12px; margin: 0 0 8px; background: var(--jw-card); }
.tk-coms summary { cursor: pointer; }
.tk-coms .jw-he-block { font-size: 1.15rem; line-height: 1.9; }
.tk-com { border-top: 1px dashed var(--jw-line); padding-top: 8px; margin-top: 8px; }
.tk-com-en { font-family: var(--jw-serif); line-height: 1.6; }
.tk-com .jw-more { font-size: .85rem; }
