/**
 * Gallery Block Styles
 * 
 * @package AloraAlkemia
 */

.gallery-section {
    padding: 40px 0;
}

.gallery-container {
    display: grid;
    gap: 15px;
    margin: 0 auto;
    max-width: 1200px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    display: block;
}

.gallery-lightbox-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-lightbox-link:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    padding: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

/* Lightbox Styles */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.gallery-lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 0 20px 20px;
    font-size: 1rem;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-container {
        max-width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 30px 0;
    }
    
    .gallery-container {
        gap: 10px;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 20px 0;
    }
    
    .gallery-container {
        gap: 8px;
        padding: 0 10px;
    }
    
    .lightbox-content {
        margin: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .gallery-item {
        transition: none;
    }
    
    .gallery-item:hover {
        transform: none;
    }
    
    .gallery-image {
        transition: none;
    }
    
    .gallery-lightbox-link:hover .gallery-image {
        transform: none;
    }
    
    .gallery-caption {
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .gallery-item {
        border: 2px solid #000;
    }
    
    .lightbox-close {
        border: 2px solid #fff;
    }
}
