/* Shared accessibility layer: skip link, focus, preferences panel and the classes it toggles. */
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -100px; z-index: 100;
  background: #12261A; color: #fff; padding: 12px 18px; font: 700 16px/1.2 system-ui, sans-serif;
}
.skip-link:focus { top: 12px; }

.lang-toggle {
  font: 700 15px/1 "Assistant", system-ui, sans-serif; background: none; color: inherit;
  border: 2px solid currentColor; padding: 8px 14px; cursor: pointer; min-height: 44px; min-width: 44px;
}
@media (hover: hover) { .lang-toggle:hover { background: rgb(255 255 255 / .12); } }

/* The trigger sits at the far end of the reading direction (left in Hebrew), clear of where lines start,
   and above the iPhone home indicator. */
.a11y-trigger {
  position: fixed; inset-inline-end: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 50; width: 48px; height: 48px;
  display: grid; place-items: center; border: 2px solid #F3F1EC; border-radius: 50%;
  background: #12261A; color: #F3F1EC; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.a11y-trigger:focus-visible, .a11y-panel button:focus-visible, .a11y-panel a:focus-visible { outline: 3px solid #B8964E; outline-offset: 3px; }
.a11y-panel {
  position: fixed; inset-inline-end: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 51; width: min(320px, calc(100vw - 28px));
  max-height: calc(100vh - 100px); overflow: auto;
  background: #fff; color: #12261A; padding: 18px; display: grid; gap: 8px;
  box-shadow: 0 10px 40px rgb(0 0 0 / .3); font: 400 16px/1.4 "Assistant", system-ui, sans-serif;
}
.a11y-panel[hidden] { display: none; }
.a11y-panel h2 { font: 800 20px/1.2 "Assistant", system-ui, sans-serif; margin: 0 0 4px; letter-spacing: 0; color: #12261A; }
.a11y-opt {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  text-align: start; font: 600 16px/1.2 "Assistant", system-ui, sans-serif; padding: 12px 14px; min-height: 48px;
  background: #F3F1EC; color: #12261A; border: 2px solid transparent; cursor: pointer;
}
.a11y-opt[aria-pressed="true"] { background: #1F4029; color: #fff; }
.a11y-check { visibility: hidden; }
.a11y-opt[aria-pressed="true"] .a11y-check { visibility: visible; }
.a11y-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; }
.a11y-link {
  background: none; border: 0; padding: 0; min-height: 44px; display: inline-flex; align-items: center;
  font: 700 15px/1.2 "Assistant", system-ui, sans-serif; color: #1F4029; text-decoration: underline; cursor: pointer;
}
.a11y-status { margin: 0; font-size: 14px; min-height: 1.2em; }

/* ---------- What the preferences do ---------- */
/* Larger text: scales everything in the page content (headings, buttons, figures), not only body text. */
html.a11y-text header, html.a11y-text main, html.a11y-text footer { zoom: 1.25; }

/* High contrast: a real palette swap on the content only, so fixed elements (the panel) keep their place. */
html.a11y-contrast { --ground: #fff; --sand: #fff; --gold: #000; --gold-deep: #000; --green: #000; --ink: #000; }
html.a11y-contrast header, html.a11y-contrast main, html.a11y-contrast footer { background: #fff !important; color: #000 !important; }
html.a11y-contrast main *, html.a11y-contrast header *, html.a11y-contrast footer * {
  background-color: transparent !important; color: #000 !important; border-color: #000 !important; text-shadow: none !important;
}
html.a11y-contrast main a, html.a11y-contrast header a, html.a11y-contrast footer a { color: #0000C8 !important; text-decoration: underline !important; }
html.a11y-contrast .btn, html.a11y-contrast .chip, html.a11y-contrast .lang-toggle, html.a11y-contrast details, html.a11y-contrast li, html.a11y-contrast .amount-box {
  border: 2px solid #000 !important;
}
html.a11y-contrast .btn { background: #000 !important; color: #fff !important; text-decoration: none !important; }
html.a11y-contrast [aria-pressed="true"] { background: #000 !important; color: #fff !important; }
html.a11y-contrast svg .cell { fill: #fff; stroke: #000; stroke-width: 1; }
html.a11y-contrast svg .cell.on { fill: #000; }
html.a11y-contrast svg .room, html.a11y-contrast svg .fixture { stroke: #000; }
html.a11y-contrast svg text { fill: #000; stroke: #fff; }
html.a11y-contrast img { filter: grayscale(1) contrast(1.2); }
html.a11y-contrast [role="progressbar"] { border: 2px solid #000 !important; }
html.a11y-contrast [role="progressbar"] span { background: #000 !important; }

html.a11y-links a { text-decoration: underline !important; text-decoration-thickness: 2px !important; outline: 2px dashed currentColor; outline-offset: 2px; }
html.a11y-links a:focus-visible { outline: 4px solid #B8964E !important; outline-offset: 3px; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-motion [data-reveal] { opacity: 1 !important; transform: none !important; }
html.a11y-font body, html.a11y-font h1, html.a11y-font h2, html.a11y-font h3, html.a11y-font p, html.a11y-font a, html.a11y-font button,
html.a11y-font input, html.a11y-font summary, html.a11y-font dd, html.a11y-font li, html.a11y-font span {
  font-family: Arial, "Segoe UI", system-ui, sans-serif !important; letter-spacing: 0 !important;
}

/* Content that animates in is shown at once when it receives keyboard focus */
[data-reveal]:focus-within { opacity: 1 !important; transform: none !important; }

/* Windows high contrast (forced colours) */
@media (forced-colors: active) {
  [aria-pressed="true"] { outline: 3px solid Highlight; }
  [role="progressbar"] { border: 1px solid CanvasText; }
  [role="progressbar"] span { background: Highlight !important; forced-color-adjust: none; }
  .btn, .chip { border: 2px solid ButtonText; }
}

@media print {
  .a11y-trigger, .a11y-panel, .skip-link { display: none !important; }
}
