/* Keep the caption in normal flow so larger text can increase the card height. */
#services .ar-gs-service-grid > .ar-gs-service {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0;
    min-width: 0;
    min-height: 0 !important;
    aspect-ratio: auto;
    padding: 0 !important;
    padding-top: clamp(12rem, 22vw, 21rem) !important;
    background: #101113;
}

#services .ar-service-photo,
#services .ar-gs-service-showcase__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#services .ar-service-photo {
    object-fit: cover;
    object-position: center 30%;
}

#services .ar-gs-service-showcase__media img {
    object-fit: cover;
    object-position: center;
}

/* Keep the left-hand displays in view when the card becomes portrait. */
#services .ar-gs-service-showcase__media img[data-ar-showcase-slide="0"],
#services .ar-gs-service-showcase__media img[data-ar-showcase-slide="1"] {
    object-position: 22% center;
}

@media (max-width: 575px), (pointer: coarse) and (max-width: 960px) and (max-height: 500px) {
    #services .ar-gs-service-grid > .ar-gs-service--showcase,
    #services .ar-gs-service-grid > .ar-gs-service--jdm {
        display: block;
        padding-top: 0 !important;
    }

    /* Size the photo from the card width, independently of the caption height. */
    #services .ar-gs-service--showcase > .ar-gs-service-showcase__media {
        position: relative;
        height: auto;
        aspect-ratio: 4 / 3;
    }

    #services .ar-gs-service-showcase__media img {
        height: auto;
    }

    #services .ar-gs-service--jdm > .ar-service-photo {
        position: relative;
        display: block;
        height: auto;
        z-index: auto;
    }

    /* Overlap the foreground pavement so the whole vehicle stays visible. */
    #services .ar-gs-service--jdm > .ar-service-caption {
        margin-top: -20%;
    }

    #services .ar-gs-service--showcase > .ar-service-caption {
        margin-top: -1rem;
    }
}

#services .ar-gs-service > .ar-gs-index {
    position: absolute;
    inset: 0.85rem auto auto 0.85rem;
    padding: 0.25rem 0.5rem;
    background: rgb(10 11 13 / 78%);
    color: #ffe2a1;
    z-index: 1;
}

#services .ar-gs-service > .ar-service-caption {
    position: relative;
    inset: auto;
    align-self: stretch;
    padding: clamp(1rem, 1.8vw, 1.55rem);
    color: #fff;
    background: rgb(11 12 15 / 78%);
    border-top: 1px solid rgb(255 255 255 / 20%);
}

#services .ar-service-caption h3 {
    margin: 0 0 0.45rem;
    color: #fff;
    font-size: clamp(1.25rem, 2vw, 1.85rem) !important;
    line-height: 1.12;
    text-shadow: none;
}

#services .ar-service-caption p {
    margin: 0;
    color: #f3f0e9 !important;
    font-size: 0.95rem;
    line-height: 1.45;
    text-shadow: none;
}

#services .ar-service-caption a {
    margin-top: 0.65rem;
    color: #ffe2a1 !important;
}
