body {
    margin: 0;
    font-family: var(--font-heading);
    color: var(--color-text);
}

/* Form controls don't inherit the page font by default (they fell back to
   Arial); make them match the rest of the site. */
button,
input,
select,
textarea {
    font-family: inherit;
}

:root {
    /* Royal Blue design system (MCA-DESIGN-01B). */
    --color-primary: #0A1589;
    --color-primary-dark: #08106C;
    --color-primary-hover: #1626B0;
    --color-accent: #2F45C8;
    --color-bg: #FFFFFF;
    --color-bg-muted: #EFEFEF;
    --color-bg-tint: #EEF0FA;
    --color-border: #D9DCEB;
    --color-text: #111A3A;
    --color-text-muted: #4B5578;
    /* Form-control outlines need 3:1 against white (WCAG 1.4.11), which
       the decorative --color-border does not reach. */
    --color-border-input: color-mix(in srgb, var(--color-text-muted) 70%, var(--color-bg));
    /* Status feedback (MCA-WEBSITE-UIUX-01K-B): success and error messages
       and form errors. Text on its background passes AA (4.8 and 4.76:1). */
    --color-success: #1E7A46;
    --color-success-bg: #E8F6EE;
    --color-error: #C0392B;
    --color-error-bg: #FDECEB;

    /* Legacy names, kept so existing components pick up the new palette
       by role: "aqua" was the solid accent (buttons, focus rings), "teal"
       the dark brand colour (headings, links, footer), "ice" the light
       tint. Rename call sites to the role names above as each component
       is redesigned. */
    --color-bg-ice: var(--color-bg-tint);
    --color-aqua: var(--color-primary);
    --color-aqua-hover: var(--color-primary-hover);
    --color-teal: var(--color-primary);
    --color-teal-soft: var(--color-text-muted);

    --font-heading: 'Manrope', 'Segoe UI', Arial, sans-serif;

    /* "Minimally rounded" corner used for cards and panels (MCA-DESIGN-01G). */
    --radius-card: 4px;
    /* Generic image glyph for missing-image placeholders, used as a mask so
       its colour comes from the tokens. */
    --placeholder-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='1'/%3E%3Ccircle cx='8.5' cy='9.5' r='1.5'/%3E%3Cpath d='M21 16l-5-5-9 9'/%3E%3C/svg%3E");
}

/* Form honeypot field (the forms.py of contact, training, membership): off screen for people, still in the
   form for bots. Was an inline style; the CSP blocks style attributes
   (MCA-WEBSITE-SEC-HEADERS-02). !important keeps the inline style's
   precedence over any form-input rule. */
input.form-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Visually hidden but announced by screen readers. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Skip link (MCA-A11Y-01): off-screen until focused, then laid over the
   top of the header (absolute, so the layout never moves). */
.skip-link {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 20px;
    border-radius: 6px;
    background-color: var(--color-primary);
    color: var(--color-bg);
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 16px));
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

.skip-link:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--color-bg);
}

/* Below the desktop nav bar the brand row sits close under the ~33–37px
   utility bar, so the link stays inside that strip, clear of the brand and
   the menu button. */
@media (max-width: 1099.98px) {
    .skip-link {
        top: 2px;
        min-height: 28px;
        padding: 0 14px;
        font-size: 0.8125rem;
    }
}

/* <main> takes focus only as the skip link's target; the ring would
   outline the whole page body. */
#main-content:focus {
    outline: none;
}


/* Homepage hero: a full-bleed image banner (MCA-DESIGN-01D). Text and the
   floating training card line up with the 1280px site grid (the header's
   max-width 1280px + 20px padding) via --hero-gutter. */
.hero {
    --hero-gutter: max(20px, calc((100% - 1240px) / 2));
    position: relative;
    width: 100%;
    font-family: var(--font-heading);
}

.hero--with-image {
    color: var(--color-bg);
}

.hero__frame {
    position: relative;
    width: 100%;
    min-height: 360px;
    overflow: hidden;
    background-color: var(--color-primary-dark);
}

.hero__picture {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* In normal flow (not absolutely positioned) so the frame grows with long
   titles/subtitles instead of clipping the CTA; min-height: inherit keeps
   the frame's cinematic height when the text is short. */
.hero__overlay {
    position: relative;
    z-index: 1;
    min-height: inherit;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 var(--hero-gutter);
    box-sizing: border-box;
    /* Strong enough under the text column for AA contrast even over a
       white image area, fading out so the photo stays visible on the
       right. */
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--color-primary-dark) 85%, transparent) 0%,
        color-mix(in srgb, var(--color-primary-dark) 65%, transparent) 55%,
        color-mix(in srgb, var(--color-primary-dark) 15%, transparent) 100%
    );
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 560px;
    width: 100%;
    padding: 48px 0;
    text-align: left;
    box-sizing: border-box;
    min-width: 0;
}

.hero__title {
    margin: 0 0 14px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(1.5rem, 7vw, 2rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--color-bg);
    overflow-wrap: break-word;
}

.hero__subtitle {
    margin: 0 0 24px;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--color-bg);
    overflow-wrap: break-word;
}

/* White pill: a blue button would disappear into the blue overlay. */
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.hero__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 28px;
    border: 1px solid var(--color-bg);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-sizing: border-box;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.hero__cta--primary {
    background-color: var(--color-bg);
    color: var(--color-primary);
}

.hero__cta:hover,
.hero__cta:focus {
    transform: translateY(-1px);
}

.hero__cta--primary:hover,
.hero__cta--primary:focus {
    background-color: var(--color-bg-tint);
}

@media (max-width: 479.98px) {
    .hero__actions {
        flex-direction: column;
    }
}

.hero__cta:focus-visible {
    outline: 2px solid var(--color-bg);
    outline-offset: 3px;
}

.hero--default {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-bg);
    padding: 48px var(--hero-gutter);
    box-sizing: border-box;
}

/* Upcoming training floating card (bottom-right on desktop/tablet,
   stacked below the hero on mobile via normal block flow — see the
   768px override below for the desktop/tablet positioning). */

.hero__training-card {
    display: block;
    margin: 16px var(--hero-gutter) 0;
    background-color: var(--color-bg);
    color: var(--color-teal);
    border-radius: var(--radius-card);
    padding: 14px 18px;
    text-decoration: none;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--color-text) 14%, transparent);
    box-sizing: border-box;
    position: relative;
    transition: box-shadow 0.15s ease;
}

.hero__training-card:hover,
.hero__training-card:focus {
    box-shadow: 0 14px 34px color-mix(in srgb, var(--color-text) 20%, transparent);
}

.hero__training-card:focus-visible {
    outline: 2px solid var(--color-bg);
    outline-offset: 3px;
}

.hero__training-card-eyebrow {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-teal-soft);
    margin-bottom: 4px;
}

/* Compact card (MCA-DESIGN-02Z): long training titles stop at two lines;
   the full title is on the detail page and in the link's text. */
.hero__training-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.975rem;
    line-height: 1.35;
    margin-bottom: 4px;
    padding-right: 4px;
    overflow-wrap: anywhere;
}

.hero__training-card-title::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 2px solid var(--color-aqua-hover);
    border-top: 2px solid var(--color-aqua-hover);
    transform: rotate(45deg);
    vertical-align: middle;
    transition: transform 0.15s ease;
}

.hero__training-card:hover .hero__training-card-title::after,
.hero__training-card:focus .hero__training-card-title::after {
    transform: rotate(45deg) translate(2px, -2px);
}

.hero__training-card-date {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-teal-soft);
}

@media (max-width: 767.98px) {
    /* On mobile the text spans the whole frame, so the wash is vertical
       and uniformly strong enough for AA; text-shadow adds separation
       over busy photos. Editors can upload a dedicated mobile_image to
       control the focal area. */
    .hero__overlay {
        background: linear-gradient(
            180deg,
            color-mix(in srgb, var(--color-primary-dark) 60%, transparent) 0%,
            color-mix(in srgb, var(--color-primary-dark) 85%, transparent) 100%
        );
    }

    .hero__title,
    .hero__subtitle {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    }

    /* The card sits on white below the hero, where a white ring would be
       invisible. */
    .hero__training-card:focus-visible {
        outline-color: var(--color-primary-hover);
    }
}

@media (min-width: 768px) {
    .hero__frame {
        min-height: 520px;
    }

    /* Vertically centre the fallback text like the image hero; the card is
       absolutely positioned at this width, so it is not a flex item. */
    .hero--default {
        display: flex;
        align-items: center;
        min-height: 520px;
        padding-top: 64px;
        padding-bottom: 64px;
    }

    .hero__content {
        padding: 64px 0;
    }

    .hero__title {
        font-size: 2.75rem;
    }

    .hero__subtitle {
        font-size: 1.2rem;
        margin-bottom: 32px;
    }

    .hero__training-card {
        position: absolute;
        right: var(--hero-gutter);
        bottom: 32px;
        z-index: 3;
        width: 264px;
        margin: 0;
    }
}

/* Tablet: narrower text column so it clears the bottom-right card and
   stays within the strong part of the overlay. */
@media (min-width: 768px) and (max-width: 1023.98px) {
    .hero__content {
        max-width: 420px;
    }
}

@media (min-width: 1200px) {
    .hero__frame {
        min-height: 620px;
    }

    .hero--default {
        min-height: 620px;
    }

    .hero__title {
        font-size: 3.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero__cta,
    .hero__training-card,
    .hero__training-card-title::after {
        transition: none;
    }

    .hero__cta:hover,
    .hero__cta:focus {
        transform: none;
    }
}

/* Homepage About MCA preview */

/* Homepage section rhythm (MCA-DESIGN-02O): every content section uses the
   same block padding, so neighbours sit 2x apart whichever sections are
   hidden (MCA-DESIGN-02N). */
:root {
    --home-section-space: 32px;
}

@media (min-width: 768px) {
    :root {
        --home-section-space: 48px;
    }
}

.home-about {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--home-section-space) 20px;
    box-sizing: border-box;
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    gap: 32px;
    font-family: var(--font-heading);
}

