/* styles.css v1.0.0 (Tanya and Chumash Illustrated; the Rambam Illustrated look, plus rows of Hebrew beside English) */
/* The booklets' own typefaces: FreeSerif Bold for the Rambam's Hebrew, Liberation Serif Bold
   (renamed Rambam Label) for the Chapter and Halacha labels. English text is Inter, as in the booklets.
   Licenses: site/fonts/LICENSE.txt */
@font-face { font-family: "Rambam Hebrew"; src: url("fonts/rambam-hebrew.woff2") format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0590-05FF, U+FB1D-FB4F, U+0020-0040, U+005B-0060, U+007B-007E, U+2010-2027; }
@font-face { font-family: "Crimson Pro"; src: url("fonts/crimson-pro-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Crimson Pro"; src: url("fonts/crimson-pro-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rambam Label"; src: url("fonts/rambam-label.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
/* Layout idea: one narrow reading column, booklet colors, fixed bottom tabs on phones. */
:root {
  color-scheme: light;
  --navy: #0B2059;
  --navy-soft: #23376e;
  --gold: #C8921A;
  --gold-soft: #F1D48A;
  --cream: #FFF6DE;
  --paper: #FBFAF6;
  --card: #FFFFFF;
  --ink: #161B24;
  --muted: #5F677A;
  --line: #E4DFD0;
  --good: #2E7D32;
  --font-en: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-he: "Rambam Hebrew", "Times New Roman", serif;
  --font-label: "Rambam Label", "Times New Roman", serif;
  --fs: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-en);
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: 76px;
}
a { color: var(--navy); }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; margin: 0; }
[lang="he"] { font-family: var(--font-he); }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy); color: #fff;
  padding: 4px 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; }
