/* Bido accessibility layer (IS 5568 / WCAG 2.0 AA), ported from the ShiftBee landing site.
   Loaded on every page after styles.css. Two jobs:
     1. The preferences widget (a11y.js): a comfort tool, not an overlay. It never rewrites
        content, alt text or ARIA; it only applies classes the visitor turned on.
     2. The a11y-* classes a11y.js sets on <html>. */

:root {
  --a11y-ring-dark: #e9a93a; /* honey: on the near-black bands */
  --a11y-ring: #7a5300; /* accentInk: 3:1 and up on the light page and white cards (WCAG 1.4.11) */
  --a11y-hero: #181614;
  --a11y-on-hero: #f4f1ea;
  --a11y-ink: #141311;
  --a11y-body: #55524c;
  --a11y-line: #dedcd6;
}

/* ---------- focus ring: dark on light surfaces, honey on the dark bands ---------- */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--a11y-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

.nav :where(a, button):focus-visible,
.hero :where(a, button):focus-visible,
.legal-hero :where(a, button):focus-visible,
.section--dark :where(a, button):focus-visible,
.cta__card :where(a, button):focus-visible,
.a11y-trigger:focus-visible {
  outline-color: var(--a11y-ring-dark);
}

[tabindex='-1']:focus {
  outline: none;
}

/* ---------- the widget ---------- */

.a11y-trigger {
  position: fixed;
  inset-block-end: calc(20px + env(safe-area-inset-bottom, 0px));
  inset-inline-start: 20px;
  z-index: 120;
  inline-size: 52px;
  block-size: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(244, 241, 234, 0.16);
  border-radius: 50%;
  background: var(--a11y-hero);
  color: var(--a11y-ring-dark);
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  box-shadow: 0 4px 18px rgba(16, 14, 12, 0.3);
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 160ms;
}

.a11y-trigger:hover {
  box-shadow: 0 6px 24px rgba(16, 14, 12, 0.4);
}

.a11y-trigger:active {
  transform: scale(0.95);
}

.a11y-trigger svg {
  inline-size: 26px;
  block-size: 26px;
}

.a11y-panel {
  position: fixed;
  inset-block-end: calc(84px + env(safe-area-inset-bottom, 0px));
  inset-inline-start: 20px;
  z-index: 121;
  inline-size: min(344px, calc(100vw - 40px));
  max-block-size: min(78vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  color: var(--a11y-ink);
  box-shadow: 0 0 0 1px rgba(20, 18, 15, 0.06), 0 20px 60px -10px rgba(20, 18, 15, 0.35);
  font-family: 'Heebo', system-ui, sans-serif;
}

.a11y-panel[hidden] {
  display: none;
}

.a11y-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 14px;
}

.a11y-panel__head h2 {
  margin: 0;
  margin-inline-end: auto;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.a11y-panel__close {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border: 0;
  border-radius: 50%;
  background: #f1f1ef;
  color: var(--a11y-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
}

.a11y-panel__close:hover {
  background: #e6e5e1;
}

.a11y-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.a11y-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: 82px;
  padding: 10px 6px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #f1f1ef;
  color: var(--a11y-ink);
  font: 600 13.6px/1.4 'Heebo', system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}

.a11y-opt:hover {
  border-color: var(--a11y-line);
}

.a11y-opt svg {
  inline-size: 20px;
  block-size: 20px;
  flex: none;
}

.a11y-opt[aria-pressed='true'],
.a11y-opt.is-active {
  background: #fff1cc;
  border-color: #c98a14;
  color: #5c3f00;
}

.a11y-opt__val {
  font-size: 12.8px;
  line-height: 1.4;
  font-weight: 700;
  opacity: 0.75;
}

.a11y-reset {
  margin-block-start: 12px;
  inline-size: 100%;
  min-block-size: 46px;
  border: 1.5px solid var(--a11y-line);
  border-radius: 999px;
  background: #fff;
  color: var(--a11y-ink);
  font: 700 15px/1.25 'Heebo', system-ui, sans-serif;
  cursor: pointer;
}

.a11y-reset:hover {
  border-color: var(--a11y-body);
}

.a11y-panel__note {
  margin: 12px 0 0;
  color: var(--a11y-body);
  font-size: 13px;
  line-height: 1.5;
}

.a11y-panel__note a {
  color: #7a5300;
}

.a11y-sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- preference classes, set on <html> by a11y.js ---------- */

html.a11y-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

html.a11y-headings :is(h1, h2, h3, h4) {
  outline: 2px dashed currentColor;
  outline-offset: 4px;
}

/* Filters go on the root, not <body>: a filter on any other element traps position: fixed
   children, and the widget would fall to the bottom of the page. */
html.a11y-contrast-high {
  filter: contrast(1.32);
}

html.a11y-contrast-invert {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-contrast-mono {
  filter: grayscale(1) contrast(1.12);
}

/* keep photos and the widget readable under inversion */
html.a11y-contrast-invert :is(img, .a11y-trigger, .a11y-panel) {
  filter: invert(1) hue-rotate(180deg);
}

/* the page's type is in rem, so scaling the root scales all of it (the widget is in px and stays put) */
html.a11y-text-115 { font-size: 115%; }
html.a11y-text-130 { font-size: 130%; }
html.a11y-text-150 { font-size: 150%; }

html.a11y-lines-16 body :is(p, li, dd, blockquote) { line-height: 1.9 !important; }
html.a11y-lines-20 body :is(p, li, dd, blockquote) { line-height: 2.4 !important; }

html.a11y-font body,
html.a11y-font body :is(h1, h2, h3, h4, p, li, a, span, button, summary) {
  font-family: Arial, 'Segoe UI', system-ui, sans-serif !important;
  letter-spacing: normal !important;
}

html.a11y-cursor-black,
html.a11y-cursor-black * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M6 2l18 13-8 1.5 4.5 9-3.5 1.8-4.5-9L6 24z' fill='%23000' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E") 4 2, auto !important;
}

html.a11y-cursor-large,
html.a11y-cursor-large * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 32 32'%3E%3Cpath d='M6 2l18 13-8 1.5 4.5 9-3.5 1.8-4.5-9L6 24z' fill='%23fff' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") 7 3, auto !important;
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* reveal-on-scroll pieces start hidden: show them when motion is off */
html.a11y-reduce-motion :is(.reveal, .hero__phones .phone) {
  opacity: 1 !important;
  transform: none !important;
  translate: none !important;
}

html.a11y-reduce-motion .hero__phones .phone--back {
  transform: rotate(-5deg) !important;
}

@media print {
  html[class*='a11y-'] { filter: none !important; }
  .a11y-trigger,
  .a11y-panel,
  .skip { display: none !important; }
}

@media (max-width: 560px) {
  .a11y-trigger {
    inset-block-end: calc(14px + env(safe-area-inset-bottom, 0px));
    inset-inline-start: 14px;
    inline-size: 48px;
    block-size: 48px;
  }

  .a11y-panel {
    inset-block-end: calc(72px + env(safe-area-inset-bottom, 0px));
    inset-inline: 14px;
    inline-size: auto;
  }
}
