/* ===========================================
   PREMIUM GALLERY SECTION STYLING
   Enhanced Design with Gold Gradient Theme
=========================================== */

/* CSS Custom Properties */
:root {
    /* Primary Colors from Logo */
    --gold-primary: #D4AF37;
    --gold-light: #F4E4A6;
    --gold-dark: #B8860B;
    --black: #121212;
    --dark-grey: #2C2C2C;
    --medium-grey: #555555;
    --light-grey: #F8F8F8;
    --white: #FFFFFF;
    
    /* Gradients */
    --gradient-gold-dark: linear-gradient(135deg, var(--gold-primary) 0%, var(--dark-grey) 100%);
    --gradient-gold-subtle: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    --gradient-gold-light: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 100%);
    --gradient-gold-vertical: linear-gradient(to bottom, var(--gold-primary) 0%, var(--dark-grey) 100%);
    --gradient-overlay: linear-gradient(to bottom, transparent 0%, rgba(18, 18, 18, 0.8) 100%);
    --gradient-gold-hover: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    
    /* Shadows */
    --shadow-subtle: 0 4px 12px rgba(18, 18, 18, 0.08);
    --shadow-medium: 0 8px 24px rgba(18, 18, 18, 0.12);
    --shadow-elevated: 0 12px 32px rgba(18, 18, 18, 0.16);
    --shadow-strong: 0 16px 40px rgba(18, 18, 18, 0.2);
    --shadow-gold: 0 8px 24px rgba(212, 175, 55, 0.3);
    --shadow-image: 0 4px 20px rgba(0, 0, 0, 0.15);
    
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-2xl: 24px;
    --border-radius-3xl: 32px;
    
    /* Transitions */
    --transition-standard: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Section Base Styling */
.gallery-section {
    padding: 100px 20px;
    background-color: var(--white);
    position: relative;
    overflow: hidden;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-gold-dark);
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 0 20px;
}

.section-badge {
    display: inline-block;
    padding: 10px 24px;
    background: var(--gradient-gold-dark);
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 30px;
    box-shadow: var(--shadow-subtle);
    margin-bottom: 25px;
}

.section-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 20px;
    line-height: 1.2;
    position: relative;
}

.title-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0 25px;
}

.decoration-line {
    width: 60px;
    height: 2px;
    background: var(--gradient-gold-subtle);
    border-radius: 1px;
}

.decoration-icon {
    color: var(--gold-primary);
    font-size: 1.25rem;
    background: var(--white);
    padding: 10px;
    border-radius: 50%;
    box-shadow: var(--shadow-gold);
}

.section-intro {
    font-size: 1.125rem;
    color: var(--medium-grey);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Gallery Filters - FIXED */
.gallery-filters {
    margin-bottom: 40px;
    padding: 0 20px;
}

.filters-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--white);
    border: 2px solid rgba(44, 44, 44, 0.1);
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dark-grey);
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-subtle);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--gold-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.filter-btn.active {
    background: var(--gradient-gold-subtle);
    color: var(--white);
    border-color: transparent;
    box-shadow: var(--shadow-gold);
}

.filter-text {
    font-weight: 600;
}

.filter-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 50px;
    padding: 0 20px;
}

.gallery-item {
    position: relative;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    aspect-ratio: 4/3;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-subtle);
    border: 1px solid rgba(212, 175, 55, 0.1);
    cursor: pointer;
}

.gallery-image {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
    display: block;
    transform: scale(1);
    filter: brightness(1);
}

/* Image Overlay - BOTTOM POSITIONED */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px;
    background: var(--gradient-overlay);
    transform: translateY(100%);
    transition: var(--transition-smooth);
    z-index: 2;
}

.project-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--gradient-gold-subtle);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-gold);
}

.project-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
    line-height: 1.3;
}

.project-desc {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    margin-bottom: 15px;
}

.view-project {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-light);
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-smooth);
}

.view-project i {
    font-size: 0.875rem;
    transition: var(--transition-standard);
}

/* Gallery CTA */
.gallery-cta {
    text-align: center;
    padding: 0 20px;
}

