/* ============================================================
   Accessibility (WCAG 2.1 / 2.2 Level AA) remediation styles
   Loaded last in <head> so these rules win the cascade.
   ============================================================ */

/* ---- Skip to main content link (WCAG 2.4.1 Bypass Blocks) ----
   Hidden off-screen until it receives keyboard focus, then it
   becomes prominently visible at the top-left of the page. */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    padding: 12px 18px;
    background: #ffffff;
    color: #17497b;
    border: 2px solid #17497b;
    border-radius: 0 0 4px 0;
    font-weight: bold;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
}

.skip-to-content:focus,
.skip-to-content:focus-visible {
    left: 8px;
    top: 8px;
    outline: 3px solid #17497b;
    outline-offset: 2px;
}

/* ---- Visually-hidden utility for screen-reader-only labels ----
   Used to give hand-written form controls a programmatic <label>
   without altering the visual design (WCAG 1.3.1 / 4.1.2). */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---- Visible keyboard focus indicator (WCAG 2.4.7 Focus Visible) ----
   The theme previously suppressed/omitted focus outlines. Restore a
   strong, high-contrast indicator for keyboard users. :focus-visible
   keeps mouse clicks from showing the ring. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="link"]:focus-visible {
    outline: 3px solid #0b5fff;
    outline-offset: 2px;
    /* second ring guarantees contrast on any background colour */
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9);
}

/* When the <main> region is focused via the skip link, don't paint a
   distracting ring around the whole page. */
main#main-content:focus,
main#main-content:focus-visible {
    outline: none;
    box-shadow: none;
}

/* ---- Button reset for elements promoted from <div>/<span> to <button>
   in the header (mobile menu, mobile cart/search, desktop cart).
   Keeps them visually identical to the original non-semantic markup. */
button.menu-btn,
button.menu-icon,
button#shoppingBagMenuItem,
button.cont-link,
button.link-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: inherit;
    cursor: pointer;
    line-height: normal;
}

button#shoppingBagMenuItem {
    display: inline-block;
    vertical-align: middle;
}

/* ---- Non-text contrast (WCAG 1.4.11) ----
   Give the header search field and its submit control a visible
   boundary (>= 3:1) so the input target is perceivable. */
#search-container {
    border: 1px solid #6a6a6a;
    border-radius: 3px;
}

#search-container input#skw {
    border: 0;
    background: transparent;
}

/* Cart count badge: ensure the badge boundary/text is perceivable. */
.badge.lblCartCount {
    border: 1px solid transparent;
}

/* Ensure interactive controls advertise a pointer affordance. */
[role="button"] {
    cursor: pointer;
}

/* Product-page pop-up close (X) promoted from <div> to <button>. The X icon
   is a CSS background scoped to div.close.upper-right, so re-declare it for
   the button and strip default button chrome. (accessibility.css lives in
   /Content, so the relative image path matches Site.css.) */
button.close.upper-right {
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    border: 0;
    background-color: transparent;
    background-image: url(images/common/x-dark.png);
    background-position: center center;
    background-repeat: no-repeat;
    height: 30px;
    width: 30px;
    position: absolute;
    right: 15px;
    cursor: pointer;
    margin-top: -10px;
    margin-right: -10px;
}

