/**
 * Board Section Block Styles
 *
 * @package ACF Child Theme
 */

:root {
    --color-yellow: #e3cd51;
    --color-light: #e7e9ed;
    --color-text: #595959;
    --color-teal: #2d5765;
    --color-white: #ffffff;
    --font-primary: 'Aptos', sans-serif;
}

/* ── Section Wrapper — full-width light background ───────────────────────── */
.board-section {
    background-color: var(--color-light, #e7e9ed);
    width: 100%;
    padding: 80px 0;
    margin-bottom: 0 !important;
}

/* ── Content Container — WordPress layout width ──────────────────────────── */
.board-section__container {
    width: 90%;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.board-section__header {
    text-align: center;
    margin-bottom: 50px;
}

.board-section__title {
    font-family: var(--font-primary, 'Aptos', sans-serif);
    font-size: 3.25rem;
    font-weight: 700;
    color: var(--color-text, #595959);
    display: inline-block;
    margin: 0;
    line-height: 1.2;
}

/* Yellow underline accent — matches title text width */
.board-section__title::after {
    content: '';
    display: block;
    width: 100%;
    height: 4px;
    background-color: var(--color-yellow, #e3cd51);
    margin-top: 16px;
    margin-bottom: 30px;
}

/* Description WYSIWYG */
.board-section__description {
    font-family: var(--font-primary, 'Aptos', sans-serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text, #595959);
    line-height: 1.7;
    max-width: 680px;
    margin: 0 auto;
}

.board-section__description p {
    margin: 0 0 1em 0;
}

.board-section__description p:last-child {
    margin-bottom: 0;
}

/* ── Experts Grid — centered, flex wrap ──────────────────────────────────── */
.board-section__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

/* ── Single Expert Card ──────────────────────────────────────────────────── */
.board-section__card {
    background-color: var(--color-white, #ffffff);
    width: calc(20% - 20px);
    min-width: 180px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.board-section__card--has-bio {
    cursor: pointer;
}

.board-section__card--has-bio:hover,
.board-section__card--has-bio:focus {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
    outline: none;
}

/* ── Card Portrait Image ─────────────────────────────────────────────────── */
.board-section__card-image-wrap {
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
    padding: 10px 10px 0;
}

.board-section__card-image {
    width: 100%;
    display: block;
    object-fit: cover;
    object-position: top center;
    border-radius: 4px;
}

/* ── Card Body ───────────────────────────────────────────────────────────── */
.board-section__card-body {
    padding: 14px 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.board-section__card-name {
    font-family: var(--font-primary, 'Aptos', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text, #595959);
    margin: 0;
    line-height: 1.3;
}

.board-section__card-position {
    font-family: var(--font-primary, 'Aptos', sans-serif);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-teal, #2d5765);
    margin: 0;
    line-height: 1.4;
}

/* ── Modal Overlay ───────────────────────────────────────────────────────── */
.board-section__modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.board-section__modal[hidden] {
    display: none;
}

.board-section__modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

/* ── Modal Content Box ───────────────────────────────────────────────────── */
.board-section__modal-content {
    position: relative;
    background-color: var(--color-white, #ffffff);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    z-index: 1;
    animation: board-modal-in 0.25s ease;
}

@keyframes board-modal-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Modal Close Button ──────────────────────────────────────────────────── */
.board-section__modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text, #595959);
    padding: 0;
    z-index: 2;
    transition: color 0.2s ease;
}

.board-section__modal-close:hover {
    color: var(--color-teal, #2d5765);
}

/* ── Modal Inner Layout ──────────────────────────────────────────────────── */
.board-section__modal-inner {
    display: flex;
    gap: 28px;
    padding: 40px 36px;
    align-items: flex-start;
}

/* ── Modal Photo ─────────────────────────────────────────────────────────── */
.board-section__modal-photo-wrap {
    flex-shrink: 0;
    width: 160px;
    height: 200px;
    border-radius: 4px;
    overflow: hidden;
}

.board-section__modal-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    border-radius: 4px;
}

/* ── Modal Text ──────────────────────────────────────────────────────────── */
.board-section__modal-text {
    flex: 1;
    min-width: 0;
}

.board-section__modal-name {
    font-family: var(--font-primary, 'Aptos', sans-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text, #595959);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.board-section__modal-position {
    font-family: var(--font-primary, 'Aptos', sans-serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-teal, #2d5765);
    margin: 0 0 18px 0;
    line-height: 1.4;
}

.board-section__modal-bio {
    font-family: var(--font-primary, 'Aptos', sans-serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text, #595959);
    line-height: 1.7;
}

.board-section__modal-bio p {
    margin: 0 0 1em 0;
}

.board-section__modal-bio p:last-child {
    margin-bottom: 0;
}

/* ── Tablet ──────────────────────────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1023px) {
    .board-section {
        padding: 60px 0;
    }

    .board-section__header {
        margin-bottom: 40px;
    }

    .board-section__title {
        font-size: 2rem;
    }

    .board-section__description {
        font-size: 0.95rem;
    }

    .board-section__grid {
        gap: 20px;
    }

    .board-section__card {
        width: calc(33.333% - 14px);
        min-width: 160px;
        max-width: 260px;
    }

    .board-section__modal-inner {
        padding: 32px 28px;
        gap: 22px;
    }

    .board-section__modal-photo-wrap {
        width: 130px;
        height: 165px;
    }
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .board-section {
        padding: 50px 0;
    }

    /* ── Content Container — WordPress layout width ──────────────────────────── */
    .board-section__container {
        max-width: var(--theme-normal-container-max-width, 1290px);
        width: var(--theme-container-width, 100%);
    }

    .board-section__header {
        margin-bottom: 35px;
    }

    .board-section__title {
        font-size: 1.75rem;
    }

    .board-section__description {
        font-size: 0.9rem;
    }

    .board-section__grid {
        gap: 16px;
    }

    .board-section__card {
        width: calc(50% - 8px);
        min-width: 140px;
        max-width: none;
    }

    .board-section__card-name {
        font-size: 0.875rem;
    }

    .board-section__card-position {
        font-size: 0.75rem;
    }

    /* Modal stacks vertically on mobile */
    .board-section__modal-inner {
        flex-direction: column;
        padding: 50px 24px 28px;
        gap: 18px;
        align-items: center;
        text-align: center;
    }

    .board-section__modal-photo-wrap {
        width: 120px;
        height: 150px;
    }

    .board-section__modal-name {
        font-size: 1.1rem;
    }

    .board-section__modal-position {
        font-size: 0.85rem;
    }

    .board-section__modal-bio {
        font-size: 0.9rem;
        text-align: left;
    }
}
