/* ========================================
   GALLERY SECTION STYLES
   Modern Photo Gallery with Premium Design
   ======================================== */

/* ========================================
   1. SECTION BACKGROUND
   ======================================== */

.gallery-section {
    background: linear-gradient(135deg,
            #5e1914 0%,
            #8B2500 25%,
            #A0522D 50%,
            #ddc656 75%,
            #f4e4a6 100%);
    background-size: 400% 400%;
    animation: galleryGradientShift 20s ease infinite;
    position: relative;
    padding: 60px 0;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.93);
    z-index: 0;
}

.gallery-section>* {
    position: relative;
    z-index: 1;
}

@keyframes galleryGradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ========================================
   2. HEADING STYLES
   ======================================== */

.gallery-heading {
    background: linear-gradient(90deg,
            #5e1914 0%,
            #8B2500 20%,
            #ddc656 40%,
            #f4e4a6 50%,
            #ddc656 60%,
            #8B2500 80%,
            #5e1914 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    display: inline-block;
    animation:
        galleryShimmer 4s linear infinite,
        galleryFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(94, 25, 20, 0.3));
}

.gallery-section .text-muted {
    animation: fadeInSlide 1s ease-out, subtitlePulse 3s ease-in-out infinite 1s;
    letter-spacing: 3px;
    font-weight: 500;
}

@keyframes galleryShimmer {
    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}

@keyframes galleryFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ========================================
   3. GALLERY GRID
   ======================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px 0;
}

/* ========================================
   4. GALLERY CARD
   ======================================== */

.gallery-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    aspect-ratio: 1/1;
    background: #f5f5f5;
}

.gallery-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(94, 25, 20, 0.25),
        0 0 30px rgba(221, 198, 86, 0.3);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* ========================================
   5. GALLERY OVERLAY
   ======================================== */

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top,
            rgba(94, 25, 20, 0.95) 0%,
            rgba(94, 25, 20, 0.7) 50%,
            transparent 100%);
    padding: 60px 15px 15px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-category {
    display: inline-block;
    background: linear-gradient(135deg, #ddc656 0%, #f4e4a6 100%);
    color: #5e1914;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ========================================
   6. VIEW ICON ON HOVER
   ======================================== */

.gallery-view-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ddc656 0%, #f4e4a6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(221, 198, 86, 0.5);
}

.gallery-view-icon i {
    font-size: 1.5rem;
    color: #5e1914;
}

.gallery-card:hover .gallery-view-icon {
    transform: translate(-50%, -50%) scale(1);
}

/* ========================================
   7. LIGHTBOX MODAL
   ======================================== */

.gallery-modal .modal-content {
    background: transparent;
    border: none;
}

.gallery-modal .modal-body {
    padding: 0;
    position: relative;
}

.gallery-modal .modal-body img {
    width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
}

.gallery-modal .btn-close {
    position: absolute;
    top: -40px;
    right: 0;
    filter: invert(1);
    opacity: 0.8;
}

.gallery-modal .modal-caption {
    background: linear-gradient(135deg, #5e1914 0%, #8B2500 100%);
    color: #fff;
    padding: 15px 20px;
    border-radius: 0 0 10px 10px;
    margin-top: -5px;
}

.gallery-modal .modal-caption h5 {
    margin: 0 0 5px;
    font-weight: 600;
}

.gallery-modal .modal-caption p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ========================================
   8. CAROUSEL NAVIGATION
   ======================================== */

.gallery-carousel-wrapper {
    position: relative;
    overflow: visible;
    padding: 20px 0;
}

.gallery-carousel-prev,
.gallery-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5e1914 0%, #8B2500 100%);
    color: white;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(94, 25, 20, 0.3);
}

.gallery-carousel-prev {
    left: -25px;
}

.gallery-carousel-next {
    right: -25px;
}

.gallery-carousel-prev:hover,
.gallery-carousel-next:hover {
    background: linear-gradient(135deg, #8B2500 0%, #5e1914 100%);
    box-shadow: 0 6px 20px rgba(94, 25, 20, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.gallery-carousel-prev:disabled,
.gallery-carousel-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #ccc;
}

.gallery-carousel-prev i,
.gallery-carousel-next i {
    font-size: 1.5rem;
}

/* Carousel Dots */
.gallery-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.gallery-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    border: 2px solid #5e1914;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.gallery-dot:hover {
    background: #ddc656;
    transform: scale(1.2);
}

.gallery-dot.active {
    background: linear-gradient(135deg, #5e1914 0%, #ddc656 100%);
    width: 30px;
    border-radius: 6px;
}

/* ========================================
   9. RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .gallery-carousel-prev {
        left: -15px;
    }

    .gallery-carousel-next {
        right: -15px;
    }

    .gallery-carousel-prev,
    .gallery-carousel-next {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 40px 0;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gallery-heading {
        font-size: 2rem !important;
    }

    .gallery-view-icon {
        width: 45px;
        height: 45px;
    }

    .gallery-view-icon i {
        font-size: 1.2rem;
    }

    .gallery-carousel-prev,
    .gallery-carousel-next {
        width: 35px;
        height: 35px;
    }

    .gallery-carousel-prev {
        left: 5px;
    }

    .gallery-carousel-next {
        right: 5px;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-title {
        font-size: 0.8rem;
    }

    .gallery-category {
        font-size: 0.6rem;
        padding: 2px 8px;
    }
}

/* ========================================
   10. ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-card {
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-card:nth-child(1) {
    animation-delay: 0.1s;
}

.gallery-card:nth-child(2) {
    animation-delay: 0.2s;
}

.gallery-card:nth-child(3) {
    animation-delay: 0.3s;
}

.gallery-card:nth-child(4) {
    animation-delay: 0.4s;
}

.gallery-card:nth-child(5) {
    animation-delay: 0.5s;
}

.gallery-card:nth-child(6) {
    animation-delay: 0.6s;
}

.gallery-card:nth-child(7) {
    animation-delay: 0.7s;
}

.gallery-card:nth-child(8) {
    animation-delay: 0.8s;
}

/* ========================================
   11. ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {

    .gallery-card,
    .gallery-overlay,
    .gallery-view-icon,
    .gallery-section {
        animation: none !important;
        transition: none !important;
    }
}

.gallery-card:focus {
    outline: 3px solid #ddc656;
    outline-offset: 3px;
}