.view-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--gradient-gold-dark);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-gold);
    position: relative;
    overflow: hidden;
}

.view-more-btn i {
    font-size: 1.125rem;
    transition: var(--transition-standard);
}

.view-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-gold-subtle);
    transition: var(--transition-smooth);
    z-index: 1;
}

.view-more-btn span,
.view-more-btn i {
    position: relative;
    z-index: 2;
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 18, 0.98);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(10px);
}

.lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-container {
    position: relative;
    max-width: 1000px;
    width: 90%;
    max-height: 90vh;
    background: var(--white);
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-strong);
    border: 2px solid rgba(212, 175, 55, 0.3);
    animation: modalAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--gradient-gold-dark);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    transform: rotate(90deg) scale(1.1);
    background: var(--gradient-gold-subtle);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: var(--gradient-gold-dark);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-nav:hover {
    transform: translateY(-50%) scale(1.1);
    background: var(--gradient-gold-subtle);
}

.lightbox-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    height: 100%;
    max-height: 90vh;
}

.lightbox-image-wrapper {
    position: relative;
    overflow: hidden;
}

.lightbox-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: imageFadeIn 0.6s ease;
}

@keyframes imageFadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-info {
    padding: 40px;
    background: var(--white);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(44, 44, 44, 0.1);
}

.lightbox-type {
    display: inline-block;
    padding: 8px 16px;
    background: var(--gradient-gold-subtle);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 20px;
    align-self: flex-start;
}

.lightbox-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 15px;
    line-height: 1.3;
}

.lightbox-description {
    font-size: 1rem;
    color: var(--medium-grey);
    line-height: 1.6;
    margin-bottom: 30px;
    flex: 1;
}

.lightbox-details {
    border-top: 1px solid rgba(44, 44, 44, 0.1);
    padding-top: 20px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.detail-item i {
    color: var(--gold-primary);
    font-size: 1rem;
    width: 20px;
}

.detail-item span {
    font-size: 0.9375rem;
    color: var(--dark-grey);
}

/* ===========================================
   ENHANCED HOVER EFFECTS & INTERACTIONS
=========================================== */

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-elevated);
}

/* IMAGE ZOOM EFFECT - CLEAR AND VISIBLE */
.gallery-item:hover .gallery-image img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

/* BOTTOM OVERLAY SLIDE-UP EFFECT */
.gallery-item:hover .image-overlay {
    transform: translateY(0);
}

/* View project button animation */
.gallery-item:hover .view-project {
    opacity: 1;
    transform: translateX(0);
}

.gallery-item:hover .view-project i {
    transform: translateX(4px);
}

/* View more button hover effect */
.view-more-btn:hover::before {
    left: 0;
}

.view-more-btn:hover i {
    transform: translateX(5px);
}

/* Filter button active state animation */
.filter-btn.active {
    animation: filterActive 0.3s ease;
}

