/* Gallery Page Specific Styles */
/* Note: Main navbar styles are in css/main.css - do not override here */

/* Gallery Filter Buttons */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 10px 24px;
    border: 2px solid #ddd;
    background: white;
    color: #333;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary, #D65A00);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: 0;
}

.filter-btn:hover::before,
.filter-btn.active::before {
    width: 300px;
    height: 300px;
}

.filter-btn span {
    position: relative;
    z-index: 1;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--primary, #D65A00);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(214, 90, 0, 0.3);
}

/* Gallery Counter */
.gallery-counter {
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #777;
    font-weight: 500;
}

.gallery-counter span {
    color: var(--primary, #D65A00);
    font-weight: 700;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 4/3;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.15);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0) 60%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-caption {
    color: #FFF8F0;
    transform: translateY(10px);
    transition: transform 0.4s ease;
    background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.28));
    padding: 10px 14px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 6px 18px rgba(246,162,33,0.14), inset 0 1px 0 rgba(255,255,255,0.03);
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-caption h3 {
    font-size: 1.15rem;
    margin: 0 0 6px 0;
    color: #F6A821; /* warm gold-orange */
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6), 0 0 6px rgba(246,162,33,0.08);
}

.gallery-caption p {
    font-size: 0.88rem;
    color: #FFEFD6;
    opacity: 0.95;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

/* small decorative accent bar */
.gallery-caption::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: linear-gradient(90deg, #FFB74D, #F6A821);
    border-radius: 2px;
    margin-bottom: 8px;
    opacity: 0.95;
}

.gallery-overlay i {
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-overlay i {
    opacity: 0.9;
    transform: scale(1) rotate(0);
}

/* Gallery Item Show/Hide Animation */
.gallery-item[style*="display: none"] {
    display: none !important;
}

.gallery-item.gallery-show {
    animation: galleryItemIn 0.4s ease forwards;
}

@keyframes galleryItemIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85vh;
    position: relative;
    animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.lightbox-caption {
    text-align: center;
    color: white;
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: 500;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: rgba(214, 90, 0, 0.9);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(214, 90, 0, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(214, 90, 0, 0.4);
}

.lightbox-close {
    top: 30px;
    right: 30px;
    font-size: 2rem;
    font-weight: 300;
}

.lightbox-prev {
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Filter buttons active state */
.filter-btn.active {
    background: var(--primary, #D65A00);
    color: white;
    border-color: var(--primary, #D65A00);
}

/* Responsive */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
        gap: 16px;
    }

    .gallery-filters {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 18px;
        font-size: 0.78rem;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
        gap: 15px;
    }

    .gallery-filters {
        gap: 6px;
        margin-bottom: 25px;
    }

    .filter-btn {
        padding: 7px 14px;
        font-size: 0.75rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .gallery-item {
        aspect-ratio: 1;
        border-radius: 8px;
    }

    .gallery-caption h3 {
        font-size: 0.85rem;
    }

    .gallery-caption p {
        font-size: 0.7rem;
    }

    .gallery-overlay {
        padding: 10px;
    }

    .gallery-overlay i {
        font-size: 1rem;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
    }

    .gallery-filters {
        gap: 5px;
        margin-bottom: 20px;
    }
}

/* Higher-specificity rules to ensure caption colors apply (fallback uses !important) */
.gallery-grid .gallery-item .gallery-overlay .gallery-caption h3 {
    color: #F6A821; /* warm gold-orange */
    text-shadow: 0 2px 6px rgba(0,0,0,0.6), 0 0 6px rgba(246,162,33,0.08);
}

.gallery-grid .gallery-item .gallery-overlay .gallery-caption p {
    color: #FFEFD6;
    opacity: 0.98;
}

/* Accent bar fallback */
.gallery-grid .gallery-item .gallery-overlay .gallery-caption::before {
    background: linear-gradient(90deg, #FFB74D, #F6A821) !important;
}

/* Force colors if other styles are overriding */
.gallery-grid .gallery-item .gallery-overlay .gallery-caption h3,
.gallery-grid .gallery-item .gallery-overlay .gallery-caption p {
    color: inherit !important;
}