/* =========================================================
   FSC AFRICA - GLOBAL PUBLIC UI
   Consistent back-to-top control for every public page.
   ========================================================= */

.fsc-site-back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 1200;
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(183, 131, 50, 0.55);
    border-radius: 50%;
    background: #000000;
    color: #b78332;
    box-shadow: 0 14px 34px rgba(2, 22, 35, 0.18);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition:
        opacity 180ms ease,
        visibility 180ms ease,
        transform 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        border-color 180ms ease;
}

.fsc-site-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

.fsc-site-back-to-top:hover,
.fsc-site-back-to-top:focus-visible {
    background: #b78332;
    color: #000000;
    border-color: #b78332;
}

.fsc-site-back-to-top:focus-visible {
    outline: 3px solid rgba(183, 131, 50, 0.55);
    outline-offset: 4px;
}

.fsc-site-back-to-top svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 767px) {
    .fsc-site-back-to-top {
        right: 18px;
        bottom: 18px;
        width: 48px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fsc-site-back-to-top {
        transition: none;
    }
}

/* Review correction: the supplied mobile menu kept black division labels
   but made their panel transparent. Keep the desktop panel's light surface. */
@media (max-width: 1024px) {
    body.fsc-site .fsc-nav__dropdown[open] .fsc-nav__dropdown-panel {
        margin-top: 8px;
        margin-bottom: 16px;
        overflow: hidden;
        border: 1px solid var(--fsc-border);
        border-radius: var(--fsc-radius-sm);
        background: var(--fsc-surface);
    }
}

/* Audit v5: common focus, layout and navigation treatment. */
body.fsc-site :where(a, button, summary, input, select, textarea):focus-visible {
    outline: 3px solid #b78332;
    outline-offset: 4px;
}
body.fsc-site :where(.fsc-split__content, .fsc-section-heading, .fsc-contact-grid > *, .fsc-field) { min-width: 0; }
body.fsc-site :where(h1, h2, h3, p, a) { overflow-wrap: break-word; }
body.fsc-site .fsc-field input, body.fsc-site .fsc-field select, body.fsc-site .fsc-field textarea { min-width: 0; max-width: 100%; }
.fsc-nav > a[aria-current="page"], .fsc-nav__dropdown.has-current-page > summary { color: #d8a958; }
.fsc-nav > a[aria-current="page"] { text-decoration: underline; text-underline-offset: 7px; }
.fsc-nav__dropdown-panel a[aria-current="page"] { box-shadow: inset 3px 0 0 #b78332; }
#main-content, [id] { scroll-margin-top: 24px; }
.fsc-form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fsc-form-note a { text-decoration: underline !important; text-underline-offset: 3px; }
.validation-summary-valid { display: none; }
body.fsc-site .fsc-section-heading > h2, body.fsc-site .fsc-simple-page h1, body.fsc-site .fsc-simple-page h2 { color: #020607; }
body.fsc-site .fsc-section--dark .fsc-section-heading > h2 { color: #fff; }
@media (max-width: 1024px) {
    body.fsc-site .fsc-nav.is-open { max-height: calc(100dvh - 112px); overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 480px) {
    body.fsc-site .fsc-page-hero h1 { font-size: clamp(2.2rem, 9.5vw, 3.2rem); }
    body.fsc-site .fsc-field :is(input, select, textarea) { font-size: 16px; }
    body.fsc-site .fsc-form-card { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    body.fsc-site *, body.fsc-site *::before, body.fsc-site *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

:where(.fsc-site) img { height: auto; }
.fsc-course-card__image { display: block; }
.fsc-course-card__image img { height: auto; }

.fsc-form-trap { left: auto; clip-path: inset(50%); clip: rect(0,0,0,0); white-space: nowrap; }

/* Numbered photographs have individual focal points within the existing frames. */
[data-image-ref="01"] img, [data-image-ref="07"] img { object-position: 50% 65%; }
[data-image-ref="02"] img, [data-image-ref="08"] img { object-position: 18% 48%; }
[data-image-ref="04"] img, [data-image-ref="10"] img { object-position: 48% 68%; }
[data-image-ref="05"] img { object-position: 48% 49%; }
[data-image-ref="06"] img { object-position: 50% 35%; }
[data-image-ref="12"] img { object-position: 50% 15%; }
[data-image-ref="13"] img { object-position: 60% 51%; }
[data-image-ref="14"] img { object-position: 76% 49%; }
[data-image-ref="28"] img { object-position: 54% 50%; }
[data-image-ref="29"] img { object-position: 48% 55%; }
[data-image-ref="31"] img { object-position: 39% 31%; }
[data-image-ref="32"] img { object-position: 50% 45%; }
[data-image-ref="34"] img { object-position: 18% 46%; }

/* Landscape editorial images keep more of the group or scene in view. */
.about-intro__visual[data-image-ref="06"] > img {
    min-height: 0;
    aspect-ratio: 4 / 3;
}
.fsc-split__media:is([data-image-ref="14"], [data-image-ref="32"]) img {
    aspect-ratio: 4 / 3;
}

@media (max-width: 1024px) {
    .fsc-split__media:is([data-image-ref="14"], [data-image-ref="32"]) img {
        aspect-ratio: 16 / 10;
    }
}

@media (max-width: 600px) {
    .fsc-split__media:is([data-image-ref="12"], [data-image-ref="29"]) img {
        aspect-ratio: 4 / 5;
    }
    [data-image-ref="31"] img { object-position: 34% 42%; }
}

/* Retain white hero copy over the light doorway and grass in these photographs. */
.fsc-page-hero:is([data-image-ref="13"], [data-image-ref="34"]) .fsc-page-hero__overlay {
    background: linear-gradient(90deg, rgba(0, 0, 0, .86), rgba(0, 0, 0, .70) 41%,
        rgba(0, 0, 0, .22) 75%, rgba(0, 0, 0, .12));
}

@media (max-width: 767px) {
    .fsc-page-hero:is([data-image-ref="13"], [data-image-ref="34"]) .fsc-page-hero__overlay {
        background: linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .25) 28%,
            rgba(0, 0, 0, .76) 60%, rgba(0, 0, 0, .90));
    }
}

/* Keep the supplied facility overview in its natural proportions above the card copy. */
.fsc-facility-photo-card {
    display: flex;
    flex-direction: column;
    background: var(--fsc-primary);
}

.fsc-facility-photo-card > .fsc-image-card__media,
.fsc-facility-photo-card > .fsc-image-card__content,
.fsc-facility-photo-card > .about-division-card__content {
    position: relative;
    inset: auto;
    height: auto;
}

.fsc-facility-photo-card > .fsc-image-card__content,
.fsc-facility-photo-card > .about-division-card__content {
    margin-top: auto;
}

.fsc-facility-photo-card .fsc-image-card__media img,
.about-division-card.fsc-facility-photo-card > img,
.fsc-split__media[data-image-ref="26"] img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    transform: none;
}
