/* Shared by every page: self-hosted fonts, day/night theme, accessibility toolbar. */

/* Heebo & Rubik — SIL Open Font License 1.1 (see /assets/webfonts/OFL.txt) */
@font-face { font-family: 'Heebo'; src: url('/assets/webfonts/heebo-hebrew.woff2') format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; src: url('/assets/webfonts/heebo-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; src: url('/assets/webfonts/rubik-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── theme tokens (page :root sets the light palette; these add/override) ── */
:root {
  color-scheme: light;
  --card: #fff;
  --deep: #15181F;
  --nav-glass: rgba(244, 239, 230, .9);
  --accent-btn: #C2441C;
  --accent-btn-hover: #A63A18;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111318; --paper-2: #181B22; --card: #1B1E26;
    --ink: #F1ECE3; --deep: #0B0D11; --navy: #151C2E;
    --muted: #A3A7B0; --line: rgba(241, 236, 227, .14);
    --accent-ink: #F08A62; --accent-soft: #3A2219;
    --nav-glass: rgba(17, 19, 24, .88);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111318; --paper-2: #181B22; --card: #1B1E26;
  --ink: #F1ECE3; --deep: #0B0D11; --navy: #151C2E;
  --muted: #A3A7B0; --line: rgba(241, 236, 227, .14);
  --accent-ink: #F08A62; --accent-soft: #3A2219;
  --nav-glass: rgba(17, 19, 24, .88);
}

/* ── basics ── */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
.skip-link {
  position: fixed; top: 10px; inset-inline-start: 10px; z-index: 200;
  background: var(--ink); color: var(--paper); font: 700 16px/1 var(--body);
  padding: 14px 20px; border-radius: 12px; text-decoration: none;
  transform: translateY(-160%); transition: transform .2s ease;
}
.skip-link:focus { transform: none; }

/* ── day / night toggle ── */
.theme-btn {
  width: 44px; height: 44px; border-radius: 12px; cursor: pointer; flex: none;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  display: inline-grid; place-items: center; padding: 0;
}
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

/* ── accessibility toolbar ── */
.a11y-btn {
  position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 70;
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--paper); cursor: pointer;
  background: #1A4FA8; color: #fff; display: grid; place-items: center; padding: 0;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5);
}
.a11y-btn svg { width: 30px; height: 30px; }
.a11y-panel {
  position: fixed; bottom: 82px; inset-inline-end: 18px; z-index: 71;
  width: min(320px, calc(100vw - 36px)); max-height: calc(100vh - 110px); overflow-y: auto;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); padding: 18px;
  font: 400 16px/1.4 var(--body);
}
.a11y-panel[hidden] { display: none; }
.a11y-panel h2 { font: 700 19px/1.2 var(--body); margin: 0 0 14px; display: flex; justify-content: space-between; align-items: center; }
.a11y-close { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; font-size: 20px; line-height: 1; }
.a11y-size { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.a11y-size div { display: flex; gap: 8px; align-items: center; }
.a11y-size button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: inherit; font: 700 17px/1 var(--body); cursor: pointer; }
.a11y-size output { min-width: 3.2em; text-align: center; font-weight: 700; }
.a11y-opt {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 48px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: inherit; font: 500 16px/1.3 var(--body); cursor: pointer; text-align: start;
}
.a11y-opt::after {
  content: ''; flex: none; width: 40px; height: 24px; border-radius: 99px;
  background: var(--line); box-shadow: inset 0 0 0 1px var(--line);
  background-image: radial-gradient(circle at 12px 12px, var(--paper) 8px, transparent 9px);
}
.a11y-opt[aria-pressed="true"]::after { background-color: #1A4FA8; background-image: radial-gradient(circle at 28px 12px, #fff 8px, transparent 9px); }
[dir="rtl"] .a11y-opt::after { background-image: radial-gradient(circle at 28px 12px, var(--paper) 8px, transparent 9px); }
[dir="rtl"] .a11y-opt[aria-pressed="true"]::after { background-image: radial-gradient(circle at 12px 12px, #fff 8px, transparent 9px); }
.a11y-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.a11y-foot a { color: var(--accent-ink); font-weight: 700; }
.a11y-reset { border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 10px; padding: 10px 14px; font: 500 15px/1 var(--body); cursor: pointer; }
@media (max-width: 640px) {
  .a11y-btn { width: 48px; height: 48px; bottom: 23px; }
  .a11y-btn svg { width: 26px; height: 26px; }
}

/* ── accessibility modes (set on <html>) ── */
html.a11y-size-1 body > main, html.a11y-size-1 body > footer { zoom: 1.12; }
html.a11y-size-2 body > main, html.a11y-size-2 body > footer { zoom: 1.25; }
html.a11y-size-3 body > main, html.a11y-size-3 body > footer { zoom: 1.4; }

html.a11y-contrast.a11y-contrast {
  --muted: var(--ink);
  --line: color-mix(in srgb, var(--ink) 55%, transparent);
  --on-dark-muted: var(--on-dark);
}
html.a11y-contrast .tools-track span { opacity: 1; }
html.a11y-contrast img, html.a11y-contrast video { filter: contrast(1.08); }

html.a11y-links a:not(.btn):not(.skip-link) { text-decoration: underline !important; text-underline-offset: 3px; text-decoration-thickness: 2px; }
html.a11y-links a.btn { outline: 2px solid currentColor; outline-offset: 2px; }

html.a11y-readable.a11y-readable { --display: Arial, 'Arial Hebrew', sans-serif; --body: Arial, 'Arial Hebrew', sans-serif; }
html.a11y-readable body { letter-spacing: .01em; word-spacing: .06em; }

html.a11y-still { scroll-behavior: auto !important; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-still .reveal { opacity: 1 !important; transform: none !important; }