.brand-he { font-size: 24px; font-weight: 700; color: var(--gold-soft); }
.brand-en { font-weight: 700; letter-spacing: .01em; }
.top-link { color: var(--gold-soft); font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.top-links { display: flex; gap: 14px; }
.brand-en { white-space: nowrap; }
@media (max-width: 520px) { .brand-he { display: none; } .top-links { gap: 2px; } }
@media (max-width: 400px) { .brand-en { font-size: 15px; } .back span { display: none; } .back { padding: 0 8px; } }
@media (min-width: 820px) and (max-width: 1040px) { .brand-he { display: none; } .top-nav a { padding: 0 8px !important; font-size: 14px !important; } .top-link { padding: 0 2px; } }
@media (max-width: 350px) { .brand-en { font-size: 14px; } .top-link[href="#about"] { display: none; } }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; color: var(--navy); font-size: 14px; }
.form input, .form textarea { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); width: 100%; }
.form input:focus, .form textarea:focus { border-color: var(--navy); outline: none; }
.form textarea { min-height: 140px; resize: vertical; }
.form .trap { position: absolute; left: -9999px; }
.answer.good { border-color: var(--good); background: #EEF7EE; }

main { max-width: 760px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
main:focus { outline: none; }
.loading, .empty { color: var(--muted); padding: 24px 0; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; padding: 4px 0;
  border-radius: 10px;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--navy); }
.tabs a.on svg { stroke-width: 2.2; }

/* Back button, top links on wide screens, breadcrumbs, page footer */
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 10px 0 4px; margin-left: -6px;
  background: rgba(255,255,255,.1); border: 0; border-radius: 10px; color: #fff; font-weight: 600; font-size: 14px; }
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.back[hidden] { display: none; }
.top { gap: 10px; }
.brand { margin-right: auto; }
.top-nav { display: none; }
.top-link.on, .top-nav a.on { color: #fff; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.crumb a { display: inline-flex; align-items: center; min-height: 32px; }
.crumb .sep { color: var(--line); }
.foot { max-width: 760px; margin: 8px auto 0; padding: 20px 16px 28px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--navy); font-weight: 600; text-decoration: none; }
.foot p { margin: 0; }
.pager span:empty { display: block; }

/* Day header */
.day {
  background: var(--navy); color: #fff; border-radius: 16px; padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.day .eyebrow { color: var(--gold-soft); font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.day h1 { font-size: 24px; font-weight: 800; }
.day .dates { color: #D5DBEE; font-size: 14px; }
.day .note { background: rgba(255,255,255,.12); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.day-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--navy); background: var(--navy); color: #fff;
  border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 14px; text-decoration: none;
}
.btn.gold { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.small { padding: 6px 12px; font-size: 14px; min-height: 44px; min-width: 44px; }
.btn[disabled] { opacity: .45; cursor: default; }

/* Pushable "learn" buttons */
.push {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(#F7DE8C, #E3B437); color: var(--navy); font-weight: 800; text-decoration: none;
  border: 0; border-radius: 12px; padding: 10px 14px; font-size: 15px; line-height: 1.2;
  box-shadow: 0 4px 0 #A9780F, 0 6px 12px rgba(0,0,0,.18);
  transform: translateY(0); cursor: pointer;
}
.push:hover { filter: brightness(1.04); }
.push:active { transform: translateY(3px); box-shadow: 0 1px 0 #A9780F, 0 2px 4px rgba(0,0,0,.18); }
.push.big { display: flex; width: 100%; padding: 16px 18px; border-radius: 16px; margin-top: 10px; }
.push-main { font-size: 20px; }
.push-sub { font-size: 14px; font-weight: 600; opacity: .8; margin-top: 2px; }
.push.small { padding: 7px 14px; font-size: 14px; min-height: 44px; white-space: nowrap; box-shadow: 0 3px 0 #A9780F; }
.push-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.btn.line { background: transparent; border-color: rgba(255,255,255,.45); color: #fff; }
.day.slim h1 { font-size: 22px; }
.chapter > .count { color: var(--muted); font-size: 14px; margin-top: -4px; }
.chapter-head { align-items: center; }
@media (prefers-reduced-motion: no-preference) { .push { transition: transform .06s, box-shadow .06s; } }

/* Chapter block */
.chapter { display: flex; flex-direction: column; gap: 10px; }
.chapter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--navy); padding-bottom: 6px; }
.chapter-head h2 { font-size: 19px; color: var(--navy); font-weight: 800; }
.chapter-head .count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.chapter-head a.count { display: inline-flex; align-items: center; min-height: 44px; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; text-decoration: none; color: inherit;
}
.row:hover { border-color: var(--gold); }
.badge {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--cream); color: var(--navy); font-weight: 800; font-size: 15px;
  border: 1px solid var(--gold-soft); font-variant-numeric: tabular-nums;
}
.row.aux .badge { background: var(--navy); color: var(--gold-soft); border-color: var(--navy); font-size: 11px; }
.row-title { font-weight: 700; color: var(--navy); line-height: 1.3; }
.row-sub { color: var(--muted); font-size: 14px; line-height: 1.35; }
.row-part { color: var(--gold); font-size: 14px; font-weight: 700; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; font-size: 13px; font-weight: 800; }
.tick.done { background: var(--good); border-color: var(--good); color: #fff; }

/* Reader */
.crumb { color: var(--muted); font-size: 14px; font-weight: 600; }
.crumb a { color: var(--muted); }
.reader-head { display: flex; flex-direction: column; gap: 4px; }
.pill {
  align-self: flex-start; background: linear-gradient(#F3D77D, #D9A520); color: var(--navy);
  font-weight: 700; border-radius: 999px; padding: 4px 14px; font-size: 14px; font-family: var(--font-label); font-size: 17px; padding: 5px 16px; }
.reader-head h1 { font-size: 24px; color: var(--navy); font-weight: 800; }
.reader-head .sub { color: var(--muted); }
.scene { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #EDEAE0; padding: 0; width: 100%; display: block; }
.scene img { width: 100%; }
.hint { color: var(--muted); font-size: 14px; text-align: center; margin: -8px 0 0; }
.saying { background: var(--cream); border-left: 5px solid var(--gold); border-radius: 10px; padding: 12px 14px; }
.saying .label { color: var(--navy); font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.saying p { margin: 4px 0 0; font-weight: 700; font-size: calc(16.5px * var(--fs)); line-height: 1.45; }
.block { display: flex; flex-direction: column; gap: 8px; }
.block h2 { font-size: 14px; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.english p { margin: 0 0 10px; font-size: calc(16.5px * var(--fs)); max-width: 65ch; }
.english .tr { font-weight: 600; color: var(--ink); }
.english .note { font-weight: 400; color: #6B7183; }
.hl-tag, .he-tag { display: inline-block; background: var(--navy); color: #fff; font-family: var(--font-label); font-weight: 700;
  font-size: 0.82em; line-height: 1; padding: 4px 10px 5px; border-radius: 999px; margin-right: 4px; vertical-align: 0.08em; }
.he-tag { font-family: var(--font-he); margin: 0 0 0 6px; }
.english .key { font-size: 14px; color: var(--muted); }
.hebrew p { margin: 0 0 10px; font-family: var(--font-he); font-size: calc(22px * var(--fs)); line-height: 1.8; }
.hebrew .key { font-family: var(--font-en); font-size: 14px; color: var(--muted); direction: ltr; text-align: left; }
.sizer { display: inline-flex; gap: 6px; }
.sizer button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 12px; min-height: 44px; min-width: 44px; font-weight: 700; color: var(--navy); }
.reader-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pager .btn { padding: 12px; }
.textpage p { margin: 0 0 8px; max-width: 65ch; }
details.textpage summary { cursor: pointer; font-weight: 600; color: var(--navy, #1d2b5a); min-height: 44px; display: flex; align-items: center; }
details.textpage[open] summary { margin-bottom: 8px; }

/* Study view and reading controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); cursor: pointer; min-height: 44px; padding: 0 8px 0 2px; border-radius: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--card); color: var(--muted); padding: 0 14px; min-height: 44px; font-weight: 600; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--navy); color: #fff; }
.seg.track { display: flex; width: 100%; background: var(--card); }
.seg.track button { flex: 1; font-size: 15px; }
.study { display: flex; flex-direction: column; gap: 14px; }
.chapter-head a.count { color: var(--navy); font-weight: 600; }
.st { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.st h3 { font-size: 17px; }
.st h3 a { color: var(--navy); text-decoration: none; display: block; }
.st h3 small { color: var(--gold); font-size: 14px; font-weight: 700; white-space: nowrap; }
.pill .he, .chapter-head .he { font-family: var(--font-he); font-weight: 700; }
.chapter-head .he { color: var(--gold); font-size: 0.9em; }
.st-num { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; margin-right: 6px; border-radius: 8px; background: var(--cream); border: 1px solid var(--gold-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.st-cols { display: flex; flex-direction: column-reverse; gap: 12px; }
.st-sum { margin: 0; background: var(--cream); border-left: 4px solid var(--gold); border-radius: 8px; padding: 8px 12px; font-size: calc(15px * var(--fs)); }
.heb-img { width: 100%; border-radius: 8px; cursor: zoom-in; }
.heb-img + .heb-img { margin-top: 8px; }
.no-pics .st-pic { display: none; }
.lang-he .st-en { display: none; }
.lang-en .st-he { display: none; }
@media (min-width: 700px) {
  .st-cols { flex-direction: row; align-items: flex-start; }
  .st-cols > div { flex: 1; min-width: 0; }
}

/* Browse */
.section-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.section-card h2 { font-size: 18px; color: var(--navy); font-weight: 800; }
.section-card .en { color: var(--muted); font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--gold-soft); background: var(--cream); color: var(--navy); border-radius: 10px; padding: 7px 12px; font-weight: 700; font-size: 14px; text-decoration: none; }
.chip small { font-weight: 500; color: var(--muted); }

/* Search and ask */
.field { display: flex; gap: 8px; }
.field input, .ask-box textarea {
  flex: 1; width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
}
.field input:focus, .ask-box textarea:focus { border-color: var(--navy); outline: none; }
.help { color: var(--muted); font-size: 14px; margin: 0; }
.result { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; display: block; }
.result .where { color: var(--gold); font-weight: 800; font-size: 12.5px; letter-spacing: .04em; }
.result .title { color: var(--navy); font-weight: 700; }
.result .snip { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.result .snip[dir="rtl"] { font-family: var(--font-he); font-size: 17px; }
mark { background: #FBE7A6; color: inherit; border-radius: 3px; padding: 0 1px; }
.ask-box { display: flex; flex-direction: column; gap: 10px; }
.ask-box textarea { min-height: 96px; resize: vertical; }
.examples { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.examples button { border: 1px dashed var(--gold); background: transparent; color: var(--navy); border-radius: 10px; padding: 6px 10px; font-size: 14px; text-align: left; }
.answer { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; white-space: pre-wrap; }
.answer.error { border-color: #C9792B; background: #FFF4E8; }
.fine { color: var(--muted); font-size: 14px; margin: 0; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head h1 { font-size: 20px; color: var(--navy); font-weight: 800; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell {
  aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; font-variant-numeric: tabular-nums;
}
.cal-cell.blank { border: 0; background: transparent; }
.cal-cell.has { color: var(--navy); border-color: var(--gold-soft); background: var(--cream); }
.cal-cell.has::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.cal-cell.prev::after { background: transparent; border: 1.5px solid var(--gold); }
.cal-cell.today { outline: 2px solid var(--navy); outline-offset: -2px; }
.cal-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.cal-list a { display: flex; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: inherit; }
.cal-list .d { font-weight: 700; color: var(--navy); white-space: nowrap; }
.cal-list .l { color: var(--muted); text-align: right; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 5px; }
.legend i.o { background: transparent; border: 1.5px solid var(--gold); }

/* About */
.prose h1 { font-size: 24px; color: var(--navy); font-weight: 800; margin-bottom: 8px; }
.prose h2 { font-size: 17px; color: var(--navy); margin: 14px 0 4px; }
.prose p { margin: 0 0 10px; max-width: 65ch; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: #0A1022; display: flex; flex-direction: column; }
.lightbox[hidden] { display: none; }
.lightbox-bar { display: flex; justify-content: space-between; padding: 10px 12px; gap: 8px; }
.lightbox-bar button { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 600; }
.lightbox-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; align-items: flex-start; }
.lightbox-scroll img { width: 100%; max-width: none; margin: auto; }
.lightbox-scroll.zoom img { width: 240%; margin: 0; }

@media (min-width: 820px) {
  .top-nav { display: flex; gap: 2px; }
  .top-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--gold-soft); font-weight: 600; font-size: 15px; text-decoration: none; border-radius: 10px; }
  .top-nav a:hover { background: rgba(255,255,255,.08); }
  .tabs { display: none; }
  body { padding-bottom: 0; }
  .tabs { justify-content: center; gap: 8px; }
  .tabs a { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 6px; font-size: 14px; padding: 8px 16px; min-height: 44px; }
  .tabs svg { width: 18px; height: 18px; }
  main { padding-top: 24px; }
  .lightbox-scroll.zoom img { width: 170%; }
}
/* Phone held sideways: let the header scroll away and keep the bottom bar slim. */
@media (orientation: landscape) and (max-height: 500px) {
  .top { position: static; padding: 6px 16px; }
  .tabs { padding: 2px 4px calc(2px + env(safe-area-inset-bottom, 0px)); }
  .tabs a { flex-direction: row; justify-content: center; gap: 6px; font-size: 13px; min-height: 44px; padding: 0; }
  .tabs svg { width: 20px; height: 20px; }
  body { padding-bottom: 56px; }
}
/* Very wide screens: a wider reading column and one step larger type. */
@media (min-width: 1600px) {
  main { max-width: 900px; }
  body { font-size: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
  .row, .chip, .btn { transition: border-color .15s, background-color .15s; }
}

/* ---------- home page (v1.10.0): full width bands, a two column grid from 900px ---------- */
main.home { max-width: none; padding: 0; gap: 0; }
.hm-in { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.hm-serif { font-family: "Crimson Pro", Georgia, "Times New Roman", serif; font-weight: 600; color: var(--navy); letter-spacing: -0.01em; }
.hm-band { padding: 40px 0; }
.home .btn.line { background: transparent; border-color: var(--navy); color: var(--navy); }
.home .hm-navy .btn.line { border-color: rgba(255,255,255,.45); color: #fff; }
.hm-cols { display: grid; gap: 28px; }
@media (min-width: 900px) { .hm-cols { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 48px; } }

.hm-hero { padding: 36px 0 40px; }
.hm-hero h1 { font-size: clamp(44px, 9vw, 76px); line-height: 1; margin: 0 0 16px; }
.hm-hero p { font-size: 18px; color: var(--ink); max-width: 34em; margin: 0 0 20px; }
.hm-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hm-hero-pic { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: #ece6d6; min-height: 220px; box-shadow: 0 10px 30px rgba(11,32,89,.12); }
.hm-hero-pic img { width: 100%; height: 100%; max-height: 340px; object-fit: cover; }
.hm-ph { height: 260px; }
.hm-hero-pic figcaption { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.95);
  border-radius: 10px; padding: 8px 12px 8px 8px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.hm-hero-pic figcaption b { display: block; font-size: 14px; color: var(--navy); }
.hm-hero-pic figcaption small { display: block; font-size: 12px; color: var(--muted); }
.hm-chip-he { font-family: var(--font-he); background: var(--navy); color: #fff; border-radius: 8px; min-width: 34px; height: 34px; display: grid; place-items: center; font-size: 17px; padding: 0 6px; }

.hm-blue { background: #EEF4FB; }
.hm-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .hm-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.hm-main, .hm-side { display: grid; gap: 16px; min-width: 0; }
.hm-card { background: var(--card); border: 1px solid #dde6f1; border-radius: 16px; padding: 18px; }
.hm-card h3 { margin: 0 0 12px; font-size: 15px; color: var(--navy); }
.hm-card h3.hm-serif { font-size: 24px; }
.hm-today-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.hm-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); border: 1px solid var(--navy); border-radius: 999px; padding: 2px 9px; }
.hm-today h2 { font-size: clamp(28px, 5vw, 36px); margin: 8px 0 2px; line-height: 1.1; }
.hm-sub { color: var(--muted); font-style: italic; font-size: 15px; }
.hm-note { margin-top: 14px; background: var(--cream); border: 1px solid var(--gold-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.hm-chs { list-style: none; margin: 14px 0 0; padding: 0; }
.hm-chs li { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 12px 0; }
.hm-ch { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); min-height: 44px; }
.hm-ch img, .hm-noimg { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: #e8eef6; }
.hm-ch-t { min-width: 0; }
.hm-ch-t b { display: block; color: var(--navy); font-size: 16px; }
.hm-ch-t b .he { font-family: var(--font-he); font-weight: 400; margin-left: 4px; }
.hm-ch-t small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }
.hm-learn { flex: none; font-weight: 700; font-size: 14px; color: var(--navy); background: var(--gold-soft); border-radius: 999px; padding: 0 14px; min-height: 44px; display: grid; place-items: center; text-decoration: none; }
.hm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hm-wds { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.hm-wd { display: grid; justify-items: center; gap: 2px; padding: 8px 0; border-radius: 10px; text-decoration: none; color: var(--muted); min-height: 44px; }
.hm-wd span { font-size: 11px; }
.hm-wd b { font-size: 17px; color: var(--ink); font-weight: 600; }
.hm-wd.has b { color: var(--navy); }
.hm-wd.has::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.hm-wd.now { background: var(--navy); color: #fff; }
.hm-wd.now b { color: #fff; }
.hm-prog + .hm-prog { margin-top: 12px; }
.hm-prog-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink); gap: 8px; }
.hm-bar { height: 6px; background: #e3ebf5; border-radius: 99px; margin-top: 6px; overflow: hidden; }
.hm-bar i { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.hm-find label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.hm-find select, .hm-find input, .hm-form select, .hm-form input, .hm-form textarea {
  font: inherit; font-size: 16px; font-weight: 400; min-height: 44px; border: 1px solid #cfd7e3; border-radius: 10px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%; }
.hm-find .btn { width: 100%; }
.hm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hm-or { text-align: center; font-size: 12px; color: var(--muted); margin: 12px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.hm-date { display: flex; gap: 8px; }
.hm-date input { flex: 1; min-width: 0; }
.hm-date .btn { width: auto; }
.hm-link { display: block; margin-top: 12px; font-size: 14px; font-weight: 600; min-height: 44px; line-height: 44px; }
.hm-spot p { font-size: 14px; color: var(--muted); margin: 0 0 12px; }

.hm-navy { background: var(--navy); color: #fff; padding: 48px 0; }
.hm-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-soft); }
.hm-navy h2 { color: #fff; font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 10px 0 24px; }
.hm-feats { display: grid; gap: 18px; }
@media (min-width: 560px) { .hm-feats { grid-template-columns: 1fr 1fr; } }
.hm-feats b { display: block; font-family: "Crimson Pro", Georgia, serif; font-size: 21px; font-weight: 600; margin-bottom: 4px; }
.hm-feats p { margin: 0; font-size: 14px; color: rgba(255,255,255,.82); }
.hm-page { display: block; background: #fff; color: var(--ink); text-decoration: none; border-radius: 6px; padding: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.3); max-width: 420px; margin: 0 auto; }
.hm-page-top { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.hm-page img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 4px; }
.hm-page p { font-size: 13px; margin: 10px 0 0; line-height: 1.5; }
.hm-page p.he { font-family: var(--font-he); font-size: 17px; line-height: 1.7; text-align: right; }

.hm-pages-top { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--navy); padding-top: 14px; margin-bottom: 18px; gap: 12px; }
.hm-pages-top h2 { margin: 0; font-size: 30px; }
.hm-pages-top a { font-weight: 700; font-size: 14px; min-height: 44px; line-height: 44px; }
.hm-pics { display: grid; gap: 16px; }
@media (min-width: 640px) { .hm-pics { grid-template-columns: repeat(3, 1fr); } .hm-pic img { aspect-ratio: 4 / 5; } }
.hm-pic { text-decoration: none; color: var(--ink); }
.hm-pic img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; background: #ece6d6; }
.hm-pic b { display: block; font-family: "Crimson Pro", Georgia, serif; font-weight: 500; font-size: 19px; margin-top: 8px; color: var(--ink); }
.hm-pic small { color: var(--muted); font-size: 13px; }

.hm-fix { background: #EFE6D8; }
.hm-fix h2 { font-size: clamp(28px, 5vw, 38px); margin: 0 0 8px; line-height: 1.1; }
.hm-fix p { color: var(--muted); }
.hm-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.hm-form small { font-weight: 400; color: var(--muted); }
.hm-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.home .answer { margin-top: 10px; }
.hm-soon { flex: none; font-size: 12px; font-weight: 700; color: #8a5a00; background: var(--cream); border: 1px solid var(--gold-soft); border-radius: 999px; padding: 4px 10px; }
/* One Hebrew and English pair per halacha on pages with two or three halachos (v1.12.0) */
.st-cols.pair + .st-cols.pair { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.block .st-cols.pair .hebrew p:last-child, .block .st-cols.pair .english p:last-child { margin-bottom: 0; }

/* ---------- screen sizes (v1.13.0), from the size audit and the Claude Design mockups ---------- */
/* Reading controls: two short rows on phones (pictures and text size, then language), one row from 560px. */
.controls { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 8px; }
.controls .seg { grid-column: 1 / -1; display: flex; }
.controls .seg button { flex: 1; }
.controls .check { min-height: 40px; }
.controls .sizer button { min-height: 40px; min-width: 42px; }
.controls .seg button { min-height: 40px; }
.controls .sizer { grid-row: 1; grid-column: 2; }
@media (min-width: 560px) {
  .controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; }
  .controls .seg { grid-column: auto; }
  .controls .seg button { flex: 0 0 auto; }
}
/* In the study view the controls stay in reach while scrolling. */
.controls.stick { position: sticky; top: 52px; z-index: 5; box-shadow: 0 4px 14px rgba(11, 32, 89, .08); }

/* Pictures never fill the whole first screen, so the Rambam's words start near the top. */
.scene.st-pic { width: fit-content; max-width: 100%; margin: 0 auto; }
.scene.st-pic img { width: auto; max-width: 100%; max-height: min(52vh, 440px); margin: 0 auto; }
@media (min-width: 600px) { .scene.st-pic img { max-height: min(40vh, 380px); } .st .scene.st-pic img { max-height: min(34vh, 300px); } }

/* Halacha page: Hebrew beside English from tablet width. */
.rd, .rd-side, .rd-main, .rd-texts { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 700px) {
  .rd-texts { flex-direction: row-reverse; align-items: flex-start; gap: 28px; }
  .rd-texts > .block { flex: 1; min-width: 0; }
}

/* Large screens: reading pages get a wider column. */
@media (min-width: 1100px) {
  main.wide { max-width: 1200px; padding-left: 24px; padding-right: 24px; }
  /* Halacha page: title, picture and controls on the left stay in place; the text scrolls on the right. */
  .rd { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 36px; align-items: start; }
  .rd-side { position: sticky; top: 68px; }
  .rd-side .scene.st-pic img { max-height: min(46vh, 380px); }
  /* The side column is narrow, so its controls use the two row layout. */
  .rd-side .controls { display: grid; grid-template-columns: 1fr auto; }
  .rd-side .controls .seg { grid-column: 1 / -1; }
  .rd-side .controls .seg button { flex: 1; }
  .rd-main { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 26px; }
  .reader-head h1 { font-size: 28px; }
  /* Study view: each halacha is one row, the picture beside its Hebrew and English. */
  .st { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px 26px; align-items: start; padding: 18px; }
  .st h3 { grid-column: 1 / -1; }
  .st .scene.st-pic { grid-column: 1; margin: 0; }
  .st .scene.st-pic img { max-height: 320px; }
  .st-body { grid-column: 2; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .st.nopic .st-body, .no-pics .st-body { grid-column: 1 / -1; }
  .no-pics .st { grid-template-columns: minmax(0, 1fr); }
  .controls.stick { top: 60px; }
}
.st-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Tablets: the bottom bar keeps its buttons together instead of spreading them across the screen. */
@media (min-width: 600px) and (max-width: 819px) {
  .tabs { justify-content: center; }
  .tabs a { flex: 0 1 112px; }
}

/* Home page on tablets: the hero and the two columns start at 720px, with a smaller hero picture. */
@media (min-width: 720px) {
  .hm-cols { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 32px; }
  .hm-grid { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
}
@media (min-width: 720px) and (max-width: 899px) {
  .hm-hero-pic img { max-height: 260px; }
  .hm-hero h1 { font-size: 52px; }
}
@media (min-width: 900px) { .hm-grid { grid-template-columns: minmax(0, 1fr) 300px; } }

/* ---------- shiur videos and audio (v1.15.0) ---------- */
.shiur { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; margin: 14px 0; display: flex; flex-direction: column; gap: 14px; }
.shiur h2 { margin: 0; font-size: 18px; color: var(--navy); }
.shiur-item { display: flex; flex-direction: column; gap: 8px; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #000; cursor: pointer; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: rgba(204, 0, 0, .92); display: flex; align-items: center; justify-content: center; }
.yt-play svg { width: 26px; height: 26px; fill: #fff; }
.yt:hover .yt-play, .yt:focus-visible .yt-play { background: #c00; }
.yt-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.shiur audio { width: 100%; }
.shiur-cap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 14.5px; }
.shiur-cap b { color: var(--ink); }
.shiur-cap span { color: var(--muted); }
.shiur-cap a { color: var(--navy); font-weight: 600; margin-left: auto; }
@media (min-width: 1100px) { main.wide .shiur { max-width: 760px; } }

/* ---------- picture captions (v1.16.0): "In the picture" lines from the booklet ---------- */
.cap { margin: 4px auto 0; max-width: 560px; font-size: 14.5px; line-height: 1.45; color: var(--ink); text-align: center; }
.cap b { color: #7A5308; font-weight: 700; }
.st-body .cap { text-align: left; margin: 0; max-width: none; }
@media (min-width: 1100px) { .st .cap { grid-column: 1; } }

/* ---------- Tanya and Chumash: one phrase per row, Hebrew beside English ---------- */
.rws { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rw { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-top: 1px solid var(--line); }
.rw:first-child { border-top: 0; }
.rw:nth-child(even) { background: #FCFBF7; }
.rw .hebrew { margin: 0; font-family: var(--font-he); font-size: calc(23px * var(--fs)); line-height: 1.7; }
.rw .english { margin: 0; font-size: calc(16.5px * var(--fs)); line-height: 1.5; display: inline; }
.rw .english .tr { font-weight: 600; color: var(--ink); }
.rw .english .note { font-weight: 400; color: #6B7183; }
.rw-en { min-width: 0; }
.rw-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; margin-right: 6px; border-radius: 11px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; vertical-align: 2px; font-variant-numeric: tabular-nums; }
.rw-lab { display: inline; color: var(--navy-soft); font-size: 12px; font-weight: 700; letter-spacing: .02em; margin-bottom: 1px; }
.rw-lab + .english { display: block; }
.rw-h { background: #EAF1FB !important; }
.rw-h .hebrew, .rw-h .english .note, .rw-h .english .tr { color: #1F5FBF; font-weight: 700; }
.rw-label { background: var(--cream); border-top: 1px solid var(--line); padding: 6px 12px; }
.rw-label:first-child { border-top: 0; }
.rw-label span { color: #8A5F0D; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.heb-pic { max-width: 100%; height: auto; display: block; margin-left: auto; }
@media (min-width: 700px) {
  .rw { flex-direction: row-reverse; align-items: center; gap: 24px; }
  .rw-he { flex: 1 1 52%; } .rw-en { flex: 1 1 48%; }
  .lang-he .rw-he, .lang-en .rw-en { flex-basis: 100%; }
}
.pics { display: grid; gap: 10px; grid-template-columns: 1fr; }
.pics.n2, .pics.n3, .pics.n4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .pics.n3 { grid-template-columns: repeat(3, 1fr); } .pics.n4 { grid-template-columns: repeat(4, 1fr); } }
.pics.n1 { max-width: 520px; margin: 0 auto; width: 100%; }
.pics figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.pics .scene { border: 0; border-radius: 0; }
.pics .scene img { display: block; width: 100%; height: auto; }
.pics figcaption { padding: 8px 10px 10px; font-size: calc(14px * var(--fs)); font-weight: 600; line-height: 1.35; }
.unit h2 { font-size: 19px; }
.unit h2 a { color: var(--navy); text-decoration: none; display: block; }
.cards { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } .cards .plain, .cards-h { grid-column: 1 / -1; } }
.card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.card.plain { border-left-color: var(--gold); background: var(--cream); }
.card b { color: var(--navy); line-height: 1.3; }
.card p { margin: 0; font-size: calc(15.5px * var(--fs)); line-height: 1.45; }
.card ul { margin: 0; padding-left: 18px; font-size: calc(15.5px * var(--fs)); line-height: 1.45; }
.card .rw-n { align-self: flex-start; }
.card-he { font-family: var(--font-he); font-size: calc(20px * var(--fs)); color: var(--navy); }
.cards-h { margin: 6px 0 0; font-size: 13px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.review .card { border-left-color: var(--gold); }
.about-fold > summary { cursor: pointer; font-size: 14px; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; min-height: 44px; display: flex; align-items: center; }
.scene.cover { max-width: 520px; margin: 0 auto; }
.daycard { grid-template-columns: 72px 1fr auto; }
.daycard .thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }
.sisters { display: flex; flex-wrap: wrap; gap: 8px; }
.sisters a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--navy); border-radius: 22px; color: var(--navy); font-weight: 600; text-decoration: none; background: var(--card); }
.foot .sisters { justify-content: center; margin: 8px 0; }