.home-about__visual {
    width: 100%;
}

.home-about__image,
.home-about__image-fallback {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-card);
}

.home-about__image {
    object-fit: cover;
}



.home-about__content {
    width: 100%;
}

.home-about__eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-teal-soft);
    margin-bottom: 12px;
}

.home-about__title {
    margin: 0 0 16px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--color-teal);
}

.home-about__text {
    margin: 0 0 24px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-teal);
}

.home-about__cta {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    background-color: var(--color-aqua);
    color: var(--color-bg);
    text-decoration: none;
    font-weight: 700;
}

.home-about__cta:hover,
.home-about__cta:focus {
    background-color: var(--color-aqua-hover);
}

.home-about__cta:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 3px;
}

@media (min-width: 768px) {
    .home-about {
        flex-direction: row;
        align-items: center;
    }

    .home-about__visual,
    .home-about__content {
        width: 50%;
    }

    .home-about__title {
        font-size: 2.25rem;
    }
}

/* Homepage Featured News (MCA-DESIGN-02F): four equal compact cards on
   white — 1 column, 2 from 600px, 4 from 992px; 4:3 cover-cropped images,
   no card chrome. */
.home-news {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--home-section-space) 20px;
    box-sizing: border-box;
    background-color: var(--color-bg);
    font-family: var(--font-heading);
}

.home-news__header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.home-news__eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.home-news__title {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--color-primary);
}

.home-news__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    /* 44px+ tap area; the negative margin keeps the text where it was. */
    padding: 12px 0;
    margin: -12px 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.home-news__cta::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--color-primary-hover);
    border-top: 2px solid var(--color-primary-hover);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.home-news__cta:hover::after,
.home-news__cta:focus::after {
    transform: rotate(45deg) translate(2px, -2px);
}

.home-news__cta:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 4px;
}

.home-news__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px 20px;
}

.home-news__card {
    min-width: 0;
}

.home-news__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.home-news__link:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 4px;
    border-radius: 6px;
}

.home-news__image,
.home-news__image-fallback {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
}

.home-news__image {
    object-fit: cover;
    object-position: center;
    background-color: var(--color-bg-tint);
}

.home-news__body {
    padding-top: 12px;
    min-width: 0;
}

.home-news__category {
    display: inline-block;
    padding: 3px 8px;
    background-color: var(--color-bg-tint);
    color: var(--color-text-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

/* Long titles stop at three lines; the full title is on the detail page
   and still in the accessible name of the link. */
.home-news__card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    margin: 0 0 6px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.35;
    color: var(--color-primary);
    overflow-wrap: anywhere;
}

.home-news__link:hover .home-news__card-title {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.home-news__date {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Rendered only in the single-article layout (MCA-DESIGN-02T). */
.home-news__summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
    margin: 0 0 10px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

/* Phones (MCA-DESIGN-02I): compact rows, a 4:3 thumbnail beside the text,
   so the list stays short (the three-article lead card is the exception,
   see MCA-NEWS-02 below). The thumbnail width is fixed per viewport
   and its height comes from aspect-ratio, so nothing shifts as images load. */
@media (max-width: 599.98px) {
    .home-news__grid {
        gap: 20px;
    }

    .home-news__link {
        flex-direction: row;
        align-items: flex-start;
        gap: 14px;
    }

    .home-news__image,
    .home-news__image-fallback {
        flex: 0 0 auto;
        width: clamp(96px, 30vw, 120px);
    }

    .home-news__card .home-news__image-fallback::after {
        width: 28px;
        height: 28px;
    }

    .home-news__body {
        flex: 1 1 auto;
        padding-top: 0;
    }

    .home-news__category {
        margin-bottom: 6px;
    }

    .home-news__summary {
        display: none;
    }
}

@media (min-width: 600px) {
    .home-news__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .home-news__header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .home-news__title {
        font-size: 2.25rem;
    }
}

/* Adaptive layouts by article count (MCA-DESIGN-02T): the template adds
   --count-N (1-3 since MCA-NEWS-01), so no count leaves empty columns.
   Placed after the base grid rules so equal-specificity overrides win.
   Phones keep the compact rows above whatever the count. */
@media (min-width: 600px) {
    /* One article: a full-width card, image and text side by side. */
    .home-news__grid--count-1 {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-news__grid--count-1 .home-news__link {
        flex-direction: row;
        align-items: center;
        gap: 32px;
    }

    .home-news__grid--count-1 .home-news__image,
    .home-news__grid--count-1 .home-news__image-fallback {
        flex: 0 0 calc(50% - 16px);
        width: calc(50% - 16px);
        aspect-ratio: 16 / 9;
    }

    .home-news__grid--count-1 .home-news__body {
        flex: 1 1 0;
        padding-top: 0;
    }

    .home-news__grid--count-1 .home-news__card-title {
        -webkit-line-clamp: 4;
        line-clamp: 4;
        margin-bottom: 10px;
        font-size: 1.375rem;
        line-height: 1.3;
    }
}

@media (min-width: 992px) {
    .home-news__grid--count-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-news__grid--count-1 .home-news__link {
        gap: 40px;
    }

    .home-news__grid--count-1 .home-news__image,
    .home-news__grid--count-1 .home-news__image-fallback {
        flex-basis: calc(50% - 20px);
        width: calc(50% - 20px);
    }

    .home-news__grid--count-1 .home-news__card-title {
        font-size: 1.75rem;
    }

    /* Two wide cards: a shorter image keeps them from towering over the
       sections around them. */
    .home-news__grid--count-2 .home-news__image,
    .home-news__grid--count-2 .home-news__image-fallback {
        aspect-ratio: 16 / 9;
    }

    .home-news__grid--count-2 .home-news__card-title {
        font-size: 1.25rem;
    }
}

/* Editorial layout for three articles (MCA-NEWS-02): the featured (first)
   card leads, the other two follow smaller. From 992px the content is at
   least 952px wide, so a 2fr/1fr split leaves the side cards ~300px for a
   16:9 image and a three-line title; narrower, the lead card takes the
   full width above the other two. */
@media (max-width: 599.98px) {
    .home-news__grid--count-3 .home-news__card:first-child .home-news__link {
        flex-direction: column;
        gap: 0;
    }

    .home-news__grid--count-3 .home-news__card:first-child .home-news__image,
    .home-news__grid--count-3 .home-news__card:first-child .home-news__image-fallback {
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .home-news__grid--count-3 .home-news__card:first-child .home-news__body {
        padding-top: 12px;
    }

    .home-news__grid--count-3 .home-news__card:first-child .home-news__card-title {
        font-size: 1.125rem;
    }
}

@media (min-width: 600px) and (max-width: 991.98px) {
    .home-news__grid--count-3 .home-news__card:first-child {
        grid-column: 1 / -1;
    }

    .home-news__grid--count-3 .home-news__card:first-child .home-news__link {
        flex-direction: row;
        align-items: center;
        gap: 28px;
    }

    .home-news__grid--count-3 .home-news__card:first-child .home-news__image,
    .home-news__grid--count-3 .home-news__card:first-child .home-news__image-fallback {
        flex: 0 0 calc(50% - 14px);
        width: calc(50% - 14px);
        aspect-ratio: 16 / 9;
    }

    .home-news__grid--count-3 .home-news__card:first-child .home-news__body {
        flex: 1 1 0;
        padding-top: 0;
    }

    .home-news__grid--count-3 .home-news__card:first-child .home-news__card-title {
        -webkit-line-clamp: 4;
        line-clamp: 4;
        font-size: 1.25rem;
        line-height: 1.3;
    }

    .home-news__grid--count-3 .home-news__card:not(:first-child) .home-news__image,
    .home-news__grid--count-3 .home-news__card:not(:first-child) .home-news__image-fallback {
        aspect-ratio: 16 / 9;
    }
}

@media (min-width: 992px) {
    .home-news__grid--count-3 {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        gap: 28px 32px;
    }

    .home-news__grid--count-3 .home-news__card:first-child {
        grid-row: 1 / span 2;
    }

    /* The lead image fills whatever height the two side cards set, so both
       columns end level; min-height keeps it substantial. */
    .home-news__grid--count-3 .home-news__card:first-child .home-news__image,
    .home-news__grid--count-3 .home-news__card:first-child .home-news__image-fallback {
        flex: 1 1 0;
        min-height: 320px;
        aspect-ratio: auto;
    }

    .home-news__grid--count-3 .home-news__card:first-child .home-news__body {
        padding-top: 16px;
    }

    .home-news__grid--count-3 .home-news__card:first-child .home-news__card-title {
        font-size: 1.75rem;
        line-height: 1.25;
    }

    .home-news__grid--count-3 .home-news__card:not(:first-child) .home-news__image,
    .home-news__grid--count-3 .home-news__card:not(:first-child) .home-news__image-fallback {
        aspect-ratio: 16 / 9;
    }
}

/* Homepage Upcoming Training */

.home-training {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--home-section-space) 20px;
    box-sizing: border-box;
    background-color: var(--color-bg);
    font-family: var(--font-heading);
}

.home-training__header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.home-training__eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-teal-soft);
    margin-bottom: 8px;
}

.home-training__title {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--color-teal);
}

.home-training__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    /* 44px+ tap area; the negative margin keeps the text where it was. */
    padding: 12px 0;
    margin: -12px 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-teal);
    text-decoration: none;
    white-space: nowrap;
}

