/* =======================================
   GALLERY PAGE STYLES
   ======================================= */

:root {
    --primary-red: #C41E3A;
    --dark-bg: #1a1a1a;
}

/* Gallery Hero */
.gallery-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* Gallery Album Card */
.gallery-album-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.gallery-album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.album-cover {
    height: 300px;
    overflow: hidden;
}

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

.gallery-album-card:hover .album-cover img {
    transform: scale(1.1);
}

.album-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    color: white;
}

.album-info h5 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.album-meta {
    background: #f8f9fa;
}

/* Gallery Image Card */
.gallery-image-card {
    cursor: pointer;
    position: relative;
}

.image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    padding-top: 100%; /* 1:1 Aspect Ratio */
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-image-card:hover .image-wrapper img {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(196, 30, 58, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image-card:hover .image-overlay {
    opacity: 1;
}

.image-overlay i {
    color: white;
    font-size: 2rem;
}

.image-caption {
    background: #f8f9fa;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 120px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    background: var(--primary-red);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10000;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-red);
}

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

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.lightbox-info {
    margin-top: 20px;
    text-align: center;
    color: white;
}

.lightbox-caption {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.lightbox-meta {
    display: flex;
    gap: 20px;
    justify-content: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Lightbox Thumbnails */
.lightbox-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 2px;
}

.lightbox-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.lightbox-thumbnail:hover {
    opacity: 0.8;
}

.lightbox-thumbnail.active {
    opacity: 1;
    border: 2px solid var(--primary-red);
}

/* Masonry Grid (CSS Grid Alternative) */
#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* Lazy Loading */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    #gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        top: 10px;
        right: 10px;
    }
    
    .lightbox-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .album-cover {
        height: 200px;
    }
}

/* Print Styles */
@media print {
    .lightbox-overlay {
        display: none;
    }
}
