/* ============================================================
   BTE MEET THE TEAM
   Department filter pills (same language as Job Vacancies) +
   horizontally scrolling card track (same mechanics as Brands
   Carousel) + hover-to-reveal "View Profile" + a pop-up modal
   showing the fuller bio, since there's no dedicated profile page.
   ============================================================ */

.bte-team {
    position: relative;
    overflow: hidden;
}

.bte-team__inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.bte-team__inner--header {
    padding-top: clamp(var(--space-12), 7vw, var(--space-20));
    padding-bottom: var(--space-8);
}

/* 2026-07-17 — the Team section now locks (pinned on desktop); its top
   sits at the viewport top, putting the title behind the fixed header
   (~137px). Clear the header height plus breathing space so the title
   and everything below it sit lower. Desktop only (lock is desktop-only). */
@media (min-width: 1024px) {
    .bte-team__inner--header {
        padding-top: calc( var(--bte-header-h, 137px) + var(--space-8) );
    }
}

.bte-team__inner--footer {
    /* 2026-07-17 — reduced further (was clamp(space-6,3vw,space-10),
       originally clamp(space-12,7vw,space-20)); the gap below the
       headshot tiles was still too large. */
    padding-bottom: clamp(var(--space-3), 2vw, var(--space-6));
}

/* ---- Header: label above, filters + arrow nav together below ---- */
.bte-team__header {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.bte-team__label {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
}

.bte-team__controls-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.bte-team__filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    flex: 1 1 auto;
}

.bte-team__filter {
    padding: var(--space-2) var(--space-5);
    border-radius: 999px;
    /* Liquid glass — same recipe as .bte-nav__list (main nav):
       semi-transparent dark fill, brighter border on top/left than
       bottom/right for a subtle "catching the light" edge, and a
       backdrop blur so whatever's behind it (the triangle pattern)
       shows through softened rather than sharp. */
    background: rgba(7, 9, 58, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.28);
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px) saturate(1.6) brightness(0.95);
    -webkit-backdrop-filter: blur(16px) saturate(1.6) brightness(0.95);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 4px 20px rgba(0, 0, 0, 0.25);
    color: var(--bte-red);
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.bte-team__filter:hover {
    background: rgba(7, 9, 58, 0.5);
}

.bte-team__filter.is-active {
    background: rgba(7, 9, 58, 0.55);
    border-color: var(--bte-red);
    color: var(--bte-red);
}

.bte-team__nav {
    margin-left: auto;
}

/* Team Directory prev/next now use the shared .bte-arrow-btn class
   with no local override — bte_arrow_nav() is the same shared component
   used by Services, Brands Carousel, Manufacturers and News, and all of
   them (Team included) now render identically from that one class, so
   a future style/icon change to .bte-arrow-btn applies here too. */

/* ---- Body row: full-width so the track can bleed to the right
   edge of the page — deliberately sits outside .bte-team__inner's
   max-width constraint (see the PHP render function). Left padding
   matches the container's own gutter so cards start aligned with
   the header above; no right padding, so the track runs to the
   actual viewport edge instead of stopping at the content width. */
.bte-team__body-row {
    position: relative;
    padding-left: var(--gutter);
    /* Side note is absolutely positioned now (see below) and no
       longer contributes to this row's natural height via normal
       flow — this guarantees room for it regardless of exactly how
       much text it holds, so it can't get clipped by .bte-team's
       own overflow:hidden.
       2026-07-18 — the reserve is now only this generous when a side
       note is actually present (--has-note below). Without one, the
       oversized reserve was pure empty space between the last row of
       headshot tiles and the footer, which read as too large. */
    /* 2026-07-23 — reserve removed; the side note is now in normal flow
       (below the cards), so the row sizes to its content and there's no
       empty band before the footer. */
    min-height: 0;
}

/* Side note is absolutely positioned and needs vertical room reserved
   for it; only then do we fall back to the larger reserve. */
.bte-team__body-row--has-note {
    min-height: 0;
}

.bte-team__viewport {
    /* No overflow set here — this wrapper does no functional
       clipping of its own; .bte-team__track's overflow-x:auto below
       already handles the scroll behaviour. Having overflow:hidden
       here too was clipping the dotted hover border regardless of
       the padding/margin compensation on the track, since this
       element's own edge sat right at the track's un-compensated
       boundary. */
}

