/* The Case Study page (category-case-study.php). The newest case opens like
   the lead paper of a journal: a margin of facts, the title, a summary set as
   an abstract, a tall photo. The rest run as a sequence of differently shaped
   blocks (a wide feature, a row of four, a text-only panel), broken by two
   banners, so the page never settles into one repeated row.
   Shared parts: archive.css. */

/* ---------- Lead case ---------- */
.vx-case-lead {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) minmax(0, 0.9fr);
    gap: clamp(20px, 3vw, 48px);
    align-items: start;
    padding: clamp(40px, 5vw, 64px) 0;
    border-bottom: 1px solid var(--vx-rule);
    color: var(--vx-ink);
    text-decoration: none;
}
.vx-case-lead__title {
    margin: 0;
    font-size: clamp(30px, 3.2vw, 44px);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-wrap: balance;
}
.vx-case-lead .vx-summary {
    font-size: 18px;
    -webkit-line-clamp: 5;
}
.vx-case-lead .vx-frame {
    aspect-ratio: 4 / 5;
}
.vx-case-lead .vx-more {
    margin-top: 22px;
}

/* The margin of facts, set as label and value. */
.vx-facts {
    display: grid;
    gap: 12px;
    margin: 0;
    padding-top: 4px;
}
.vx-facts div {
    display: grid;
    gap: 2px;
}
.vx-facts dt {
    font-size: 12px;
    font-weight: 700;
    color: var(--vx-muted);
}
.vx-facts dd {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--vx-ink);
    font-variant-numeric: tabular-nums;
}
.vx-facts .is-solution dd {
    color: var(--vx-red);
}

/* Like a journal abstract: the summary opens with its own bold label. */
.vx-summary {
    display: -webkit-box;
    margin: 12px 0 0;
    max-width: 62ch;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.65;
    color: var(--vx-body);
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.vx-summary b {
    font-weight: 800;
    color: var(--vx-ink);
}
.vx-case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: baseline;
    margin: 16px 0 8px;
}

/* ---------- Blocks ---------- */
.vx-block {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(28px, 3vw, 40px) clamp(20px, 2.4vw, 32px);
    padding: clamp(44px, 5vw, 64px) 0;
    border-bottom: 1px solid var(--vx-rule);
}

/* A tile: photo, solution and date, title. */
.vx-tile {
    display: block;
    color: var(--vx-ink);
    text-decoration: none;
}
.vx-tile__text {
    display: block;
}
.vx-tile .vx-frame {
    aspect-ratio: 3 / 2;
}
.vx-tile__title {
    margin: 0;
    font-size: 19px;
    line-height: 1.32;
    font-weight: 800;
    letter-spacing: -0.015em;
    text-wrap: balance;
}
.vx-tile .vx-more {
    margin-top: 18px;
}

/* Feature: one case at two thirds width, with its summary. */
.vx-tile--feature {
    grid-column: span 8;
}
.vx-tile--feature .vx-frame {
    aspect-ratio: 16 / 9;
}
.vx-tile--feature .vx-tile__title {
    font-size: clamp(24px, 2.4vw, 32px);
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -0.025em;
}

/* Beside a feature: two cases stacked, as text with a small square photo. */
.vx-stack {
    grid-column: span 4;
    display: grid;
    align-content: start;
}
.vx-stack .vx-tile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 16px;
    padding: 22px 0;
    border-top: 1px solid var(--vx-rule);
}
.vx-stack .vx-tile:first-child {
    padding-top: 0;
    border-top: 0;
}
.vx-stack .vx-frame {
    grid-column: 2;
    grid-row: 1;
    aspect-ratio: 1;
}
.vx-stack .vx-tile__text {
    grid-column: 1;
    grid-row: 1;
}
.vx-stack .vx-case-meta {
    margin-top: 0;
}
.vx-stack .vx-tile__title {
    font-size: 17px;
}
.vx-block--flip .vx-tile--feature {
    order: 2;
}
.vx-block--flip .vx-stack {
    order: 1;
}

.vx-tile--quarter {
    grid-column: span 3;
}
.vx-tile--third {
    grid-column: span 4;
}
.vx-tile--half {
    grid-column: span 6;
}
.vx-tile--half .vx-frame {
    aspect-ratio: 16 / 9;
}
.vx-tile--half .vx-tile__title {
    font-size: 22px;
}

