/*
 * Makerere AI Health Lab - site styles
 * ------------------------------------------------------------------
 * Loaded AFTER web/assets/css/style.css (the compiled Bootstrap 4.5.3
 * theme) so everything here can override the vendored template without
 * editing that 176 KB build artefact.
 *
 * Contents
 *   1. Tokens
 *   2. Base & accessibility
 *   3. Typography & section headers
 *   4. Buttons & badges
 *   5. Cards (project, person, publication, stat)
 *   6. Header, navigation, footer
 *   7. Hero & page hero
 *   8. Logo strips
 *   9. Forms
 *  10. AIHA-Net & conferences
 *  11. Utilities
 */

/* ============================================================ 1. Tokens */

:root {
    /* The template's brand green. At 2.43:1 on white it is not usable for
       text or for white-on-green buttons, so it is reserved for large
       decorative areas only. --lab-green-ink is the accessible counterpart
       (5.1:1 on white) used for text, links and button fills. */
    --lab-green: #7AB730;
    --lab-green-ink: #4E7A1E;
    --lab-green-deep: #3C5F16;
    --lab-green-wash: #F2F8EA;
    --lab-green-border: #D6E9BC;

    --lab-ink: #1C2419;
    --lab-body: #4A5348;
    --lab-muted: #6B746A;

    --lab-surface: #FFFFFF;
    --lab-surface-alt: #F7F9F5;
    --lab-border: #E2E7DE;

    --lab-radius: 10px;
    --lab-radius-lg: 16px;
    --lab-shadow: 0 1px 2px rgba(28, 36, 25, .05), 0 8px 24px rgba(28, 36, 25, .06);
    --lab-shadow-lift: 0 4px 12px rgba(28, 36, 25, .08), 0 16px 40px rgba(28, 36, 25, .10);

    --lab-space: 1.5rem;
    --lab-section-y: 5rem;
}

/* ================================================ 2. Base & accessibility */

body {
    color: var(--lab-body);
    background: var(--lab-surface);
    -webkit-font-smoothing: antialiased;
}

/* The template ships no visible focus ring. Keyboard users need one. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 3px solid var(--lab-green-ink);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Fallback for browsers without :focus-visible. */
.btn:focus,
.nav-link:focus,
.form-control:focus {
    box-shadow: 0 0 0 .2rem rgba(78, 122, 30, .3);
}

.lab-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    padding: .75rem 1.25rem;
    background: var(--lab-green-ink);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.lab-skip-link:focus {
    left: .5rem;
    top: .5rem;
    color: #fff;
}

.lab-visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ================================ 3. Typography & section headers */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--lab-ink);
    font-weight: 600;
    line-height: 1.25;
}

a {
    color: var(--lab-green-ink);
}

a:hover, a:focus {
    color: var(--lab-green-deep);
}

.lab-section {
    padding-top: var(--lab-section-y);
    padding-bottom: var(--lab-section-y);
}

.lab-section--tight {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.lab-section--alt {
    background: var(--lab-surface-alt);
}

.lab-section--wash {
    background: var(--lab-green-wash);
}

.lab-section-header {
    max-width: 46rem;
    margin-bottom: 2.5rem;
}

.lab-section-header--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.lab-eyebrow {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--lab-green-ink);
    margin-bottom: .625rem;
}

.lab-section-title {
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
    margin-bottom: .75rem;
}

.lab-section-intro {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--lab-body);
    margin-bottom: 0;
}

.lab-prose p {
    line-height: 1.75;
    margin-bottom: 1.1rem;
}

.lab-prose > :last-child {
    margin-bottom: 0;
}

/* ====================================== 4. Buttons & badges */

.btn {
    border-radius: var(--lab-radius);
    font-weight: 600;
    padding: .7rem 1.4rem;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

/* White-on-#7AB730 is 2.43:1. Darkened so button labels actually pass AA. */
.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: var(--lab-green-ink);
    border-color: var(--lab-green-ink);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--lab-green-deep);
    border-color: var(--lab-green-deep);
    color: #fff;
}

