/* ===== Сетка ===== */

.screenshots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}


/* ===== Карточка ===== */

.screenshot-card {
    flex: 1 1 320px;
    /* max-width:420px; */

    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    border: #777 1px solid;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


.screenshots-grid-large .screenshot-card {
    flex: 1 1 calc((100% - 36px) / 2);
    max-height: 360px;
}

.screenshots-grid-small .screenshot-card {
    flex: 1 1 calc((100% - 56px) / 3);
    max-width: 420px;
    max-height: 320px;
}

@media (max-width:900px) {

    .screenshots-grid-large .screenshot-card,
    .screenshots-grid-small .screenshot-card {
        flex: 1 1 calc((100% - 24px) / 2);
    }

}

@media (max-width:500px) {

    .screenshots-grid-large .screenshot-card,
    .screenshots-grid-small .screenshot-card {
        flex: 1 1 100%;
    }

}


/* ===== Изображение ===== */

.screenshot-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter .4s ease, transform .4s ease;

}

/* ===== Нижний заголовок ===== */

.screenshot-bottom {
    position: absolute;
    bottom:  6px;
    right: 6px;
    /* right: 10%; */
    /* transform: translateX(-10%);  */

  /*   left: 50%;
    

     border: #777 1px solid; */
   
    padding: 6px 16px;
    
    background: rgba(30,30,30, 0.8);
    border-radius: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px); /* для Safari */

    color: white;
    font-size: 16px;
    font-weight: 400;
    text-align: center;

    transition: opacity .3s ease, transform .3s ease;
}



/* ===== Центрированный overlay ===== */

.screenshot-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
    padding: 24px;

    background: rgba(0, 0, 0, 0.65);

    opacity: 0;
    transition: opacity .35s ease;
}

/* ===== Текст ===== */

.screenshot-title {
    color: white;
    font-size: 20px;
    margin: 0;
}

.screenshot-desc {
    color: #ddd;
    margin-top: 12px;
    font-size: 14px;
    max-width: 320px;
}

/* ===== Hover ===== */


.screenshot-card:hover img {
    filter: blur(4px) brightness(0.7);
    transform: scale(1.05);
}

.screenshot-card:hover .screenshot-bottom {
    opacity: 0;
    transform: translateY(10px);
}

.screenshot-card:hover .screenshot-overlay {
    opacity: 1;
}

.screenshot-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);

    font-size: 13px;
    color: #ddd;

    background: rgba(0, 0, 0, 0.35);
    padding: 6px 10px;
    border-radius: 6px;

    opacity: 0;
    transition: opacity .25s ease;
}

/* показывать только при hover */

.screenshot-card:hover .screenshot-hint {
    opacity: 1;
}




/* ===== Lightbox ===== */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 10000;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}



/* контейнер */

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
}

/* изображение */

.lightbox-img-wrapper {
    position: relative;
    overflow: hidden;
}

#lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    cursor: pointer;

    transition:
        opacity .25s ease,
        transform .25s ease;
}

.lightbox-img-transition {
    opacity: 0;
    transform: scale(0.96);
}

/* текст */

.lightbox-caption {
    margin-top: 16px;
    text-align: center;
    max-width: 900px;
}

#lightbox-title {
    color: white;
    font-size: 22px;
    font-weight: 600;
}

#lightbox-desc {
    color: #ccc;
    margin-top: 8px;
    font-size: 15px;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;

    transform: translateY(-50%);
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
    opacity: 0.7;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {

    .lightbox-prev,
    .lightbox-next {
        display: none;
    }

}


.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;

    font-size: 36px;
    line-height: 1;

    color: white;
    background: none;
    border: none;

    cursor: pointer;
    opacity: 0.75;

    transition: opacity .2s ease, transform .15s ease;
}

.lightbox-close:hover {
    opacity: 1;
    transform: scale(1.05);
}

.lightbox-counter {
    position: absolute;
    bottom: 16px;
    right: 20px;

    font-size: 13px;
    color: #ddd;

    background: rgba(0, 0, 0, 0.4);
    padding: 6px 10px;
    border-radius: 6px;

    backdrop-filter: blur(4px);
}