/*
 * Clean Smart - accessibility additions (additive only)
 * Load AFTER style.css and media_query.css.
 * Does not change existing colours, backgrounds or layout, except:
 *   - the skip link is hidden until focused;
 *   - nav links and buttons on touch screens get a 44px minimum box.
 */

/* 1. Skip link: visually hidden until it receives keyboard focus */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.skip-link:focus,
.skip-link:focus-visible {
    position: fixed;
    top: 16px;
    left: 16px;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    z-index: 10000;
    padding: 12px 18px;
    background: #000;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    border-radius: 6px;
    text-decoration: underline;
    outline: 3px solid #003A4C;
    outline-offset: 2px;
}

/* 2. Visible keyboard focus for links, buttons and form controls.
 *    Dark teal (12.3:1 on white) because the brand cyan #00C2FF is only
 *    2.07:1 on white, below the 3:1 WCAG 2.2 requirement (SC 1.4.11). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #003A4C;
    outline-offset: 3px;
}

/* Form fields where the theme removes or thins the focus ring */
.subscribe-input-main input:focus-visible,
.search-input input:focus-visible,
.calcult-from-grid input:focus-visible,
.your-message-input input:focus-visible {
    outline: 3px solid #003A4C;
    outline-offset: 2px;
}

/* Dark areas: the teal ring would disappear, so use brand cyan there */
footer a:focus-visible,
footer button:focus-visible,
footer input:focus-visible,
footer [role="button"]:focus-visible {
    outline-color: #00C2FF;
}

/* 3. Reduced motion: stop CSS animations and transitions
 *    (animations end on their final state, so content is not left hidden) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
}

/* 4. Minimum 44px touch targets for nav links and buttons on touch screens */
@media (pointer: coarse) {
    /* inline links: switch to inline-flex so min-height can apply */
    .nav a,
    .menu li a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        min-width: 44px;
    }
    /* block-level dropdown and mobile menu links: height only, no display change */
    .submenu a,
    .for-mobile-menu a {
        min-height: 44px;
    }
    button,
    [type="button"],
    [type="submit"],
    .hamburger {
        min-height: 44px;
        min-width: 44px;
    }
}
