/* ============================================
   SECTION: Meet Our Team
   Arrow-scrollable horizontal row of team member cards.
   Card sizing matched to the Figma export (380x542) with the
   photo filling the lower portion. Reuses the generic carousel
   behaviour from js/sections/home/carousel.js.
   ============================================ */

.meet-team {
    padding: 100px var(--section-side-padding);
    background: var(--color-white);
    overflow: hidden;
}

/* Header aligns with the main nav: 1240 cap centered, gutter lives
   on the section padding (same recipe as .navbar / .navbar__container).
   The carousel below stays full-width. */
.meet-team__head {
    max-width: var(--container-max);
    margin-inline: auto;
}

.meet-team__title {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: var(--font-weight-normal);
    line-height: 50px;
    letter-spacing: -1px;
    color: #484336;
    margin: 0 0 32px;
}

.meet-team__title .accent-script {
    font-size: 42px;
    line-height: 50px;
    letter-spacing: -0.03em;
    color: var(--color-primary);   /* #ff6485 */
}

/* Carousel: full-width track + prev/next arrows */
.meet-team__carousel {
    position: relative;
}

.meet-team__row {
    list-style: none;
    margin: 0;
    padding: 8px 4px;
    display: flex;
    /* center the cards when they fit; falls back to start-alignment
       (so scrolling begins from the left) when they overflow */
    justify-content: safe center;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox — hide scrollbar; arrows drive it */
}
.meet-team__row::-webkit-scrollbar {
    display: none;                  /* WebKit — hide scrollbar */
}

/* Scroll-position bars — phones only (arrows take over above). Aligned to
   the container so they sit under the heading, not the full-bleed track. */
.meet-team__bars {
    display: none;
    gap: 7px;
    max-width: var(--container-max);
    margin: 24px auto 0;
}

.meet-team__bar {
    flex: 1 1 0;
    height: 4px;
    border-radius: 100px;
    background: var(--color-primary-light);
    transition: background-color var(--transition-fast);
}

.meet-team__bar.is-active {
    background: var(--color-primary);
}

.meet-team__arrow {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-white);
    border: 2px solid var(--color-primary-light);
    box-shadow: var(--shadow-card);
    color: var(--color-primary);
    cursor: pointer;
    transition: background-color var(--transition-fast), opacity var(--transition-fast);
}
.meet-team__arrow:hover {
    background: var(--color-primary-light);
}
.meet-team__arrow--prev {
    left: 0;
}
.meet-team__arrow--next {
    left: auto;
    right: 0;
    transform: translate(50%, -50%);
}
.meet-team__arrow[hidden] {
    display: none;
}
.meet-team__arrow:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}

/* ----- Card (3D flip: front = photo, back = bio) ----- */
.team-member {
    flex: 0 0 380px;
    max-width: 88vw;
    height: 542px;
    scroll-snap-align: start;
    perspective: 1400px;
}

.team-member__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.team-member.is-flipped .team-member__inner {
    transform: rotateY(180deg);
}

.team-member__face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.team-member__front {
    background: var(--color-white);
    border: 2px solid var(--color-primary-light);
}

.team-member__back {
    background: var(--color-primary-light);   /* #ffebf0 */
    border: 2px solid var(--color-primary-light);
    transform: rotateY(180deg);
}

/* Once the flip animation settles, drop the 3D context and un-rotate
   the back. A scroll container CANNOT scroll while nested inside a
   `preserve-3d` (rotated) face — flattening here is what makes the
   bio actually scrollable. JS adds `.flip-done` on transitionend. */
.team-member.flip-done .team-member__inner {
    transform-style: flat;
    transform: none;
}
.team-member.flip-done .team-member__front {
    visibility: hidden;
}
.team-member.flip-done .team-member__back {
    transform: none;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}

/* Full-face click target that flips the card. Sits above the card
   content (which is non-interactive text/imagery). */
.team-member__toggle {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.team-member__toggle:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: -3px;
    border-radius: 12px;
}

.team-member__info {
    padding: 40px 40px 0;
}

.team-member__name {
    font-family: var(--font-accent);   /* Borel */
    font-size: 28px;
    font-weight: var(--font-weight-normal);
    line-height: 42px;
    color: #ea627e;
    margin: 0;
}

.team-member__role {
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    line-height: 20px;
    color: #3e2e2d;
    margin: 6px 0 0;
}

.team-member__photo-wrap {
    margin-top: auto;
    width: 100%;
    height: 380px;
    overflow: hidden;
}

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

/* ----- Back face: bio + small photo -----
   Bio and footer are absolutely positioned so the bio gets a
   DEFINITE height (top..bottom) — that's what makes overflow
   scrolling reliable inside the rotated 3D face. The bio sits
   above the flip toggle (z-index) so it can be scrolled; the
   surrounding margins + footer remain click-to-flip. */
.team-member__bio {
    position: absolute;
    z-index: 3;
    top: 32px;
    left: 32px;
    right: 32px;
    bottom: 120px;              /* clears the footer (64px photo + 32px gutter) */
    font-size: 17px;
    font-weight: var(--font-weight-medium);
    line-height: 28px;
    color: var(--color-text-heading);
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) rgba(12, 39, 51, 0.08);
}
/* WebKit: styling the scrollbar forces a persistent (non-overlay) bar,
   so it's always visible even with macOS "show scrollbars: when scrolling". */
.team-member__bio::-webkit-scrollbar {
    width: 8px;
    -webkit-appearance: none;
}
.team-member__bio::-webkit-scrollbar-track {
    background: rgba(12, 39, 51, 0.08);
    border-radius: 4px;
}
.team-member__bio::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

.team-member__back-footer {
    position: absolute;
    z-index: 1;
    left: 32px;
    right: 32px;
    bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team-member__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: #ffda8c;
    overflow: hidden;
    flex-shrink: 0;
}

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

.team-member__flip-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-heading);
    opacity: 0.55;
}

.meet-team__empty {
    color: var(--color-text-body);
    padding: var(--space-2xl) 0;
}

@media (max-width: 768px) {
    .meet-team {
        padding: 60px var(--section-side-padding);
    }
    /* On touch devices, hide the arrows and let users swipe the row */
    .meet-team__arrow {
        display: none;
    }
}

/* ----- Phones: position bars stand in for the arrows ----- */
@media (max-width: 600px) {
    .meet-team__bars {
        display: flex;
    }
}

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