/* =========================
   MODAL
   ========================= */

body.modal-open{
    overflow: hidden;
}

.modal{
    position: fixed;
    inset: 0;
    display: none;
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

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

.modal__backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal__panel{
    position: relative;
    width: min(1180px, 100%);
    height: min(84vh, 820px);
    background: #fff;
    border-radius: 22px;
    border: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 28px 80px rgba(0,0,0,.28);
    overflow: hidden;
    z-index: 1;
}

.modal__close{
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    padding: 8px;
    color: var(--modal-close-color);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    transition: color .2s ease, transform .2s ease;
}

.modal__close:hover{
    color: var(--modal-close-hover);
}

.modal__content{
    height: 100%;
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3 + 1/3 */
    min-height: 0;
}

.modal__left{
    position: relative;
    background: #0f0f10;
    min-height: 0;
}

.modal__right{
    padding: 22px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.modal__kicker{
    margin: 0 0 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: .82rem;
    color: var(--text-muted);
}

.modal__title{
    margin: 0 0 12px;
    font-size: 1.6rem;
    color: var(--text);
    overflow-wrap: anywhere;
}

.modal__meta{
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: .98rem;
    line-height: 1.4;
}

.modal__link{
    display: inline-block;
    margin-bottom: 14px;
    color: var(--secondary-color);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.modal__link:hover{
    color: var(--secondary-color-hover);
    text-decoration: underline;
}

.modal__desc{
    margin: 0 0 16px;
    color: var(--text-muted);
    line-height: 1.6;
}

.modal__tags{
    display:flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* MOBILE */
@media (max-width: 900px){

    .modal{
        padding: 16px;
        align-items: center;
        justify-content: center;
    }

    .modal__panel{
        width: 100%;
        max-width: 560px;
        height: auto;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }

    .modal__content{
        grid-template-columns: 1fr;
        height: auto;
    }

    .modal__left{
        height: 480px;
        flex-shrink: 0;
    }

    .modal__right{
        overflow-y: auto;
        padding: 18px;
    }
}

@media (max-width: 420px){
    .modal__left{ height: 270px; }
}