@charset "UTF-8";

/**
 * Modern Gallery Component
 * Responsive tiles, object-fit: contain (no crop), no hover pin icon
 */

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

.nx-gallery-section {
    padding: clamp(2rem, 5vw, 3.5rem) 0;
    background: var(--filter-bg, #fafafa);
    position: relative;
}

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

/* Title: home-section-unified.modern.css */

/* ============================================================
   GRID — mobile-first
   ============================================================ */

.nx-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

@media (min-width: 600px) {
    .nx-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
}

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

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

.nx-gallery-item {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 0;
    border-radius: 14px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
}

.nx-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    border-color: color-mix(in srgb, var(--primary, #0d6efd) 28%, var(--border-color, #ddd));
}

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

a.nx-gallery-link {
    cursor: pointer;
}

a.nx-gallery-link:focus-visible {
    outline: 3px solid var(--primary, #0d6efd);
    outline-offset: 2px;
}

/* ============================================================
   IMAGE — contain, no crop
   ============================================================ */

.nx-gallery-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    overflow: hidden;
    background:
        linear-gradient(
            160deg,
            color-mix(in srgb, var(--card-bg, #fff) 90%, var(--filter-bg, #f5f5f7)) 0%,
            var(--filter-bg, #f5f5f7) 100%
        );
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .nx-gallery-image-wrapper {
        padding: 1rem;
        aspect-ratio: 16 / 10;
    }
}

.nx-gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    background: transparent;
    transition: opacity 0.25s ease;
}

.nx-gallery-image.is-fallback,
.nx-gallery-image[src*="default.webp"] {
    opacity: 0.65;
    max-width: 48%;
    max-height: 48%;
}

/* Overlay / map-pin icon removed — hide if legacy markup remains */
.nx-gallery-overlay,
.nx-gallery-icon {
    display: none !important;
}

/* ============================================================
   MOBILE: peek carousel when few wide items feel cramped
   ============================================================ */

@media (max-width: 575.98px) {
    .nx-gallery-item {
        border-radius: 12px;
    }

    .nx-gallery-image-wrapper {
        padding: 0.5rem;
        aspect-ratio: 1 / 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nx-gallery-item {
        transition: none;
    }

    .nx-gallery-item:hover {
        transform: none;
    }
}
