/* The parashah calendar and the parashah pages (tools/parashah.mjs).
   Only the tokens from base.css, which already carry light and dark; every
   side is logical, so the Hebrew pages mirror without a rule of their own.
   Column widths are in em, not ch: ch waits for the web font, and the
   column shrank once it arrived (33.5em is the old 68ch in Assistant). */

/* ---- This Shabbat ------------------------------------------------------- */
.now-block { display: grid; gap: .3rem; max-width: 33.5em; margin: 0 0 clamp(1.5rem, 4vw, 2.5rem); padding: 1.2rem 1.4rem 1.3rem; border-radius: var(--r-card); background: var(--brand-tint); }
.now-block h2 { font-family: var(--f-body); font-size: var(--step--1); font-weight: 700; line-height: 1.3; letter-spacing: .16em; text-transform: uppercase; word-spacing: normal; color: var(--brand); }
[dir="rtl"] .now-block h2 { font-size: .95rem; letter-spacing: .02em; }
.now-name { font-family: var(--f-display); font-size: var(--step-3); font-weight: 500; line-height: 1.15; color: var(--ink); text-wrap: balance; }
.now-name a { color: inherit; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: .16em; }
.now-name a:hover { color: var(--brand); }
.now-when { display: flex; flex-wrap: wrap; gap: .1rem 1rem; margin-top: .2rem; color: var(--ink-2); }
.now-when time { font-weight: 600; color: var(--ink); }
/* The Hebrew date always takes a line of its own, so the block's height does
   not change when the web font replaces the fallback (it did, by 29px). */
.now-when .heb { color: var(--ink-2); flex-basis: 100%; }

/* ---- The calendar, one table a Hebrew year --------------------------------- */
.year .cal { margin-top: .25rem; font-variant-numeric: tabular-nums; }
.year .cal thead th { font-weight: 700; white-space: nowrap; }
.year .cal td:first-child { color: var(--ink); }
.cal .names a { color: var(--brand); font-weight: 600; text-decoration: none; }
.cal .names a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cal .kind { display: inline-block; margin-inline-start: .35rem; padding: .02rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.cal tr.now > * { font-weight: 600; }
.cal tr.now > td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .cal tr.now > td:first-child { box-shadow: inset -3px 0 0 var(--brand); }
@media (max-width: 520px) {
  .cal { font-size: .9rem; }
  .cal th, .cal td { padding: .55rem .45rem; }
}
/* On a phone the date stays on one line, so the rows keep one height. */
@media (min-width: 360px) and (max-width: 520px) { .year .cal td.d { white-space: nowrap; } }

/* ---- Every parashah, book by book ------------------------------------------ */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: 1.75rem 1.5rem; margin-top: 1.5rem; }
.guide-section .books h3 { margin: 0 0 .6rem; font-size: var(--step-1); }
.plist { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
.plist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5rem; }
.plist a { color: var(--brand); font-weight: 600; text-decoration: none; }
.plist a:hover { text-decoration: underline; text-underline-offset: 3px; }
.plist .plain { color: var(--ink-3); }
.plist .he { font-size: 1.02rem; color: var(--ink-3); }

/* ---- A parashah: when it is read --------------------------------------------- */
.dates { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.dates li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem 1rem; padding-block: .8rem; border-bottom: 1px solid var(--line); }
.dates time { font-weight: 600; color: var(--ink); }
.dates .heb { color: var(--ink-2); }
.dates .with { flex-basis: 100%; font-size: .92rem; color: var(--ink-3); }
.dates .with a { color: var(--ink-2); text-underline-offset: 3px; }

/* ---- A parashah: its stories and passages ------------------------------------
   One block each: where it is, its name (a link to its page), its one line,
   then a verse and what it teaches (a story) or its introduction and first
   verse (a passage). */
.pitem + .pitem { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.pitem-head { display: grid; grid-template-columns: clamp(5.5rem, 24vw, 8.5rem) minmax(0, 1fr); gap: 1rem; align-items: center; }
.pitem-art { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-md); background: var(--paper-deep); }
.pitem .where { font-size: .85rem; color: var(--ink-3); }
.guide-section .pitem h3 { margin: .15rem 0 0; font-size: var(--step-2); line-height: 1.2; }
.pitem h3 a { color: var(--ink); text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: .16em; }
.pitem h3 a:hover { color: var(--brand); }
.guide-section .pitem .one { margin-top: .8rem; font-weight: 600; color: var(--ink); }
.pitem .tag-line { margin-top: .35rem; font-size: .82rem; font-weight: 700; color: var(--brand); }
.pitem .intro { margin-top: .8rem; }
.pitem .facts { margin-top: 1rem; }
.pitem .facts dd strong { color: var(--ink); }
.pitem .facts dd p + p { margin-top: .5rem; }
.pitem .more { margin-top: 1rem; }
.pitem .more a { color: var(--brand); font-weight: 600; }
.pitem + .credit { margin-top: 2rem; }

/* What js/parashah.js hides once its date has passed stays hidden, whatever its display. */
.now-block[hidden], .dates[hidden], .dates li[hidden], .dates-end[hidden] { display: none; }