.btn-outline-primary {
    color: var(--lab-green-ink);
    border-color: var(--lab-green-ink);
    background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--lab-green-ink);
    border-color: var(--lab-green-ink);
    color: #fff;
}

.btn-lab-ghost {
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .75);
    background: transparent;
}

.btn-lab-ghost:hover,
.btn-lab-ghost:focus {
    background: #fff;
    border-color: #fff;
    color: var(--lab-green-deep);
}

.lab-badge {
    display: inline-flex;
    /* Badges sit inside column flex containers (card bodies); without this
       they stretch to the full container width instead of hugging their text. */
    align-self: flex-start;
    width: fit-content;
    align-items: center;
    gap: .4rem;
    padding: .28rem .7rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.lab-badge--active     { background: var(--lab-green-wash); color: var(--lab-green-deep); border-color: var(--lab-green-border); }
.lab-badge--completed  { background: #EEF1F5; color: #40506B; border-color: #D6DDE8; }
.lab-badge--dataset    { background: #E8F2FB; color: #1B4F80; border-color: #C6DFF3; }
.lab-badge--pilot      { background: #FDF3E3; color: #825200; border-color: #F3E0BC; }
.lab-badge--partners   { background: #F6EDFA; color: #61307E; border-color: #E4D0EE; }
.lab-badge--neutral    { background: var(--lab-surface-alt); color: var(--lab-body); border-color: var(--lab-border); }

.lab-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: var(--lab-muted);
}

.lab-meta-chip i {
    color: var(--lab-green-ink);
}

/* ================================================== 5. Cards */

.lab-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--lab-surface);
    border: 1px solid var(--lab-border);
    border-radius: var(--lab-radius-lg);
    box-shadow: var(--lab-shadow);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.lab-card:hover,
.lab-card:focus-within {
    transform: translateY(-3px);
    box-shadow: var(--lab-shadow-lift);
    border-color: var(--lab-green-border);
}

.lab-card__body {
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.lab-card__icon {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: var(--lab-radius);
    background: var(--lab-green-wash);
    color: var(--lab-green-deep);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.lab-card__title {
    font-size: 1.0625rem;
    line-height: 1.4;
    margin-bottom: .6rem;
}

.lab-card__title a {
    color: inherit;
    text-decoration: none;
}

.lab-card__title a:hover,
.lab-card__title a:focus {
    color: var(--lab-green-ink);
    text-decoration: underline;
}

.lab-card__summary {
    font-size: .9375rem;
    line-height: 1.65;
    color: var(--lab-body);
    margin-bottom: 1rem;
}

/* Keeps a grid of cards visually even when the source copy varies in
   length. Full text stays in the DOM for search engines and assistive tech. */
.lab-card__summary--clamp {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lab-card__title--clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.lab-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1rem;
    margin-bottom: 1rem;
}

.lab-card__footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--lab-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.lab-card__link {
    font-weight: 600;
    font-size: .9375rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.lab-card__link:hover,
.lab-card__link:focus {
    text-decoration: underline;
}

.lab-card__link i {
    transition: transform .15s ease;
}

.lab-card__link:hover i {
    transform: translateX(3px);
}

/* ---- Person card ---- */

.lab-person {
    text-align: center;
}

.lab-person__figure {
    position: relative;
    margin: 0;
    aspect-ratio: 1 / 1;
    background: var(--lab-surface-alt);
    overflow: hidden;
}

/* aspect-ratio fallback for older Safari */
@supports not (aspect-ratio: 1 / 1) {
    .lab-person__figure { height: 0; padding-bottom: 100%; }
    .lab-person__figure img { position: absolute; inset: 0; }
}

.lab-person__figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.lab-person__initials {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: var(--lab-green-wash);
    color: var(--lab-green-deep);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.lab-person__body {
    padding: 1.25rem 1.1rem 1.4rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.lab-person__name {
    font-size: 1rem;
    margin-bottom: .25rem;
}

.lab-person__role {
    font-size: .85rem;
    color: var(--lab-green-ink);
    font-weight: 600;
    margin-bottom: .3rem;
    line-height: 1.45;
}

.lab-person__affiliation {
    font-size: .82rem;
    color: var(--lab-muted);
    margin-bottom: .5rem;
    line-height: 1.5;
}

.lab-person__expertise {
    font-size: .8rem;
    color: var(--lab-body);
    margin-bottom: .75rem;
    line-height: 1.55;
}

.lab-person__actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    align-items: center;
}

.lab-person__social {
    display: flex;
    gap: .4rem;
    justify-content: center;
}

.lab-person__social a {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--lab-border);
    color: var(--lab-body);
    font-size: .8rem;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.lab-person__social a:hover,
.lab-person__social a:focus {
    background: var(--lab-green-ink);
    border-color: var(--lab-green-ink);
    color: #fff;
}

.lab-group-heading {
    font-size: 1.1rem;
    letter-spacing: .02em;
    padding-bottom: .6rem;
    margin-bottom: 1.75rem;
    border-bottom: 2px solid var(--lab-green-border);
    display: flex;
    align-items: baseline;
    gap: .6rem;
}

.lab-group-heading__count {
    font-size: .78rem;
    font-weight: 600;
    color: var(--lab-muted);
}

/* ---- Stat card ---- */

.lab-stat {
    height: 100%;
    padding: 1.6rem 1.25rem;
    border-radius: var(--lab-radius-lg);
    background: var(--lab-surface);
    border: 1px solid var(--lab-border);
    text-align: center;
}

.lab-stat__value {
    font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem);
    font-weight: 700;
    line-height: 1.05;
    color: var(--lab-green-deep);
    margin-bottom: .35rem;
}

.lab-stat__label {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lab-ink);
    margin-bottom: .3rem;
}

.lab-stat__note {
    font-size: .8rem;
    color: var(--lab-muted);
    margin-bottom: 0;
    line-height: 1.5;
}

/* ---- Publication card ---- */

.lab-pub {
    display: flex;
    gap: 1.1rem;
    padding: 1.35rem;
    border: 1px solid var(--lab-border);
    border-radius: var(--lab-radius-lg);
    background: var(--lab-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.lab-pub:hover,
.lab-pub:focus-within {
    border-color: var(--lab-green-border);
    box-shadow: var(--lab-shadow);
}

.lab-pub__icon {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: var(--lab-radius);
    background: var(--lab-green-wash);
    color: var(--lab-green-deep);
}

.lab-pub__title {
    font-size: 1rem;
    margin-bottom: .3rem;
    line-height: 1.45;
}

.lab-pub__authors {
    font-size: .875rem;
    color: var(--lab-body);
    margin-bottom: .3rem;
}

.lab-pub__meta {
    font-size: .8rem;
    color: var(--lab-muted);
    margin-bottom: .7rem;
}

.lab-pub__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* ---- Empty state ---- */

.lab-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    border: 1px dashed var(--lab-border);
    border-radius: var(--lab-radius-lg);
    background: var(--lab-surface-alt);
}

.lab-empty__icon {
    font-size: 2rem;
    color: var(--lab-green-ink);
    margin-bottom: .85rem;
}

/* ---- Filter pills ---- */

.lab-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2rem;
}

.lab-filter {
    border: 1px solid var(--lab-border);
    background: var(--lab-surface);
    color: var(--lab-body);
    border-radius: 999px;
    padding: .4rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s ease;
}

.lab-filter:hover,
.lab-filter:focus {
    border-color: var(--lab-green-ink);
    color: var(--lab-green-deep);
    text-decoration: none;
}

.lab-filter[aria-pressed="true"],
.lab-filter.is-active {
    background: var(--lab-green-ink);
    border-color: var(--lab-green-ink);
    color: #fff;
}

/* ============================ 6. Header, navigation, footer */

.lab-topbar {
    background: var(--lab-surface-alt);
    border-bottom: 1px solid var(--lab-border);
    font-size: .85rem;
}

.lab-topbar a {
    color: var(--lab-body);
    text-decoration: none;
}

.lab-topbar a:hover,
.lab-topbar a:focus {
    color: var(--lab-green-deep);
    text-decoration: underline;
}

.lab-topbar__social a {
    display: inline-grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    color: var(--lab-green-ink);
}

.lab-topbar__social a:hover,
.lab-topbar__social a:focus {
    background: var(--lab-green-ink);
    color: #fff;
}

.lab-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--lab-surface);
    box-shadow: 0 1px 0 var(--lab-border);
}

.lab-navbar {
    padding-top: .5rem;
    padding-bottom: .5rem;
}

.lab-navbar .navbar-brand img {
    width: 210px;
    max-width: 60vw;
    height: auto;
}

.lab-navbar .nav-link {
    color: var(--lab-ink) !important;
    font-weight: 600;
    font-size: .9375rem;
    padding: .75rem .85rem !important;
    border-radius: 6px;
}

.lab-navbar .nav-link:hover,
.lab-navbar .nav-link:focus {
    color: var(--lab-green-deep) !important;
    background: var(--lab-green-wash);
}

.lab-navbar .nav-link.active,
.lab-navbar .nav-item.active > .nav-link {
    color: var(--lab-green-deep) !important;
    background: var(--lab-green-wash);
}

.lab-navbar .dropdown-menu {
    min-width: 15rem;
    border: 1px solid var(--lab-border);
    border-radius: var(--lab-radius);
    box-shadow: var(--lab-shadow);
    padding: .4rem;
    margin-top: .25rem;
}

.lab-navbar .dropdown-item {
    border-radius: 6px;
    padding: .55rem .8rem;
    font-size: .9rem;
    font-weight: 500;
    color: var(--lab-ink);
    white-space: normal;
}

.lab-navbar .dropdown-item:hover,
.lab-navbar .dropdown-item:focus,
.lab-navbar .dropdown-item.active {
    background: var(--lab-green-wash);
    color: var(--lab-green-deep);
}

.lab-navbar .navbar-toggler {
    border: 1px solid var(--lab-border);
    padding: .5rem .7rem;
    border-radius: 8px;
}

/*
 * Open dropdowns on hover at desktop widths.
 *
 * The original theme did this in JS by firing synthetic clicks on
 * mouseover/mouseout, which fought keyboard focus and made the menus
 * unusable without a mouse. CSS does the same job with no scripting, and
 * :focus-within keeps it working for keyboard users - who additionally
 * still get Bootstrap's normal click-to-open behaviour.
 *
 * A padding bridge spans the gap between the trigger and the panel so the
 * menu does not close while the pointer travels to it.
 */
@media (min-width: 992px) {
    .lab-navbar .nav-item.dropdown:hover > .dropdown-menu,
    .lab-navbar .nav-item.dropdown:focus-within > .dropdown-menu {
        display: block;
    }

    .lab-navbar .nav-item.dropdown > .dropdown-menu {
        margin-top: 0;
        top: 100%;
    }

    /* Invisible bridge across the trigger/panel gap. */
    .lab-navbar .nav-item.dropdown::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: .5rem;
    }

    .lab-navbar .nav-item.dropdown {
        position: relative;
    }
}

@media (max-width: 991.98px) {
    .lab-navbar .navbar-collapse {
        margin-top: .75rem;
        padding-top: .5rem;
        border-top: 1px solid var(--lab-border);
        max-height: 75vh;
        overflow-y: auto;
    }

    .lab-navbar .dropdown-menu {
        border: 0;
        box-shadow: none;
        padding-left: .75rem;
        background: transparent;
    }
}

/* ---- Footer ---- */

.lab-footer {
    background: #17200F;
    color: #C6CFBB;
    padding-top: 4rem;
    padding-bottom: 1.5rem;
    margin-top: 0;
}

.lab-footer h2,
.lab-footer h3 {
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
}

.lab-footer a {
    color: #C6CFBB;
    text-decoration: none;
}

.lab-footer a:hover,
.lab-footer a:focus {
    color: #fff;
    text-decoration: underline;
}

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

.lab-footer__list li + li {
    margin-top: .55rem;
}

.lab-footer__brand img {
    width: 210px;
    max-width: 100%;
    height: auto;
    margin-bottom: 1.25rem;
}

.lab-footer__tagline {
    font-size: .9rem;
    line-height: 1.65;
    max-width: 22rem;
}

.lab-footer__social {
    display: flex;
    gap: .5rem;
    margin-top: 1.1rem;
}

.lab-footer__social a {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .25);
}

.lab-footer__social a:hover,
.lab-footer__social a:focus {
    background: var(--lab-green);
    border-color: var(--lab-green);
    color: #17200F;
}

.lab-footer__contact {
    font-size: .9rem;
    line-height: 1.7;
    list-style: none;
    padding: 0;
    margin: 0;
}

.lab-footer__contact li {
    display: flex;
    gap: .6rem;
    margin-bottom: .6rem;
}

.lab-footer__contact i {
    color: var(--lab-green);
    margin-top: .3rem;
}

.lab-footer__bar {
    border-top: 1px solid rgba(255, 255, 255, .12);
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    font-size: .85rem;
}

/* ============================================ 7. Hero & page hero */

.lab-hero {
    position: relative;
    color: #fff;
    background: #24310F;
    overflow: hidden;
}

.lab-hero__media {
    position: absolute;
    inset: 0;
}

.lab-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 52% 42%;
}

