.modal{
    position:fixed;
    inset:0;
    background:rgba(214,223,183,.35);
    display:none;
    justify-content:center;
    align-items:flex-start;
    padding-top:120px;
    z-index:10;
}

.modal.active{
    display:flex;
}

.modal-card{
    width:min(1000px,90vw);
    height:min(600px,82vh);
    display:flex;
    background:#f4f7e9;
    position:relative;
    overflow:hidden;
    box-sizing:border-box;
}

.modal-image{
    flex:0 0 calc(100% - 270px);
    width:calc(100% - 270px);
    height:100%;
    box-sizing:border-box;
    object-fit:contain;
    object-position:left center;
}

.modal-info{
    flex:0 0 270px;
    width:270px;
    box-sizing:border-box;
    padding:30px;
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
    overflow-y:auto;
    scrollbar-width:none;
}

.modal-info::-webkit-scrollbar{
    display:none;
}

.modal-info h2{
    font-size:24px;
    font-weight:500;
    margin:0 0 10px;
}

.modal-info p{
    margin:8px 0;
    font-size:14px;
}

.modal-meta{
    width:100%;
    box-sizing:border-box;
    display:flex;
    gap:12px;
    padding:20px 0;
    font-size:14px;
}

.modal-tags{
    font-size:14px;
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:12px;
}

.modal-tags a{
    height:22px;
    padding:0 9px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    background:#e7ecd1;
    color:inherit;
    text-decoration:none;
    font-size:12px;
    line-height:22px;
}

.modal-meta a{
    color:inherit;
    text-decoration:none;
}

.modal-close{
    position:absolute;
    top:15px;
    right:15px;
    z-index:2;
    border:none;
    background:none;
    font-size:24px;
    cursor:pointer;
}

.series-preview{
    flex:0 0 calc(100% - 270px);
    width:calc(100% - 270px);
    height:100%;
    box-sizing:border-box;
    padding:30px;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:12px;
    overflow-y:auto;
    align-content:start;
    scrollbar-width:none;
}

.series-preview::-webkit-scrollbar{
    display:none;
}

.series-preview img{
    width:100%;
    aspect-ratio:3 / 2;
    object-fit:cover;
    display:block;
    cursor:pointer;
}

.series-viewer{
    flex:0 0 calc(100% - 270px);
    width:calc(100% - 270px);
    height:100%;
    box-sizing:border-box;
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.series-viewer .modal-image{
    width:100%;
    height:100%;
    object-fit:contain;
}

.series-hover-zone{
    position:absolute;
    top:0;
    bottom:0;
    width:10%;
    z-index:4;
    cursor:pointer;
}

.series-hover-left{
    left:0;
}

.series-hover-right{
    right:0;
}

.series-arrow{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:40px;
    height:60px;
    border:none;
    background:none;
    font-size:20px;
    line-height:60px;
    padding:0;
    z-index:3;
    pointer-events:none;
    opacity:0;
    transition:opacity .15s ease;
    color:rgba(100,100,100,.5);
}

.series-prev{
    left:18px;
}

.series-next{
    right:18px;
}

.series-hover-left:hover ~ .series-prev,
.series-hover-right:hover ~ .series-next{
    opacity:1;
}

.series-dots{
    position:absolute;
    left:0;
    right:0;
    bottom:18px;
    display:flex;
    justify-content:center;
    gap:7px;
    z-index:3;
}

.series-dots button{
    width:7px;
    height:7px;
    padding:0;
    border:none;
    border-radius:50%;
    background:rgba(220,220,220,.3);
}

.series-dots button.active{
    background:rgba(220,220,220,1);
}

.series-counter{
    position:absolute;
    left:0;
    right:0;
    bottom:18px;
    display:flex;
    justify-content:center;
    z-index:3;
    font-size:12px;
    color:rgba(220,220,220,.7);
}

@media(max-width:1080px) and (min-width:769px){

    .series-viewer{
        width:100%;
        flex:none;
    }
    
    .series-viewer .modal-image{
        height:100%;
        max-height:none;
    }

    .modal-card{
    width:700px;
    height:auto;
    max-height:85vh;
    flex-direction:column;
}

    .modal-image{
        width:100%;
        height:auto;
        max-height:55vh;
        flex:none;
    }

    .series-preview{
        width:100%;
        flex:1;
        min-height:0;
        grid-template-columns:repeat(3,1fr);
        padding:25px 25px 0;
        overflow-y:auto;
    }

    .modal-info{
        width:100%;
        flex:none;
        padding:25px;
        overflow-y:auto;
    }

}

@media(max-width:768px){

    .series-viewer{
        width:100%;
        flex:0 0 auto;
    }

    .modal-card{
        flex-direction:column;
        width:90vw;
        height:auto;
        max-height:90vh;
        margin-top:-10px;
    }

    .series-preview{
        width:100%;
        height:auto;
        flex:none;
        grid-template-columns:repeat(3,1fr);
        gap:10px;
        padding-bottom:0;
        max-height:55vh;
    }

    .modal-image{
        width:100%;
        height:auto;
        max-height:60vh;
        flex:none;
    }

    .modal-info{
        width:100%;
        flex:none;
        padding:25px;
    }

}