/* ============================================
   TEAM — Blueprint Leadership Component (Carousel)
   Shared between homepage (#team) and company page (#leadership)
   ============================================ */

/* Shared leadership header (label + heading + intro) used by both
   the homepage team section and the company-page leadership section.
   Mirrors the rules in company-page.css so the homepage doesn't need
   to load that whole file. */
.co-leadership__header-wrap {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    padding-top: var(--section-padding);
    padding-bottom: var(--space-8);
    background: #F5F5F5;
}

.co-label {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

.co-heading {
    font-family: var(--font-heading);
    font-size: var(--text-section);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    letter-spacing: -0.6px;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-6);
}

.co-intro {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    line-height: var(--leading-normal);
    max-width: var(--text-max-width);
    margin: 0;
}
.team {
    padding: clamp(2rem, 4vw, 4rem) 0;
    background: #F5F5F5;
}

.team__blueprint {
    position: relative;
    background: transparent;
    margin: 0 clamp(3rem, 10vw, 10rem);
    padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 4vw, 4rem);
    overflow: visible;
}

.team__blueprint::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50%;
    background-color: #1a1814;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    border-radius: clamp(16px, 2vw, 28px);
    z-index: 0;
}

/* Carousel viewport — full-bleed horizontal scroll with drag.
   Breaks out of .team__blueprint margins+padding so the drag/scroll area
   spans the full page width. The dark backdrop on .team__blueprint stays
   where it is — only the carousel itself extends edge-to-edge. */
.team__grid {
    position: relative;
    z-index: 1;
    display: flex;
    gap: clamp(20px, 3vw, 48px);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    padding-bottom: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
    /* Negate parent's outer margin + inner padding to reach viewport edges */
    margin-left: calc(-1 * (clamp(3rem, 10vw, 10rem) + clamp(1.5rem, 4vw, 4rem)));
    margin-right: calc(-1 * (clamp(3rem, 10vw, 10rem) + clamp(1.5rem, 4vw, 4rem)));
    /* But keep the first card aligned with the original blueprint inner edge */
    padding-left: calc(clamp(3rem, 10vw, 10rem) + clamp(1.5rem, 4vw, 4rem));
    padding-right: 0;
}

