/* ============================================================
   Blink accessibility helper — widget + visitor modes + real fixes.
   The widget is a fixed overlay (no layout shift). Every visitor mode is
   scoped to html.blink-a11y-* and never touches the widget itself.
   ============================================================ */

/* ---------- real fixes (all visitors) ---------- */
.blink-a11y-skips { position: absolute; top: 0; inset-inline-start: 0; z-index: 2147483001; }
.blink-a11y-skip {
  position: absolute;
  inset-inline-start: 8px;
  top: -200px;
  white-space: nowrap;
  padding: 12px 18px;
  border-radius: 10px;
  background: #111 !important;
  color: #fff !important;
  font: 600 15px/1.3 system-ui, "Arial Hebrew", Arial, sans-serif;
  text-decoration: none !important;
}
.blink-a11y-skip:focus { top: 8px; outline: 3px solid #ffbf47 !important; outline-offset: 2px; }
html.blink-a11y-fx-focus :focus-visible {
  outline: 2px solid #1a5fd0 !important;
  outline-offset: 2px !important;
}
@media (prefers-reduced-motion: reduce) {
  html.blink-a11y-fx-motion *,
  html.blink-a11y-fx-motion *::before,
  html.blink-a11y-fx-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* theme editor only: images with no alt text */
.blink-a11y-noalt { outline: 3px dashed #d72c0d !important; outline-offset: -3px !important; }
.blink-a11y-althint {
  position: fixed; inset-block-start: 12px; inset-inline-end: 12px; z-index: 2147483000; max-inline-size: 320px;
  padding: 10px 14px; border-radius: 10px; background: #fff4f2; color: #8e1f0b; border: 1px solid #f3b3a6;
  font: 500 13px/1.45 system-ui, "Arial Hebrew", Arial, sans-serif; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* ---------- widget ---------- */
.blink-a11y {
  --blink-a11y-size: 52px;
  --blink-a11y-off: 18px;
  --blink-a11y-ink: #14161a;
  --blink-a11y-mute: #555b63;
  --blink-a11y-line: #e3e5ea;
  position: fixed;
  z-index: 2147483000;
  bottom: calc(var(--blink-a11y-off) + var(--blink-satc-h, 0px));
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", "Heebo", "Arial Hebrew", Arial, sans-serif;
  color: var(--blink-a11y-ink);
  letter-spacing: normal;
  word-spacing: normal;
  text-align: start;
}
.blink-a11y *, .blink-a11y *::before, .blink-a11y *::after { box-sizing: border-box; }
.blink-a11y--bottom-start, .blink-a11y--middle-start { inset-inline-start: var(--blink-a11y-off); }
.blink-a11y--bottom-end, .blink-a11y--middle-end { inset-inline-end: var(--blink-a11y-off); }
.blink-a11y--middle-start, .blink-a11y--middle-end { bottom: auto; top: 50%; transform: translateY(-50%); }
/* keep clear of the Blink cookie banner while it is open — moved with translate
   (not bottom) so the lift is not counted as a layout shift (CLS) */
html.blink-cookie-open .blink-a11y--bottom-start > .blink-a11y-toggle, html.blink-cookie-open .blink-a11y--bottom-end > .blink-a11y-toggle { translate: 0 calc(-1 * var(--blink-cookie-h, 0px)); }
.blink-a11y .blink-a11y-toggle {
  inline-size: var(--blink-a11y-size);
  block-size: var(--blink-a11y-size);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: var(--blink-a11y-bg, #1d4ed8) !important;
  color: var(--blink-a11y-fg, #fff) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.blink-a11y .blink-a11y-toggle:hover { transform: scale(1.06); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28); }
.blink-a11y .blink-a11y-toggle svg { inline-size: 58%; block-size: 58%; }
.blink-a11y .blink-a11y-toggle:focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px var(--blink-a11y-bg, #1d4ed8);
}
.blink-a11y .blink-a11y-live, .blink-a11y .blink-a11y-sr {
  position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0;
}
.blink-a11y .blink-a11y-panel {
  position: absolute;
  bottom: calc(var(--blink-a11y-size) + 12px);
  inset-inline-start: 0;
  inline-size: min(380px, calc(100vw - 2 * var(--blink-a11y-off)));
  max-block-size: min(780px, calc(100vh - var(--blink-a11y-size) - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: #fff !important;
  color: var(--blink-a11y-ink) !important;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--blink-a11y-line);
  text-align: start;
}
.blink-a11y--bottom-end .blink-a11y-panel, .blink-a11y--middle-end .blink-a11y-panel { inset-inline-start: auto; inset-inline-end: 0; }
.blink-a11y--middle-start .blink-a11y-panel, .blink-a11y--middle-end .blink-a11y-panel { bottom: auto; top: 50%; transform: translateY(-50%); inset-inline-start: calc(var(--blink-a11y-size) + 12px); }
.blink-a11y--middle-end .blink-a11y-panel { inset-inline-start: auto; inset-inline-end: calc(var(--blink-a11y-size) + 12px); }
.blink-a11y .blink-a11y-panel[hidden] { display: none; }
.blink-a11y .blink-a11y-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; margin: 0;
  background: var(--blink-a11y-bg, #1d4ed8) !important; color: var(--blink-a11y-fg, #fff) !important;
}
.blink-a11y .blink-a11y-badge { inline-size: 34px; block-size: 34px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.blink-a11y .blink-a11y-badge svg { inline-size: 22px; block-size: 22px; }
.blink-a11y .blink-a11y-title { flex: 1; margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; color: inherit !important; }
.blink-a11y .blink-a11y-close {
  inline-size: 40px; block-size: 40px; flex: none; display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.16) !important; color: inherit !important; cursor: pointer;
}
.blink-a11y .blink-a11y-close:hover { background: rgba(255, 255, 255, 0.28) !important; }
.blink-a11y .blink-a11y-close svg { inline-size: 20px; block-size: 20px; }
.blink-a11y .blink-a11y-body { overflow-y: auto; padding: 4px 14px 6px; overscroll-behavior: contain; }
.blink-a11y .blink-a11y-sec { margin: 10px 0 0; }
.blink-a11y .blink-a11y-sec-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; color: var(--blink-a11y-mute) !important; }
.blink-a11y .blink-a11y-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.blink-a11y .blink-a11y-grid > * { grid-column: span 2; }
/* an incomplete last row stretches instead of leaving holes */
.blink-a11y .blink-a11y-grid > :last-child:nth-child(3n + 1) { grid-column: span 6; }
.blink-a11y .blink-a11y-grid > :nth-last-child(2):nth-child(3n + 1),
.blink-a11y .blink-a11y-grid > :nth-last-child(2):nth-child(3n + 1) + * { grid-column: span 3; }
/* exactly four tools read better as 2 × 2 */
.blink-a11y .blink-a11y-grid:has(> :nth-child(4):last-child) > * { grid-column: span 3; }
.blink-a11y .blink-a11y-tool {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-block-size: 74px; padding: 8px 6px 10px; margin: 0;
  border: 1.5px solid var(--blink-a11y-line); border-radius: 14px; background: #f7f8fa !important; color: var(--blink-a11y-ink) !important;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center; cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.blink-a11y .blink-a11y-tool:hover { border-color: #b9bec7; background: #fff !important; }
.blink-a11y .blink-a11y-ico { display: flex; inline-size: 26px; block-size: 26px; color: var(--blink-a11y-bg, #1d4ed8); }
.blink-a11y .blink-a11y-ico svg { inline-size: 100%; block-size: 100%; }
.blink-a11y .blink-a11y-tool[aria-pressed="true"] {
  border-color: var(--blink-a11y-bg, #1d4ed8);
  background: color-mix(in srgb, var(--blink-a11y-bg, #1d4ed8) 9%, #fff) !important;
  box-shadow: inset 0 0 0 1px var(--blink-a11y-bg, #1d4ed8);
}
.blink-a11y .blink-a11y-tool[aria-pressed="true"]::after {
  content: ""; position: absolute; inset-block-start: 6px; inset-inline-end: 6px; inline-size: 16px; block-size: 16px; border-radius: 50%;
  background: var(--blink-a11y-bg, #1d4ed8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.3 6.6 11 12 5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}
.blink-a11y .blink-a11y-dots { display: flex; gap: 4px; }
.blink-a11y .blink-a11y-dot { inline-size: 14px; block-size: 4px; border-radius: 2px; background: #cfd3da; }
.blink-a11y .blink-a11y-dot--on { background: var(--blink-a11y-bg, #1d4ed8); }
.blink-a11y .blink-a11y-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px 0; border-block-start: 1px solid var(--blink-a11y-line);
}
.blink-a11y .blink-a11y-reset {
  display: inline-flex; align-items: center; gap: 6px; min-block-size: 40px; padding: 0 14px; margin: 0; border: 0; border-radius: 12px;
  background: var(--blink-a11y-ink) !important; color: #fff !important; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.blink-a11y .blink-a11y-reset svg { inline-size: 18px; block-size: 18px; }
.blink-a11y .blink-a11y-statement { color: #0b57b5 !important; font-size: 14px; font-weight: 600; text-decoration: underline !important; text-underline-offset: 3px; }
.blink-a11y .blink-a11y-note { margin: 0; padding: 8px 14px 14px; font-size: 12px; line-height: 1.45; color: var(--blink-a11y-mute) !important; }
.blink-a11y button:focus-visible, .blink-a11y a:focus-visible { outline: 3px solid #1a5fd0 !important; outline-offset: 2px !important; }
.blink-a11y .blink-a11y-head button:focus-visible { outline-color: #fff !important; box-shadow: 0 0 0 5px #111; }
@media (max-width: 749px) {
  .blink-a11y--no-mobile, .blink-a11y-skips--no-mobile { display: none; }
  .blink-a11y .blink-a11y-panel,
  .blink-a11y--middle-start .blink-a11y-panel,
  .blink-a11y--middle-end .blink-a11y-panel {
    position: fixed; inset-inline: 8px; bottom: 8px; top: auto; transform: none;
    inline-size: auto; max-block-size: calc(100dvh - 16px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .blink-a11y .blink-a11y-toggle, .blink-a11y .blink-a11y-tool { transition: none; }
}
@media (forced-colors: active) {
  .blink-a11y .blink-a11y-toggle, .blink-a11y .blink-a11y-panel, .blink-a11y .blink-a11y-tool { border: 2px solid CanvasText; }
  .blink-a11y .blink-a11y-tool[aria-pressed="true"] { border: 4px double Highlight; }
  .blink-a11y .blink-a11y-dot--on { background: Highlight; }
}

/* ---------- visitor modes ---------- */
html.blink-a11y-fs-1 body > *:not(#blink-a11y-root):not(.blink-a11y-guide) { zoom: 1.12; }
html.blink-a11y-fs-2 body > *:not(#blink-a11y-root):not(.blink-a11y-guide) { zoom: 1.25; }
html.blink-a11y-fs-3 body > *:not(#blink-a11y-root):not(.blink-a11y-guide) { zoom: 1.4; }

/* Contrast modes. The page colour goes on <body> and on the theme's opaque surfaces (header,
   menus, drawers, dialogs, form controls); every other element turns transparent so that colour
   shows through. Images, video, SVG icons and background-image heroes are never painted over:
   an opaque colour on EVERY element put black content wrappers and overlays on top of the
   media (Horizon hero + product gallery vanished, live run 15.10.2026). Overlays laid over
   media keep a translucent dim so the text on them stays readable. */
html.blink-a11y-c-high body *:not(#blink-a11y-root):not(#blink-a11y-root *):not(.blink-a11y-guide) {
  background-color: transparent !important; color: #fff !important; border-color: #fff !important;
}
html.blink-a11y-c-high body, html.blink-a11y-c-high body :is(header, nav, dialog, [role="dialog"], [role="menu"], [role="listbox"], [aria-modal="true"], [popover], input, select, textarea, button, [role="button"], .button, .btn, [class*="drawer"], [class*="header"], [class*="menu"], [class*="modal"], [class*="popup"], [class*="popover"], [class*="dropdown"]):not(#blink-a11y-root):not(#blink-a11y-root *):not(.blink-a11y-guide) { background-color: #000 !important; }
html.blink-a11y-c-high body :is([class*="overlay"], [class*="scrim"]):not(#blink-a11y-root):not(#blink-a11y-root *):not(.blink-a11y-guide) { background-color: rgba(0, 0, 0, 0.55) !important; }
html.blink-a11y-c-high body a:not(#blink-a11y-root *) { color: #ffeb3b !important; }
html.blink-a11y-c-dark body *:not(#blink-a11y-root):not(#blink-a11y-root *):not(.blink-a11y-guide) {
  background-color: transparent !important; color: #ececec !important; border-color: #555 !important;
}
html.blink-a11y-c-dark body, html.blink-a11y-c-dark body :is(header, nav, dialog, [role="dialog"], [role="menu"], [role="listbox"], [aria-modal="true"], [popover], input, select, textarea, button, [role="button"], .button, .btn, [class*="drawer"], [class*="header"], [class*="menu"], [class*="modal"], [class*="popup"], [class*="popover"], [class*="dropdown"]):not(#blink-a11y-root):not(#blink-a11y-root *):not(.blink-a11y-guide) { background-color: #141414 !important; }
html.blink-a11y-c-dark body :is([class*="overlay"], [class*="scrim"]):not(#blink-a11y-root):not(#blink-a11y-root *):not(.blink-a11y-guide) { background-color: rgba(20, 20, 20, 0.55) !important; }
html.blink-a11y-c-dark body a:not(#blink-a11y-root *) { color: #8ab4f8 !important; }
html.blink-a11y-c-light body *:not(#blink-a11y-root):not(#blink-a11y-root *):not(.blink-a11y-guide) {
  background-color: transparent !important; color: #111 !important; border-color: #888 !important;
}
html.blink-a11y-c-light body, html.blink-a11y-c-light body :is(header, nav, dialog, [role="dialog"], [role="menu"], [role="listbox"], [aria-modal="true"], [popover], input, select, textarea, button, [role="button"], .button, .btn, [class*="drawer"], [class*="header"], [class*="menu"], [class*="modal"], [class*="popup"], [class*="popover"], [class*="dropdown"]):not(#blink-a11y-root):not(#blink-a11y-root *):not(.blink-a11y-guide) { background-color: #fff !important; }
html.blink-a11y-c-light body :is([class*="overlay"], [class*="scrim"]):not(#blink-a11y-root):not(#blink-a11y-root *):not(.blink-a11y-guide) { background-color: rgba(255, 255, 255, 0.6) !important; }
html.blink-a11y-c-light body a:not(#blink-a11y-root *) { color: #0645ad !important; }
html.blink-a11y-c-mono body > *:not(#blink-a11y-root):not(.blink-a11y-guide) { filter: grayscale(1) !important; }

html.blink-a11y-links body a:not(#blink-a11y-root *) {
  text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important;
  outline: 2px dashed currentColor !important; outline-offset: 2px !important;
}
html.blink-a11y-heads body :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(#blink-a11y-root *) {
  outline: 2px solid currentColor !important; outline-offset: 4px !important; border-radius: 2px;
  background-color: rgba(255, 191, 71, 0.22) !important;
}
html.blink-a11y-font body *:not(#blink-a11y-root *):not(i):not([class*="icon"]):not(svg):not(svg *) {
  font-family: Arial, "Arial Hebrew", Helvetica, sans-serif !important;
}
html.blink-a11y-lh body *:not(#blink-a11y-root *) { line-height: 1.8 !important; }
html.blink-a11y-lh body p:not(#blink-a11y-root *) { margin-block-end: 2em !important; }
html.blink-a11y-ls body *:not(#blink-a11y-root *) { letter-spacing: 0.12em !important; word-spacing: 0.16em !important; }
html.blink-a11y-cursor, html.blink-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='M6 3l30 21-13 2 8 15-6 3-8-15-11 9z' fill='%23000' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}
html.blink-a11y-noanim *, html.blink-a11y-noanim *::before, html.blink-a11y-noanim *::after {
  animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important; scroll-behavior: auto !important;
}
html.blink-a11y-hideimg body :is(img, picture, video, svg image):not(#blink-a11y-root *) { visibility: hidden !important; }
html.blink-a11y-hideimg body *:not(#blink-a11y-root *):not(.blink-a11y-guide) { background-image: none !important; }
html.blink-a11y-focus body *:focus {
  outline: 3px solid #ffbf47 !important; outline-offset: 2px !important; box-shadow: 0 0 0 6px #111 !important;
}

/* reading guide (line) / mask */
.blink-a11y-guide { position: fixed; inset: 0; z-index: 2147482999; pointer-events: none; }
.blink-a11y-line::after {
  content: ""; position: absolute; inset-inline: 0; top: calc(var(--blink-a11y-y, 50vh) + 14px); block-size: 6px;
  background: #ffbf47; box-shadow: 0 0 0 2px #111;
}
.blink-a11y-mask {
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.62) calc(var(--blink-a11y-y, 50vh) - 60px),
    transparent calc(var(--blink-a11y-y, 50vh) - 60px),
    transparent calc(var(--blink-a11y-y, 50vh) + 60px),
    rgba(0, 0, 0, 0.62) calc(var(--blink-a11y-y, 50vh) + 60px));
}

/* A theme drawer / modal is open: drop below it (Horizon drawers are z 8+,
   Dawn's 1000; top-layer dialogs win anyway). Still above page content. */
html:is(.blink-ovl, .js-drawer-open, .lock-all, [scroll-lock], :has(theme-drawer[open], cart-drawer.active, cart-drawer[open], dialog[open]:not([class*="blink"]), body.overflow-hidden, body.overflow-hidden-mobile, body.overflow-hidden-tablet, body.overflow-hidden-desktop, x-drawer[open], .drawer--is-open, body.js-drawer-open, cart-drawer[aria-hidden="false"], #mini-cart[aria-hidden="false"], #sidebar-cart[aria-hidden="false"], details.cart-drawer-container[open], .drawer.is-open, .drawer.is-active, .popup-modal--active, body[style*="overflow: hidden"])) .blink-a11y { z-index: 5; }
/* …and the closed button steps aside entirely: a theme drawer inside a low stacking context
   (Archetype Motion: #CartDrawer z 30 under a z-1 page wrapper) still lost to z 5 (live QA). */
html:is(.blink-ovl, .js-drawer-open, .lock-all, [scroll-lock]) .blink-a11y:not(:has(.blink-a11y-toggle[aria-expanded="true"])) { opacity: 0; visibility: hidden; pointer-events: none; }