.lab-hero__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg,
            rgba(12, 22, 6, .97) 0%,
            rgba(16, 30, 9, .94) 55%,
            rgba(22, 40, 12, .90) 100%);
}

.lab-hero__inner {
    position: relative;
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
}

.lab-hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 992px) {
    .lab-hero__grid {
        grid-template-columns: 1.05fr .95fr;
        gap: 3.5rem;
    }
}

.lab-hero__copy {
    max-width: 38rem;
}

.lab-hero__figure {
    margin: 0;
    border-radius: var(--lab-radius-lg);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    border: 1px solid rgba(255, 255, 255, .12);
}

.lab-hero__figure img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 26rem;
    object-fit: cover;
    object-position: center 45%;
}

.lab-hero__caption {
    background: rgba(0, 0, 0, .45);
    color: #DCE6CE;
    font-size: .8rem;
    line-height: 1.5;
    padding: .7rem .9rem;
    margin: 0;
}

.lab-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #C8E39B;
    margin-bottom: 1rem;
}

.lab-hero__title {
    color: #fff;
    font-size: clamp(1.9rem, 1.2rem + 2.9vw, 3.25rem);
    line-height: 1.14;
    margin-bottom: 1.1rem;
}

.lab-hero__lead {
    font-size: clamp(1rem, .95rem + .35vw, 1.15rem);
    line-height: 1.7;
    color: #E3EAD8;
    margin-bottom: 1.9rem;
}

