/* ===============================
   CV MODAL (PRODUCTION-SAFE)
================================ */

/* ================= BASE STATE ================= */

.cv-modal {
    display: none;                 /* CLOSED by default */
    position: fixed;
    inset: 0;
    z-index: 9999;

    /* Centering mechanism */
    align-items: center;
    justify-content: center;

    /* Safe area support (iOS / Android) */
    padding: env(safe-area-inset-top)
             env(safe-area-inset-right)
             env(safe-area-inset-bottom)
             env(safe-area-inset-left);
}

/* ================= OPEN STATE ================= */

.cv-modal.is-open {
    display: flex;                 /* OPEN */
}

/* ================= OVERLAY ================= */

.cv-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.65);
}

/* ================= MODAL BOX ================= */

.cv-modal-box {
    position: relative;
    width: 100%;
    max-width: 1100px;
    max-height: 92vh;
    margin: 0 auto;
    background: #f3f3f3;
    border-radius: 18px;
    padding: 24px;
    overflow-y: auto;
    animation: modalFade .25s ease;
    z-index: 1;
}

/* ================= CLOSE BUTTON ================= */

.cv-modal-close {
    position: sticky;
    top: 0;
    margin-left: auto;
    display: block;
    font-size: 26px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
}

/* ================= MODAL CONTENT ================= */

.cv-modal-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
}

/* CV preview */
.cv-modal-left img {
    width: 100%;
    background: #fff;
    padding: 12px;
    border-radius: 12px;
}

/* ================= ANIMATION ================= */

@keyframes modalFade {
    from {
        opacity: 0;
        transform: scale(.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {

    .cv-modal-box {
        max-height: 94vh;
        padding: 16px;
        border-radius: 14px;
    }

    .cv-modal-body {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cv-modal-close {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .cv-modal-left img {
        padding: 10px;
    }
}
