
.bio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bio-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bio-modal-card {
    background: var(--bg-secondary);
    width: 90%;
    max-width: 700px;
    max-height: 100%; /* Gives the card a bit more vertical screen room */
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow-y: auto;
    display: flex !important;
    flex-direction: column !important;
}


.bio-modal-overlay.active .bio-modal-card {
    transform: translateY(0);
}


.bio-close-btn:hover {
    background: #f1f5f9;
    transform: scale(1.05);
}



/* Close Button Positioned Safely */
.bio-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-main);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Updated: Passport Photo Container --- */
.bio-photo-wrapper {
    width: 100%;
    /* Max height keeps it restricted so text stays highly visible on desktop and mobile */
    height: 380px; 
    background: #ffffff; /* Clean white background padding color instead of a stretch tint */
    flex-shrink: 0;
    margin-top: 2.5rem; /* Pushes the image down slightly below the close button alignment */
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px 5px;
}




.bio-photo-wrapper img {
    height: 100%;
    width: auto; /* Allows width to scale proportionally based on passport height */
    max-width: 100%;
    margin: 5px 5px;
    /* 'contain' guarantees the full portrait photo is completely visible without any cropping */
    object-fit: contain; 
}

/* Long Biography Text Section */
.bio-content {
    padding: 2rem;
    margin: 5px 5px;
}

.bio-content h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.bio-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

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