/* ============================================================
   mcma24 — Accessibility (WCAG 2.0 AA) overlay stylesheet
   Loaded after style.css so rules here override the base theme.
   Each block cites the barrier ID from the Barriers Register.
   ============================================================ */

/* B-06 — Skip to main content link (WCAG 2.4.1 Bypass Blocks, A).
   Visually hidden until focused, lands above all stacked content. */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 99999;
    padding: 0.6em 1.2em;
    background: #1a1a1a;
    color: #fff;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    border-bottom-right-radius: 4px;
}
.skip-link:focus {
    top: 0;
    outline: 2px solid #2c5145;
    outline-offset: 2px;
}
#main-content:focus {
    outline: none;
}

/* B-04 / B-17 — Hero title contrast (WCAG 1.4.3 Contrast Minimum, AA).
   Two-line caption box over a hero video background. The parent <p
   class="title"> in the base theme was display:inline-block, which
   sized it to whichever line it directly contained text for — and the
   inner block-level <span> for the second line would then overflow or
   underflow that box. Both lines need a single coherent dark backdrop
   that fits the widest of them and provides comfortable padding so the
   text never clips at the edge.

   Switch the parent to inline-block with `width: fit-content` so it
   shrink-fits to whichever child is widest. The span stays block-level
   so it still forces the line break, but takes the parent's content
   width and inherits the dark background. Single coherent dark box,
   both lines fit, comfortable right-side padding. */
.banner .title {
    display: inline-block;
    width: fit-content;
    width: -moz-fit-content;
    max-width: calc(100% - 40px);
    background-color: #1a1a1a;
    color: #fff;
    padding: 14px 30px;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.banner .title > span {
    display: block;
    background-color: transparent;
    padding: 0;
    margin-top: 8px;
    line-height: 1.1;
}

/* B-05 / B-17 — "PART OF MCM 2001" link contrast (WCAG 1.4.3, AA).
   Visually the link is white on the #2c5145 dark-green header/footer
   background (~7.5:1, passes AA). Skynet's contrast walker, like
   pa11y's HTML_CodeSniffer engine, ignores the position:fixed .header
   ancestor and computes the link colour against the body's implicit
   white background, producing a false-positive failure. Pin an
   explicit background-color on the link itself (matching the surrounding
   header/footer so it's visually identical) so the walker has a
   concrete dark background to measure against. */
.header .logo span a[href*="mcm2001"],
.header .navbar .sidebar-logo span a[href*="mcm2001"],
.ft-logo span.mcm2001 {
    background-color: #2c5145;
    color: #fff;
    text-decoration: underline;
}

/* B-03 — Active-page nav link contrast (WCAG 1.4.3, AA).
   Pa11y's contrast walker ignores the fixed-position .header ancestor
   and computes the link's text colour against the body's implicit
   white background, producing a false-positive 1:1 reading for the
   white-on-dark-green link. Pinning an explicit background-color on
   the active anchor (matching the header so it's visually transparent)
   gives the contrast algorithm something concrete to measure against
   while preserving the visual design.

   Add an underline as the AT-noticeable indicator since browsers also
   need to convey "active page" to colour-blind users non-chromatically. */
.header nav .navbar .links > li.current-menu-item > a,
.header nav .navbar .links > li > a[aria-current="page"] {
    color: #fff !important;
    background-color: #2c5145;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

/* B-11 — Respect prefers-reduced-motion (WCAG 2.3.3 Animation from
   Interactions, AAA — advisory but low cost to satisfy).
   Disable non-essential transitions and animations site-wide when the
   user has signalled the preference at the OS or browser level. Keep
   essential motion (loading spinners) by exempting specific selectors. */
/* B-21 — Apply the bespoke MontserratSemiBold/uppercase styling that the
   `has-medium-font-size` Gutenberg class used to provide on the home
   page's feature headings. The class was stripped server-side by the
   the_content filter in inc/a11y.php because Chrome's HTML parser
   appears to demote h3 elements carrying it to h4 inside
   .wp-block-column containers. */
.mcma24-feature-heading {
    text-transform: uppercase;
    font-family: 'MontserratSemiBold', sans-serif;
    font-weight: normal;
    font-size: 1.1em;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
    .banner video,
    .video {
        display: none;
    }
}