.lab-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

/* Compact hero for interior pages */
.lab-pagehero {
    position: relative;
    background: var(--lab-green-wash);
    border-bottom: 1px solid var(--lab-green-border);
    padding-top: 3.25rem;
    padding-bottom: 3.25rem;
}

.lab-pagehero__title {
    font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.6rem);
    margin-bottom: .6rem;
}

.lab-pagehero__lead {
    font-size: 1.0625rem;
    line-height: 1.7;
    max-width: 44rem;
    margin-bottom: 0;
    color: var(--lab-body);
}

.lab-breadcrumb {
    font-size: .82rem;
    margin-bottom: .9rem;
}

.lab-breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: 0;
    margin: 0;
}

.lab-breadcrumb li + li::before {
    content: "/";
    margin-right: .4rem;
    color: var(--lab-muted);
}

.lab-breadcrumb a {
    color: var(--lab-body);
    text-decoration: none;
}

.lab-breadcrumb a:hover,
.lab-breadcrumb a:focus {
    text-decoration: underline;
}

.lab-breadcrumb [aria-current="page"] {
    color: var(--lab-muted);
}

/* ================================================ 8. Logo strips */

.lab-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.75rem 2.5rem;
}

.lab-logos__item {
    display: grid;
    place-items: center;
    min-height: 4.5rem;
    flex: 0 0 auto;
}

