/* ============================================
   HERO GALLERY ANIMATION OVERLAY
   Center is transparent window showing actual hero
   ============================================ */

/* Gallery Overlay Wrapper */
.hero-gallery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9998;
    /* Below hero when it animates */
    background: var(--color-brand-pearl-white);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

.hero-gallery-overlay.visible {
    opacity: 1;
}

/* Gallery Grid */
.hero-gallery-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 16px;
    padding: 16px;
}

/* Gallery Items */
.hero-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    opacity: 1;
    transform: scale(1) translate(0, 0);
    transition: all 0.6s cubic-bezier(0.76, 0, 0.24, 1);
    background: #1a1a1a;
}

.hero-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Center Window - Transparent to show hero behind */
.hero-gallery-item.hero-gallery-center {
    background: transparent;
    backdrop-filter: none;
}

/* Animation Out States */
.hero-gallery-item.animating-out {
    transform: scale(0.3) translate(var(--tx), var(--ty));
    opacity: 0;
}

/* Center window fades out */
.hero-gallery-item.hero-gallery-center.animating-out {
    transform: scale(1.5);
    opacity: 0;
    border-color: transparent;
}

/* ============================================\n   RESPONSIVE DESIGN\n   ============================================ */

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .hero-gallery-grid {
        gap: 10px;
        padding: 10px;
    }

    .hero-gallery-item {
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .hero-gallery-grid {
        gap: 8px;
        padding: 8px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .hero-gallery-overlay {
        display: none !important;
    }

    #hero.hero-split {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   LOADING OPTIMIZATION
   ============================================ */

.hero-gallery-item img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.hero-gallery-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-brand-pearl-white);
    z-index: -1;
}