/* סידור יהודי — עיצוב רך, כמו האפליקציה: כחול לילה וזהב, כרטיסים מעוגלים, מימין לשמאל */
:root {
  --bg: #eef1f7; --bg2: #e3e8f2; --card: #ffffff; --text: #1b1f2a; --muted: #5b6475;
  --accent: #7a5a00; --gold: #c9a227; --navy: #14213d; --line: #dfe4ee; --past: #9aa3b2;
  --holy: #fbf3dc; --today: #e8eefc; --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1222; --bg2: #101a30; --card: #141e36; --text: #eef1f7; --muted: #a9b2c4;
    --accent: #e3c766; --gold: #e3c766; --navy: #0b1222; --line: #26324f; --past: #5d6880;
    --holy: #2a2410; --today: #1d2b4f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: linear-gradient(180deg, var(--bg2), var(--bg)) fixed; color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Arial Hebrew", Arial, sans-serif; line-height: 1.55;
}
a { color: var(--accent); }
a:focus-visible, select:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip { position: absolute; right: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.skip:focus { right: 8px; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding: 10px 16px; background: var(--navy); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.brand { color: #fff; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { color: #dfe6ff; text-decoration: none; padding: 6px 10px; border-radius: 999px; font-size: .95rem; }
.top nav a[aria-current="page"], .top nav a:hover { background: rgba(255,255,255,.14); color: #fff; }

main, .app-cta, .foot, .ded { max-width: 1600px; margin: 0 auto; padding: 0 16px; }
.ded { max-width: 1568px; }
main { padding-top: 12px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(20,33,61,.06); border: 1px solid var(--line);
}
h1 { font-size: 1.6rem; margin: .2em 0; } h2 { font-size: 1.1rem; margin: 1em 0 .4em; color: var(--accent); }
.muted { color: var(--muted); margin: 0; } .small { font-size: .85rem; color: var(--muted); }
.hero h1 { font-size: 1.9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tags span { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--accent); font-weight: 700;
  padding: 2px 10px; border-radius: 999px; font-size: .9rem; }

.chooser { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.chooser label { display: flex; gap: 6px; align-items: center; font-size: .9rem; color: var(--muted); }
select, input[type=date], button {
  font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px 10px; min-height: 40px;
}

.next { border: 2px solid var(--gold); }
.next-name { font-size: 1.25rem; font-weight: 800; margin: 2px 0; }
.next-time { margin: 0; } .next-time time { font-size: 2rem; font-weight: 900; color: var(--accent); direction: ltr; }

table.zt { width: 100%; border-collapse: collapse; }
.zt th, .zt td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: right; font-weight: 500; }
.zt td { text-align: left; font-variant-numeric: tabular-nums; font-weight: 700; direction: ltr; }
.zt tr.past th, .zt tr.past td { color: var(--past); }
.zt tr.now th, .zt tr.now td { color: var(--accent); }
.zt.wide td { text-align: center; } .zt.wide thead th { color: var(--muted); font-size: .85rem; }

.shabbat .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; margin-top: 6px; }
.shabbat .two div { background: var(--holy); border-radius: 14px; padding: 10px; }
.shabbat strong { display: block; font-size: 1.7rem; color: var(--accent); direction: ltr; }

.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0; }
.daynav a { text-decoration: none; font-weight: 700; } .daynav h1 { font-size: 1.1rem; text-align: center; }

table.cal { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.cal td { background: var(--bg); border-radius: 10px; vertical-align: top; height: 74px; padding: 0; }
.cal td.empty { background: transparent; }
.cal td.holy { background: var(--holy); } .cal td.today { outline: 2px solid var(--gold); }
.cal a { display: flex; flex-direction: column; height: 100%; padding: 4px 5px; color: var(--text); text-decoration: none; }
.cal .g { font-weight: 800; } .cal .h { font-size: .8rem; color: var(--accent); }
.cal .l, .cal .x { font-size: .68rem; color: var(--muted); line-height: 1.2; }

ul.cities { columns: 3 140px; padding: 0; list-style: none; } ul.cities li { padding: 3px 0; }
.prose p, .prose li { max-width: 62ch; }

.ded { margin-top: 10px; text-align: center; font-weight: 700; color: var(--accent);
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; transition: opacity .4s; }
.app-cta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.app-cta > div { flex: 1 1 260px; font-size: .95rem; }
.btn { display: inline-block; background: var(--navy); color: #fff; text-decoration: none; font-weight: 700;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--gold); }
.foot { padding: 20px 16px 40px; text-align: center; font-size: .9rem; }
@media (max-width: 420px) { h1 { font-size: 1.35rem; } .hero h1 { font-size: 1.5rem; } .cal td { height: 64px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.search { display: flex; gap: 8px; align-items: center; margin: 6px 0 4px; color: var(--muted); }
.search input { flex: 1; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }

/* ── מסך רחב: כל רוחב הדף ─────────────────────────────────────────────── */
.layout { display: grid; gap: 0 18px; }
.sections { display: grid; gap: 0 28px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.sections .sec h2 { margin-top: .6em; }
.cols { display: grid; gap: 0 28px; }
.top { padding-inline: max(16px, calc((100% - 1600px) / 2 + 16px)); }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(300px, 380px) 1fr; align-items: start; }
  .layout .side { position: sticky; top: 72px; }
  .cols { grid-template-columns: 1fr 1fr; align-items: start; }
  .cal td { height: 104px; }
  .cal .h { font-size: .9rem; } .cal .l, .cal .x { font-size: .78rem; }
  .hero h1 { font-size: 2.1rem; }
}

/* ── סידור וספרים ─────────────────────────────────────────────────────── */
.top nav { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; }
.top nav a { white-space: nowrap; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tile { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--bg);
  color: var(--text); text-decoration: none; border: 1px solid var(--line); }
.tile:hover { border-color: var(--gold); }
.tile .em { font-size: 1.5rem; line-height: 1.2; }
.tile.dim { opacity: .6; }
.badge { display: inline-block; margin-inline-start: 6px; font-size: .75rem; font-weight: 800; padding: 1px 8px;
  border-radius: 999px; background: color-mix(in srgb, var(--gold) 25%, transparent); color: var(--accent); }
.badge.now { background: var(--gold); color: #1b1f2a; }
.quick, .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.quick a, .chips a { text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.chips.num a { min-width: 3.2em; text-align: center; padding: 6px 8px; }
.quick a:hover, .chips a:hover { border-color: var(--gold); }
h3 { font-size: 1rem; margin: .8em 0 .2em; color: var(--muted); }
ul.notes { margin: 0; padding: 0; list-style: none; } ul.notes li { padding: 4px 0; border-bottom: 1px solid var(--line); }
ul.notes li:last-child { border: 0; }
.hint { background: var(--holy); border-radius: 12px; padding: 8px 10px; margin: 8px 0 0; }
.toc ol { margin: 0; padding-inline-start: 1.4em; max-height: 50vh; overflow: auto; }
.toc li { padding: 2px 0; } .toc a { text-decoration: none; }
.toc.big ol { max-height: none; font-size: 1.15rem; } .toc.big li { padding: 6px 0; }
.tools .row { display: flex; gap: 8px; margin: 6px 0; } .tools button { min-width: 56px; font-weight: 800; cursor: pointer; }

/* טקסט התפילה — גופן עברי עם ניקוד, גודל לפי בחירה (--fs) */
:root { --fs: 1.3rem; --fw: #8b1e2d; }
@media (prefers-color-scheme: dark) { :root { --fw: #f0a64a; } }
.siddur-text { font-family: "Taamey Frank CLM", "Frank Ruehl CLM", "SBL Hebrew", "David", "Times New Roman", serif;
  font-size: var(--fs); line-height: 1.9; }
.siddur-text p { margin: .45em 0; white-space: pre-line; }
.siddur-text h2 { font-family: system-ui, "Segoe UI", Arial, sans-serif; font-size: 1.05rem; margin: 1.4em 0 .3em;
  padding-bottom: 4px; border-bottom: 2px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.siddur-text .tsec:first-child h2 { margin-top: 0; }
.siddur-text .note { font-family: system-ui, "Segoe UI", Arial, sans-serif; font-size: .78em; color: var(--muted); line-height: 1.5; }
.siddur-text .note.h { color: var(--accent); font-weight: 700; }
.siddur-text .ins { background: color-mix(in srgb, var(--gold) 14%, transparent); border-inline-start: 4px solid var(--gold);
  border-radius: 10px; padding: 6px 12px; margin: 8px 0; }
.siddur-text .ins p { margin: .2em 0; font-weight: 600; }
.ins-l { font-family: system-ui, Arial, sans-serif; font-size: .72em; font-weight: 800; color: var(--accent); }
.siddur-text mark { background: color-mix(in srgb, var(--gold) 28%, transparent); color: inherit; border-radius: 4px; }
.siddur-text .fw { color: var(--fw); font-weight: 700; }
body.no-fw .siddur-text .fw { color: inherit; font-weight: inherit; }
.chz { border: 1px dashed var(--line); border-radius: 12px; padding: 4px 12px; margin: 8px 0; }
.chz summary { cursor: pointer; font-family: system-ui, Arial, sans-serif; font-size: .8em; color: var(--accent); font-weight: 700; padding: 4px 0; }
.book .vn { font-family: system-ui, Arial, sans-serif; font-size: .7em; color: var(--accent); font-weight: 800; }
.credit { margin-top: 8px; }
@media (min-width: 900px) { .layout .side { max-height: calc(100vh - 90px); overflow: auto; } }
.toc summary { cursor: pointer; list-style: none; } .toc summary::-webkit-details-marker { display: none; }
.toc summary h2 { display: inline; margin: 0; } .toc summary::after { content: " ▾"; color: var(--accent); }
.toc[open] summary::after { content: " ▴"; } .toc ol { margin-top: 8px; }
.tools .row { align-items: center; flex-wrap: wrap; } .tools .row .muted { margin-inline-end: auto; }
.tools label { display: block; margin-top: 4px; }

/* ── כפתור ותפריט נגישות ───────────────────────────────────────────────── */
.a11y-btn { position: fixed; left: 16px; bottom: 16px; z-index: 30; width: 54px; height: 54px; border-radius: 50%;
  background: #1a4fd6; color: #fff; border: 3px solid #fff; font-size: 1.7rem; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); padding: 0; min-height: 0; }
.a11y-btn:hover { background: #123ca8; }
.a11y-panel { position: fixed; left: 16px; bottom: 80px; z-index: 31; width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 110px); overflow: auto; background: var(--card); color: var(--text);
  border: 2px solid #1a4fd6; border-radius: 18px; padding: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.35); font-size: 1rem; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; }
.a11y-head h2 { margin: 0; color: var(--text); }
.a11y-head button { min-height: 36px; width: 40px; padding: 0; cursor: pointer; }
.a11y-size { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.a11y-size span { margin-inline-end: auto; font-weight: 700; }
.a11y-size button { width: 52px; font-weight: 800; cursor: pointer; }
.a11y-size output { min-width: 3.4em; text-align: center; font-variant-numeric: tabular-nums; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-grid button { text-align: start; cursor: pointer; font-size: .92rem; min-height: 48px; }
.a11y-grid button[aria-pressed="true"] { background: #1a4fd6; color: #fff; border-color: #1a4fd6; font-weight: 700; }
.a11y-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.a11y-foot button { cursor: pointer; }

html.a11y-contrast {
  --bg: #000; --bg2: #000; --card: #000; --text: #fff; --muted: #fff; --accent: #ffeb3b; --gold: #ffeb3b;
  --navy: #000; --line: #fff; --past: #c8c8c8; --holy: #1a1a00; --today: #000; --fw: #7fdbff;
}
html.a11y-contrast body { background: #000; }
html.a11y-contrast .card, html.a11y-contrast .tile, html.a11y-contrast select, html.a11y-contrast button,
html.a11y-contrast input { border-color: #fff !important; box-shadow: none; }
html.a11y-contrast a { color: #ffeb3b; }
html.a11y-contrast .top { border-bottom: 2px solid #fff; }
html.a11y-gray main, html.a11y-gray .top, html.a11y-gray .ded, html.a11y-gray .app-cta, html.a11y-gray .foot { filter: grayscale(1); }
html.a11y-links a { text-decoration: underline !important; text-underline-offset: 3px; text-decoration-thickness: 2px; }
html.a11y-font body, html.a11y-font .siddur-text, html.a11y-font .siddur-text h2 {
  font-family: Arial, "Segoe UI", Helvetica, sans-serif !important; letter-spacing: .01em; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-cursor, html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M4 3 L4 40 L14 31 L21 46 L28 43 L21 28 L35 28 Z' fill='black' stroke='white' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, auto !important; }
html.a11y-focus :focus { outline: 4px solid #ffeb3b !important; outline-offset: 3px !important; box-shadow: 0 0 0 8px #000 !important; }
@media print { .a11y-btn, .a11y-panel { display: none !important; } }