.home-training__cta::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--color-aqua-hover);
    border-top: 2px solid var(--color-aqua-hover);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.home-training__cta:hover::after,
.home-training__cta:focus::after {
    transform: rotate(45deg) translate(2px, -2px);
}

.home-training__cta:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 4px;
}

.home-training__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.home-training__card {
    display: block;
    text-decoration: none;
    color: var(--color-teal);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

/* The card is an <article>; its single full-card link carries focus, so
   the lift effect also follows keyboard focus via :focus-within. */
.home-training__card:hover,
.home-training__card:focus-within {
    box-shadow: 0 14px 34px color-mix(in srgb, var(--color-text) 12%, transparent);
    transform: translateY(-2px);
}

.home-training__link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* Inset so the card's overflow: hidden doesn't clip the focus ring. */
.home-training__link:focus-visible {
    outline: 2px solid var(--color-aqua-hover);
    outline-offset: -4px;
    border-radius: var(--radius-card);
}

.home-training__image,
.home-training__image-fallback {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.home-training__image {
    object-fit: cover;
}



.home-training__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    box-sizing: border-box;
    min-width: 0;
}

.home-training__category {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 999px;
    background-color: var(--color-bg-ice);
    color: var(--color-teal-soft);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.home-training__card-title {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.home-training__date,
.home-training__meta {
    display: block;
    font-size: 0.85rem;
    color: var(--color-teal-soft);
}

.home-training__closed {
    display: inline-block;
    align-self: flex-start;
    margin-top: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: var(--color-bg-ice);
    color: var(--color-teal);
    font-size: 0.78rem;
    font-weight: 700;
}

/* Phones and small tablets (MCA-DESIGN-02V, MCA-UX-01): compact rows like
   the news cards, a thumbnail beside the text. The thumbnail stretches to
   the row height and crops with object-fit: cover; titles stop at two lines
   (the full title stays in the link's accessible name), and grid-auto-rows
   keeps every row equal. The two-column card grid takes over at 768px. */
@media (max-width: 767.98px) {
    .home-training__grid {
        grid-auto-rows: 1fr;
        gap: 12px;
    }

    .home-training__link {
        display: flex;
        align-items: stretch;
    }

    .home-training__image,
    .home-training__image-fallback {
        flex: 0 0 auto;
        width: clamp(96px, 28vw, 112px);
        height: auto;
        min-height: 104px;
        aspect-ratio: auto;
    }

    .home-training__card .home-training__image-fallback::after {
        width: 28px;
        height: 28px;
    }

    .home-training__body {
        flex: 1 1 auto;
        gap: 4px;
        padding: 10px 12px;
    }

    .home-training__category {
        padding: 2px 8px;
        font-size: 0.625rem;
    }

    .home-training__card-title,
    .home-training__meta {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        overflow-wrap: anywhere;
    }

    .home-training__card-title {
        font-size: 0.9375rem;
    }

    .home-training__date,
    .home-training__meta {
        font-size: 0.75rem;
    }

    .home-training__closed {
        margin-top: 2px;
        padding: 2px 8px;
        font-size: 0.6875rem;
    }
}

/* Small tablets: the row is 560–727px wide, so a larger thumbnail and
   slightly roomier text keep it balanced. */
@media (min-width: 600px) and (max-width: 767.98px) {
    .home-training__image,
    .home-training__image-fallback {
        width: 160px;
        min-height: 112px;
    }

    .home-training__body {
        padding: 12px 18px;
    }

    .home-training__card-title {
        font-size: 1rem;
    }

    .home-training__date,
    .home-training__meta {
        font-size: 0.8125rem;
    }
}

@media (min-width: 768px) {
    .home-training__header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .home-training__title {
        font-size: 2.25rem;
    }

    .home-training__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Tablet: a lone third card spans both columns, laid out image-beside-body
   so its 16:9 image stays one column wide instead of growing full width. */
@media (min-width: 768px) and (max-width: 991.98px) {
    .home-training__card:nth-child(3):last-child {
        grid-column: 1 / -1;
    }

    .home-training__card:nth-child(3):last-child .home-training__link {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
    }
}

@media (min-width: 992px) {
    .home-training__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Homepage Member Organizations & Cooperation Partners */

.home-members,
.home-partners {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--home-section-space) 20px;
    box-sizing: border-box;
    background-color: var(--color-bg);
    font-family: var(--font-heading);
}

.home-members__header,
.home-partners__header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.home-members__eyebrow,
.home-partners__eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-teal-soft);
    margin-bottom: 8px;
}

.home-members__title,
.home-partners__title {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--color-teal);
}

.home-partners__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    /* 44px+ tap area; the negative margin keeps the text where it was. */
    padding: 12px 0;
    margin: -12px 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-teal);
    text-decoration: none;
    white-space: nowrap;
}

.home-partners__cta::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--color-aqua-hover);
    border-top: 2px solid var(--color-aqua-hover);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.home-partners__cta:hover::after,
.home-partners__cta:focus::after {
    transform: rotate(45deg) translate(2px, -2px);
}

/* Logo grid (MCA-DESIGN-02Q): equal tinted tiles shared by the member and
   partner sections. Columns step 2 / 3 / 4 / 6, and grid-auto-rows: 1fr
   keeps every row as tall as the tallest tile; names are clamped (the full
   name stays in the tile's title, alt text and link label) so one very
   long name cannot stretch the whole grid.

   Centred last row (MCA-DESIGN-02W): the grid has twice as many half-width
   tracks as visible columns and every tile spans two, so tile widths and
   gaps are unchanged. The first tile of a short last row (:nth-child(Nn+1)
   that is also :nth-last-child(r)) starts N - r tracks in, i.e. half a
   column per missing tile; the rest auto-place after it. Each rule is
   scoped to its own column range so none leaks into another layout. */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 12px;
}

.logo-grid__item {
    display: flex;
    grid-column: span 2;
    min-width: 0;
}

/* 2 columns */
@media (max-width: 359.98px) {
    .logo-grid__item:nth-child(2n + 1):nth-last-child(1) {
        grid-column: 2 / span 2;
    }
}

/* 3 columns */
@media (min-width: 360px) and (max-width: 767.98px) {
    .logo-grid__item:nth-child(3n + 1):nth-last-child(1) {
        grid-column: 3 / span 2;
    }

    .logo-grid__item:nth-child(3n + 1):nth-last-child(2) {
        grid-column: 2 / span 2;
    }
}

/* 4 columns */
@media (min-width: 768px) and (max-width: 1099.98px) {
    .logo-grid__item:nth-child(4n + 1):nth-last-child(1) {
        grid-column: 4 / span 2;
    }

    .logo-grid__item:nth-child(4n + 1):nth-last-child(2) {
        grid-column: 3 / span 2;
    }

    .logo-grid__item:nth-child(4n + 1):nth-last-child(3) {
        grid-column: 2 / span 2;
    }
}

/* 6 columns */
@media (min-width: 1100px) {
    .logo-grid__item:nth-child(6n + 1):nth-last-child(1) {
        grid-column: 6 / span 2;
    }

    .logo-grid__item:nth-child(6n + 1):nth-last-child(2) {
        grid-column: 5 / span 2;
    }

    .logo-grid__item:nth-child(6n + 1):nth-last-child(3) {
        grid-column: 4 / span 2;
    }

    .logo-grid__item:nth-child(6n + 1):nth-last-child(4) {
        grid-column: 3 / span 2;
    }

    .logo-grid__item:nth-child(6n + 1):nth-last-child(5) {
        grid-column: 2 / span 2;
    }
}

.logo-tile {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    min-height: 112px;
    padding: 14px 8px;
    background-color: var(--color-bg-tint);
    border: 1px solid transparent;
    border-radius: 6px;
    box-sizing: border-box;
    color: var(--color-text);
    text-align: center;
    text-decoration: none;
}

.logo-tile--link {
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.logo-tile--link:hover {
    border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
    background-color: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg-tint));
}

.logo-tile--link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.logo-tile__media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
}

/* max-* rather than fixed sizes, so contain never letterboxes a logo
   inside an oversized box and the original aspect ratio is kept. */
.logo-tile__logo {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-tile__name,
.logo-tile__wordmark {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: break-word;
}

.logo-tile__name {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-text-muted);
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

/* No logo: the name becomes the tile's visual. */
.logo-tile__wordmark {
    font-size: 0.8125rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--color-primary);
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.logo-tile--link:hover .logo-tile__name,
.logo-tile--link:hover .logo-tile__wordmark {
    text-decoration: underline;
}

.home-partners__cta:focus-visible {
    outline: 2px solid var(--color-aqua-hover);
    outline-offset: 2px;
}

@media (min-width: 360px) {
    .logo-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .home-members__header,
    .home-partners__header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .home-members__title,
    .home-partners__title {
        font-size: 2.25rem;
    }

    .logo-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 16px;
    }

    .logo-tile {
        min-height: 132px;
        padding: 20px 16px;
    }

    .logo-tile__media {
        height: 56px;
    }

    .logo-tile__name {
        font-size: 0.8125rem;
    }

    .logo-tile__wordmark {
        font-size: 0.9375rem;
    }
}

@media (min-width: 1100px) {
    .logo-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 20px;
    }
}

/* No vertical padding of its own: the section above already ends with
   --home-section-space, and the footer's margin-top sets the gap below. */
.home-membership-cta {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.home-membership-cta__inner {
    background-color: var(--color-bg-tint);
    border-radius: var(--radius-card);
    margin: 0;
    padding: 32px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    font-family: var(--font-heading);
    overflow: hidden;
}

.home-membership-cta__content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.home-membership-cta__eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-teal-soft);
}

