/* Анімація при відкритті */

.fancybox__caption {
    text-align: center;
}

.fancybox-zoomIn {
    animation: zoomIn 0.4s ease both;
}

/* Анімація при закритті */
.fancybox-zoomOut {
    animation: zoomOut 0.3s ease both;
}

/* Самі анімації */
@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 20px;
    animation: fadeInGrid 0.8s ease both;
}


.photos-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border-top: 3px solid rgba(59, 162, 231, 0.93);
    border-left: 3px solid rgba(59, 162, 231, 0.93);
    border-bottom: 3px solid rgba(66, 119, 215, 0.93);
    border-right: 3px solid rgba(66, 119, 215, 0.93);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    break-inside: avoid;
    align-self: start;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInItem 0.6s ease-out forwards;
    animation-delay: calc(var(--order) * 100ms);
    transition:
            border-top-color 0.5s ease,
            border-right-color 0.5s ease,
            border-bottom-color 0.5s ease,
            border-left-color 0.5s ease,
            box-shadow 0.3s ease-out;
    box-sizing: border-box;
}

.photos-card:hover {
    box-shadow:
            4px 8px 20px rgba(0, 0, 0, 0.4),
            2px 6px 10px rgba(0, 0, 0, 0.25);

    /* Кольори міняються по колу */
    border-top-color: rgba(66, 119, 215, 0.93);
    border-right-color: rgba(59, 162, 231, 0.93);
    border-bottom-color: rgba(59, 162, 231, 0.93);
    border-left-color: rgba(66, 119, 215, 0.93);
}


/* Натиснення миші або дотик */
.photos-card:active {
    transform: translateY(2px);
    box-shadow:
            2px 4px 10px rgba(0, 0, 0, 0.3),
            1px 2px 5px rgba(0, 0, 0, 0.2);
}


.photos-image-wrapper {
    width: 100%;
    background: #eee;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    display: block;
}

.photos-image-inner {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.photos-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.4s ease;
}

.photos-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100%;
}

.photos-caption {
    margin-top: auto;
    background: linear-gradient(135deg, #2b2d42 0%, #4b4e6d 100%);
    width: 100%;
    padding: 10px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #f1f1f1;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    line-height: 1.4;
    overflow: hidden;
    word-break: break-word;
    box-shadow:
            inset 0 1px 2px rgba(255,255,255,0.1),
            0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.4s ease;
    box-sizing: border-box;
    border-radius: 0;
}



.photos-no-photos {
    text-align: center;
    font-size: 1.2em;
    margin-top: 40px;
    color: #888;
}

.photos-hidden-form {
    display: none;
}

/* Анімації */
@keyframes fadeInGrid {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInItem {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}



@media (max-width: 992px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }
}


@media (max-width: 768px) {
    .photos-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }

    .photos-card {
        border-radius: 8px;
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
        transform: none;
        animation: none;
        opacity: 1;
        transition: none;
    }

    .photos-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .photos-image-wrapper {
        border: none;
        padding: 0;
    }

    .photos-image-inner {
        transition: none;
        transform: none;
    }

    .photos-card:hover .photos-image-inner {
        transform: none;
    }

    .photos-caption {
        padding: 10px;
        font-size: 0.75rem;
        letter-spacing: 1px;
        background: linear-gradient(135deg, #2b2d42 0%, #4b4e6d 100%);
        box-shadow: none;
    }

    .photos-card:hover .photos-caption {
        background: linear-gradient(135deg, #2b2d42 0%, #4b4e6d 100%);
        color: #f1f1f1;
    }

}
