/**
 * LRAL Gallery Styles
 * Enhanced photo gallery with filtering and overlay effects
 */

/* ==========================================
   Gallery Filters - Clean & Modern
   ========================================== */

.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
    padding: 0 20px;
}

.gallery-filter-btn {
    padding: 12px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.gallery-filter-btn:hover {
    background: #f8fafc;
    border-color: #73281E;
    color: #73281E;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(115, 40, 30, 0.15);
}

.gallery-filter-btn.active {
    background: #73281E;
    border-color: #73281E;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(115, 40, 30, 0.25);
    transform: translateY(-1px);
}

.category-count {
    margin-left: 6px;
    opacity: 0.7;
    font-size: 12px;
    font-weight: 400;
}

/* ==========================================
   Photo Grid Enhancements - Clean & Consistent
   ========================================== */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 40px;
    padding: 0;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: #ffffff;
    aspect-ratio: 4/3;
}

.photo-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.08);
}

/* Simplified Grid - No Complex Variations for Better Consistency */
.photo-item.photo-large,
.photo-item.photo-tall,
.photo-item.photo-wide {
    /* Reset all special sizing for consistent grid */
    grid-column: span 1;
    grid-row: span 1;
}

/* ==========================================
   Photo Overlay - Cleaner Design
   ========================================== */

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 24px;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay-content {
    width: 100%;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-overlay-content {
    transform: translateY(0);
}

.photo-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.photo-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin: 0 0 8px 0;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.photo-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.photo-category-badge {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   Gallery Item Animation States
   ========================================== */

.photo-item.hidden {
    display: none;
}

.photo-item.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.photo-item.fade-in {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ==========================================
   Responsive Design - Mobile First Approach
   ========================================== */

@media (max-width: 1200px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        margin-top: 32px;
    }

    .photo-item {
        border-radius: 12px;
        aspect-ratio: 1;
    }

    .gallery-filters {
        gap: 8px;
        margin-bottom: 32px;
    }

    .gallery-filter-btn {
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 20px;
    }

    .photo-title {
        font-size: 14px;
    }

    .photo-description {
        font-size: 12px;
    }

    .photo-overlay {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .photo-item {
        aspect-ratio: 4/3;
    }

    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .gallery-filter-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }

    .photo-overlay {
        /* Always visible on mobile for better accessibility */
        opacity: 0.9;
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            transparent 80%
        );
    }

    .photo-overlay-content {
        transform: translateY(0);
    }
}

/* ==========================================
   Loading State & Image Loading
   ========================================== */

.gallery-loading {
    text-align: center;
    padding: 60px 20px;
}

.gallery-loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #73281E;
    border-radius: 50%;
    animation: gallery-spinner 0.8s linear infinite;
}

@keyframes gallery-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Image Loading States */
.photo-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.photo-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

.photo-item img {
    transition: opacity 0.3s ease;
}

.photo-item:not(.loaded) img {
    opacity: 0;
}

/* ==========================================
   Empty State
   ========================================== */

.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: #6b7280;
}

.gallery-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.5;
}

.gallery-empty h3 {
    font-size: 24px;
    color: #374151;
    margin-bottom: 12px;
}

.gallery-empty p {
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
}

/* ==========================================
   Accessibility
   ========================================== */

.photo-item:focus {
    outline: 3px solid #73281E;
    outline-offset: 2px;
}

.gallery-filter-btn:focus {
    outline: 2px solid #73281E;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .photo-item,
    .photo-item img,
    .photo-overlay,
    .photo-overlay-content,
    .gallery-filter-btn {
        transition: none;
    }

    .photo-item:hover {
        transform: none;
    }

    .photo-item:hover img {
        transform: none;
    }
}