.lab-logos__item img {
    /* These logos are SVGs that carry a viewBox but no width/height. Chrome
       cannot resolve `width: auto` from that, so the images rendered exactly
       0px wide and appeared to be missing entirely. Both dimensions are set
       explicitly and object-fit keeps each logo's own aspect ratio. */
    height: 4.5rem;
    width: 10.5rem;
    object-fit: contain;
    opacity: .95;
    transition: opacity .2s ease, transform .2s ease;
}

.lab-logos__item:hover img,
.lab-logos__item:focus-within img {
    opacity: 1;
    transform: scale(1.03);
}

/* Placeholder chip for a partner whose logo file we do not have yet. */
.lab-logos__chip {
    display: inline-flex;
    align-items: center;
    padding: .6rem 1.15rem;
    border: 1px dashed var(--lab-border);
    border-radius: var(--lab-radius);
    font-weight: 700;
    font-size: .95rem;
    color: var(--lab-body);
    background: var(--lab-surface);
}

/* ==================================================== 9. Forms */

.lab-form label,
.lab-form legend {
    font-size: .875rem;
    font-weight: 600;
    color: var(--lab-ink);
    margin-bottom: .35rem;
}

.lab-form .form-control {
    border: 1px solid var(--lab-border);
    border-radius: var(--lab-radius);
    padding: .75rem .9rem;
    height: auto;
    font-size: .95rem;
    color: var(--lab-ink);
    background-color: #fff;
}

