/* Our Team page: board, junior board, emeriti */

/* ============================================
   Board of Directors Section (Six Cards)
   ============================================ */
.board-section {
    background-color: var(--bg-white);
    padding: 6rem 0 2rem 0;
}

.board-grid {
    display: grid;
    /* Fixed-width columns + centered grid to center short last rows (1–2 cards). */
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
    justify-content: center;
    gap: 2.5rem;
}

.junior-board-intro-wrapper {
    margin-top: 1rem;
    padding-bottom: 3rem;
}

.junior-board-intro {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

@media (max-width: 1200px) {
    .board-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

@media (max-width: 480px) {
    .board-grid {
        grid-template-columns: 1fr;
    }
}

.board-card {
    perspective: 1200px; /* 3D container */
}

.board-card-inner {
    position: relative;
    width: 100%;
    min-height: 320px;
    transition: transform 0.7s ease;
    transform-style: preserve-3d;
    cursor: pointer;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.board-card:hover .board-card-inner,
.board-card-inner:focus {
    transform: rotateY(180deg);
    outline: none;
}

/* Programmatic/mobile flip */
.board-card-inner.is-flipped {
    transform: rotateY(180deg);
}

.board-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background-color: #E8EAED;
    border: 1px solid #C4C7CC;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.board-card-front {
    z-index: 2;
}

.board-card-back {
    transform: rotateY(180deg);
    /* Match site brand colors (primary gradient) */
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: #fff;
}

.board-card-back.is-bio-shrunk .board-back-content {
    justify-content: flex-start;
    padding: 1rem 1.2rem 1.1rem 1.2rem;
}

.board-image {
    height: 140px;
    width: 140px;
    margin: 0 auto;
    background-color: var(--bg-light);
    overflow: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.board-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.board-card:hover .board-card-front .board-image img { transform: scale(1.05); }

.board-content {
    padding: 1.25rem;
    text-align: center;
}

.board-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--text-dark);
}

.board-role {
    font-size: 0.95rem;
    color: var(--text-medium);
}

/* .board-hint removed per request */

.board-back-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.5rem;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
}

.board-card-back .board-name { 
    color: #fff; 
    margin-bottom: 0;
}

.board-card-back .board-role { 
    color: #eaeaea; 
    font-size: 0.8125rem;
    margin-top: 0;
}
.board-bio { color: #ffffff; opacity: 0.95; line-height: 1.8; font-size: 0.875rem; transition: font-size 0.2s ease; }

/* ============================================
   Community Liaisons & Emeriti Section - Scrolling Cards
   ============================================ */
.emeriti-section {
    padding: 2rem 0 0.6rem 0; /* Reduced bottom padding by 85% from 4rem to 0.6rem */
    background-color: var(--bg-white);
}

.emeriti-carousel-wrapper {
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

.emeriti-carousel-prev,
.emeriti-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    box-sizing: border-box;
    overflow: hidden;
    line-height: 1;
    font-size: 0;
}

.emeriti-carousel-prev:hover,
.emeriti-carousel-next:hover {
    background: var(--primary-dark);
    transform: translateY(-50%);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.emeriti-carousel-prev:active,
.emeriti-carousel-next:active {
    transform: translateY(-50%);
    opacity: 0.8;
}

.emeriti-carousel-prev {
    left: 1rem;
}

.emeriti-carousel-next {
    right: 1rem;
}

.emeriti-carousel-prev svg,
.emeriti-carousel-next svg {
    width: 18px;
    height: 18px;
}

.emeriti-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 1rem 2rem;
    will-change: scroll-position;
}

.emeriti-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.emeriti-card {
    flex: 0 0 450px;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background-color: #F8F9FA;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 160px;
    min-height: 160px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    overflow: hidden;
    will-change: transform, max-height; /* Optimize hover animations */
}

.emeriti-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    z-index: 10;
    overflow: visible;
    /* Prevent layout shifts from affecting scroll position */
    margin-bottom: 0;
}

.emeriti-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.emeriti-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.emeriti-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--bg-light);
    border-radius: 50%;
}

.emeriti-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0;
}

.emeriti-name {
    font-size: 0.8125rem;
    font-weight: 700;
    margin: 0 0 0.125rem 0;
    color: var(--text-dark);
    line-height: 1.3;
    flex-shrink: 0;
}

.emeriti-bio {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-medium);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: contents; /* Optimize text expansion */
}

.emeriti-card:hover .emeriti-bio {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    text-overflow: unset;
}

.no-emeriti-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-medium);
    font-style: italic;
}

@media (max-width: 768px) {
    .emeriti-card {
        flex: 0 0 360px;
        padding: 1.25rem;
        gap: 1rem;
        max-height: 140px;
        min-height: 140px;
    }

    .emeriti-card:hover {
        max-height: 400px;
    }

    .emeriti-image {
        width: 80px;
        height: 80px;
    }

    .emeriti-name {
        font-size: 0.8125rem;
    }

    .emeriti-bio {
        font-size: 0.75rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .emeriti-card:hover .emeriti-bio {
        -webkit-line-clamp: unset;
        line-clamp: unset;
    }
}

@media (max-width: 768px) {
    .board-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        justify-content: center;
    }
}

