/* ================================================================= */
/* PAGE-SPECIFIC STYLES: ABOUT (about.css) */
/* Re-designed for Team Grid + Modal */
/* ================================================================= */

/* --- 1. Page Header & Intro --- */
/* ------------------------------------------------------------- */

.about-page-main {
    /* Base color: Dark Navy */
    background-color: var(--color-bg-primary);

    /* "Faded Linen" texture: two layered diagonal gradients */
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.04), /* 4% opacity white */
            rgba(255, 255, 255, 0.04) 1px,
            transparent 1px,
            transparent 4px /* 1px line, 3px space */
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, 0.04),
            rgba(255, 255, 255, 0.04) 1px,
            transparent 1px,
            transparent 4px
        );
}

.about-header-section {
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.about-header-section .page-headline {
    /* Uses .section-headline style from components.css */
    margin-bottom: var(--spacing-sm);
}

.about-header-section .about-intro {
    /* Uses .section-paragraph style from components.css */
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-size: var(--font-size-lg);
    color: var(--color-text-primary);
}


/* --- 2. Team Grid --- */
/* ------------------------------------------------------------- */
.team-grid-section {
    padding-bottom: var(--spacing-xl);
}

.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* This is the fix: it centers each row */
    gap: var(--spacing-md);
}

.team-card {
    /* --- ADD THESE NEW LINES --- */
    flex-basis: 310px; /* Set a consistent base width */
    flex-grow: 0;       /* Don't allow cards to grow */
    flex-shrink: 1;     /* Allow cards to shrink on small screens */
    max-width: 100%;    /* Ensure responsiveness */
    /* --- END OF ADDED LINES --- */

    background-color: var(--color-bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-img);
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.team-card-image {
    width: 100%;
    max-width: 180px; /* Constrain headshot size */
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%; /* Circular headshots */
    margin: 0 auto var(--spacing-sm) auto;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.team-card-name {
    font-family: var(--font-family-header);
    font-size: 1.3rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0;
}

.team-card-title {
    font-family: var(--font-family-body);
    font-size: 1rem;
    color: var(--color-accent-primary); /* Use brand blue for title */
    margin: var(--spacing-xs) 0 0 0;
    line-height: 1.4;
}


/* --- 3. Team Modal --- */
/* ------------------------------------------------------------- */

/* Overlay: Full screen, dark, transparent */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto; /* Allow scrolling on modal for small screens */
}

/* Modal Box: The content window */
.team-modal {
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius-img);
    padding: var(--spacing-lg);
    width: 100%;
    max-width: 900px; /* Max width of the modal */
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

/* Close Button (Top Right) */
.modal-close-btn {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-md);
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}
.modal-close-btn:hover {
    color: var(--color-text-primary);
    transform: scale(1.1);
}

/* Modal Content Layout (2-col grid) */
.modal-content-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-lg);
    align-items: flex-start;
}

.modal-image {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--border-radius-img);
}

.modal-bio-name {
    font-family: var(--font-family-header);
    font-size: 2rem;
    color: var(--color-text-primary);
    margin: 0;
}

.modal-bio-title {
    font-family: var(--font-family-body);
    font-size: 1.1rem;
    color: var(--color-accent-primary);
    margin: var(--spacing-xs) 0 var(--spacing-md) 0;
}

.modal-bio-text p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

/* --- 4. Modal Visible State --- */
/* ------------------------------------------------------------- */
.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.is-visible .team-modal {
    transform: scale(1);
}

/* Prevent body scrolling when modal is open */
body.modal-is-open {
    overflow: hidden;
}


/* --- 5. Responsive --- */
/* ------------------------------------------------------------- */
@media (max-width: 768px) {
    .team-modal {
        padding: var(--spacing-md);
        padding-top: var(--spacing-lg); /* Space for close btn */
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Stack modal content on mobile */
    .modal-content-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .modal-image {
        max-width: 250px; /* Don't let image be full width */
        margin: 0 auto;
        aspect-ratio: 1 / 1;
        border-radius: 50%;
    }

    .modal-bio-name {
        font-size: 1.8rem;
        text-align: center;
    }
    .modal-bio-title {
        font-size: 1rem;
        text-align: center;
    }
}