/**
 * Normal Gallery Block - Frontend Styles
 *
 * @package TechTrustEvents
 * @since 1.0.0
 */

.techtrust-normal-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--gallery-gap, 16px);
    margin: 0 0 2rem 0;
}

.gallery-item {
    flex: 0 0 calc((100% - (var(--gallery-gap, 16px) * (var(--gallery-columns, 4) - 1))) / var(--gallery-columns, 4));
    max-width: calc((100% - (var(--gallery-gap, 16px) * (var(--gallery-columns, 4) - 1))) / var(--gallery-columns, 4));
    position: relative;
    padding: 10px 10px 0 10px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.gallery-image-container {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.gallery-image-container img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px 8px 0 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
}

.gallery-image-container img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.gallery-image-container a {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.gallery-image-container a:hover img {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.gallery-caption {
    background: #fff;
    color: #333;
    padding: 15px;
    margin-top: 0;
}

.gallery-caption-title {
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-caption-subtitle {
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.7;
    font-weight: 400;
    line-height: 1.3;
    color: #666;
}


.techtrust-normal-gallery-empty {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-item {
        /* flex: 0 0 calc((100% - (var(--gallery-gap, 16px) * (calc(var(--gallery-columns, 4) - 1) - 1))) / calc(var(--gallery-columns, 4) - 1)); */
        max-width: calc((100% - (var(--gallery-gap, 16px) * (calc(var(--gallery-columns, 4) - 1) - 1))) / calc(var(--gallery-columns, 4) - 1));
    }
}

@media (max-width: 768px) {
    .gallery-item {
        flex: 0 0 calc((100% - var(--gallery-gap, 16px)) / 2);
        max-width: calc((100% - var(--gallery-gap, 16px)) / 2);
    }
    
    .techtrust-normal-gallery {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .techtrust-normal-gallery {
        gap: 16px;
    }
}

/* Animation for loading */
.gallery-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-item:nth-child(1) {
    animation-delay: 0.1s;
}

.gallery-item:nth-child(2) {
    animation-delay: 0.2s;
}

.gallery-item:nth-child(3) {
    animation-delay: 0.3s;
}

.gallery-item:nth-child(4) {
    animation-delay: 0.4s;
}

.gallery-item:nth-child(5) {
    animation-delay: 0.5s;
}

.gallery-item:nth-child(6) {
    animation-delay: 0.6s;
}

.gallery-item:nth-child(7) {
    animation-delay: 0.7s;
}

.gallery-item:nth-child(8) {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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