/* Board Members slider (shortcode: [hfch_board_members]) */

.hfch-board {
    --hfch-board-gap: 32px;
    --hfch-board-per-view: 3;
    /* Tints derived from design-system tokens — no hardcoded colour values */
    --hfch-board-tint: color-mix(in srgb, var(--hfch-navy) 8%, transparent);
    --hfch-board-shadow: color-mix(in srgb, var(--hfch-navy) 8%, transparent);
    --hfch-board-shadow-hover: color-mix(in srgb, var(--hfch-navy) 14%, transparent);
    --hfch-board-arrow-gutter: 48px;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--hfch-board-arrow-gutter);
    font-family: var(--hfch-font-body);
}

/* Track — native horizontal scroll with snap, so touch swipe works for free */
.hfch-board-viewport {
    overflow: hidden;
}

.hfch-board-track {
    display: flex;
    gap: var(--hfch-board-gap);
    margin: 0;
    padding: 8px 4px 24px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Hidden until JS has shuffled the order; auto-reveals if JS never runs */
    opacity: 0;
    animation: hfch-board-reveal 0s linear 1.5s forwards;
}

.hfch-board-track::-webkit-scrollbar {
    display: none;
}

.hfch-board.is-ready .hfch-board-track {
    opacity: 1;
    animation: none;
    transition: opacity 0.3s ease;
}

@keyframes hfch-board-reveal {
    to { opacity: 1; }
}

/* Cards */
.hfch-board-card {
    flex: 0 0 calc((100% - (var(--hfch-board-per-view) - 1) * var(--hfch-board-gap)) / var(--hfch-board-per-view));
    display: flex;
    flex-direction: column;
    margin: 0;
    scroll-snap-align: start;
    background: var(--hfch-white);
    border: 1px solid var(--hfch-board-tint);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 18px var(--hfch-board-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hfch-board-card:hover {
    box-shadow: 0 10px 28px var(--hfch-board-shadow-hover);
    transform: translateY(-3px);
}

.hfch-board-card-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--hfch-board-tint);
    overflow: hidden;
}

.hfch-board-card-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.hfch-board-card-initials {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--hfch-font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--hfch-navy);
    opacity: 0.6;
}

.hfch-board-card-body {
    flex: 1;
    padding: 28px 30px 32px;
}

.hfch-board-card-name {
    margin: 0 0 6px;
    font-family: var(--hfch-font-body);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--hfch-navy);
}

/* Brand red darkened 10% so small caps text passes WCAG AA (≈5:1 on white) */
.hfch-board-card-designation {
    margin: 0 0 16px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--hfch-red) 90%, black);
}

.hfch-board-card-bio {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: color-mix(in srgb, currentColor 82%, transparent);
}

/* Side arrows — quiet chevrons in the gutters, vertically centred on the cards.
   Selectors use `.hfch-board button.hfch-board-nav` to out-rank the Hello Elementor
   reset and Elementor Kit global button styles (padding, border, #c36 hover fill). */
.hfch-board button.hfch-board-nav {
    position: absolute;
    top: calc(50% - 8px); /* offset for the track's uneven top/bottom padding */
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: var(--hfch-navy);
    font-size: 0;
    line-height: 0;
    opacity: 0.35;
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.hfch-board button.hfch-board-nav svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
}

.hfch-board button.hfch-board-prev {
    left: 6px;
}

.hfch-board button.hfch-board-next {
    right: 6px;
}

.hfch-board button.hfch-board-nav:hover,
.hfch-board button.hfch-board-nav:focus {
    opacity: 0.9;
    background: var(--hfch-board-tint);
    color: var(--hfch-navy);
    border: 0;
    box-shadow: none;
}

.hfch-board button.hfch-board-nav:focus:not(:focus-visible) {
    outline: none;
}

.hfch-board button.hfch-board-nav:focus-visible {
    outline: 2px solid var(--hfch-amber);
    outline-offset: 2px;
}

.hfch-board.is-static button.hfch-board-nav {
    display: none;
}

/* Tablet: 2 per view */
@media (max-width: 1024px) {
    .hfch-board {
        --hfch-board-gap: 24px;
        --hfch-board-per-view: 2;
    }
}

/* Mobile: 1 per view with a peek of the next card; narrower arrow gutters */
@media (max-width: 768px) {
    .hfch-board {
        --hfch-board-gap: 16px;
        --hfch-board-arrow-gutter: 32px;
    }

    .hfch-board button.hfch-board-nav {
        width: 28px;
        height: 28px;
    }

    .hfch-board button.hfch-board-nav svg {
        width: 18px;
        height: 18px;
    }

    .hfch-board button.hfch-board-prev {
        left: 2px;
    }

    .hfch-board button.hfch-board-next {
        right: 2px;
    }

    .hfch-board-card {
        flex-basis: 85%;
    }

    .hfch-board-card-body {
        padding: 22px 22px 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hfch-board-track {
        scroll-behavior: auto;
    }

    .hfch-board-card,
    .hfch-board-card:hover {
        transition: none;
        transform: none;
    }
}
