/**
 * PREIT People Styles
 *
 * @package Preit_People
 */

/* Person Photo */
.person-photo {
    width: 100%;
    height: auto;
    display: block;
}

/* Fallback logomark images */
.person-photo-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* People Grid - Basic Layout */
.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.person-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.person-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.person-card-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.person-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-card-content {
    padding: 20px;
}

.person-card-name {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.person-card-title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.4;
}

.person-card-bio {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
}

/* People List - Alternative Layout */
.people-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 40px 0;
}

.person-list-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 24px;
    align-items: start;
}

.person-list-image {
    width: 150px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
}

.person-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-list-content h3 {
    margin: 0 0 4px;
    font-size: 1.4rem;
    font-weight: 600;
}

.person-list-title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #666;
}

.person-list-bio {
    margin: 0;
    line-height: 1.6;
    color: #555;
}

/* Group Headers */
.people-group-header {
    margin: 40px 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #333;
}

.people-group-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.people-group-header:first-child {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .people-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .person-list-item {
        grid-template-columns: 100px 1fr;
        gap: 16px;
    }

    .person-list-image {
        width: 100px;
    }
}

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

    .person-list-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .person-list-image {
        width: 150px;
        margin: 0 auto 16px;
    }
}

/* ========================================
   Bio Modal - People CPT popup bios
   ======================================== */

/* Clickable card indicator */
.kb-query-item.person-has-bio {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.kb-query-item.person-has-bio:hover {
    opacity: 0.85;
}

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

/* Modal overlay / backdrop */
.preit-bio-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.6);
    padding: 40px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    justify-content: center;
}

.preit-bio-modal.is-open {
    display: flex;
}

/* Modal inner container */
.preit-bio-modal-inner {
    position: relative;
    background: var(--global-palette9, #fff);
    border-radius: 8px;
    max-width: 680px;
    width: 100%;
    margin: auto;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: preitModalFadeIn 0.25s ease;
}

@keyframes preitModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close button */
.preit-bio-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--global-palette2, #007c7b);
    border: none;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.preit-bio-modal-close svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.preit-bio-modal-close:hover,
.preit-bio-modal-close:focus {
    background: var(--global-palette4, #0a3330);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    outline: none;
}

/* Modal header */
.preit-bio-modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--global-palette7, #e0e0e0);
}

.preit-bio-modal-photo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
}

.preit-bio-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preit-bio-modal-name-wrap {
    flex: 1;
    min-width: 0;
}

.preit-bio-modal-name {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--global-palette3, #333);
}

.preit-bio-modal-title {
    margin: 0;
    font-size: 1rem;
    color: var(--global-palette4, #666);
    line-height: 1.4;
}

/* Modal body / bio content */
.preit-bio-modal-body {
    color: var(--global-palette4, #444);
    font-size: 1rem;
    line-height: 1.7;
}

.preit-bio-modal-body p:first-child {
    margin-top: 0;
}

.preit-bio-modal-body p:last-child {
    margin-bottom: 0;
}

/* Bio modal responsive */
@media (max-width: 600px) {
    .preit-bio-modal {
        padding: 20px 12px;
    }

    .preit-bio-modal-inner {
        padding: 24px 20px;
    }

    .preit-bio-modal-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .preit-bio-modal-photo {
        width: 80px;
        height: 80px;
    }

    .preit-bio-modal-name {
        font-size: 1.25rem;
    }
}