.home-membership-cta__title {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--color-teal);
    max-width: 640px;
}

.home-membership-cta__text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-teal);
    max-width: 560px;
}

/* MCA-DESIGN-02Z: one 48px button (above the 44px touch minimum) with the
   shared 6px radius; it hovers to the same royal blue as the other
   primary buttons. */
.home-membership-cta__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 48px;
    padding: 0 28px;
    border-radius: 6px;
    background-color: var(--color-primary);
    color: var(--color-bg);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background-color 0.15s ease;
}

.home-membership-cta__cta:hover,
.home-membership-cta__cta:focus {
    background-color: var(--color-primary-hover);
}

.home-membership-cta__cta:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Narrow phones: the stacked button spans the panel, like the hero CTA. */
@media (max-width: 479.98px) {
    .home-membership-cta__cta {
        width: 100%;
        white-space: normal;
        text-align: center;
    }
}

@media (min-width: 768px) {
    .home-membership-cta__inner {
        padding: 40px 48px;
    }

    .home-membership-cta__title {
        font-size: 2.25rem;
    }
}

/* Desktop: text left, the button right and vertically centred on it. */
@media (min-width: 992px) {
    .home-membership-cta__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-membership-cta__cta,
    .home-news__card,
    .home-news__cta::after,
    .home-training__card,
    .home-training__cta::after,
    .logo-tile--link,
    .home-partners__cta::after {
        transition: none;
    }
}

/* Site header: a white brand bar above a full-width royal blue nav bar
   (MCA-DESIGN-01C). Below the desktop breakpoint the nav collapses into a
   blue panel toggled by #nav-toggle (static/js/main.js). */

.site-header {
    background-color: var(--color-bg);
    border-bottom: 3px solid var(--color-primary);
    position: relative;
    z-index: 10;
    font-family: var(--font-heading);
}

/* Utility bar above the brand row (MCA-DESIGN-02C) */

.utility-bar {
    border-bottom: 1px solid var(--color-border);
}

.utility-bar__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
}

.utility-bar__group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.utility-bar__group--end {
    gap: 16px;
    /* Stays right-aligned when the left group (Facebook) is not rendered. */
    margin-left: auto;
}

.utility-bar__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.utility-bar__link--icon {
    justify-content: center;
    min-width: 28px;
}

.utility-bar__link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.utility-bar__link:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
    border-radius: 2px;
}

.utility-bar__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: currentColor;
}

@media (max-width: 479.98px) {
    .utility-bar__group,
    .utility-bar__group--end {
        gap: 10px;
    }

    .utility-bar__link {
        min-height: 32px;
        font-size: 0.75rem;
    }

    .utility-bar__link--icon {
        min-width: 24px;
    }

    /* The address stays on the contact page; keep the phone bar to one row. */
    .utility-bar__item--secondary {
        display: none;
    }
}

.site-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 44px;
    text-decoration: none;
    color: var(--color-primary);
}

.site-header__brand:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 4px;
    border-radius: 4px;
}

.site-header__logo {
    max-height: 48px;
    max-width: 120px;
    width: auto;
    height: auto; /* width/height attributes give the ratio only (PERF-01) */
    display: block;
    flex-shrink: 0;
}

.site-header__brand-text {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    overflow-wrap: break-word;
    min-width: 0;
}

.site-header__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 9px;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: none;
    cursor: pointer;
    box-sizing: border-box;
}

.site-header__toggle[aria-expanded="true"] {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-bar {
    background-color: var(--color-bg);
}

.site-header__toggle:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
}

.site-header__toggle-bar {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--color-primary);
}

/* Phones: the official logo is wide (~2.5:1), so it gets the width and the
   name is set a little smaller to keep the brand row at 72px down to 320px. */
@media (max-width: 479.98px) {
    .site-header__brand {
        gap: 10px;
    }

    .site-header__logo {
        max-height: 40px;
        max-width: 90px;
    }

    .site-header__brand-text {
        font-size: 0.8125rem;
        letter-spacing: 0;
    }
}

/* Primary navigation (mobile/tablet first: a stacked blue panel) */

.site-nav {
    display: none;
    background-color: var(--color-primary);
    color: var(--color-bg);
}

.site-nav--open {
    display: block;
}

.site-nav__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 20px 20px;
    box-sizing: border-box;
}

.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.site-nav__item {
    border-bottom: 1px solid color-mix(in srgb, var(--color-bg) 18%, transparent);
}

.site-nav__link,
.site-nav__summary {
    display: block;
    padding: 12px 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-bg);
    text-decoration: none;
    cursor: pointer;
}

.site-nav__link:hover,
.site-nav__summary:hover {
    background-color: var(--color-primary-hover);
}

/* Current page: darker fill plus a white underline bar, so the state is
   not conveyed by colour alone. */
.site-nav__link[aria-current="page"],
.site-nav__summary--current {
    background-color: var(--color-primary-dark);
    box-shadow: inset 0 -3px 0 var(--color-bg);
}

.site-nav__link:focus-visible,
.site-nav__summary:focus-visible {
    outline: 2px solid var(--color-bg);
    outline-offset: -4px;
    border-radius: 4px;
}

.site-nav__summary::-webkit-details-marker {
    display: none;
}

/* Caret for a text summary ("Бидний тухай"), matching the ▾ of the
   icon-only toggles; drawn with borders so it adds no spoken text. */
.site-nav__summary:not(.site-nav__summary--icon)::after {
    content: '';
    display: inline-block;
    margin-left: 8px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    border-bottom-width: 0;
    vertical-align: middle;
}

.site-nav__submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 8px 16px;
}

.site-nav__sublink {
    display: flex;
    align-items: center;
    min-height: 44px;
    box-sizing: border-box;
    padding: 8px;
    font-size: 0.9rem;
    color: var(--color-bg);
    text-decoration: none;
    cursor: pointer;
}

.site-nav__sublink:hover,
.site-nav__sublink:focus {
    text-decoration: underline;
}

.site-nav__sublink:focus-visible {
    outline: 2px solid var(--color-bg);
    outline-offset: -2px;
    border-radius: 4px;
}

.site-nav__cta {
    display: block;
    margin-top: 16px;
    padding: 12px 24px;
    border-radius: 6px;
    background-color: var(--color-bg);
    color: var(--color-primary);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.site-nav__cta:hover,
.site-nav__cta:focus {
    background-color: var(--color-bg-tint);
}

.site-nav__cta:focus-visible {
    outline: 2px solid var(--color-bg);
    outline-offset: 3px;
}

/* A nav item that is both a real link and a disclosure toggle for a
   submenu of not-yet-implemented destinations (e.g. "Сургалт"). */

/* Mobile: the ▾ toggle is pinned to the right of the link row, so the
   submenu inside its <details> opens full width below the link rather
   than in a narrow column beside it. */
.site-nav__link-group {
    position: relative;
}

.site-nav__link-group .site-nav__link {
    padding-right: 52px;
    line-height: 20px;
}

.site-nav__summary--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    padding: 0;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.site-nav__link-group .site-nav__summary--icon {
    position: absolute;
    top: 0;
    right: 0;
    height: 44px;
}

/* Desktop: brand bar on top, then one row of white links across the blue
   bar. The larger brand row and the header CTAs start at 1280px. */
@media (min-width: 1280px) {
    .site-header__inner {
        min-height: 96px;
        padding: 16px 20px;
    }

    .site-header__logo {
        max-height: 64px;
        max-width: 160px;
    }

    .site-header__brand-text {
        font-size: 1.5rem;
    }
}

/* The link row itself needs ~1000px (seven nowrap items, the "Гишүүн
   болох" pill and padding), so it replaces the menu panel from 1100px
   (MCA-DESIGN-02J); below that it would not fit beside the pill. */
@media (min-width: 1100px) {
    .site-header__toggle {
        display: none;
    }

    .site-nav {
        display: block;
    }

    .site-nav__inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        min-height: 56px;
        padding: 0 20px;
    }

    .site-nav__list {
        flex-direction: row;
        align-items: stretch;
        align-self: stretch;
    }

    .site-nav__item {
        border-bottom: none;
        position: relative;
        display: flex;
    }

    .site-nav__link,
    .site-nav__summary {
        display: flex;
        align-items: center;
        padding: 0 14px;
        font-size: 0.9375rem;
        white-space: nowrap;
    }

    .site-nav__link-group {
        display: flex;
    }

    .site-nav__link-group .site-nav__link {
        padding-right: 4px;
        line-height: normal;
    }

    .site-nav__link-group .site-nav__summary--icon {
        position: static;
        width: 28px;
        height: 100%;
        padding: 0;
    }

    .site-nav__dropdown {
        display: flex;
    }

    .site-nav__dropdown[open] .site-nav__submenu,
    .site-nav__dropdown .site-nav__submenu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        background: var(--color-bg);
        border: 1px solid var(--color-border);
        border-top: 3px solid var(--color-primary);
        border-radius: 0 0 12px 12px;
        padding: 8px 0;
        box-shadow: 0 12px 28px color-mix(in srgb, var(--color-primary-dark) 18%, transparent);
    }

    .site-nav__sublink {
        padding: 10px 18px;
        font-size: 0.95rem;
        color: var(--color-primary);
    }

    .site-nav__sublink:hover,
    .site-nav__sublink:focus {
        background-color: var(--color-bg-tint);
    }

    .site-nav__sublink:focus-visible {
        outline-color: var(--color-primary-hover);
    }

    .site-nav__cta {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        box-sizing: border-box;
        margin-top: 0;
        padding: 9px 22px;
        white-space: nowrap;
    }
}