@keyframes filterActive {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* ===========================================
   RESPONSIVE DESIGN
=========================================== */

/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .lightbox-content {
        grid-template-columns: 1fr;
        max-height: 80vh;
    }
    
    .lightbox-image-wrapper {
        height: 300px;
    }
    
    .lightbox-image {
        height: 100%;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .filters-container {
        justify-content: center;
    }
}

/* Mobile (up to 767px) */
@media screen and (max-width: 767px) {
    .gallery-section {
        padding: 60px 15px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .gallery-filters {
        padding: 0 10px;
        margin-bottom: 30px;
    }
    
    .filters-container {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        margin-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 8px;
    }
    
    .filters-container::-webkit-scrollbar {
        height: 4px;
    }
    
    .filters-container::-webkit-scrollbar-track {
        background: rgba(44, 44, 44, 0.1);
        border-radius: 2px;
    }
    
    .filters-container::-webkit-scrollbar-thumb {
        background: var(--gradient-gold-subtle);
        border-radius: 2px;
    }
    
    .filter-btn {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 0.875rem;
    }
    
    .image-overlay {
        padding: 20px;
    }
    
    .project-title {
        font-size: 1.15rem;
    }
    
    .project-desc {
        font-size: 0.875rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-intro {
        font-size: 1rem;
    }
    
    .title-decoration {
        gap: 15px;
    }
    
    .decoration-line {
        width: 40px;
    }
    
    .lightbox-container {
        width: 95%;
        max-height: 85vh;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .lightbox-nav.prev {
        left: 10px;
    }
    
    .lightbox-nav.next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .lightbox-info {
        padding: 25px;
    }
    
    .lightbox-title {
        font-size: 1.5rem;
    }
    
    .lightbox-description {
        font-size: 0.9375rem;
    }
    
    /* Reduce zoom effect on mobile for performance */
    .gallery-item:hover .gallery-image img {
        transform: scale(1.03);
    }
}

/* Small Mobile (up to 480px) */
@media screen and (max-width: 480px) {
    .section-title {
        font-size: 1.75rem;
    }
    
    .gallery-item {
        aspect-ratio: 3/2;
    }
    
    .project-title {
        font-size: 1.1rem;
    }
    
    .view-more-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .lightbox-title {
        font-size: 1.25rem;
    }
    
    .detail-item span {
        font-size: 0.875rem;
    }
    
    .filters-container {
        gap: 6px;
    }
    
    .filter-btn {
        padding: 8px 14px;
        font-size: 0.8125rem;
    }
}

/* Large Desktop (1200px and above) */
@media screen and (min-width: 1200px) {
    .gallery-grid {
        gap: 30px;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .lightbox-container {
        max-width: 1100px;
    }
    
    /* Enhanced hover effects for large screens */
    .gallery-item:hover .gallery-image img {
        transform: scale(1.1);
    }
}

/* Image Loading Styles */
.gallery-image img {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Lazy Loading with Blur Effect */
.gallery-image img[data-src] {
    filter: blur(10px) brightness(1.1);
    transform: scale(1.02);
    transition: filter 0.6s ease, transform 0.6s ease;
}

.gallery-image img.loaded {
    filter: blur(0) brightness(1);
    transform: scale(1);
}

/* Loading skeleton */
.gallery-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(240, 240, 240, 0.8) 25%, 
        rgba(230, 230, 230, 0.8) 50%, 
        rgba(240, 240, 240, 0.8) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    z-index: 1;
    display: none;
}

.gallery-image.loading::before {
    display: block;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* No results message */
.gallery-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.gallery-no-results.active {
    display: block;
    animation: fadeIn 0.6s ease;
}

.no-results-icon {
    font-size: 3rem;
    color: var(--gold-primary);
    margin-bottom: 20px;
    opacity: 0.7;
}

.no-results-text {
    font-size: 1.25rem;
    color: var(--medium-grey);
    margin-bottom: 15px;
}

.no-results-hint {
    font-size: 0.9375rem;
    color: var(--medium-grey);
    opacity: 0.8;
}
/* --- 1. IMAGE CLARITY FIX --- */
/* This forces images to be 100% clear at all times */
.gallery-image img {
    opacity: 1 !important;        /* Force visibility */
    filter: none !important;     /* Remove all blurs/brightness shifts */
    transform: scale(1);
    transition: transform 0.4s ease;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Remove the "loading" skeleton that might be covering your image */
.gallery-image::before {
    display: none !important;
}

/* --- 2. FILTER CHIPS FIX --- */
.gallery-filters {
    position: relative;
    z-index: 100;               /* Ensure it sits above the grid */
    margin-bottom: 40px;
}

.filters-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    pointer-events: auto;       /* Ensures clicks are captured */
}

.filter-btn {
    cursor: pointer !important; /* Forces the hand cursor */
    position: relative;
    z-index: 101;
    background: var(--white);
    border: 2px solid rgba(44, 44, 44, 0.1);
    padding: 12px 20px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--gold-primary);
}

.filter-btn.active {
    background: var(--gradient-gold-subtle) !important;
    color: white !important;
    border-color: transparent;
}

/* --- 3. CLEAN HOVER (No Blur) --- */
.gallery-item:hover .gallery-image img {
    transform: scale(1.05);     /* Just a slight zoom, no color change */
}