/* ==========================================================================
   pds-solutions — asymmetric bento of measures
   ========================================================================== */

.pds-solutions {
    position: relative;
    padding-block: var(--pds-section-y);
    background: var(--pds-paper);
}

.pds-solutions__inner {
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 5vw, 4rem);
}

/* --- Head ----------------------------------------------------------------- */

.pds-solutions__head {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    align-items: end;
    gap: 1.75rem clamp(2rem, 4vw, 4rem);
}

/* The column itself is the measure. A `ch` cap here would be read against the
   body font of the wrapper, not the display face of the h2, which is how the
   title ended up breaking into six words-per-line. */
.pds-solutions__head-copy {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-inline-size: 0;
}

/* Cap sits on the heading, so `ch` is measured in the display face. */
.pds-solutions__head-copy .pds__h2 {
    max-inline-size: 17ch;
}

/* Pushed to the end of its column so the slack falls in the middle gap rather
   than as a band of white against the right edge. */
.pds-solutions__intro {
    max-inline-size: 52ch;
    margin-inline-start: auto;
    padding-block-end: .375rem;
    text-wrap: pretty;
}

/* --- Grid ------------------------------------------------------------------
   A 12-column bed; each tile sets --pds-span in the editor. Rows are a fixed
   base height so a "tall" tile is exactly two of them plus the gap, which is
   what keeps the bento from drifting out of alignment. */

.pds-solutions__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: minmax(15.5rem, auto);
    gap: clamp(.875rem, 1.4vw, 1.25rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.pds-solutions__cell {
    grid-column: span var(--pds-span, 4);
    min-inline-size: 0;
}

.pds-solutions__cell--tall {
    grid-row: span 2;
}

/* --- Card ------------------------------------------------------------------ */

.pds-solutions__card {
    position: relative;
    display: flex;
    flex-direction: column;
    block-size: 100%;
    padding: .5rem;
    border-radius: var(--pds-r-lg);
    border: 1px solid var(--pds-line);
    background: var(--pds-bone);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color .45s var(--pds-ease), background-color .45s var(--pds-ease),
                transform .55s var(--pds-ease-out), box-shadow .55s var(--pds-ease-out);
}

a.pds-solutions__card:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: var(--pds-shadow-lg);
    background: var(--pds-paper);
}

/* --- Media ----------------------------------------------------------------- */

.pds-solutions__media {
    position: relative;
    display: block;
    flex: 1;
    min-block-size: 9rem;
    border-radius: calc(var(--pds-r-lg) - .5rem);
    background: var(--pds-bone-deep);
}

.pds-solutions__media img,
.pds-solutions__clip {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    transition: transform 1s var(--pds-ease-out), opacity .5s var(--pds-ease);
}

.pds-solutions__clip {
    opacity: 0;
    z-index: 1;
}

.pds-solutions__card.is-playing .pds-solutions__clip {
    opacity: 1;
}

.pds-solutions__card:hover .pds-solutions__media img {
    transform: scale(1.06);
}

/* Icon badge floating on the media */
.pds-solutions__icon {
    position: absolute;
    z-index: 2;
    inset-block-start: .875rem;
    inset-inline-start: .875rem;
    display: grid;
    place-items: center;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(12px);
    color: var(--pds-purple);
    transition: background-color .45s var(--pds-ease), color .45s var(--pds-ease),
                transform .45s var(--pds-ease);
}

.pds-solutions__card:hover .pds-solutions__icon {
    background: var(--pds-orange);
    color: #1B0C05;
    transform: rotate(-8deg);
}

/* --- Body ------------------------------------------------------------------ */

.pds-solutions__body {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1.25rem 1rem 1rem;
}

.pds-solutions__meta {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pds-orange-ink);
}

.pds-solutions__title {
    font-family: var(--pds-display);
    font-size: clamp(1.25rem, 1.7vw, 1.625rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.025em;
    color: var(--pds-title);
    margin: 0;
}

.pds-solutions__text {
    font-size: var(--pds-fs-small);
    line-height: 1.55;
    color: var(--pds-body);
}

/* --- Overlay variant --------------------------------------------------------
   Text sits on the media instead of under it. Used for the one or two hero
   tiles in the bento that carry a strong photograph. */

.pds-solutions__card--overlay {
    padding: 0;
    border-color: transparent;
}

.pds-solutions__card--overlay .pds-solutions__media {
    position: absolute;
    inset: 0;
    border-radius: var(--pds-r-lg);
}

.pds-solutions__card--overlay .pds-solutions__media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(23, 9, 42, .88) 4%, rgba(23, 9, 42, .34) 46%, rgba(23, 9, 42, .05) 100%);
}

.pds-solutions__card--overlay .pds-solutions__icon {
    z-index: 3;
}

.pds-solutions__card--overlay .pds-solutions__body {
    position: relative;
    z-index: 2;
    margin-block-start: auto;
    padding: clamp(1.25rem, 2.4vw, 1.875rem);
}

.pds-solutions__card--overlay .pds-solutions__title {
    color: #fff;
}

.pds-solutions__card--overlay .pds-solutions__text {
    color: rgba(255, 255, 255, .82);
}

.pds-solutions__card--overlay .pds-solutions__meta {
    color: var(--pds-orange);
}

/* --- Go arrow --------------------------------------------------------------- */

.pds-solutions__go {
    position: absolute;
    z-index: 3;
    inset-block-start: .875rem;
    inset-inline-end: .875rem;
    display: grid;
    place-items: center;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    border-radius: 50%;
    background: var(--pds-title);
    color: #fff;
    opacity: 0;
    transform: scale(.72);
    transition: opacity .4s var(--pds-ease), transform .5s var(--pds-ease-out),
                background-color .4s var(--pds-ease), color .4s var(--pds-ease);
}

a.pds-solutions__card:hover .pds-solutions__go,
a.pds-solutions__card:focus-visible .pds-solutions__go {
    opacity: 1;
    transform: none;
}

a.pds-solutions__card:hover .pds-solutions__go {
    background: var(--pds-orange);
    color: #1B0C05;
}

/* --- Responsive -------------------------------------------------------------- */

@media (max-width: 1023px) {

    .pds-solutions__head {
        grid-template-columns: minmax(0, 1fr);
    }

    .pds-solutions__head-copy .pds__h2 {
        max-inline-size: 20ch;
    }

    .pds-solutions__intro {
        max-inline-size: 60ch;
        margin-inline-start: 0;
    }

    /* The 12-column bed has no room left to be asymmetric at this width, so
       every tile becomes a half. Tall tiles keep their double height, which is
       what stops the bento from flattening into a plain list too early. */
    .pds-solutions__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: minmax(14rem, auto);
    }

    .pds-solutions__cell {
        grid-column: span 1;
    }
}

@media (max-width: 599px) {

    .pds-solutions__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pds-solutions__cell,
    .pds-solutions__cell--tall {
        grid-column: span 1;
        grid-row: auto;
    }

    .pds-solutions__card--overlay {
        min-block-size: 22rem;
    }
}
