@charset "UTF-8";

/**
 * Modern Gallery Component
 * 
 * Purpose: Modern, responsive image gallery display
 * Features:
 * - Responsive grid layout
 * - Hover effects
 * - Lightbox-ready structure
 * - 100% responsive
 * 
 * @version 1.0.0
 * @date 2026-01-25
 */

/* ============================================================
   GALLERY SECTION
   ============================================================ */

.nx-gallery-section {
    padding: 4rem 0;
    background: #fafafa;
    position: relative;
}

.nx-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================
   GALLERY HEADER
   ============================================================ */

.nx-gallery-header {
    text-align: center;
    margin-bottom: 3rem;
}

.nx-gallery-title {
    font-size: 2.75rem;
    font-weight: 800;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    color: #1d1d1f;
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, #1d1d1f 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.nx-gallery-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--bs-primary, #0d6efd), transparent);
    border-radius: 2px;
}

@media (max-width: 768px) {
    .nx-gallery-title {
        font-size: 2.25rem;
        letter-spacing: -0.025em;
    }
    
    .nx-gallery-title::after {
        width: 50px;
        height: 3px;
        bottom: -6px;
    }
}

/* ============================================================
   GALLERY GRID
   ============================================================ */

.nx-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 991px) {
    .nx-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .nx-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

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

/* ============================================================
   GALLERY ITEM
   ============================================================ */

.nx-gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.nx-gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.1);
}

.nx-gallery-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ============================================================
   GALLERY IMAGE
   ============================================================ */

.nx-gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f5f5f7;
}

.nx-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.4s ease;
    filter: brightness(1) contrast(1);
}

.nx-gallery-item:hover .nx-gallery-image {
    transform: scale(1.1);
    filter: brightness(1.05) contrast(1.05);
}

/* ============================================================
   GALLERY OVERLAY
   ============================================================ */

.nx-gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    z-index: 2;
}

.nx-gallery-item:hover .nx-gallery-overlay {
    opacity: 1;
}

.nx-gallery-icon {
    width: 48px;
    height: 48px;
    color: #ffffff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nx-gallery-item:hover .nx-gallery-icon {
    transform: scale(1);
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 576px) {
    .nx-gallery-item {
        border-radius: 12px;
    }
    
    .nx-gallery-icon {
        width: 36px;
        height: 36px;
    }
}

/* ============================================================
   LOADING STATE
   ============================================================ */

.nx-gallery-image.lazyload {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nx-gallery-image.lazyloaded {
    opacity: 1;
}

/* ============================================================
   ANIMATION
   ============================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nx-gallery-item {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.nx-gallery-item:nth-child(1) { animation-delay: 0.1s; }
.nx-gallery-item:nth-child(2) { animation-delay: 0.2s; }
.nx-gallery-item:nth-child(3) { animation-delay: 0.3s; }
.nx-gallery-item:nth-child(4) { animation-delay: 0.4s; }
.nx-gallery-item:nth-child(5) { animation-delay: 0.5s; }
.nx-gallery-item:nth-child(6) { animation-delay: 0.6s; }
.nx-gallery-item:nth-child(n+7) { animation-delay: 0.7s; }