.lab-form .form-control:focus {
    border-color: var(--lab-green-ink);
}

.lab-form .form-control::placeholder {
    color: #98A195;
}

.lab-form .lab-required {
    color: #B3261E;
    margin-left: .15rem;
}

.lab-form .lab-help {
    font-size: .8rem;
    color: var(--lab-muted);
    margin-top: .3rem;
}

.lab-form .invalid-feedback,
.lab-form .lab-error {
    display: block;
    font-size: .82rem;
    color: #B3261E;
    margin-top: .3rem;
}

.lab-form .form-control.is-invalid {
    border-color: #B3261E;
}

.lab-checkgroup {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: .5rem .9rem;
}

.lab-check {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .6rem .75rem;
    border: 1px solid var(--lab-border);
    border-radius: var(--lab-radius);
    background: #fff;
    font-size: .875rem;
    font-weight: 500;
    color: var(--lab-body);
    cursor: pointer;
    margin-bottom: 0;
}

.lab-check:hover {
    border-color: var(--lab-green-border);
}

.lab-check input {
    margin-top: .2rem;
    flex: 0 0 auto;
}

.lab-honeypot {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

.lab-alert {
    border-radius: var(--lab-radius);
    border: 1px solid var(--lab-green-border);
    background: var(--lab-green-wash);
    color: var(--lab-green-deep);
    padding: 1rem 1.15rem;
    font-size: .92rem;
}

.lab-alert--error {
    border-color: #F0C9C6;
    background: #FCEFEE;
    color: #8C1D18;
}

/* ==================================== 10. AIHA-Net & conferences */

.lab-subnav {
    position: sticky;
    top: 76px;
    z-index: 1020;
    background: var(--lab-surface);
    border-bottom: 1px solid var(--lab-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lab-subnav__list {
    display: flex;
    gap: .25rem;
    list-style: none;
    margin: 0;
    padding: .5rem 0;
    white-space: nowrap;
}

.lab-subnav__list a {
    display: inline-block;
    padding: .5rem .85rem;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--lab-body);
    text-decoration: none;
}

.lab-subnav__list a:hover,
.lab-subnav__list a:focus,
.lab-subnav__list a.is-active {
    background: var(--lab-green-wash);
    color: var(--lab-green-deep);
}

/* Anchored sections must clear the sticky header + subnav. */
[id] {
    scroll-margin-top: 8.5rem;
}

.lab-accordion .lab-accordion__item {
    border: 1px solid var(--lab-border);
    border-radius: var(--lab-radius-lg);
    background: var(--lab-surface);
    margin-bottom: .85rem;
    overflow: hidden;
}

.lab-accordion__trigger {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    background: none;
    border: 0;
    text-align: left;
    font-weight: 600;
    color: var(--lab-ink);
}

.lab-accordion__trigger:hover {
    background: var(--lab-surface-alt);
}

.lab-accordion__num {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--lab-green-wash);
    color: var(--lab-green-deep);
    font-size: .85rem;
    font-weight: 700;
}

.lab-accordion__heading {
    flex: 1 1 auto;
}

.lab-accordion__heading small {
    display: block;
    font-weight: 500;
    font-size: .875rem;
    color: var(--lab-body);
    margin-top: .2rem;
    line-height: 1.55;
}

.lab-accordion__chevron {
    flex: 0 0 auto;
    color: var(--lab-muted);
    transition: transform .2s ease;
    margin-top: .35rem;
}

.lab-accordion__trigger[aria-expanded="true"] .lab-accordion__chevron {
    transform: rotate(180deg);
}

.lab-accordion__panel {
    padding: 0 1.35rem 1.35rem 4.35rem;
}

@media (max-width: 575.98px) {
    .lab-accordion__panel { padding-left: 1.35rem; }
}

.lab-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.lab-chip {
    display: inline-flex;
    align-items: center;
    padding: .35rem .8rem;
    border-radius: 999px;
    background: var(--lab-surface);
    border: 1px solid var(--lab-border);
    font-size: .82rem;
    font-weight: 600;
    color: var(--lab-body);
}

.lab-toggle {
    display: inline-flex;
    padding: .25rem;
    border-radius: 999px;
    background: var(--lab-surface-alt);
    border: 1px solid var(--lab-border);
    gap: .25rem;
}

.lab-toggle button {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: .5rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--lab-body);
    cursor: pointer;
}