/* Header CTA (MCA-DESIGN-02D/02P): desktop brand row only. It replaces the
   nav bar's membership pill at this width; below it the pill carries the
   same CTA (in the bar from 1100px, in the menu panel below that). */
.site-header__actions {
    display: none;
}

@media (min-width: 1280px) {
    .site-header__actions {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
    }

    .site-nav__cta {
        display: none;
    }
}

.site-header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.site-header__cta--primary {
    background-color: var(--color-primary);
    color: var(--color-bg);
}

.site-header__cta--primary:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.site-header__cta:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 3px;
}

/* Site footer */

.site-footer {
    background-color: var(--color-teal);
    color: var(--color-bg-ice);
    margin-top: 40px;
    font-family: var(--font-heading);
}

.site-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.site-footer__heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-bg);
    margin: 0 0 12px;
}

.site-footer__logo {
    max-height: 48px;
    max-width: 100%;
    height: auto; /* width/height attributes give the ratio only (PERF-01) */
    display: block;
    margin-bottom: 12px;
}

/* The header logo is drawn for white backgrounds (MCA-DESIGN-02Z). */
.site-footer__logo-plate {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-bottom: 14px;
    padding: 10px 14px;
    background-color: var(--color-bg);
    border-radius: 6px;
    box-sizing: border-box;
}

.site-footer__plate-logo {
    display: block;
    max-width: 100%;
    max-height: 40px;
    width: auto;
    height: auto;
}

.site-footer__brand-text {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--color-bg);
    margin-bottom: 12px;
    overflow-wrap: break-word;
}

.site-footer__description {
    margin: 0;
    line-height: 1.6;
    color: var(--color-bg-ice);
}

.site-footer__list,
.site-footer__contact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__list li,
.site-footer__contact li {
    margin-bottom: 8px;
}

.site-footer__list a,
.site-footer__contact a {
    color: var(--color-bg-ice);
    text-decoration: none;
}

/* A long contact value such as an email address has no spaces to break at,
   so it would widen the footer grid track and scroll the page sideways
   (BL-FOOTER-EMAIL-OVERFLOW-01). Allow a break anywhere, which also shrinks
   the min-content width the grid sizes by; short values are unaffected. */
.site-footer__contact a {
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* Footer tap areas (MCA-UX-02): 4px of padding cancelled by a negative
   margin makes each link 30px tall, exactly the row pitch, so targets meet
   without overlapping and nothing moves. Touch-sized phones get full 44px
   rows below. */
.site-footer__list a,
.site-footer__contact a,
.site-footer__privacy {
    display: inline-block;
    padding: 4px 0;
    margin: -4px 0;
}

@media (max-width: 767.98px) {
    .site-footer__list li,
    .site-footer__contact li {
        margin-bottom: 0;
    }

    .site-footer__list a,
    .site-footer__contact a,
    .site-footer__privacy {
        display: inline-flex;
        align-items: center;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        margin: 0;
    }
}

.site-footer__list a:hover,
.site-footer__contact a:hover,
.site-footer__list a:focus,
.site-footer__contact a:focus {
    color: var(--color-bg);
    text-decoration: underline;
    text-decoration: underline;
}

/* "Биднийг дагаарай" (MCA-UI-HEADER-FOOTER-01): a white disc keeps the
   royal blue Facebook mark visible on the royal blue footer; the white
   focus ring comes from .site-footer a:focus-visible. */
.site-footer__follow {
    margin-top: 20px;
}

.site-footer__follow-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--color-bg);
    color: var(--color-primary);
}

.site-footer__follow-link:hover {
    background-color: var(--color-bg-ice);
}

.site-footer__follow-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    padding: 20px 20px;
    font-size: 0.9rem;
    color: var(--color-bg-ice);
}

/* The contact column is omitted when nothing is configured
   (MCA-DESIGN-02R), so the grid adapts to 3 or 4 columns: on tablets an
   odd count lets the brand column take the full first row, and from 992px
   each rendered column gets an equal share. */
@media (min-width: 768px) {
    .site-footer__inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .site-footer__col--brand:nth-last-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (min-width: 992px) {
    .site-footer__inner {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
    }

    .site-footer__col--brand:nth-last-child(odd) {
        grid-column: auto;
    }
}

/* Generic page hero (About, Greeting, History) */

/* Same compact royal blue page header as .contact-hero / .survey-hero /
   .feedback-hero (MCA-DESIGN-01F): left-aligned on the 1280px grid. */
.page-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-bg);
    padding: 40px 20px;
    box-sizing: border-box;
}

.page-hero__content {
    max-width: 1240px;
    margin: 0 auto;
}

.page-hero__title {
    margin: 0 0 12px;
    font-weight: 800;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.2;
    overflow-wrap: break-word;
}

.page-hero__subtitle {
    margin: 0;
    max-width: 640px;
    font-size: 1.1rem;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .page-hero {
        padding: 56px 20px;
    }
}

/* Error pages (404; 500 is a standalone template with inline styles) */

.error-page__code {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.error-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 20px 64px;
    box-sizing: border-box;
}

.error-page__text {
    margin: 0 0 28px;
    max-width: 640px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
}

.error-page__cta {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    background-color: var(--color-primary);
    color: var(--color-bg);
    font-weight: 700;
    text-decoration: none;
}

.error-page__cta:hover,
.error-page__cta:focus {
    background-color: var(--color-primary-hover);
}

/* A touch-sized target like the CTA beside it (MCA-WEBSITE-W4); the row
   centres its items, so the text does not move. */
.error-page__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
}

.error-page__link:hover,
.error-page__link:focus {
    text-decoration: underline;
}

.error-page__cta:focus-visible,
.error-page__link:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 3px;
}

/* Privacy page, consent checkbox and form privacy notices (MCA-02C-2) */

.privacy-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 64px;
    box-sizing: border-box;
}

.privacy-page__draft {
    margin: 0 0 24px;
    padding: 12px 16px;
    border-left: 4px solid var(--color-primary);
    background-color: var(--color-bg-tint);
    color: var(--color-text);
    font-weight: 600;
}

.privacy-page__body {
    line-height: 1.7;
    color: var(--color-text);
    overflow-wrap: break-word;
}

.privacy-page__empty {
    color: var(--color-text-muted);
}

.form-consent__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-consent__row input[type="checkbox"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form-consent__row input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
}

.form-field .form-consent__label {
    font-weight: 400;
    line-height: 1.5;
    cursor: pointer;
}

.form-consent__link,
.form-privacy-notice__link {
    align-self: flex-start;
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
}

.form-privacy-notice {
    display: flex;
    flex-direction: column;
    margin: 0 0 20px;
    font-size: 0.9rem;
}

.form-privacy-notice__text {
    margin: 0;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.form-consent__link:focus-visible,
.form-privacy-notice__link:focus-visible,
.site-footer__privacy:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
}

.site-footer__bottom p + p {
    margin-top: 8px;
}

.site-footer__privacy {
    color: var(--color-bg);
}

/* Every footer link gets the white ring; the browser default is nearly
   invisible on the royal blue footer (MCA-DESIGN-02J). */
.site-footer a:focus-visible {
    outline: 2px solid var(--color-bg);
    outline-offset: 2px;
}

/* About page */

.about-sections {
    max-width: 1280px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    gap: 32px;
}

.about-section__title {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
}

.about-section__text {
    margin: 0;
    line-height: 1.7;
    color: var(--color-text);
    white-space: pre-line;
}

/* Text written in the template, not admin plain text: the membership info
   blocks (MCA-FIX-02) and the cooperation intro (MCA-FIX-03). The
   template's indentation must not become blank lines the way pre-line
   keeps them above. */
.about-section__text--rich {
    white-space: normal;
}

/* overflow-wrap: admin-entered membership text can hold long unbroken
   strings (a URL); without it they widen the grid column past 320px. */
.about-section__text--rich p {
    margin: 0 0 12px;
    overflow-wrap: anywhere;
}

.about-section__text--rich ul {
    margin: 0 0 20px;
    padding-left: 1.25rem;
    overflow-wrap: anywhere;
}

.about-section__text--rich li + li {
    margin-top: 4px;
}

/* Membership subsections (MCA-WEBSITE-FEATURE-03B): requirements,
   benefits, documents and the form-information list. */
.about-section__subtitle {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-primary);
}

.about-sections__empty {
    text-align: center;
    color: var(--color-text-muted);
}

@media (min-width: 768px) {
    .about-sections {
        grid-template-columns: repeat(3, 1fr);
    }

    /* The membership page has two articles, so no empty third column
       (MCA-WEBSITE-UIUX-01F-D). */
    .about-sections--two-column {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Greeting page */

.greeting {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px;
}

.greeting__inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    text-align: center;
}

.greeting__photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
}

/* Only the photo is centred in the one-column layout: the letter itself
   reads left-aligned at every width (MCA-WEBSITE-W4). */
.greeting__body {
    align-self: stretch;
    text-align: left;
}

.greeting__message {
    line-height: 1.7;
    color: var(--color-text);
    white-space: pre-line;
}

.greeting__empty {
    color: var(--color-text-muted);
}

.greeting__author-name {
    display: block;
    font-weight: 700;
    color: var(--color-primary);
}

.greeting__author-position {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .greeting__inner {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }

    .greeting__photo {
        flex-shrink: 0;
    }
}

/* History timeline */

.timeline {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.timeline__empty {
    text-align: center;
    color: var(--color-text-muted);
}

.timeline__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--color-border);
}

.timeline__item {
    position: relative;
    padding: 0 0 32px 28px;
}