/* Text-only panel: no photo, a pale ground, the summary does the work. */
.vx-panel {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 2.6vw, 36px);
    background: var(--vx-light);
    color: var(--vx-ink);
    text-decoration: none;
}
.vx-panel .vx-case-meta {
    margin-top: 0;
}
.vx-panel .vx-tile__title {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.025em;
}
.vx-panel .vx-summary {
    -webkit-line-clamp: 6;
}
.vx-panel .vx-more {
    margin-top: auto;
    padding-top: 22px;
}

/* ---------- Banners ---------- */
.vx-banner {
    margin-top: clamp(44px, 5vw, 64px);
}

/* Red: the homepage's closing red band, as a call to book a discussion. */
.vx-banner--red {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    align-items: center;
    padding: clamp(36px, 4.5vw, 60px) clamp(28px, 4.5vw, 64px);
    color: rgba(255, 255, 255, 0.88);
    background:
        radial-gradient(70% 90% at 100% 100%, rgba(29, 29, 27, 0.35), rgba(29, 29, 27, 0) 70%),
        linear-gradient(120deg, #E3122A 0%, #C11A2B 50%, #9E1B2B 100%);
}
.vx-banner--red h2 {
    margin: 0 0 10px;
    max-width: 22ch;
    font-size: clamp(26px, 2.8vw, 38px);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #fff;
}
.vx-banner--red p {
    margin: 0;
    max-width: 52ch;
    font-size: 17px;
    line-height: 1.6;
}
.vx-banner__button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 26px;
    background: #fff;
    color: var(--vx-red-dark);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}
.vx-banner__button svg {
    width: 16px;
    height: 16px;
    transition: transform 260ms var(--vx-ease);
}
.vx-banner__button:hover svg {
    transform: translateX(4px);
}
.vx-archive .vx-banner__button:focus-visible {
    outline-color: #fff;
}

/* Light: a photo and a pointer to the homepage's two-question picker. */
.vx-banner--light {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    background: var(--vx-light);
    color: var(--vx-ink);
    text-decoration: none;
}
.vx-banner--light .vx-frame {
    min-height: 260px;
}
.vx-banner__text {
    align-self: center;
    padding: clamp(28px, 4vw, 56px);
}
.vx-banner--light h2 {
    margin: 0 0 10px;
    font-size: clamp(24px, 2.4vw, 32px);
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -0.025em;
}
.vx-banner--light p {
    margin: 0 0 20px;
    max-width: 46ch;
    font-size: 16px;
    line-height: 1.6;
    color: var(--vx-body);
}

@media (max-width: 1024px) {
    .vx-tile--feature,
    .vx-stack {
        grid-column: 1 / -1;
    }
    .vx-block--flip .vx-tile--feature,
    .vx-block--flip .vx-stack {
        order: 0;
    }
    .vx-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 24px;
    }
    .vx-stack .vx-tile,
    .vx-stack .vx-tile:first-child {
        padding: 18px 0 0;
        border-top: 1px solid var(--vx-rule);
    }
    .vx-tile--quarter,
    .vx-tile--third,
    .vx-panel {
        grid-column: span 6;
    }
}
@media (max-width: 960px) {
    .vx-case-lead {
        grid-template-columns: 150px minmax(0, 1fr);
    }
    .vx-case-lead .vx-frame {
        grid-column: 1 / -1;
        grid-row: 1;
        aspect-ratio: 16 / 9;
    }
}
@media (max-width: 680px) {
    .vx-case-lead {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
    .vx-case-lead__title {
        font-size: 28px;
    }
    .vx-facts {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 22px;
    }
    .vx-stack {
        grid-template-columns: minmax(0, 1fr);
    }
    .vx-tile--quarter,
    .vx-tile--third,
    .vx-tile--half,
    .vx-panel {
        grid-column: 1 / -1;
    }
    .vx-banner--red,
    .vx-banner--light {
        grid-template-columns: minmax(0, 1fr);
    }
    .vx-banner--light .vx-frame {
        min-height: 200px;
    }
}