.lab-toggle button[aria-selected="true"] {
    background: var(--lab-green-ink);
    color: #fff;
}

.lab-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: var(--lab-radius-lg);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--lab-border);
}

.lab-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.lab-linkcard {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.3rem;
    border: 1px solid var(--lab-border);
    border-radius: var(--lab-radius-lg);
    background: var(--lab-surface);
    text-decoration: none;
    color: var(--lab-ink);
    height: 100%;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.lab-linkcard:hover,
.lab-linkcard:focus {
    border-color: var(--lab-green-border);
    box-shadow: var(--lab-shadow);
    transform: translateY(-2px);
    color: var(--lab-ink);
    text-decoration: none;
}

.lab-linkcard__icon {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: var(--lab-radius);
    background: var(--lab-green-wash);
    color: var(--lab-green-deep);
    font-size: 1.1rem;
}

.lab-linkcard__title {
    font-weight: 600;
    font-size: .975rem;
    margin-bottom: .15rem;
}

.lab-linkcard__note {
    font-size: .82rem;
    color: var(--lab-muted);
    margin: 0;
}

.lab-quote {
    border-left: 4px solid var(--lab-green);
    padding: .35rem 0 .35rem 1.35rem;
    margin: 0;
}

.lab-quote li {
    margin-bottom: .6rem;
    line-height: 1.65;
}

.lab-year {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--lab-green-deep);
    background: var(--lab-green-wash);
    border: 1px solid var(--lab-green-border);
    border-radius: 999px;
    padding: .35rem .9rem;
    margin-bottom: 1rem;
}

