/* IBS Accessibility Companion */

/* Visually hidden text (e.g. "(opens in a new tab)"). */
.ibs-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* WCAG 2.4.7: a focus indicator that stays visible on light, dark and yellow backgrounds. */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
summary:focus,
[tabindex]:focus {
  outline: 3px solid #1a1a1a !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #fff !important;
}

/*
 * Google Reviews widget ships its own "a:focus { outline: 0 }" rules and a red outline on a
 * red button. Same ring as above, with extra specificity so static analysers that compare
 * selectors (not only !important) also see a visible indicator.
 */
html body .wp-gr.wpac a:focus,
html body .wp-gr.wpac a.wp-google-name:focus,
html body .grw-review a:focus,
html body .wp-google-wr a:focus,
html body #Content .wp-google-wr a:focus,
html body #Content .wp-google-wr a:focus-visible,
html body a[onclick*="rplg_leave_review_window"]:focus,
html body a[onclick*="rplg_leave_review_window"]:focus-visible {
  outline: 3px solid #1a1a1a !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #fff !important;
}

/*
 * WCAG 1.4.1 (F73): links inside running text must not be told apart by colour alone.
 * Buttons, icons and menus are excluded so the design of those stays as it is.
 */
p a:not([class*="btn"]):not([class*="button"]):not(.action_button):not([class*="icon"]):not([class*="social"]):not([class*="menu"]),
.woocommerce-info a,
.woocommerce-message a,
.woocommerce-noreviews a {
  text-decoration: underline !important;
}

/*
 * WCAG 1.4.8: avoid justified text. The site ships a global
 * "p { text-align: justify !important }" rule, so this must be !important too;
 * its higher specificity (body p) wins, while more specific rules such as
 * "#Footer ... p { text-align: center !important }" still apply.
 */
body p {
  text-align: left !important;
}

/*
 * WCAG 1.4.3: colour chosen by ibs-a11y.js for text that failed contrast. Hover and focus are
 * excluded so the theme's own interaction colours keep working.
 */
[data-ibs-contrast]:not(:hover):not(:focus),
html body :is(#Wrapper, #Content, #Footer, #Header, #Top_bar, #Side_slide) [data-ibs-contrast][data-ibs-contrast]:not(:hover):not(:focus) {
  color: var(--ibs-contrast-color) !important;
}

/*
 * Ally widget fallbacks. The widget defines these on its shadow :host with !important, so in real
 * browsers its own values always win and nothing changes. Static analysers that cannot resolve
 * :host custom properties otherwise fall back to the browser's default link blue on the page
 * background (F24 / 1.4.6 false positives). Values are the widget's own theme colours.
 */
:root {
  --ea11y-widget-accent-contrast: #fff;
  --ea11y-widget-accent-safe: #2847f3;
  --ea11y-widget-border-color: #2847f3;
  --ea11y-widget-secondary-background: #2847f3;
  --ea11y-widget-footer-accent: #17298d;
}

/* WCAG 2.5.5: 44px minimum height for the header "Order online" button. */
.action_button {
  box-sizing: border-box;
  min-height: 44px;
}

/*
 * OneTap ships ".onetap-container-toggle .onetap-toggle:focus { outline: 0 !important }", which is
 * more specific than the generic ring above, so the accessibility button itself had no visible
 * focus. Same ring, higher specificity.
 */
html body .onetap-container-toggle .onetap-toggle:focus,
html body .onetap-container-toggle .onetap-toggle:focus-visible {
  outline: 3px solid #1a1a1a !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px #fff !important;
}