.timeline__marker {
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-primary);
}

/* The year is positioned out of flow beside the marker: a fixed 20px line
   box centred on the 12px dot (top -4px), with .timeline__content reserving
   room below it at every width, so long titles never run into it
   (MCA-FIX-01). */
.timeline__year {
    position: absolute;
    left: 20px;
    top: -4px;
    font-size: 1rem;
    line-height: 20px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--color-primary);
}

.timeline__content {
    padding-top: 28px;
}

.timeline__image {
    max-width: 100%;
    height: auto; /* width/height attributes give the ratio only (PERF-01) */
    border-radius: 4px;
    margin-bottom: 12px;
    display: block;
}

.timeline__title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: var(--color-primary);
    overflow-wrap: break-word;
}

/* Keeps the line breaks staff type in the admin, like .about-section__text
   and .greeting__message; the text itself stays autoescaped. */
.timeline__description {
    margin: 0;
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-line;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .timeline__image {
        max-width: 320px;
    }
}

/* Training list — also the /news/ listing and the cooperation partner
   grid. Cards follow the homepage editorial news style (MCA-DESIGN-01E/F):
   no card chrome, square corners, 16:9 cover image, blue title. */

.training-list {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

/* Section headings between card grids (the cooperation page's domestic /
   international groups) need space above the previous grid. */
.training-list > .about-section__title {
    margin: 48px 0 20px;
}

.training-list__empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 40px 0;
}

.training-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 32px 24px;
}

.training-card {
    min-width: 0;
}

.training-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.training-card__link:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 4px;
}

.training-card__link:hover .training-card__title {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.training-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background-color: var(--color-bg-tint);
}

.training-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Cooperation partner logos: show the whole logo, never crop it. */
.training-card--partner .training-card__image {
    object-fit: contain;
    padding: 24px;
    box-sizing: border-box;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
}

.training-card--partner .training-card__image--placeholder {
    background-color: var(--color-bg-tint);
}

/* Partner descriptions are admin plain text: keep their line breaks (the
   text stays autoescaped) and wrap long words inside the card
   (MCA-FIX-03B). */
.training-card--partner .training-card__description {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* The partner name links to its detail page (MCA-WEBSITE-FEATURE-04B);
   the card itself is not a link, so the website button stays separate. */
.training-card__title-link {
    color: inherit;
    text-decoration: none;
}

.training-card__title-link:hover,
.training-card__title-link:focus {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.training-card__title-link:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
    border-radius: 2px;
}

.training-card__body {
    padding-top: 16px;
}

.training-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.training-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--color-bg-tint);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.training-badge--type {
    background-color: var(--color-primary);
    color: var(--color-bg);
}

/* Archive cards (MCA-FEATURE-08B): a quiet grey badge, 6.4:1 contrast. */
.training-badge--completed {
    background-color: var(--color-bg-muted);
    color: var(--color-text-muted);
}

/* The list <-> archive link, between the filters and the cards. */
.training-list__switch {
    margin: -16px 0 24px;
}

.training-card__title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-primary);
    overflow-wrap: anywhere;
}

.training-card__date {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* News category label (MCA-NEWS-CAT-01): beside the date on list cards and
   in the detail meta row. Sized like the homepage label, in royal blue;
   long Mongolian names wrap instead of overflowing. */
.news-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    min-width: 0;
}

.news-category {
    display: inline-block;
    max-width: 100%;
    padding: 3px 8px;
    background-color: var(--color-bg-tint);
    color: var(--color-primary);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    overflow-wrap: anywhere;
}

@media (min-width: 768px) {
    .training-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .training-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Pagination */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.pagination__link {
    padding: 8px 16px;
    border: 1px solid var(--color-border-input);
    border-radius: 4px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.pagination__link:hover,
.pagination__link:focus {
    background-color: var(--color-bg-tint);
}

.pagination__link:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
}

.pagination__current {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* News search (MCA-NEWS-04A) — new, additive classes; does not touch
   .form-field (used by the Training/Membership forms) or any Training
   selector. */

.news-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
    font-family: var(--font-heading);
}

.news-search__label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-teal);
}

.news-search__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news-search__input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--color-border-input);
    border-radius: 999px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text);
    box-sizing: border-box;
}

.news-search__input:focus-visible {
    outline: 2px solid var(--color-aqua-hover);
    outline-offset: 2px;
}

.news-search__button {
    padding: 10px 24px;
    border: none;
    border-radius: 999px;
    background-color: var(--color-aqua);
    color: var(--color-bg);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

.news-search__button:hover,
.news-search__button:focus {
    background-color: var(--color-aqua-hover);
}

.news-search__button:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

/* The padding and matching negative margin grow the hit area to 24px tall
   (WCAG 2.5.8) without moving anything around it (MCA-WEBSITE-UIUX-01C). */
.news-search__clear {
    align-self: flex-start;
    padding: 3px 0;
    margin: -3px 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-teal-soft);
    text-decoration: none;
}

.news-search__clear:hover,
.news-search__clear:focus {
    color: var(--color-teal);
    text-decoration: underline;
}

.news-search__clear:focus-visible {
    outline: 2px solid var(--color-aqua-hover);
    outline-offset: 2px;
}

/* News category filter (MCA-NEWS-CAT-02B): wrapping pills under the search
   form; the current one is solid royal blue. Long names wrap in the pill. */
.news-categories {
    margin: -8px 0 32px;
    font-family: var(--font-heading);
}

.news-categories__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-categories__list > li {
    max-width: 100%;
}

.news-categories__link {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--color-bg-tint);
    border-radius: 999px;
    background-color: var(--color-bg-tint);
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.news-categories__link:hover {
    border-color: var(--color-primary);
}

.news-categories__link--current,
.news-categories__link--current:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: var(--color-bg);
}

.news-categories__link:focus-visible,
.news-categories__all:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
}

/* Sits centred just under the .training-list__empty message (40px padding). */
.news-categories__all {
    display: block;
    width: fit-content;
    margin: -24px auto 40px;
    color: var(--color-primary);
    font-weight: 700;
}

/* News pagination (MCA-NEWS-03A) — intentionally a separate, additive
   set of classes rather than reusing .pagination/.pagination__link
   above, so the News page can gain page-number links, a disabled
   state, flex-wrap and focus-visible styling without altering
   Training's existing pagination, which shares the training-list/
   training-grid/training-card classes with News but not these. */

.news-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    font-family: var(--font-heading);
}

.news-pagination__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    background-color: var(--color-bg-ice);
    color: var(--color-teal);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    box-sizing: border-box;
}

.news-pagination__link:hover,
.news-pagination__link:focus {
    background-color: var(--color-bg-tint);
}

.news-pagination__link:focus-visible {
    outline: 2px solid var(--color-aqua-hover);
    outline-offset: 2px;
}

.news-pagination__link--disabled {
    background-color: var(--color-bg-muted);
    color: var(--color-text-muted);
    cursor: not-allowed;
    pointer-events: none;
}

.news-pagination__pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.news-pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 999px;
    color: var(--color-teal);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.news-pagination__page:hover,
.news-pagination__page:focus {
    background-color: var(--color-bg-ice);
}

.news-pagination__page:focus-visible {
    outline: 2px solid var(--color-aqua-hover);
    outline-offset: 2px;
}

.news-pagination__page--current {
    background-color: var(--color-aqua);
    color: var(--color-bg);
    font-weight: 800;
    cursor: default;
}

/* Training detail */

.training-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.training-detail__image {
    width: 100%;
    height: auto; /* width/height attributes give the ratio only (PERF-01) */
    max-height: 360px;
    object-fit: cover;
    margin-bottom: 24px;
    display: block;
}

.training-detail__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.training-detail__description {
    line-height: 1.7;
    color: var(--color-text);
    white-space: pre-line;
    margin: 0 0 24px;
}

.training-detail__meta {
    margin: 0 0 24px;
    display: grid;
    gap: 12px;
}

/* News detail lead (MCA-NEWS-UX-01): the editor's summary between the date
   and the body, larger and set off by a royal blue rule. Plain admin text,
   so its line breaks are kept and long words wrap. */
