/* Remember The Nasi: guide pages (/nasi/, /nissan/, /pesach/ and the 13 day pages).
   Same Sand tokens as styles.css, kept in their own file so the main app page is untouched.
   html.dark switches to navy, set from the visitor's saved theme or their system setting. */

:root {
  --bg: #f2ece7;
  --card: #fffcfa;
  --ink: #2a2320;
  --muted: #6a5b55;
  --accent: #76625a;
  --accent-ink: #ffffff;
  --chip: #e6dcd5;
  --line: rgba(42, 35, 32, 0.12);
  --shadow: 0 1px 2px rgba(42, 35, 32, 0.06), 0 8px 24px rgba(42, 35, 32, 0.07);
  --today: #d9822b;
  --sans: 'Heebo', 'Helvetica Neue', Arial, sans-serif;
  --hebrew: 'Noto Serif Hebrew', 'Times New Roman', serif;
  --radius: 20px;
  --content: 760px;
  color-scheme: light;
}

html.dark {
  --bg: #0f2233;
  --card: #172c40;
  --ink: #eef2f6;
  --muted: #a9b8c6;
  --accent: #d9c7bc;
  --accent-ink: #0f2233;
  --chip: #1e3650;
  --line: rgba(238, 242, 246, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.25);
  --today: #f0a65a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: calc(var(--content) + 32px);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.site-head { padding-top: max(18px, env(safe-area-inset-top, 0px)); padding-bottom: 8px; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { width: 44px; height: 44px; border-radius: 13px; background: #fff; box-shadow: var(--shadow); flex: none; }
.brand span { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.head-right { display: flex; align-items: center; gap: 12px; flex: none; }
.bsd { font-family: var(--hebrew); font-size: 0.85rem; color: var(--muted); }
.app-link {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 0.9rem; text-decoration: none; white-space: nowrap;
}

/* ---------- Breadcrumbs ---------- */
.crumbs { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 0.85rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; padding: 0 8px; }
.crumbs a { color: var(--muted); }

/* ---------- Article ---------- */
main { padding-bottom: 32px; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.15; letter-spacing: -0.025em; margin: 18px 0 10px; }
h1 .he, .h-he { font-family: var(--hebrew); font-weight: 700; }
.lede { font-size: 1.12rem; color: var(--muted); margin: 0 0 22px; }
h2 { font-size: 1.35rem; letter-spacing: -0.015em; line-height: 1.25; margin: 0 0 10px; }
h3 { font-size: 1.08rem; margin: 22px 0 6px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 1.3em; }
li { margin-bottom: 6px; }
strong { font-weight: 700; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin: 0 0 18px;
}
@media (min-width: 700px) { .card { padding: 28px 32px; } }
.card > :last-child { margin-bottom: 0; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { color: var(--muted); font-weight: 500; }
.facts dd { margin: 0; font-weight: 600; }

.he, [lang="he"] { font-family: var(--hebrew); }
.reading-he { font-family: var(--hebrew); font-size: 1.3rem; line-height: 2.05; text-align: justify; margin: 0 0 4px; }
.reading-en { font-size: 1.02rem; }
.label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }

.table-wrap { overflow-x: auto; margin: 0 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td .he { display: block; font-size: 1.02rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.chips li { margin: 0; }
.chips a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  border-radius: 999px; background: var(--chip); color: var(--ink);
  font-weight: 600; font-size: 0.9rem; text-decoration: none;
}
.chips a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
.pager a {
  flex: 1; display: block; padding: 14px 18px; border-radius: 16px;
  background: var(--card); box-shadow: var(--shadow); text-decoration: none;
}
.pager a.next { text-align: right; }
.pager small { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.pager span { font-weight: 600; }

.note { border-left: 4px solid var(--accent); padding: 2px 0 2px 14px; color: var(--muted); }

details { border-bottom: 1px solid var(--line); padding: 10px 0; }
details:last-child { border-bottom: 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 4px; }

/* ---------- Footer ---------- */
.site-foot { padding: 8px 0 max(28px, env(safe-area-inset-bottom, 0px)); font-size: 0.88rem; color: var(--muted); }
.site-foot nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 18px; }
.site-foot h2 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 0 0 4px; }
.site-foot a { color: var(--muted); }
.site-foot .credits { text-align: center; line-height: 1.6; }
.site-foot .credits p { margin: 0 0 4px; }
