/* ========================================================= COMMON.CSS — Reusable Cross-Section Classes ========================================================= */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: 20px;
}

/* Button Foundations */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-p3);
    line-height: var(--line-height-p3);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 1px solid var(--color-primary);
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--color-white);
    border: 1px solid var(--color-white);
}

.btn-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-black);
}

.btn-dark {
    background-color: var(--color-black);
    color: var(--color-white);
    border: 1px solid var(--color-black);
}

.btn-dark:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-sm {
    font-size: var(--font-size-p4);
    line-height: var(--line-height-p4);
    padding: 8px 14px;
}

/* Dark theme */
.dark-bg {
    background-color: var(--color-black);
}
.off-white-bg {
    background-color: var(--color-offwhite);
}
.white-bg{background-color: var(--color-white);}
/* Eyebrow / Badges */
.badge-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-p1);
    line-height: var(--line-height-p1);
    color: var(--color-white);
}

.badge-eyebrow .dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background-color: var(--color-primary);
    display: inline-block;
}

/* Title Split Shared Pattern (WordPress / CMS Safe Structure) */
.title-split {
    margin-bottom: var(--space-2xl);
}

.title-split .col-right {
    margin-left: auto;
}

.title-split .col-right p {
    font-size: var(--font-size-p2);
    line-height: var(--line-height-p2);
}

/* Centered section headings on every page, home included (Figma: H3 40/48 + P2 21/28, centered). */
.site-main .title-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: center;
}
.site-main .title-split :is(.col-left, .col-right) { width: 100%; max-width: none; margin: 0 auto; }
.site-main .title-split .h2 { max-width: none; font-weight: var(--font-weight-medium); }
.site-main .title-split .col-right p { font-size: var(--font-size-p2); line-height: 28px; }
.site-main .title-split .col-right:empty { display: none; }

/* Section Divider Hairlines */
.section-divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-black);
    border: none;
    margin: 0;
    opacity: 0.2;
}

@media (max-width:1199px) {

    .title-split .col-right {
        margin-left: 0;
    }

    /* Forced breaks in headings are dropped on smaller screens. Breaks inside intro paragraphs stay:
       they separate sentences, and hiding them ran the sentences together ("at a time.NGT"). */
    .title-split .col-left .h2 br {
        display: none;
    }
}

@media (max-width:991px) {
    .title-split {
        grid-template-columns: repeat(1, 1fr);
        gap: 14px;
    }

    .title-split .col-left,
    .title-split .col-right {
        max-width: 100%;
    }

    .site-main .title-split .col-right p { font-size: 18px; }
}

@media (max-width:767px) {
    .btn {
        width: 100%;
    }
}
/* ── Skip link: hidden until focused, then shown above the header ── */
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 12px 20px;
    background: var(--color-white);
    color: var(--color-black);
    font-weight: var(--font-weight-bold);
    border-radius: 6px;
    transform: translateY(-200%);
}
.skip-link:focus,
.skip-link:focus-visible {
    transform: none;
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ── Respect the OS "reduce motion" setting site-wide ── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
}

/* ── Accessible gold (WCAG AA 4.5:1) ──
   The brand gold (#C48E2A) gives only 2.9:1 with white text or as text on light backgrounds.
   Wherever gold carries text in those two situations, the darker --color-primary-strong is used.
   Decorative gold (bullets, rules, icons) and gold text on navy keep the brand gold. */
.btn-primary {
    background-color: var(--color-primary-strong);
    border-color: var(--color-primary-strong);
}
.btn-primary:hover {
    background-color: var(--color-primary-strong-hover);
    border-color: var(--color-primary-strong-hover);
}

/* ── Rounded image cards: no dark hairline on the curved edges (QA BG_16) ──
   The card's navy background showed through the anti-aliased corners of the photo. The photo now
   overlaps the card edge by 1px, and the card clips with a mask so zoom-on-hover stays clipped too. */
.services-section .service-card,
.organisations-section .org-card {
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}
.services-section .service-img,
.organisations-section .org-img {
    top: -1px;
    left: -1px;
    width: calc(100% + 2px) !important;
    height: calc(100% + 2px) !important;
}

/* ── Back to top (footer.php + script.js) ──
   Shows after the visitor scrolls down; hidden (and out of the tab order) at the top of the page. */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background-color: var(--color-primary-strong);
    color: var(--color-white);
    box-shadow: 0 6px 18px rgba(3, 8, 50, 0.25);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base), background-color var(--transition-fast);
}
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.back-to-top:hover {
    background-color: var(--color-black);
}
.back-to-top:focus-visible {
    outline: 2px solid var(--color-black);
    outline-offset: 3px;
}
@media (max-width: 767px) {
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }
}
@media print {
    .back-to-top { display: none; }
}