.news-detail__lead {
    margin: 0 0 24px;
    padding-left: 16px;
    border-left: 3px solid var(--color-primary);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* News detail body (MCA-NEWS-FIX-02): |linebreaks already turns line breaks
   into <p>/<br>, so the shared description's pre-line would only render the
   "\n\n" between paragraphs as extra blank lines. */
.news-detail__body {
    white-space: normal;
}

/* A news cover that failed to load (MCA-WEBSITE-FEATURE-05B): main.js puts
   this div in its place, also classed .training-detail__image for the width,
   360px cap and spacing; it takes the shared placeholder tint and glyph. */
.news-detail__image-fallback {
    aspect-ratio: 16 / 9;
}

.training-detail__meta-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.training-detail__meta-row dt {
    color: var(--color-text-muted);
    font-weight: 600;
}

.training-detail__meta-row dd {
    margin: 0;
    color: var(--color-text);
    text-align: right;
}

/* 24px-tall hit area with no layout change (WCAG 2.5.8,
   MCA-WEBSITE-UIUX-01C). */
.training-detail__back {
    display: inline-block;
    padding: 1px 0;
    margin: -1px 0;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.training-detail__back:hover,
.training-detail__back:focus {
    text-decoration: underline;
}

/* The site's 2px keyboard ring instead of the browser's thin default
   (MCA-FIX-04); .calendar__nav-link below gets the same ring. */
.training-detail__back:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Cooperation partner detail (MCA-WEBSITE-FEATURE-04B): the whole logo in a
   bordered box like the list cards; admin text wraps long words. */
.partner-detail__logo {
    display: block;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 16 / 9;
    margin: 24px 0;
    padding: 24px;
    box-sizing: border-box;
    object-fit: contain;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
}

.partner-detail__logo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-tint);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.partner-detail__heading {
    margin: 0 0 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.partner-detail__text,
.partner-detail .training-detail__meta-row dd {
    overflow-wrap: anywhere;
}

/* Related news on the detail page (MCA-NEWS-REL-01B): list-style cards,
   one column on phones, two from 600px, three from 992px. */
.news-related {
    margin: 16px 0 40px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.news-related__title {
    margin: 0 0 20px;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-primary);
}

.news-related__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.news-related .training-card__title {
    font-size: 1rem;
}

@media (min-width: 600px) {
    .news-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .news-related__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Training calendar */

/* Categorical colours for the three training types; each passes AA with
   white text (14.2, 6.4 and 8.3:1). */
.calendar {
    --calendar-online: var(--color-primary);
    --calendar-classroom: #1E6B52;
    --calendar-hybrid: #6B2FA0;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.calendar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

/* A 44px-tall hit area for the month controls; the negative margin keeps
   the nav row's height unchanged (MCA-WEBSITE-UIUX-01C). */
.calendar__nav-link {
    padding: 11px 0;
    margin: -11px 0;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.calendar__nav-link:hover,
.calendar__nav-link:focus {
    text-decoration: underline;
}

.calendar__nav-link:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
    border-radius: 2px;
}

.calendar__month-label {
    margin: 0;
    font-size: 1.25rem;
    color: var(--color-primary);
    text-align: center;
}

.calendar__empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 24px 0;
}

/* Desktop 7-column grid, hidden on narrow screens in favor of the agenda list. */

.calendar__grid {
    display: none;
    width: 100%;
    /* Fixed layout sizes the seven columns from the table width rather than
       from cell content, so a long .calendar__training-link can't widen its
       column past the viewport — it wraps and clamps instead. */
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.calendar__grid th {
    padding: 8px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
}

.calendar__cell {
    width: 14.28%;
    height: 100px;
    vertical-align: top;
    border: 1px solid var(--color-border);
    padding: 6px;
}

.calendar__cell--outside {
    background-color: var(--color-bg-muted);
    color: var(--color-text-muted);
}

.calendar__cell--outside .calendar__cell-date {
    color: var(--color-text-muted);
}

.calendar__cell--has-trainings {
    background-color: var(--color-bg-tint);
}

.calendar__cell-date {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.calendar__cell-trainings {
    list-style: none;
    margin: 0;
    padding: 0;
}

.calendar__cell-training {
    margin-bottom: 2px;
}

/* position: relative contains the absolutely positioned .visually-hidden
   type label and type marker. Titles wrap, long unbroken words included,
   and every entry is at least 24px tall, the WCAG 2.2 minimum target
   (MCA-FEATURE-07B). Transparent top and bottom borders stand in for
   vertical padding: the grid's clamp clips at the padding box, so a third
   line can't show below the second. */
.calendar__training-link {
    position: relative;
    display: block;
    box-sizing: border-box;
    min-height: 24px;
    font-size: 0.72rem;
    line-height: 1.3;
    text-decoration: none;
    padding: 0 4px 0 15px;
    border-block: 4px solid transparent;
    border-radius: 3px;
    color: var(--color-bg);
    overflow-wrap: anywhere;
}

/* In the grid a title shows at most two lines, ending in an ellipsis; the
   link text (its accessible name) stays whole, and the title attribute
   repeats it as a tooltip. */
.calendar__cell .calendar__training-link {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Each type also gets a white marker shape (circle / square / diamond),
   repeated in the legend, so entries don't rely on colour alone. */
.calendar__training-link::before,
.calendar__legend-swatch::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    vertical-align: 1px;
    background-color: var(--color-bg);
}

/* The marker hangs beside the title's first line, so a long unbroken
   word wraps under the text instead of leaving the marker alone on a line. */
.calendar__training-link::before {
    position: absolute;
    top: calc(0.65em - 3px);
    left: 4px;
    margin: 0;
}

.calendar__training-link--online::before,
.calendar__legend-item--online .calendar__legend-swatch::before {
    border-radius: 50%;
}

.calendar__training-link--hybrid::before,
.calendar__legend-item--hybrid .calendar__legend-swatch::before {
    transform: rotate(45deg);
}

.calendar__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    font-size: 0.85rem;
    color: var(--color-text);
}

.calendar__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.calendar__legend-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.calendar__legend-swatch::before {
    margin: 0;
}

.calendar__legend-item--online .calendar__legend-swatch {
    background-color: var(--calendar-online);
}

.calendar__legend-item--classroom .calendar__legend-swatch {
    background-color: var(--calendar-classroom);
}

.calendar__legend-item--hybrid .calendar__legend-swatch {
    background-color: var(--calendar-hybrid);
}

.calendar__training-link--online {
    background-color: var(--calendar-online);
}

.calendar__training-link--classroom {
    background-color: var(--calendar-classroom);
}

.calendar__training-link--hybrid {
    background-color: var(--calendar-hybrid);
}

.calendar__training-link:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 1px;
}

.calendar__training-link:hover,
.calendar__training-link:focus {
    text-decoration: underline;
}

/* Mobile/tablet agenda list, shown instead of the grid below 768px. */

.calendar__agenda {
    list-style: none;
    margin: 0;
    padding: 0;
}

.calendar__agenda-day {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.calendar__agenda-date {
    flex-shrink: 0;
    width: 48px;
    font-weight: 700;
    color: var(--color-primary);
}

.calendar__agenda-trainings {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    /* Flex items default to min-width: auto, so a long unbroken title
       would stretch this column past the viewport instead of wrapping. */
    min-width: 0;
}

.calendar__agenda-trainings li {
    margin-bottom: 6px;
}

/* Today (MCA-WEBSITE-UIUX-01H-B): the date sits on a filled Royal Blue
   shape — a circle in the grid, a pill in the agenda — so it reads beyond
   colour alone. Negative margins give back the extra size, so the cell
   and the agenda row keep their layout. */
.calendar__cell--today .calendar__cell-date,
.calendar__agenda-day--today .calendar__agenda-date {
    border-radius: 999px;
    background-color: var(--color-primary);
    color: var(--color-bg);
    text-align: center;
}

/* 24px circle; the 18px date line plus its 4px gap took 22px, and so does
   24px with -3px above and 1px below. */
.calendar__cell--today .calendar__cell-date {
    width: fit-content;
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    margin: -3px 0 1px;
}

/* The agenda row is a flex row that stretches its items, so today's date
   hugs its own line instead of growing with the row's trainings. */
.calendar__agenda-day--today .calendar__agenda-date {
    align-self: flex-start;
    padding: 2px 4px;
    margin: -2px -4px;
}

@media (min-width: 768px) {
    .calendar__grid {
        display: table;
    }

    .calendar__agenda {
        display: none;
    }
}

/* Training registration CTA / closed notice (on the detail page) */

.training-detail__register-cta {
    display: inline-block;
    margin-right: 16px;
    padding: 10px 24px;
    border-radius: 6px;
    background-color: var(--color-primary);
    color: var(--color-bg);
    text-decoration: none;
    font-weight: 700;
}

.training-detail__register-cta:hover,
.training-detail__register-cta:focus {
    background-color: var(--color-primary-hover);
}

.training-detail__register-cta:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
}

.training-detail__registration-notice {
    display: inline-block;
    margin: 0 16px 16px 0;
    padding: 10px 16px;
    border-radius: 4px;
    background-color: var(--color-bg-muted);
    color: var(--color-text-muted);
}

/* Satisfaction survey CTA (on the detail page) — MCA-TRAINING-06C */

.training-detail__survey-cta {
    display: inline-block;
    margin: 0 16px 16px 0;
    padding: 10px 24px;
    border-radius: 6px;
    background-color: var(--color-aqua);
    color: var(--color-bg);
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-heading);
    transition: background-color 0.15s ease;
}

.training-detail__survey-cta:hover,
.training-detail__survey-cta:focus-visible {
    background-color: var(--color-aqua-hover);
}

.training-detail__survey-cta:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .training-detail__survey-cta {
        transition: none;
    }
}

/* Feedback CTA (on the detail page) — MCA-TRAINING-06D */

.training-detail__feedback-cta {
    display: inline-block;
    margin: 0 16px 16px 0;
    padding: 9px 23px;
    border-radius: 6px;
    border: 1px solid var(--color-teal);
    background-color: transparent;
    color: var(--color-teal);
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-heading);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.training-detail__feedback-cta:hover,
.training-detail__feedback-cta:focus-visible {
    background-color: var(--color-teal);
    color: var(--color-bg);
}

.training-detail__feedback-cta:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .training-detail__feedback-cta {
        transition: none;
    }
}

/* Success / info messages (django.contrib.messages) */

.messages {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}

.messages__item {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.messages__item--success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

.messages__item--error {
    background-color: var(--color-error-bg);
    color: var(--color-error);
}

/* Training registration page */

.training-register {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 20px;
}

.training-register__notice {
    padding: 16px;
    border-radius: 4px;
    background-color: var(--color-bg-muted);
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.training-register__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.form-errors {
    padding: 12px 16px;
    border-radius: 4px;
    background-color: var(--color-error-bg);
    color: var(--color-error);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-field label {
    font-weight: 600;
    color: var(--color-text);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="url"],
.form-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--color-border-input);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* Native file input (membership attachment, MCA-WEBSITE-UIUX-01B): the
   same box as the text fields, with the browser's own button and
   chosen-file text, so assistive technology still sees a plain file input. */
.form-field input[type="file"] {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--color-border-input);
    border-radius: 4px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--color-text-muted);
    background-color: var(--color-bg);
    cursor: pointer;
}

