/* ==========================================================
   SERGIO
   File: home-collection-grid.css
   Version: 2.2
   Purpose: Homepage Editorial Collection Grid
========================================================== */


/* ==========================================================
   COLLECTION
========================================================== */

.collection-grid {
    background: #ffffff;
    color: #111111;
}


/* ==========================================================
   COLLECTION INTRODUCTION
========================================================== */

.collection-grid-header {
    padding: 2.5rem 1.5rem 3rem;
}

.collection-grid .section-label {
    margin: 0 0 1.25rem;

    font-size: .7rem;
    line-height: 1;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.collection-grid-title {
    margin: 0;
    max-width: 44rem;

    font-size: clamp(2.25rem, 9vw, 5.5rem);
    line-height: .96;
    font-weight: 300;
    letter-spacing: -.04em;
}


/* ==========================================================
   EDITORIAL COLLECTION GRID
========================================================== */

.collection-products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.product-card {
    position: relative;

    min-width: 0;

    overflow: hidden;
    background: #f2f2f0;
}


/* Full-width editorial image */

.product-card:nth-child(3) {
    grid-column: 1 / -1;
}


/* Tall editorial image */

.product-card:nth-child(4) {
    grid-row: span 2;
}


/* ==========================================================
   PRODUCT LINKS
========================================================== */

.product-link {
    position: relative;

    display: block;

    width: 100%;
    height: 100%;

    overflow: hidden;

    color: inherit;
    text-decoration: none;
}


/* ==========================================================
   PRODUCT IMAGES
========================================================== */

.product-image {
    display: block;

    width: 100%;
    height: 100%;

    aspect-ratio: 1 / 1.25;

    object-fit: cover;

    transition:
        transform 900ms cubic-bezier(.23, 1, .32, 1);
}

.product-image--aion-detail {
    object-position: 28% 45%;
    scale: 1.18;
}

.product-card:nth-child(3) .product-image {
    aspect-ratio: 1 / 1.05;
}

.product-card:nth-child(4) .product-image {
    aspect-ratio: 1 / 2.5;
}


/* ==========================================================
   FLOATING COLLECTION LINK
========================================================== */

.collection-floating-link {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;

    display: inline-flex;
    align-items: center;
    gap: .65rem;

    color: #111111;

    font-size: .65rem;
    line-height: 1;
    font-weight: 400;
    letter-spacing: .16em;
    text-transform: uppercase;

    pointer-events: none;

    transition:
        transform 400ms cubic-bezier(.23, 1, .32, 1);
}

.collection-floating-link span:last-child {
    font-size: .9rem;
    line-height: 1;
}


/* ==========================================================
   INTERACTION
========================================================== */

.product-link:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: -1px;
}

@media (hover: hover) and (pointer: fine) {

    .product-link:hover .product-image,
    .product-link:focus-visible .product-image {
        transform: scale(1.015);
    }

    .product-card--final .product-link:hover
    .collection-floating-link,
    .product-card--final .product-link:focus-visible
    .collection-floating-link {
        transform: translate(.15rem, -.15rem);
    }

}


/* ==========================================================
   TABLET
========================================================== */

@media (min-width: 768px) {

    .collection-grid-header {
        padding: 3.5rem 2.5rem 4rem;
    }

    .collection-floating-link {
        right: 1.25rem;
        bottom: 1.25rem;
    }

}


/* ==========================================================
   DESKTOP
========================================================== */

@media (min-width: 1200px) {

    .collection-grid-header {
        padding: 6rem 4rem 5rem;
    }

    .collection-grid-title {
        max-width: 52rem;

        font-size: clamp(3.75rem, 5vw, 5.75rem);
    }

    .collection-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-flow: dense;
    }

    .product-card {
        min-height: 0;
    }

    /*
    Reset mobile editorial spans before defining
    the desktop composition.
    */

    .product-card:nth-child(3),
    .product-card:nth-child(4) {
        grid-column: auto;
        grid-row: auto;
    }

    /*
    Desktop editorial rhythm:
    first two standard objects,
    third object spans two columns,
    fourth is tall,
    final two complete the composition.
    */

    .product-card:nth-child(3) {
        grid-column: span 2;
    }

    .product-card:nth-child(4) {
        grid-row: span 2;
    }

    .product-image,
    .product-card:nth-child(3) .product-image,
    .product-card:nth-child(4) .product-image {
        width: 100%;
        height: 100%;

        aspect-ratio: auto;
        object-fit: cover;
    }

    .product-card:nth-child(1),
    .product-card:nth-child(2),
    .product-card:nth-child(5),
    .product-card:nth-child(6) {
        aspect-ratio: 4 / 5;
    }

    .product-card:nth-child(3) {
        aspect-ratio: 8 / 5;
    }

    .product-card:nth-child(4) {
        aspect-ratio: 4 / 10;
    }

    .collection-floating-link {
        right: 2rem;
        bottom: 2rem;
    }

}

/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    .product-image,
    .collection-floating-link {
        transition: none;
    }

    .product-link:hover .product-image,
    .product-link:focus-visible .product-image,
    .product-card--final .product-link:hover
    .collection-floating-link,
    .product-card--final .product-link:focus-visible
    .collection-floating-link {
        transform: none;
    }

}