.bte-team__track {
    display: flex;
    gap: var(--space-6);
    overflow-x: auto;
    overflow-y: visible;
    /* 2026-07-22 — overflow-x:auto makes the browser clip vertically too
       (spec: the other axis computes to auto), which cropped the hover
       dashed outline's -8px top. Pad the scroll area so the outline has
       room above the cards. */
    padding-top: 12px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Scrollbar hidden — the arrow buttons + snap are the intended
       navigation, a visible native scrollbar would look accidental */
    scrollbar-width: none;
    /* Same reasoning as .bte-team__viewport above — this element
       also has its own overflow (needed for the horizontal scroll),
       which was clipping the dotted border on every card's top edge
       and the first card's left edge.
       2026-07-23 — bumped 10px -> 20px: on hover the card scales up
       (1.045), pushing the dashed outline's top a few px further out,
       which was cropping the TOP of the outline again. More clip room
       fixes it; the negative margin keeps layout unchanged. */
    padding: 20px;
    /* 2026-07-30 — the first card (e.g. Rebecca Bryson) was being pulled
       hard against the viewport's left edge and cropped: scroll-snap
       (align:start, mandatory) snaps the first card's left flush to the
       scroll container's left, and the -20px left margin sat that edge
       ~20px off-screen. Add left-only room + a matching scroll-padding so
       the first card rests clear of the edge (whole box visible, hover
       outline included). Right side still bleeds to the edge unchanged. */
    padding-left: 40px;
    scroll-padding-left: 40px;
    margin: -20px;
}

.bte-team__track::-webkit-scrollbar { display: none; }

/* ---- Card ---- */
.bte-team__card {
    position: relative;
    flex: 0 0 auto;
    width: clamp(220px, 26vw, 320px);
    scroll-snap-align: start;
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.bte-team__card:hover {
    transform: scale(1.045);
    z-index: 5;
}

/* Dotted border a few pixels outside the photo on hover — sits on
   the card (not the photo wrapper itself, which needs its own
   overflow:hidden for rounded corners and would clip anything
   extending beyond its edges). Matches the photo's own aspect-ratio
   so it tracks its bounds rather than the whole card (name/role/
   contact icons included). */
.bte-team__card::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    aspect-ratio: 1 / 1;
    border: 1px dashed rgba(255, 255, 255, 0.6);
    border-radius: calc(var(--radius-md) + 8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease-out);
}

.bte-team__card:hover::before {
    opacity: 1;
}

.bte-team__card[data-filtered-out] {
    display: none;
}

.bte-team__photo-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: none;
    padding: 0;
    margin: 0 0 var(--space-4);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.04);
}

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

.bte-team__photo-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 9, 58, 0.55);
    opacity: 0;
    transition: opacity 0.25s var(--ease-out);
}

.bte-team__photo-wrap:hover .bte-team__photo-overlay,
.bte-team__photo-wrap:focus-visible .bte-team__photo-overlay {
    opacity: 1;
}

.bte-team__view-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    color: var(--bte-white);
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
    padding: var(--space-2);
    transform: scale(0.85);
    transition: transform 0.25s var(--ease-spring, var(--ease-out));
}

.bte-team__photo-wrap:hover .bte-team__view-profile,
.bte-team__photo-wrap:focus-visible .bte-team__view-profile {
    transform: scale(1);
}

.bte-team__name {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--bte-red);
    letter-spacing: 0.02em;
}

.bte-team__role {
    margin: var(--space-1) 0 var(--space-3);
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.85);
}

.bte-team__contact {
    display: flex;
    gap: var(--space-3);
}

.bte-team__contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--bte-red);
    transition: color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.bte-team__contact-icon:hover {
    color: var(--bte-white);
    transform: translateY(-2px);
}

/* ---- Side note ---- */
.bte-team__side-note {
    /* 2026-07-23 — in normal flow beneath the carousel (was absolutely
       positioned low, which forced a tall empty reserve band above the
       footer). Now the section is exactly as tall as its content. */
    position: relative;
    margin-top: var(--space-8);
    max-width: min(520px, 100%);
    padding-left: var(--space-5);
    border-left: 2px solid var(--bte-red);
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-sm);
    line-height: 1.7;
    z-index: 2;
}