.form-field input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    background-color: var(--color-bg-tint);
    color: var(--color-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.form-field input[type="file"]:hover::file-selector-button {
    background-color: var(--color-primary);
    color: var(--color-bg);
}

@media (prefers-reduced-motion: reduce) {
    .form-field input[type="file"]::file-selector-button {
        transition: none;
    }
}

.form-field input:focus,
.form-field textarea:focus {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 1px;
}

.form-field__error {
    margin: 0;
    color: var(--color-error);
    font-size: 0.85rem;
}

.training-register__submit {
    align-self: flex-start;
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    background-color: var(--color-primary);
    color: var(--color-bg);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

.training-register__submit:hover,
.training-register__submit:focus {
    background-color: var(--color-primary-hover);
}

.training-register__submit:focus-visible {
    outline: 2px solid var(--color-primary-hover);
    outline-offset: 2px;
}

/* Contact page (MCA-CONTACT-01E) */

.contact-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-bg);
    padding: 40px 20px;
    box-sizing: border-box;
    font-family: var(--font-heading);
}

.contact-hero__content {
    max-width: 1240px;
    margin: 0 auto;
}

.contact-hero__title {
    margin: 0 0 12px;
    font-weight: 800;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.2;
}

.contact-hero__subtitle {
    margin: 0;
    max-width: 640px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-bg);
}

@media (min-width: 768px) {
    .contact-hero {
        padding: 56px 20px;
    }
}

.contact-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 20px 64px;
    box-sizing: border-box;
    font-family: var(--font-heading);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    /* Each panel keeps its own height instead of the info panel stretching
       to the taller form (MCA-WEBSITE-UIUX-01F-E). */
    align-items: start;
}

@media (min-width: 768px) {
    .contact-layout {
        /* Tablet: both columns still fit side by side, slightly favoring
           the form; stacks to one column again below this breakpoint. */
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 32px;
    }
}

@media (min-width: 992px) {
    .contact-layout {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        gap: 48px;
    }
}

.contact-info,
.contact-form-panel {
    border-radius: var(--radius-card);
    padding: 28px 24px;
    box-sizing: border-box;
}

.contact-info {
    background-color: var(--color-bg-ice);
}

.contact-form-panel {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
}

.contact-info__title,
.contact-form-panel__title {
    margin: 0 0 20px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-teal);
}

.contact-info__list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-info__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-info__label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-teal-soft);
}

.contact-info__value {
    color: var(--color-teal);
    font-size: 1rem;
    line-height: 1.5;
    text-decoration: none;
    word-break: break-word;
}

.contact-info__value[href]:hover {
    text-decoration: underline;
}

.contact-info__social {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.contact-info__social a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background-color: var(--color-aqua);
    color: var(--color-bg);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}

.contact-info__social a:hover {
    background-color: var(--color-aqua-hover);
}

.contact-map {
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
}

.contact-map__label {
    margin: 0 0 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-teal-soft);
}

/* Inline, so the vertical padding enlarges the hit area to 24px without
   affecting line layout (WCAG 2.5.8, MCA-WEBSITE-UIUX-01C). */
.contact-map__link {
    padding: 1px 0;
    color: var(--color-teal);
    font-weight: 700;
    text-decoration: underline;
}

.contact-map__link:hover {
    color: var(--color-aqua-hover);
}

.contact-info__value:focus-visible,
.contact-info__social a:focus-visible,
.contact-map__link:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.contact-form__submit {
    align-self: flex-start;
    min-height: 44px;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    background-color: var(--color-aqua);
    color: var(--color-bg);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.contact-form__submit:hover {
    background-color: var(--color-aqua-hover);
}

.contact-form__submit:focus-visible {
    outline: 3px solid var(--color-teal);
    outline-offset: 2px;
    background-color: var(--color-aqua-hover);
}

@media (max-width: 767.98px) {
    .contact-form__submit {
        width: 100%;
        align-self: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-info__social a,
    .contact-form__submit {
        transition: none;
    }
}

/* Satisfaction survey page (MCA-TRAINING-06C) */

.survey-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-bg);
    padding: 40px 20px;
    box-sizing: border-box;
    font-family: var(--font-heading);
}

.survey-hero__content {
    max-width: 1240px;
    margin: 0 auto;
}

.survey-hero__title {
    margin: 0 0 12px;
    font-weight: 800;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    line-height: 1.2;
}

.survey-hero__subtitle {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--color-bg);
}

@media (min-width: 768px) {
    .survey-hero {
        padding: 56px 20px;
    }
}

.survey-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 64px;
    box-sizing: border-box;
    font-family: var(--font-heading);
}

@media (min-width: 768px) {
    .survey-page {
        padding: 56px 20px 80px;
    }
}

.survey-intro {
    margin-bottom: 28px;
}

.survey-intro__title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-teal);
}

.survey-intro__description {
    margin: 0;
    color: var(--color-teal-soft);
    line-height: 1.6;
}

.survey-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.survey-question {
    border: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.survey-question__legend {
    padding: 0;
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-teal);
    font-family: var(--font-heading);
}

.survey-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.survey-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg);
    color: var(--color-teal);
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.survey-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-teal);
    cursor: pointer;
}

.survey-option input[type="radio"]:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

/* Highlights the whole chip around a checked radio. :has() is supported by
   all current major browsers; on an older browser that lacks it, the
   native radio's own checked dot is still fully visible either way, so
   selection state is never solely dependent on this enhancement. */
.survey-option:has(input:checked) {
    background-color: var(--color-bg-tint);
    border-color: var(--color-primary);
}

.survey-form__submit {
    align-self: flex-start;
    min-height: 44px;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    background-color: var(--color-aqua);
    color: var(--color-bg);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.survey-form__submit:hover {
    background-color: var(--color-aqua-hover);
}

.survey-form__submit:focus-visible {
    outline: 3px solid var(--color-teal);
    outline-offset: 2px;
    background-color: var(--color-aqua-hover);
}

@media (max-width: 767.98px) {
    .survey-form__submit {
        width: 100%;
        align-self: stretch;
    }
}

/* 24px-tall hit area: 1px padding, margins offset so nothing moves
   (WCAG 2.5.8, MCA-WEBSITE-UIUX-01C). */
.survey-page__back {
    display: inline-block;
    padding: 1px 0;
    margin: 7px 0 -1px;
    color: var(--color-teal);
    font-weight: 600;
    text-decoration: underline;
}

.survey-page__back:hover,
.survey-page__back:focus-visible {
    color: var(--color-aqua-hover);
}

.survey-page__back:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .survey-option,
    .survey-form__submit {
        transition: none;
    }
}

/* Training feedback page (MCA-TRAINING-06D) */

.feedback-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-bg);
    padding: 40px 20px;
    box-sizing: border-box;
    font-family: var(--font-heading);
}

.feedback-hero__content {
    max-width: 1240px;
    margin: 0 auto;
}

.feedback-hero__title {
    margin: 0 0 12px;
    font-weight: 800;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    line-height: 1.2;
}

.feedback-hero__subtitle {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--color-bg);
}

@media (min-width: 768px) {
    .feedback-hero {
        padding: 56px 20px;
    }
}

.feedback-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 64px;
    box-sizing: border-box;
    font-family: var(--font-heading);
}

@media (min-width: 768px) {
    .feedback-page {
        padding: 56px 20px 80px;
    }
}

.feedback-intro {
    margin: 0 0 28px;
    color: var(--color-teal-soft);
    line-height: 1.6;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
}

.feedback-form__submit {
    align-self: flex-start;
    min-height: 44px;
    padding: 14px 32px;
    border: none;
    border-radius: 6px;
    background-color: var(--color-aqua);
    color: var(--color-bg);
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.feedback-form__submit:hover {
    background-color: var(--color-aqua-hover);
}

.feedback-form__submit:focus-visible {
    outline: 3px solid var(--color-teal);
    outline-offset: 2px;
    background-color: var(--color-aqua-hover);
}

@media (max-width: 767.98px) {
    .feedback-form__submit {
        width: 100%;
        align-self: stretch;
    }
}

/* 24px-tall hit area: 1px padding, margins offset so nothing moves
   (WCAG 2.5.8, MCA-WEBSITE-UIUX-01C). */
.feedback-page__back {
    display: inline-block;
    padding: 1px 0;
    margin: 7px 0 -1px;
    color: var(--color-teal);
    font-weight: 600;
    text-decoration: underline;
}

.feedback-page__back:hover,
.feedback-page__back:focus-visible {
    color: var(--color-aqua-hover);
}

.feedback-page__back:focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .feedback-form__submit {
        transition: none;
    }
}

/* Missing-image placeholders (MCA-DESIGN-01G): one flat tint with a muted
   image glyph everywhere, instead of plain blocks or saturated gradients.
   Placed last so it wins over each component's own display: block. */
.home-about__image-fallback,
.home-news__image-fallback,
.home-training__image-fallback,
.news-detail__image-fallback,
.training-card__image--placeholder:empty {
    display: grid;
    place-items: center;
    background: var(--color-bg-tint);
}

.home-about__image-fallback::after,
.home-news__image-fallback::after,
.home-training__image-fallback::after,
.news-detail__image-fallback::after,
.training-card__image--placeholder:empty::after {
    content: '';
    width: 40px;
    height: 40px;
    background-color: var(--color-border-input);
    -webkit-mask: var(--placeholder-icon) center / contain no-repeat;
    mask: var(--placeholder-icon) center / contain no-repeat;
}
