/* Accessibility fixes (IS 5568 / WCAG 2.1 AA) */

/* Visible focus on every interactive element: dark ring + white halo works on light, dark and green backgrounds */
:focus-visible {
    outline: 3px solid #151515 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #fff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #151515 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #fff;
}

/* Submit inside the green pill: ring the whole pill */
.green-btn:focus-within {
    outline: 3px solid #151515;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #fff;
}

.green-btn input[type=submit]:focus-visible {
    outline: none !important;
    box-shadow: none;
}

main:focus,
main:focus-visible {
    outline: none !important;
    box-shadow: none;
}

/* Visually hidden, readable by screen readers */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    white-space: nowrap;
    word-wrap: normal !important;
}

.skip-link.screen-reader-text:focus,
.skip-link.screen-reader-text:focus-visible {
    clip: auto;
    clip-path: none;
    height: auto;
    width: auto;
    margin: 0;
    overflow: visible;
    white-space: normal;
    top: 10px;
    right: 10px;
    z-index: 100000;
    background: #fff;
    color: #151515;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 4px;
}

/* Headings that replaced divs keep the original look */
h1.section-top__title,
.thank-you-title h1,
.page-404 .section-top__title h1 {
    margin: 0;
    font: inherit;
}

h1.section-top__title {
    margin: 0 auto 34px;
}

h2.form-section__title {
    color: inherit;
}

h3.items-section__item-title {
    margin: 0;
}

/* Burger is now a real <button> */
button.header__menu {
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    line-height: 0;
}

/* Main nav: submenu is a disclosure (hover, click, Enter/Space) */
.header__nav ul li.menu-item-has-children.is-open > ul.sub-menu {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 525px) {
    .header__nav ul li.menu-item-has-children.is-open > ul.sub-menu {
        display: block;
    }
}

/* Mobile nav hidden state must leave the tab order */
@media (max-width: 991px) {
    .header__nav:not(.is-open) {
        display: none;
    }
    .header__nav.is-open {
        display: block;
    }
}

/* Cookie banner controls */
#cookie-banner a {
    color: inherit;
    text-decoration: underline;
}

#cookie-banner button#close-button {
    border: 0;
    font: inherit;
    cursor: pointer;
}
