/* Tohar site — "the board" direction: white page, ink text, one committed
   blue that marks the seven clean days. Type: Rubik throughout. */
:root {
  --ink: #101a2b;
  --muted: #4a5568;
  --soft: #8a94a6;
  --blue: #1450d2;
  --blue-deep: #0f3fa8;
  --blue-soft: #e9f0ff;
  --line: #e3e7ee;
  --wait: #f1f3f7;
  --surface: #f7f8fb;
  --bg: #ffffff;
  --radius: 12px;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}
::selection { background: var(--blue-soft); color: var(--ink); }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
strong { font-weight: 700; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0; }

/* Logo mark */
.mark .lg-ink { stroke: var(--ink); }
.mark .lg-cu, .mark .lg-cu2 { stroke: var(--blue); }
.mark .lg-cu2 { opacity: .55; }
.on-dark .lg-ink { stroke: #fff; }
.on-dark .lg-cu, .on-dark .lg-cu2 { stroke: #9db8ff; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.container.narrow { max-width: 780px; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-head .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.site-nav { display: flex; align-items: center; gap: 26px; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav .btn { padding: 10px 18px; font-size: 15px; }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; }
.lang-switch svg { display: block; flex: none; width: 16px; height: 16px; }
.lang-switch, .lang-switch svg { line-height: 1; }
.site-nav a.lang-switch { color: var(--ink); }
.lang-switch:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.site-nav a.btn-primary, .site-nav a.btn-primary:hover { color: #fff; }

/* Buttons */
.btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; border-radius: 10px; border: 0;
  font: 700 17px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }

/* Hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px); }
.hero .container { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(36px, 4.8vw, 60px); font-weight: 800; line-height: 1.07; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--blue); }
.lead { margin-top: 22px; font-size: 19px; line-height: 1.7; color: var(--muted); max-width: 36em; }
.cta-row { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.cta-note { font-size: 16px; color: var(--muted); }
.cta-note a { color: var(--ink); font-weight: 700; text-decoration: none; direction: ltr; unicode-bidi: isolate; }
.hero-note { margin-top: 14px; font-size: 15px; color: var(--muted); }

/* The calendar board */
.board { border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 16px; background: var(--bg); }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.board-head b { font-size: 20px; font-weight: 700; }
.board-head span { color: var(--muted); font-size: 14px; }
.board-days, .board-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.board-days div { text-align: center; font-size: 13px; color: var(--muted); padding-bottom: 6px; }
.day { min-height: 62px; border-radius: 8px; padding: 6px 7px; position: relative; display: flex; flex-direction: column; font-size: 12px; }
.day .h { font-weight: 500; font-size: 15px; }
.day .g { position: absolute; top: 6px; left: 7px; font-size: 11px; color: var(--soft); }
[dir="ltr"] .day .g { left: auto; right: 7px; }
.day .t { margin-top: auto; font-size: 11px; font-weight: 500; line-height: 1.25; }
.day.shab { background: var(--surface); }
.day.wait { background: var(--wait); }
.day.seen { box-shadow: inset 0 0 0 2px var(--ink); }
.day.hefsek { box-shadow: inset 0 0 0 2px var(--blue); }
.day.hefsek .t { color: var(--blue); }
.day.clean { background: var(--blue); color: #fff; }
.day.clean .g { color: #c9d7ff; }
.day.tevila { background: var(--ink); color: #fff; }
.day.tevila .g { color: #aab4c6; }
.board-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.board-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.board-note { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Sections */
.section { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--surface); }
.section h2 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 800; }
.section-intro { margin-top: 12px; color: var(--muted); max-width: 40em; font-size: 18px; }

/* One cycle, as a dated list */
.timeline { list-style: none; margin: 36px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 160px 1fr; gap: 8px 32px; padding: 22px 0; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .when { font-weight: 700; color: var(--blue); font-size: 16px; padding-top: 2px; }
.timeline h3 { font-size: 20px; font-weight: 700; }
.timeline p { margin-top: 6px; color: var(--muted); max-width: 42em; }

/* Facts: heading + text pairs, no cards */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; margin-top: 28px; }
.facts div { padding: 22px 0; border-top: 1px solid var(--line); }
.facts h3 { font-size: 19px; font-weight: 700; }
.facts p { margin-top: 6px; color: var(--muted); }

/* Halacha topics as a list of rows */
.topics { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.topic { display: block; padding: 20px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.topic:hover { color: var(--ink); }
.topic:hover .topic-t { color: var(--blue); }
.topic-t { display: block; font-weight: 700; font-size: 19px; }
.topic-t::after { content: " ←"; color: var(--blue); }
[dir="ltr"] .topic-t::after { content: " →"; }
.topic-s { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; }

/* FAQ */
.faq { margin-top: 28px; max-width: 820px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 0; font-weight: 700; font-size: 18px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--blue); font-weight: 400; font-size: 24px; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 44em; }

/* Closing band — the one place the blue owns a whole region */
.closing { background: var(--blue); color: #fff; padding: clamp(56px, 8vw, 88px) 0; }
.closing .container { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.closing .mark { display: none; }
.closing h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; }
.closing p { color: #dbe6ff; font-size: 18px; }
.closing .cta-row { margin-top: 10px; }
.closing .btn-primary { background: #fff; color: var(--blue); }
.closing .btn-primary:hover { background: var(--blue-soft); color: var(--blue-deep); }
.closing .cta-note, .closing .cta-note a { color: #fff; }
.en-line { margin-top: 18px; font-size: 15px; color: #dbe6ff; direction: ltr; text-align: left; }
.en-line a { color: #fff; }
.disclaimer { margin: 0; padding: 22px clamp(16px, 4vw, 40px); text-align: center; font-size: 14px; color: var(--muted); }

/* Footer */
.site-foot { background: var(--ink); color: #c9d1de; padding: 44px 0 36px; font-size: 15px; }
.site-foot .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.site-foot .brand { color: #fff; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.foot-links a { color: #c9d1de; text-decoration: none; }
.foot-links a:hover { color: #fff; }
.foot-copy { width: 100%; font-size: 14px; color: #9aa6b8; }
.foot-copy a { color: inherit; }
.foot-legal { width: 100%; font-size: 13px; color: #8390a5; line-height: 1.55; }

/* Privacy / terms pages */
.lang-bar { padding: 10px clamp(16px, 4vw, 40px); font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: center; }
.lang-bar a { color: var(--ink); }
header.page-head { max-width: 780px; margin: 0 auto; padding: 44px clamp(16px, 4vw, 40px) 8px; }
header.page-head .logo { margin-bottom: 14px; }
header.page-head h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
header.page-head p { margin-top: 8px; color: var(--muted); font-size: 18px; }
nav.page-nav { max-width: 780px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }
nav.page-nav a { color: var(--blue); text-decoration: none; }
nav.page-nav a:hover { text-decoration: underline; }
.he, .en { max-width: 780px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 40px; }
.he { direction: rtl; text-align: right; }
.en { direction: ltr; text-align: left; border-top: 1px solid var(--line); }
.section-label { font-size: 14px; font-weight: 700; color: var(--blue); margin: 16px 0 4px; }
.he h2, .en h2 { font-size: 24px; font-weight: 800; margin: 36px 0 10px; }
.he h3, .en h3 { font-size: 19px; font-weight: 700; margin: 24px 0 8px; }
.he p, .en p { margin: 0 0 14px; }
.he ul, .he ol, .en ul, .en ol { margin: 0 0 14px; padding-inline-start: 22px; }
.he li, .en li { margin-bottom: 6px; }
.updated { color: var(--muted); font-size: 14px; }
footer.page-foot { border-top: 1px solid var(--line); padding: 28px clamp(16px, 4vw, 40px); text-align: center; font-size: 14px; color: var(--muted); }
footer.page-foot a { color: var(--ink); }

/* Article pages (about, halacha guide) */
.page-h1 { font-size: clamp(32px, 4vw, 46px); font-weight: 800; }
.crumbs { padding-top: 28px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.article { padding: 18px 0 8px; font-size: 18px; line-height: 1.75; }
.article h1 { font-size: clamp(32px, 4vw, 46px); font-weight: 800; margin-bottom: 12px; }
.article-lead { font-size: 20px; color: var(--muted); margin-bottom: 8px; }
.article h2 { font-size: 24px; font-weight: 800; margin: 40px 0 12px; }
.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 16px; padding-inline-start: 22px; }
.article h3 { font-size: 19px; font-weight: 700; margin: 26px 0 8px; }
.article .updated { margin-bottom: 8px; }
.article li { margin-bottom: 8px; }
.article-note { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.en-about { direction: ltr; text-align: left; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.en-about h2 { margin-top: 0; }
.article-cta { margin: 36px 0; padding: 28px; border-radius: var(--radius); background: var(--blue-soft); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.article-cta h2 { font-size: 22px; font-weight: 800; }
.article-cta p { color: var(--muted); flex-basis: 100%; order: 2; }
.topics-nav { margin: 8px 0 56px; }
.topics-nav h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.topics-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.topics-nav a { text-decoration: none; font-weight: 500; }
.topics-nav a:hover { text-decoration: underline; }

/* Small screens */
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .site-nav a:not(.btn):not(.lang-switch) { display: none; }
  .site-nav { gap: 12px; }
  .timeline li { grid-template-columns: 1fr; }
  .facts, .topics { grid-template-columns: 1fr; }
  .day { min-height: 50px; padding: 5px; }
  .day .h { font-size: 14px; }
  .day .g { display: none; }
  .day .t { font-size: 10px; }
}
@media (max-width: 520px) {
  .site-nav .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Calculator */
.calc { padding: 8px 0 72px; }
.calc h1 { font-size: clamp(32px, 4vw, 46px); font-weight: 800; }
.calc .lead { margin-top: 12px; }
.calc-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: clamp(24px, 4vw, 56px); margin-top: 32px; align-items: start; }
.calc-form { display: grid; gap: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; }
.calc-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.calc-form legend, .calc-form .label { font-weight: 700; font-size: 15px; padding: 0; margin-bottom: 4px; }
.calc-form .hint { font-size: 13px; color: var(--muted); }
.date-row { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; }
.calc-form select, .calc-form input[type="date"] {
  width: 100%; font: 500 16px/1.2 var(--font); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 10px; min-height: 46px;
}
.calc-form select:focus-visible, .calc-form input:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 11px 8px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; font-size: 15px; cursor: pointer; }
.seg input:checked + span { background: var(--blue); color: #fff; box-shadow: none; }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.calc-results dl { margin: 0; display: grid; gap: 0; }
.calc-results dl div { padding: 16px 0; border-top: 1px solid var(--line); }
.calc-results dl div:last-child { border-bottom: 1px solid var(--line); }
.calc-results dt { font-size: 14px; font-weight: 700; color: var(--blue); }
.calc-results dd { margin: 4px 0 0; font-size: 18px; font-weight: 500; }
.calc-note { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--blue-soft); font-size: 15px; }
.calc-assume { margin-top: 14px; font-size: 14px; color: var(--muted); }
#r-boards { display: grid; gap: 14px; margin-top: 22px; }
.calc-explain { max-width: 780px; }
.calc-explain h2 { font-size: 26px; font-weight: 800; margin: 44px 0 12px; }
.calc-explain p { margin: 0 0 14px; color: var(--ink); }
@media (max-width: 860px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* Guides: quoted halacha passages */
.article blockquote { margin: 18px 0 22px; padding: 18px 20px; background: var(--surface); border-radius: 12px; }
.article blockquote p, .article blockquote li { margin: 0 0 8px; }
.article blockquote ul { margin: 0; padding-inline-start: 20px; }
.article blockquote cite { display: block; margin-top: 10px; font-style: normal; font-size: 14px; color: var(--muted); }
.boards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0 24px; }
.guide-list { list-style: none; margin: 18px 0 0; padding: 0; }
.guide-list li { border-top: 1px solid var(--line); }
.guide-list li:last-child { border-bottom: 1px solid var(--line); }
.guide-list a { display: block; padding: 16px 0; font-weight: 700; font-size: 18px; text-decoration: none; color: var(--ink); }
.guide-list a:hover { color: var(--blue); }
@media (max-width: 860px) { .boards-2 { grid-template-columns: 1fr; } }
.boards-2 .day .g { display: none; }