.bte-team__side-note p {
    margin: 0 0 var(--space-3);
}

.bte-team__side-note p:last-child {
    margin-bottom: 0;
}

/* ---- Scroll indicator ---- */
.bte-team__scroll {
    display: flex;
    justify-content: center;
    margin-top: var(--space-10);
}

/* ============================================================
   PROFILE MODAL
   ============================================================ */

.bte-team-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.bte-team-modal[hidden] { display: none; }

.bte-team-modal.is-open .bte-team-modal__inner {
    animation: bte-team-modal-in 0.4s var(--ease-out) forwards;
}

@keyframes bte-team-modal-in {
    from { opacity: 0; transform: scale(0.94) translateY(16px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.bte-team-modal__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(7, 9, 58, 0.9);
    z-index: -1;
    cursor: pointer;
}

.bte-team-modal__inner {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    background-color: var(--bte-navy);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

@media (min-width: 640px) {
    .bte-team-modal__inner {
        grid-template-columns: 300px 1fr;
    }
}

.bte-team-modal__close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 10;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--bte-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}

.bte-team-modal__close:hover {
    background-color: var(--bte-red);
    transform: rotate(90deg);
}

.bte-team-modal__photo-wrap {
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

@media (min-width: 640px) {
    .bte-team-modal__photo-wrap {
        aspect-ratio: 3 / 4;
        height: auto;
    }
}

.bte-team-modal__photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bte-team-modal__content {
    padding: var(--space-8);
}

.bte-team-modal__name {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--bte-red);
    text-transform: uppercase;
}

.bte-team-modal__role {
    margin: var(--space-1) 0 var(--space-5);
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-sm);
}

.bte-team-modal__bio {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-sm);
    line-height: 1.75;
    margin-bottom: var(--space-6);
}

.bte-team-modal__bio p:last-child { margin-bottom: 0; }

.bte-team-modal__contact {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.bte-team-modal__contact a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--bte-white);
    font-size: var(--text-sm);
}

.bte-team-modal__contact a:hover {
    color: var(--bte-red);
}

@media (prefers-reduced-motion: reduce) {
    .bte-team-modal.is-open .bte-team-modal__inner { animation: none; }
    .bte-team__photo-overlay,
    .bte-team__view-profile { transition: none; }
}

/* ============================================================
   2026-07-24 — MOBILE fixes (Our Team)
   ============================================================ */

/* 'Our Team' heading/label clear of the fixed sticky header on phones
   (the desktop rule that does this is min-width:1024 only). */
@media (max-width: 1023px) {
    .bte-team__inner--header {
        padding-top: calc( var(--bte-header-h, 90px) + var(--space-6) );
    }
}

/* Filter pills were too big and wrapped untidily — shrink them to fit
   the phone width on one or two tidy rows. */
@media (max-width: 767px) {
    /* 2026-07-27 — first card cropping on the left. The desktop track uses
       margin:-20px / padding:20px to give the hover dashed-outline clip
       room, but that negative left margin pulls the track under the
       section's overflow:hidden edge — with the small mobile gutter the
       first card's left got clipped. Touch devices have no hover outline,
       so drop the left bleed here and give the track a clean gutter +
       scroll-padding so the first card always starts fully visible. */
    .bte-team__body-row { padding-left: 0; }
    .bte-team__track {
        margin-left: 0;
        padding-left: var(--gutter);
        scroll-padding-left: var(--gutter);
    }

    .bte-team__filters {
        gap: var(--space-2);
    }
    .bte-team__filter {
        padding: var(--space-1) var(--space-3);
        font-size: 0.68rem;
        letter-spacing: 0.02em;
    }
}

/* Profile pop-up: cap the photo so the bio is reachable, and let the
   panel scroll natively (paired with data-lenis-prevent in the JS). */
@media (max-width: 639px) {
    .bte-team-modal__photo-wrap {
        aspect-ratio: auto;
        height: 34vh;
    }
    .bte-team-modal__inner {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}
