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

/* ==========================================
   Gallery Filters
   ========================================== */

.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.gallery-filter-btn {
    padding: 10px 24px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-filter-btn:hover {
    background: #f3f4f6;
    border-color: #73281E;
    color: #73281E;
    transform: translateY(-2px);
}

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

/* ==========================================
   Photo Grid Enhancements
   ========================================== */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: #f3f4f6;
}

.photo-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

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

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

/* Grid Variations */
.photo-item.photo-large {
    grid-column: span 2;
    grid-row: span 2;
}

.photo-item.photo-tall {
    grid-row: span 2;
}

.photo-item.photo-wide {
    grid-column: span 2;
}

/* ==========================================
   Photo Overlay
   ========================================== */

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

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

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

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

.photo-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.photo-description {
    color: #e5e7eb;
    font-size: 14px;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

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

.photo-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   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
   ========================================== */

@media (max-width: 1024px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .photo-item.photo-large {
        grid-column: span 2;
        grid-row: span 1;
    }
}

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

    .photo-item.photo-large,
    .photo-item.photo-wide {
        grid-column: span 2;
        grid-row: span 1;
    }

    .photo-item.photo-tall {
        grid-row: span 1;
    }

    .gallery-filters {
        gap: 8px;
    }

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

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

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

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

    .photo-item.photo-large,
    .photo-item.photo-wide,
    .photo-item.photo-tall {
        grid-column: span 1;
        grid-row: span 1;
    }

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

    .gallery-filter-btn {
        width: 100%;
    }
}

/* ==========================================
   Loading State
   ========================================== */

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

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

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

/* ==========================================
   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;
    }
}
