/* ==========================================================================
   MENU / FOOD GALLERY
   Coffee-inspired, responsive gallery
   ========================================================================== */

.home-gallery {
    --coffee-dark: #2b1b14;
    --coffee: #6f4630;
    --coffee-light: #a8795b;
    --cream: #f7f1e8;
    --latte: #e5d2bd;
    --white: #ffffff;

    width: 100%;
    padding: clamp(3rem, 7vw, 7rem) 0;
    background: var(--cream);
    overflow: hidden;
}

.home-gallery .home-container {
    width: min(1400px, calc(100% - 40px));
    margin: 0 auto;
}


/* ==========================================================================
   GALLERY GRID
   ========================================================================== */

.home-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vw, 28px);
    width: 100%;
}


/* ==========================================================================
   GALLERY ITEM
   ========================================================================== */

.home-gallery-item {
    position: relative;
    isolation: isolate;
    margin: 0;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 22px;
    background: var(--latte);
    box-shadow:
        0 12px 30px rgba(43, 27, 20, 0.10),
        0 3px 8px rgba(43, 27, 20, 0.06);

    transition:
        transform 0.45s cubic-bezier(.22, 1, .36, 1),
        box-shadow 0.45s ease;
}


/* ==========================================================================
   IMAGE
   ========================================================================== */

.home-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;

    transform: scale(1.001);

    transition:
        transform 0.8s cubic-bezier(.22, 1, .36, 1),
        filter 0.5s ease;
}


/* ==========================================================================
   WARM OVERLAY
   ========================================================================== */

.home-gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(43, 27, 20, 0.02) 40%,
            rgba(43, 27, 20, 0.18) 100%
        );

    opacity: 0.8;
    transition: opacity 0.4s ease;
}


/* ==========================================================================
   HOVER
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {

    .home-gallery-item:hover {
        transform: translateY(-8px);

        box-shadow:
            0 24px 50px rgba(43, 27, 20, 0.18),
            0 8px 18px rgba(43, 27, 20, 0.08);
    }

    .home-gallery-item:hover img {
        transform: scale(1.07);
        filter: saturate(1.05) contrast(1.02);
    }

    .home-gallery-item:hover::after {
        opacity: 1;
    }
}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 900px) {

    .home-gallery {
        padding: 4.5rem 0;
    }

    .home-gallery .home-container {
        width: min(100% - 32px, 760px);
    }

    .home-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .home-gallery-item {
        aspect-ratio: 4 / 5;
        border-radius: 18px;
    }

    /*
     * Make the third image span the full width
     * on tablet for a more editorial layout.
     */
    .home-gallery-item:nth-child(3) {
        grid-column: 1 / -1;
        aspect-ratio: 16 / 9;
    }
}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 600px) {

    .home-gallery {
        padding: 3rem 0;
    }

    .home-gallery .home-container {
        width: calc(100% - 24px);
    }

    .home-gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .home-gallery-item,
    .home-gallery-item:nth-child(3) {
        grid-column: auto;
        aspect-ratio: 4 / 5;
        border-radius: 16px;
    }

    .home-gallery-item img {
        transform: none;
    }
}


/* ==========================================================================
   SMALL MOBILE
   ========================================================================== */

@media (max-width: 380px) {

    .home-gallery {
        padding: 2.5rem 0;
    }

    .home-gallery .home-container {
        width: calc(100% - 20px);
    }

    .home-gallery-grid {
        gap: 10px;
    }

    .home-gallery-item {
        border-radius: 13px;
    }
}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .home-gallery-item,
    .home-gallery-item img,
    .home-gallery-item::after {
        transition: none;
    }

    .home-gallery-item:hover {
        transform: none;
    }

    .home-gallery-item:hover img {
        transform: none;
    }
}