/* Hide native scrollbar — pagination is handled by .team__dots below */
.team__grid {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.team__grid::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Pagination dots — one per card. Sits on the dark backdrop. */
.team__dots {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(6px, 0.8vw, 10px);
    margin-top: clamp(1rem, 2vw, 1.75rem);
    padding: 0 clamp(0.5rem, 2vw, 1rem);
}

.team__dot {
    width: clamp(7px, 0.85vw, 9px);
    height: clamp(7px, 0.85vw, 9px);
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: background var(--duration-base, 0.2s) var(--ease-out, ease-out),
                transform var(--duration-base, 0.2s) var(--ease-out, ease-out);
}

.team__dot:hover {
    background: rgba(255, 255, 255, 0.55);
}

.team__dot:focus-visible {
    outline: 2px solid var(--color-orange, #E8652D);
    outline-offset: 3px;
}

.team__dot.is-active {
    background: var(--color-orange, #E8652D);
    transform: scale(1.35);
}

/* Each card width matches the original 3-pin layout (computed from viewport
   width minus the same outer margin + inner padding the blueprint used) */
.team__pin {
    /* `min(100vw, 1600px)` caps card width on ultra-wide displays. At any
       viewport <=1600px the min() resolves to 100vw, so this rule behaves
       exactly as before — phone/tablet layouts (handled by the <=900px /
       <=600px overrides below) are untouched. */
    flex: 0 0 calc((min(100vw, 1600px) - 2 * (clamp(3rem, 10vw, 10rem) + clamp(1.5rem, 4vw, 4rem)) - 2 * clamp(20px, 3vw, 48px)) / 3);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Trailing space after the last card so it doesn't jam against the right edge */
.team__pin:last-child {
    margin-right: calc(clamp(3rem, 10vw, 10rem) + clamp(1.5rem, 4vw, 4rem));
}

.team__img {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #2a2520;
    border: none;
    margin-bottom: var(--space-4);
}

/* Primary drag carousel cards — no shadow (large hero-style cards on the dark grid) */
.team__grid .team__img {
    box-shadow: none;
}

/* Marquee cards keep a subtle shadow */
.team__marquee .team__img {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.team__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* prevent native image-drag from interrupting carousel drag */
    user-select: none;
}

.team__tag {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    font-weight: var(--font-semibold);
    color: #fff;
    margin-bottom: 2px;
}

.team__role {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

/* Tablet: show 2 cards visible. Breakout/padding values change with the
   blueprint's tablet margin+padding. */
@media (max-width: 900px) {
    .team__blueprint {
        margin: 0 clamp(1.5rem, 5vw, 5rem);
        padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
    }

    .team__grid {
        margin-left: calc(-1 * (clamp(1.5rem, 5vw, 5rem) + clamp(1.5rem, 4vw, 3rem)));
        margin-right: calc(-1 * (clamp(1.5rem, 5vw, 5rem) + clamp(1.5rem, 4vw, 3rem)));
        padding-left: calc(clamp(1.5rem, 5vw, 5rem) + clamp(1.5rem, 4vw, 3rem));
    }

    .team__pin {
        flex: 0 0 calc((100vw - 2 * (clamp(1.5rem, 5vw, 5rem) + clamp(1.5rem, 4vw, 3rem)) - clamp(20px, 3vw, 48px)) / 2);
    }

    .team__pin:last-child {
        margin-right: calc(clamp(1.5rem, 5vw, 5rem) + clamp(1.5rem, 4vw, 3rem));
    }
}

/* Mobile: ~1.4 cards visible (peek of next as scroll affordance) */
@media (max-width: 600px) {
    .team__blueprint {
        margin: 0 var(--space-3);
        padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 3vw, 2rem);
    }

    .team__grid {
        margin-left: calc(-1 * (var(--space-3) + clamp(1rem, 3vw, 2rem)));
        margin-right: calc(-1 * (var(--space-3) + clamp(1rem, 3vw, 2rem)));
        padding-left: calc(var(--space-3) + clamp(1rem, 3vw, 2rem));
    }

    .team__pin {
        flex: 0 0 70%;
        max-width: 280px;
    }

    .team__pin:last-child {
        margin-right: calc(var(--space-3) + clamp(1rem, 3vw, 2rem));
    }
}

/* ============================================
   Secondary scroll-driven marquee carousel
   Full-bleed sibling of .team__blueprint with its own dark grid background.
   Position tied to window.scrollY (controlled by team-grid-loader.js).
   ============================================ */
/* Modifier: hide the auto-scrolling marquee on a per-instance basis (e.g. home page).
   The marquee is still built by team-grid-loader.js — this just hides it visually. */
.team--no-marquee .team__marquee {
    display: none;
}

.team__marquee {
    position: relative;
    overflow: hidden;
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
    padding: clamp(1.5rem, 3vw, 2.5rem) 0;
    /* Full viewport width — extends edge to edge */
    background-color: #1a1814;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.team__marquee-track {
    display: flex;
    gap: clamp(20px, 3vw, 48px);
    width: max-content;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

/* Marquee cards: photo-only (no name/role labels), slightly smaller than primary.
   Use flex-basis (not width) so we override the responsive .team__pin rules. */
.team__pin--marquee {
    flex: 0 0 clamp(180px, 18vw, 260px) !important;
    margin-right: 0 !important;  /* override .team__pin:last-child trailing space rules */
    max-width: none;
}

.team__pin--marquee .team__img {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .team__pin--marquee {
        flex: 0 0 clamp(160px, 26vw, 220px) !important;
    }
}

@media (max-width: 600px) {
    .team__pin--marquee {
        flex: 0 0 160px !important;
    }
}

/* Larger variant — cards match the .team__grid drag carousel scale,
   and the dark grid only covers the bottom half (mirrors .team__blueprint).
   Top half of each card sits on the page background, bottom half on the dark grid. */
.team__marquee--large {
    background-color: var(--color-pure-white, #FFFFFF);
    background-image: none;
    margin-top: 0;
    padding: clamp(2rem, 4vw, 3.5rem) 0;
}

.team__marquee--large::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50%;
    background-color: #1a1814;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

.team__marquee--large .team__marquee-track {
    position: relative;
    z-index: 1;
}

.team__marquee--large .team__pin--marquee {
    flex: 0 0 clamp(220px, 22vw, 340px) !important;
}

@media (max-width: 900px) {
    .team__marquee--large .team__pin--marquee {
        flex: 0 0 clamp(180px, 35vw, 280px) !important;
    }
}

@media (max-width: 600px) {
    .team__marquee--large .team__pin--marquee {
        flex: 0 0 200px !important;
    }
}

/* Team CTA Button (homepage only) */
.team__cta {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    margin-top: clamp(2.5rem, 5vw, 4rem);
}

.team__cta-btn {
    display: inline-flex;
    align-items: center;
    gap: clamp(1rem, 2vw, 1.75rem);
    padding: clamp(0.85rem, 1.8vw, 1.1rem) clamp(1.25rem, 2.5vw, 2rem);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: border-color var(--duration-base) var(--ease-out),
                background var(--duration-base) var(--ease-out);
}

.team__cta-btn:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.team__cta-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team__cta-label {
    font-family: var(--font-body);
    font-size: 0.625rem;
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.team__cta-title {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    font-weight: var(--font-medium);
    color: #fff;
    line-height: var(--leading-tight);
}

.team__cta-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-orange);
    color: #fff;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: transform var(--duration-base) var(--ease-out),
                box-shadow var(--duration-base) var(--ease-out);
}

.team__cta-btn:hover .team__cta-arrow {
    transform: translateX(3px);
    box-shadow: 0 4px 14px rgba(232, 101, 45, 0.3);
}

@media (max-width: 600px) {
    .team__cta-btn {
        width: 100%;
        max-width: 340px;
        justify-content: space-between;
    }
}