/* ---- CTA band ---- */

.lab-cta {
    background: linear-gradient(120deg, #24310F 0%, #3C5F16 100%);
    color: #fff;
    border-radius: var(--lab-radius-lg);
    padding: 2.75rem 2rem;
}

.lab-cta h2 {
    color: #fff;
    font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem);
    margin-bottom: .6rem;
}

.lab-cta p {
    color: #DCE6CE;
    margin-bottom: 0;
    line-height: 1.7;
}

.lab-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

/* ================================================= 11. Utilities */

.lab-grid {
    display: grid;
    gap: 1.5rem;
}

/*
 * Explicit column counts rather than repeat(auto-fit, ...).
 *
 * auto-fit collapses the empty tracks, so a section holding fewer items than
 * the intended column count stretched them across the full row - the
 * Leadership group (two people) rendered two enormous cards. Fixed counts
 * keep every grid on the site visually consistent regardless of how many
 * items it happens to contain.
 */
.lab-grid--2,
.lab-grid--3,
.lab-grid--4 { grid-template-columns: 1fr; }

@media (min-width: 576px) {
    .lab-grid--3,
    .lab-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

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

@media (min-width: 992px) {
    .lab-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.lab-note {
    font-size: .8rem;
    color: var(--lab-muted);
}

/* Marks content the site owner still needs to supply. Visible in local
   development only - see the @env guard in the components. */
.lab-todo {
    display: block;
    border-left: 3px solid #E0A800;
    background: #FFF9E6;
    color: #6B5200;
    font-size: .8rem;
    padding: .5rem .75rem;
    border-radius: 4px;
    margin-top: .6rem;
}

/* The template hard-codes a large top margin on the footer wrapper. */
.lab-main {
    display: block;
}

.back-to-top {
    z-index: 1040;
}

/* ---- Profile page ---- */

.lab-profile-aside {
    position: sticky;
    top: 6.5rem;
}

@media (max-width: 991.98px) {
    .lab-profile-aside { position: static; }
}

.lab-profile-aside .lab-person__figure {
    aspect-ratio: 4 / 5;
}

.lab-empty.text-left {
    text-align: left;
    padding: 1.5rem;
}

/* ---- AIHA-Net coverage map ---- */

.lab-map {
    height: 26rem;
    width: 100%;
    border-radius: var(--lab-radius-lg);
    border: 1px solid var(--lab-border);
    background: var(--lab-surface-alt);
    z-index: 0;
}

@media (max-width: 575.98px) {
    .lab-map { height: 20rem; }
}

/* Leaflet panes must stay under the sticky header and sub-nav. */
.leaflet-pane,
.leaflet-top,
.leaflet-bottom { z-index: 1 !important; }

/* ---- Framed section media ---- */

/*
 * Section imagery is a mix of landscape and portrait originals. Constraining
 * the frame rather than the image keeps a tall phone-camera shot from towering
 * over the copy beside it, while still filling the column.
 */
.lab-media {
    margin: 0;
    border-radius: var(--lab-radius-lg);
    overflow: hidden;
    border: 1px solid var(--lab-border);
    box-shadow: var(--lab-shadow);
    aspect-ratio: 4 / 3;
}

.lab-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@supports not (aspect-ratio: 4 / 3) {
    .lab-media { position: relative; height: 0; padding-bottom: 75%; }
    .lab-media img { position: absolute; inset: 0; }
}

/* Portrait originals get a taller frame so less of the subject is cropped. */
.lab-media--portrait { aspect-ratio: 4 / 5; }

@supports not (aspect-ratio: 4 / 5) {
    .lab-media--portrait { padding-bottom: 125%; }
}

@media (min-width: 992px) {
    .lab-media--portrait { max-height: 32rem; }
}
