/* לוח הסופרים – עיצוב אחד לכל האתר. בלי גופנים חיצוניים ובלי תמונות: האתר צריך לעבור בסינונים ולהיטען מהר גם בחיבור חלש. */
:root {
  --bg: #f6f5f2; --card: #fff; --ink: #1d2433; --muted: #5b6475; --line: #e3e1db;
  --brand: #1f6f5c; --brand-ink: #fff; --brand-soft: #e3f1ec;
  --warn-bg: #fff4cc; --warn-ink: #6b4d00; --rt-bg: #fde4e1; --rt-ink: #8a1f12;
  --miss-bg: #ececec; --miss-ink: #444; --danger: #b42318; --radius: 12px;
  /* תוכן לנשים: סגול-שזיף רך, כדי שיהיה ברור במבט אחד מה מוצג רק לנשים */
  --women: #8a3b6e; --women-soft: #f5e6ef;
  color-scheme: light dark;
}
/* כהה: אוטומטית לפי הטלפון, אלא אם המשתמש בחר בהיר. או בבחירה מפורשת. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171c; --card: #1d2128; --ink: #e9ecf1; --muted: #a3abb8; --line: #2d333d;
    --brand: #5cc3a6; --brand-ink: #0d1f1a; --brand-soft: #1b3530;
    --warn-bg: #3d3212; --warn-ink: #f3d98a; --rt-bg: #42201c; --rt-ink: #ffb4a8;
    --miss-bg: #2a2e35; --miss-ink: #cfd4dc; --danger: #ff8a7a;
    --women: #e7a3cc; --women-soft: #3a2433;
  }
}
:root[data-theme="dark"] {
    --bg: #14171c; --card: #1d2128; --ink: #e9ecf1; --muted: #a3abb8; --line: #2d333d;
    --brand: #5cc3a6; --brand-ink: #0d1f1a; --brand-soft: #1b3530;
    --warn-bg: #3d3212; --warn-ink: #f3d98a; --rt-bg: #42201c; --rt-ink: #ffb4a8;
    --miss-bg: #2a2e35; --miss-ink: #cfd4dc; --danger: #ff8a7a;
    --women: #e7a3cc; --women-soft: #3a2433;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
/* גופנים מקומיים מפרויקט Culmus (GPL עם חריגת גופנים – מותר להטמיע באתר). בלי שרת חיצוני, כך שלא מפריעים לסינונים.
   שם האתר בכתב סת"ם אשכנז (כתב אשורי), כותרות בכתר (אותיות דפוס של תנ"ך). אם לא נטענו – הגופן הרגיל. */
@font-face { font-family: "StamAshkenaz"; font-display: swap; src: url(/static/fonts/stam-ashkenaz.woff2) format("woff2"); }
@font-face { font-family: "Keter"; font-weight: 700; font-display: swap; src: url(/static/fonts/keter-bold.woff2) format("woff2"); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }

