/* Case study spots (includes/case_study_banner.html, .hcs), on any page: one card with the case
   study's picture on the left and the story on the right: a tag, the title, the summary, its
   results as a row of figures and a link. On phones the picture sits on top. Without a picture
   the emblem stands on a brand panel. */
.hcs {
    padding: 4.5rem 1rem;
    background: #F9FAFB;
}

@media (min-width: 820px) {
    .hcs {
        padding: 6rem 1.5rem;
    }
}

.hcs__card {
    display: grid;
    max-width: 72rem;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--kd-line);
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 30px 60px -45px rgba(15, 23, 42, 0.35);
}

@media (min-width: 820px) {
    .hcs__card {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
        min-height: 26rem;
    }
}

/* A flipped spot mirrors the card: the picture on the right. */
@media (min-width: 820px) {
    .hcs--flip .hcs__card {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    }

    .hcs--flip .hcs__media {
        order: 2;
    }

    .hcs--flip .hcs__body {
        padding: 3rem 3.25rem 3rem 3rem;
    }
}

/* ---------- The picture ---------- */
.hcs__media {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(160deg, var(--kd-brand), var(--kd-brand-deep));
}

@media (min-width: 820px) {
    .hcs__media {
        aspect-ratio: auto;
    }
}

.hcs__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hcs__media .hcs__mark {
    position: static;
    width: 5rem;
    height: auto;
    opacity: 0.5;
}

/* ---------- The story ---------- */
.hcs__body {
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.5rem 2rem;
}

@media (min-width: 820px) {
    .hcs__body {
        justify-content: center;
        padding: 3rem 3rem 3rem 3.25rem;
    }
}

.hcs__tag {
    align-self: flex-start;
    margin: 0;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--kd-mint-wash);
    color: var(--kd-mint-ink);
    font-size: 0.8rem;
    font-weight: 700;
}

.hcs__title {
    margin: 1rem 0 0;
    color: var(--kd-ink);
    font-size: clamp(1.6rem, 2.8vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.hcs__text {
    margin: 0.9rem 0 0;
    color: var(--kd-body);
    font-size: 1.05rem;
    line-height: 1.65;
}

/* The results: figures side by side under a fine line. */
.hcs__results {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 1rem;
    margin: 1.75rem 0 0;
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--kd-line);
    list-style: none;
}

.hcs__result {
    display: grid;
    gap: 0.35rem;
    align-content: start;
}

.hcs__result + .hcs__result {
    padding-left: 1rem;
    border-left: 1px solid var(--kd-line);
}

.hcs__num {
    color: var(--kd-ink);
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: -0.03em;
}

.hcs__sign {
    color: inherit;
}

.hcs__label {
    color: var(--kd-body);
    font-size: 0.875rem;
    line-height: 1.4;
}

.hcs__link {
    display: inline-flex;
    align-self: flex-start;
    gap: 0.4rem;
    margin-top: 1.75rem;
    color: var(--kd-brand);
    font-weight: 700;
    text-decoration: none;
}

.hcs__link span {
    transition: transform 0.2s ease;
}

.hcs__link:hover {
    color: var(--kd-brand-darker);
}

.hcs__link:hover span {
    transform: translateX(3px);
}

.hcs__link:focus-visible {
    outline: 3px solid var(--kd-brand);
    outline-offset: 3px;
    border-radius: 0.4rem;
}

@media (prefers-reduced-motion: reduce) {
    .hcs__link span {
        transition: none;
    }
}
