/* ============================================================
   Tanakh (Nach) reader — additions on top of parasha.css
   ============================================================ */

/* Rashi: dibur hamatchil + later quotations that link back to the verse */
.tk-rashi-quote { font-weight: 700; }
.tk-dh-link {
    cursor: pointer;
    border-radius: 3px;
    text-decoration: underline dotted;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.25em;
    transition: background 0.12s;
}
.tk-dh-link:hover,
.tk-dh-link:focus-visible {
    background: #fff3a3;
    color: #2a1f00;
    outline: none;
}
html.dark .tk-dh-link:hover,
html.dark .tk-dh-link:focus-visible { background: #6b5700; color: #fff7cc; }

/* Brief pulse used for both link directions (DH → verse words, word → DH) */
@keyframes tkFlash {
    0%, 60% { background: #ffb938; box-shadow: 0 0 0 3px #ffb938; }
    100%    { box-shadow: 0 0 0 0 transparent; }
}
.is-flash { animation: tkFlash 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) {
    .is-flash { animation: none; outline: 2px solid #b98a00; }
}

/* "Rashi" toggle opens every comment at once */
.pa-verses.show-rashi-all .pa-rashi.is-collapsed { display: block; }

/* Rashi English rides on the EN toggle */
.tk-rashi-en {
    display: none;
    margin-top: 0.35rem;
    direction: ltr;
    text-align: left;
    font-family: var(--font-ui);
    font-size: 0.85em;
    line-height: 1.55;
    color: var(--text-secondary);
}
.pa-verses.show-en .tk-rashi-en { display: block; }

.tk-nk-btn { min-width: 3.6em; }
.tk-empty { color: var(--text-secondary); text-align: center; padding: 2rem 1rem; }

/* ---------- Chapter grid (picker sheet + book index) ---------- */
.tk-ch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 0.4rem;
}
.tk-ch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    min-height: 52px;
    padding: 0.3rem 0.2rem;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    text-decoration: none;
}
.tk-ch:hover { border-color: var(--accent); text-decoration: none; }
.tk-ch.is-current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-accent);
}
.tk-ch.is-missing { opacity: 0.35; pointer-events: none; }
.tk-ch-he { font-family: var(--pa-font-hebrew, "Frank Ruhl Libre", serif); font-size: 1.1rem; line-height: 1.1; }
.tk-ch-num { font-size: 0.68rem; color: var(--text-secondary); }
.tk-ch.is-current .tk-ch-num { color: inherit; opacity: 0.85; }

/* ---------- Book index page ---------- */
.tk-book-shell {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
    box-sizing: border-box;
}
.tk-book-crumb { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--text-secondary); }
.tk-book-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0 0 0.5rem;
    font-size: clamp(1.6rem, 6vw, 2.2rem);
}
.tk-book-title-en { font-size: 0.55em; font-weight: 400; color: var(--text-secondary); }
.tk-book-desc { margin: 0 0 0.4rem; line-height: 1.55; color: var(--text-secondary); }
.tk-book-meta { margin: 0 0 1rem; font-size: 0.8rem; color: var(--text-tertiary, var(--text-secondary)); }