/* כותרת וניווט */
.top { display: flex; align-items: center; gap: 8px; padding: 14px 0 6px; }
.logo { font-size: 1.35rem; font-weight: 800; color: var(--ink); text-decoration: none; margin-inline-end: auto; }
.logo { display: inline-flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.logo img { flex: none; border-radius: 8px; }
.user-links { display: flex; flex: none; }
@media (max-width: 400px) { .logo small { font-size: .72rem; } .logo { gap: 8px; } .logo > span { font-size: 1.85rem; } }
.logo small { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.top a.user { font-size: .9rem; min-height: 36px; display: inline-flex; align-items: center; padding: 0 6px; }
/* תפריט: אייקון מעל השם, כמו באפליקציה – מזוהה מהר בטלפון */
nav.main { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; }
nav.main a { flex: 1 1 0; min-width: 0; font-weight: 600; font-size: .82rem; text-decoration: none; color: var(--muted); padding: 8px 2px 7px; min-height: 56px; border-bottom: 3px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
nav.main .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
nav.main a[aria-current="page"] { color: var(--brand); border-color: var(--brand); }

/* חיפוש */
form.search { display: flex; gap: 8px; margin: 4px 0 8px; }
form.search input { flex: 1; min-width: 0; }
input, select, textarea { font: inherit; font-size: 1rem; padding: 11px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { min-height: 120px; resize: vertical; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 8px; }
.chip { font-size: .9rem; min-height: 36px; padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.chip[aria-current="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* כרטיסים ושאלות */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 10px; }
.pad { padding: 14px; }
details.card > summary { list-style: none; cursor: pointer; padding: 13px 14px; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; min-height: 44px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; margin-inline-start: auto; color: var(--muted); font-weight: 400; }
details.card[open] > summary::after { content: "–"; }
.answer { padding: 0 14px 14px; overflow-wrap: anywhere; }
.answer .txt { white-space: pre-line; }
.meta { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.meta a { color: var(--muted); }
.badge { flex: none; font-size: .75rem; font-weight: 600; border-radius: 6px; padding: 1px 7px; margin-top: 2px; }
.b-var { background: var(--warn-bg); color: var(--warn-ink); }
.b-rt { background: var(--rt-bg); color: var(--rt-ink); }
.b-missing, .b-season, .b-off { background: var(--miss-bg); color: var(--miss-ink); }
.b-ok { background: var(--brand-soft); color: var(--brand); }
.contacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
a.tel { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 5px 11px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.answer a.tel { min-height: 0; padding: 0 5px; font-size: inherit; }
.masked { color: var(--muted); font-size: .9em; }
.notice { border-inline-start: 4px solid var(--rt-ink); background: var(--rt-bg); color: var(--rt-ink); padding: 10px 12px; border-radius: 8px; margin: 0 0 12px; }
.notice.soft { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.notice.ok { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.notice.err { border-color: var(--danger); background: var(--rt-bg); color: var(--rt-ink); }
h1 { font-size: 1.35rem; margin: 6px 0 12px; }
h1 { font-family: "Keter", system-ui, sans-serif; font-weight: 700; font-size: 1.7rem; line-height: 1.2; }
.logo > span { font-family: "StamAshkenaz", "Keter", system-ui, sans-serif; font-weight: 400; font-size: 2rem; line-height: 1.15; }
.logo small { font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif; letter-spacing: 0; line-height: 1.3; margin-top: 2px; }
h2 { font-size: 1.05rem; margin: 18px 0 8px; color: var(--muted); }

/* ספר טלפונים */
.row { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--line); }
.row:first-child, summary + .row { border-top: 0; }
/* שורה שכולה קישור (רשימת נושאים): בלי קו תחתון על כל הטקסט, רק הכותרת בצבע קישור */
a.row { color: var(--ink); text-decoration: none; min-height: 44px; }
a.row strong { color: var(--brand); }
a.row:hover strong { text-decoration: underline; }
.card.women a.row strong, .women-list a.row strong { color: var(--women); }
.notice.women-note { border-color: var(--women); background: var(--women-soft); }
.row .n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .k { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.nw { white-space: nowrap; }
.b-women { background: var(--women-soft); color: var(--women); }
.card.women { border-inline-start: 4px solid var(--women); }
.minyan-calls { margin: 0 0 14px; }
/* טופס איסוף מניין: שדות שמופיעים לפי הבחירה – ב-CSS בלבד (בלי סקריפט). דפדפן ישן מציג את כולם */
@supports selector(:has(*)) {
  .minyan-form .if-other, .minyan-form .if-syn, .minyan-form .if-home { display: none; }
  .minyan-form:has(#purpose option[value="other"]:checked) .if-other { display: block; }
  .minyan-form:has(input[name="where"][value="syn"]:checked) .if-syn { display: block; }
  .minyan-form:has(input[name="where"][value="home"]:checked) .if-home { display: grid; }
}
.addr { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.big { font-size: 1.1rem; margin: 6px 0 2px; }
.study-search .actions > div { flex: 1 1 140px; }
@supports not selector(:has(*)) { .minyan-form .addr { display: grid; } }
.minyan-calls h2 { margin: 0; margin-inline-end: auto; }
.card.minyan { border-inline-start: 4px solid var(--brand); }
.card.minyan.done { background: var(--brand-soft); }
.card.minyan .big { font-size: 1.15rem; margin: 6px 0 2px; }
.card.women .who { background: var(--women-soft); color: var(--women); }
.viewas { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-inline-start-color: var(--danger); }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.byline img { flex: none; }
details.grp > summary { padding: 12px 14px; font-weight: 600; cursor: pointer; min-height: 44px; }
details.grp > summary span { color: var(--muted); font-weight: 400; }

/* מדורים */
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.areas .card { margin: 0; }
.areas h3 { margin: 0 0 4px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
/* דף המדורים: אריחים, שניים בשורה בטלפון. אייקון בריבוע רך, וכל האריח לחיץ */
.areas.tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card.area { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.card.area h3 { flex-direction: column; align-items: flex-start; gap: 10px; font-size: 1rem; line-height: 1.3; }
.card.area h3 a { color: var(--ink); text-decoration: none; }
.card.area h3 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.card.area:hover { border-color: var(--brand); }
.card.area:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
.card.area p { font-size: .84rem; line-height: 1.45; }
.card.area .who { margin-top: auto; align-self: flex-start; }
.card.area .ic { width: 26px; height: 26px; padding: 9px; box-sizing: content-box; border-radius: 12px; background: var(--brand-soft); flex: none; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card.area.women .ic { stroke: var(--women); background: var(--women-soft); }
.card.area.women:hover { border-color: var(--women); }
.areas p { margin: 0; color: var(--muted); font-size: .9rem; }
.who { display: inline-block; margin-top: 8px; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); }
.who.lock { background: var(--warn-bg); color: var(--warn-ink); }

/* טפסים וכפתורים */
.form { display: grid; gap: 14px; max-width: 460px; }
.form label { font-weight: 600; display: block; margin-bottom: 4px; }
.form .hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; min-height: 36px; }
.check input { width: 20px; height: 20px; }
.btn { font: inherit; font-weight: 600; min-height: 44px; padding: 8px 18px; border-radius: 10px; border: 0; background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.sec { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--card); color: var(--danger); border: 1px solid var(--danger); }
.btn-sm { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }

/* ניהול */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: start; padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; }
th { border-top: 0; color: var(--muted); font-weight: 600; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 8px; }
.stat { display: block; text-decoration: none; color: var(--ink); }
.stat b { display: block; font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .9rem; }

footer { color: var(--muted); font-size: .85rem; margin-top: 32px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
footer a { color: var(--muted); min-height: 36px; display: inline-flex; align-items: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.mt { margin-top: 16px; }
.mt-s { margin-top: 10px; }
select.narrow { width: auto; padding: 6px 10px; }

/* בחירת תצוגה בתחתית העמוד */
.theme { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-inline-start: auto; }
.theme button { font: inherit; font-size: .85rem; min-height: 36px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.theme button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* עדכונים */
.update .txt { white-space: pre-line; overflow-wrap: anywhere; }
.update.urgent { border-inline-start: 4px solid var(--rt-ink); }
.update strong { overflow-wrap: anywhere; }

fieldset.plain { border: 0; padding: 0; margin: 0; display: grid; gap: 2px; }
fieldset.plain legend { font-weight: 600; padding: 0; margin-bottom: 4px; }


/* לוחות מודעות */
.post-title { font-size: 1rem; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.price { font-weight: 700; color: var(--brand); }
.card .txt { white-space: pre-line; overflow-wrap: anywhere; }
input.narrow-input { width: auto; flex: 1; min-width: 140px; padding: 6px 10px; }

/* בתי כנסת */
.row .time { flex: none; min-width: 4.5em; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); }
a.syn-card { text-decoration: none; color: var(--ink); display: block; }
a.syn-card:hover h3 { text-decoration: underline; }

/* התפילה הקרובה */
.zmanim { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .92rem; }
.zmanim b { color: var(--ink); }
.hero { border-inline-start: 4px solid var(--brand); }
.hero-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 2px 0 6px; }
.hero-prayer { font-size: 1.3rem; }
.hero-time { font-size: 1.6rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }

/* נושאים ותתי-נושאים */
.sub-chips { padding-inline-start: 12px; border-inline-start: 3px solid var(--line); }
details.subtopics { border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; margin: 4px 0; }
details.subtopics > summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; gap: 6px; }
details.subtopics .sub { padding-inline-start: 22px; display: grid; gap: 2px; }

/* כפתור ווטסאפ ליד נייד */
a.wa { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; margin-inline-start: 4px; vertical-align: middle; }
.answer a.wa { min-width: 28px; min-height: 28px; }
.phone-pair { display: inline-flex; align-items: center; }
