/* ==========================================================================
   First Media: case study blocks (cs*)
   Colours and type taken from firstmedia.co.uk (Bootstrap vars in brackets):
     navy      #133757  (--bs-secondary)
     green     #3ADDA4  (--bs-primary)
     raspberry #B33768  (--bs-magenta)
     cream     #F7F5F1  (--bs-grey)
   Fonts are inherited from the site (Poppins).
   Everything is scoped to .cs-* classes, so nothing else on the site changes.
   ========================================================================== */

:root {
    --cs-navy: var(--bs-secondary, #133757);
    --cs-navy-deep: #0c2740;
    --cs-green: var(--bs-primary, #3ADDA4);
    --cs-raspberry: var(--bs-magenta, #B33768);
    --cs-cream: var(--bs-grey, #F7F5F1);
    --cs-text: #212529;
    --cs-muted: #5a6573;
    --cs-white: #fff;
    --cs-radius: 8px;
    --cs-radius-lg: 20px;
    --cs-shadow-screen: 0 18px 40px -18px rgba(19, 55, 87, .35);
    --cs-gap: clamp(24px, 4vw, 48px);
    --cs-space: clamp(56px, 8vw, 112px);
}

/* ---------- Shared ---------- */

.cs-block { padding-block: var(--cs-space); color: var(--cs-text); }
/* Two white blocks in a row share one gap instead of doubling it.
   Block Grid wraps every block in .umb-block-grid__layout-item, so the rule
   looks through that wrapper. The plain sibling version covers Block Lists. */
.umb-block-grid__layout-item:has(> .cs-block:not(.cs-bg-cream):not(.cs-bg-navy):not(.cs-image--full))
+ .umb-block-grid__layout-item > .cs-block:not(.cs-bg-cream):not(.cs-bg-navy):not(.cs-image--full),
.cs-block:not(.cs-bg-cream):not(.cs-bg-navy):not(.cs-image--full)
+ .cs-block:not(.cs-bg-cream):not(.cs-bg-navy):not(.cs-image--full) { padding-top: 0; }

/* cs blocks are full-width sections: no extra margin or padding from the grid item */
.umb-block-grid__layout-item:has(> .cs-block) { margin: 0; padding: 0; }
/* Same width as the site's .container (1400px, 2rem side padding), so blocks line up with the header */
.cs-wrap { width: 100%; max-width: 1400px; padding-inline: 2rem; margin-inline: auto; box-sizing: border-box; }
@media (max-width: 575.98px) { .cs-wrap { padding-inline: 1.25rem; } }

.cs-bg-white { background: var(--cs-white); }
.cs-bg-cream { background: var(--cs-cream); }
.cs-bg-navy { background: var(--cs-navy); color: var(--cs-white); }
.cs-bg-navy .cs-h2, .cs-bg-navy h2, .cs-bg-navy h3 { color: var(--cs-white); }

.cs-h2 {
    color: var(--cs-navy);
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 32px;
}
.cs-lede {
    font-size: clamp(18px, 1.6vw, 22px);
    line-height: 1.5;
    font-weight: 500;
    color: var(--cs-navy);
    margin: 0 0 20px;
}
.cs-bg-navy .cs-lede { color: var(--cs-white); }
.cs-rte p { margin: 0 0 16px; line-height: 1.6; }
.cs-rte p:last-child { margin-bottom: 0; }
.cs-rte a { color: var(--cs-raspberry); text-decoration: underline; text-underline-offset: 3px; }
.cs-bg-navy .cs-rte a { color: var(--cs-green); }

.cs-caption {
    margin-top: 14px;
    font-size: 14px;
    color: var(--cs-muted);
    text-align: center;
}

.cs-pill {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 14.4px;
    font-weight: 600;
    line-height: 1.5;
}
.cs-pill--green { background: var(--cs-green); color: var(--cs-navy); }
.cs-pill--raspberry { background: var(--cs-raspberry); color: var(--cs-white); }
.cs-pill--outline { border: 1.5px solid var(--cs-navy); color: var(--cs-navy); }

.cs-arrow {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--cs-green);
    color: var(--cs-navy);
    font-size: 22px;
    border: 2px solid var(--cs-navy);
    box-shadow: 3px 3px 0 var(--cs-navy);
    transition: transform .2s ease, box-shadow .2s ease;
    flex: none;
}
.cs-arrow--navy { background: var(--cs-navy); color: var(--cs-white); box-shadow: none; }

/* Tone colours for stat tiles and quotes */
.cs-tone-green { background: var(--cs-green); color: var(--cs-navy); }
.cs-tone-cream { background: var(--cs-cream); color: var(--cs-navy); }
.cs-tone-navy { background: var(--cs-navy); color: var(--cs-white); }
.cs-tone-navy-deep { background: var(--cs-navy-deep); color: var(--cs-green); }
.cs-tone-raspberry { background: var(--cs-raspberry); color: var(--cs-white); }
.cs-tone-white { background: var(--cs-white); color: var(--cs-navy); }

/* ---------- csVideo ---------- */

.cs-video__figure { margin: 0; }
.cs-video__frame {
    border-radius: var(--cs-radius-lg);
    overflow: hidden;
    background: var(--cs-navy);
    aspect-ratio: 16 / 9;
}
.cs-video__frame video { width: 100%; height: 100%; display: block; object-fit: cover; }
.cs-transcript { margin-top: 20px; border-top: 1px solid rgba(19, 55, 87, .15); padding-top: 16px; }
.cs-transcript summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--cs-navy);
    list-style-position: inside;
}
.cs-transcript__body { margin-top: 12px; max-width: 760px; line-height: 1.6; }

/* ---------- csProjectOverview ---------- */

.cs-overview__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--cs-gap);
    align-items: start;
}
.cs-glance {
    margin-top: 32px;
    background: var(--cs-cream);
    border-radius: var(--cs-radius);
    padding: 28px 32px;
}
.cs-glance__heading { font-size: 18px; font-weight: 600; color: var(--cs-navy); margin: 0 0 16px; }
.cs-glance__list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
.cs-glance__row dt { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--cs-raspberry); font-weight: 600; }
.cs-glance__row dd { margin: 4px 0 0; color: var(--cs-navy); font-weight: 500; }

.cs-team {
    background: var(--cs-navy);
    color: var(--cs-white);
    border-radius: var(--cs-radius);
    padding: 28px;
    position: sticky;
    top: 120px;
}
.cs-team__heading { color: var(--cs-white); font-size: 18px; font-weight: 600; margin: 0 0 20px; }
.cs-team__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.cs-team__person { display: flex; align-items: center; gap: 14px; }
.cs-team__photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--cs-green); }
.cs-team__text { display: grid; }
.cs-team__name { color: var(--cs-white); font-weight: 600; text-decoration: none; }
a.cs-team__name:hover { color: var(--cs-green); }
.cs-team__role { font-size: 14px; opacity: .8; }

/* ---------- csImage ---------- */

.cs-image__figure { margin: 0 auto; }
.cs-image__media img { display: block; width: 100%; height: auto; }
.cs-image--framed .cs-image__media {
    background: var(--cs-cream);
    border-radius: var(--cs-radius-lg);
    padding: clamp(32px, 6vw, 72px);
}
.cs-image--framed .cs-image__media img {
    max-width: 520px;
    margin-inline: auto;
    border-radius: 12px;
    box-shadow: var(--cs-shadow-screen);
}
.cs-image--wide .cs-image__media img { border-radius: var(--cs-radius-lg); }
.cs-image--full { padding-block: 0; }
.cs-image--full .cs-image__media img { max-height: 640px; object-fit: cover; }
.cs-image--full .cs-caption { padding-inline: 20px; }

/* ---------- csSectionText ---------- */

.cs-section-text__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--cs-gap);
    align-items: start;
}
.cs-section-text__heading {
    color: var(--cs-navy);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
}
.cs-bg-navy .cs-section-text__heading { color: var(--cs-white); }

/* ---------- csNumberedCards ---------- */

.cs-numbered__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.cs-numbered__card {
    background: var(--cs-navy);
    color: var(--cs-white);
    border-radius: var(--cs-radius);
    padding: 28px 24px;
}
.cs-numbered__num { display: block; color: var(--cs-green); font-size: 40px; font-weight: 600; line-height: 1; margin-bottom: 16px; }
.cs-numbered__title { color: var(--cs-white); font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.cs-numbered__text { margin: 0; font-size: 15px; line-height: 1.55; opacity: .9; }

/* ---------- csScreenGrid ---------- */

.cs-screens__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
.cs-screens__item { margin: 0; }
.cs-screen { background: var(--cs-cream); border-radius: var(--cs-radius-lg); padding: clamp(20px, 3vw, 36px); }
.cs-screen img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: var(--cs-shadow-screen); }

/* ---------- csResultsBento ---------- */

.cs-results__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.cs-results__grid--no-quote { grid-template-columns: 1fr; }
.cs-results__quote {
    margin: 0;
    background: var(--cs-cream);
    border-radius: var(--cs-radius);
    padding: clamp(28px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 6px solid var(--cs-green);
}
.cs-results__quote blockquote { margin: 0; }
.cs-results__quote p { font-size: clamp(20px, 2vw, 26px); line-height: 1.4; font-weight: 500; color: var(--cs-navy); margin: 0; }
.cs-results__quote figcaption { margin-top: 24px; display: grid; }
.cs-results__name { font-weight: 600; color: var(--cs-navy); }
.cs-results__role { color: var(--cs-raspberry); font-size: 14px; font-weight: 600; }
.cs-results__stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cs-stat {
    border-radius: var(--cs-radius);
    padding: 28px 24px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    min-height: 180px;
}
.cs-stat__value { margin: 0 0 8px; font-size: clamp(40px, 4.5vw, 56px); font-weight: 600; line-height: 1; }
.cs-stat__label { font-size: 15px; line-height: 1.45; }
.cs-results__stats .cs-stat:first-child:nth-last-child(odd) { grid-column: 1 / -1; }

/* ---------- csFeedback ---------- */

.cs-feedback { position: relative; overflow: hidden; }
.cs-feedback::after {
    /* faint diagonal lines, echoing the header */
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 360px;
    height: 360px;
    background: repeating-linear-gradient(135deg, transparent 0 22px, rgba(58, 221, 164, .18) 22px 26px);
    pointer-events: none;
}
.cs-feedback .cs-wrap { position: relative; z-index: 1; }
.cs-feedback__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 16px;
}
.cs-fb { border-radius: var(--cs-radius); padding: 24px; margin: 0; }
.cs-fb--wide, .cs-fb--large { grid-column: span 2; }
.cs-fb--image { grid-row: span 2; padding: 0; overflow: hidden; }
.cs-fb--image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-fb blockquote { margin: 0; }
.cs-fb--quote p { margin: 0; font-size: 17px; line-height: 1.5; font-weight: 500; }
.cs-fb--large p { font-size: clamp(26px, 3vw, 38px); line-height: 1.2; font-weight: 600; }
.cs-fb figcaption { margin-top: 12px; font-size: 13px; opacity: .75; }
.cs-fb--stat { display: flex; flex-direction: column; justify-content: center; }
.cs-fb__value { margin: 0 0 6px; font-size: clamp(40px, 4vw, 52px); font-weight: 600; line-height: 1; }
.cs-fb__label { margin: 0; font-size: 15px; line-height: 1.4; }

.cs-modules { margin-top: 48px; }
.cs-modules__heading { color: var(--cs-white); font-size: 20px; font-weight: 600; margin: 0 0 16px; }
.cs-modules__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cs-module {
    border: 1.5px solid rgba(255, 255, 255, .25);
    border-radius: var(--cs-radius);
    padding: 20px 24px;
}
.cs-module__name { margin: 0 0 12px; font-weight: 600; color: var(--cs-white); }
.cs-module__stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.cs-module__stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.cs-module__stats dd { margin: 0; font-size: 34px; font-weight: 600; color: var(--cs-green); line-height: 1.1; }
.cs-module__stats dt { font-size: 13px; opacity: .85; }

/* ---------- csFaq ---------- */

.cs-faq__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--cs-gap); }
.cs-faq__heading { margin: 0; }
.cs-faq__item { border-bottom: 1px solid rgba(19, 55, 87, .15); }
.cs-faq__item:first-child { border-top: 1px solid rgba(19, 55, 87, .15); }
.cs-faq__item summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}
.cs-faq__item summary::-webkit-details-marker { display: none; }
.cs-faq__item summary::after {
    content: "+";
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--cs-green);
    color: var(--cs-navy);
    font-size: 20px;
    font-weight: 600;
}
.cs-faq__item[open] summary::after { content: "\2212"; }
.cs-faq__q { margin: 0; font-size: 18px; font-weight: 600; color: var(--cs-navy); }
.cs-faq__a { padding: 0 48px 20px 0; line-height: 1.6; }
.cs-faq__a p { margin: 0 0 12px; }

/* ---------- csRelated ---------- */

.cs-related__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cs-related__card {
    margin: 0;
    position: relative;
    border-radius: var(--cs-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease;
}
.cs-related__card--navy { background: var(--cs-navy); color: var(--cs-white); }
.cs-related__card--cream { background: var(--cs-cream); color: var(--cs-navy); }
.cs-related__card::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 180px;
    height: 180px;
    background: repeating-linear-gradient(135deg, transparent 0 18px, rgba(58, 221, 164, .22) 18px 21px);
    pointer-events: none;
}
.cs-related__media img { display: block; width: 100%; height: auto; aspect-ratio: 580 / 300; object-fit: cover; }
.cs-related__body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 12px; flex: 1; position: relative; }
.cs-related__body .cs-pill { align-self: flex-start; }
.cs-related__title { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.3; padding-right: 64px; }
.cs-related__link { color: inherit; text-decoration: none; }
.cs-related__link::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
.cs-related__card--navy .cs-related__title { color: var(--cs-white); }
.cs-related__body .cs-arrow { position: absolute; right: 28px; bottom: 28px; }
.cs-related__card:hover { transform: translateY(-4px); }
.cs-related__card:hover .cs-arrow { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--cs-navy); }
.cs-related__card:focus-within { outline: 3px solid var(--cs-green); outline-offset: 3px; }

/* ---------- Listing card (_CaseStudyCard, option D) ---------- */

.cs-card {
    margin: 0; /* the site styles every <article> with a bottom margin */
    position: relative;
    background: var(--cs-cream);
    border-radius: var(--cs-radius);
    box-shadow: 8px 8px 0 var(--cs-green);
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}
.cs-card__media { position: relative; border-radius: var(--cs-radius) var(--cs-radius) 0 0; }
.cs-card__media > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: var(--cs-radius) var(--cs-radius) 0 0;
    transition: transform .4s ease;
}
.cs-card__media { overflow: visible; }
.cs-card__logo {
    position: absolute;
    left: 20px;
    bottom: -22px;
    background: var(--cs-white);
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: 0 4px 14px rgba(19, 55, 87, .15);
    display: flex;
    align-items: center;
}
.cs-card__logo img { display: block; height: 24px; width: auto; max-width: 120px; object-fit: contain; }
.cs-card__body { padding: 40px 22px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cs-card__tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cs-card__tags .cs-pill { font-size: 13px; padding: 2px 12px; }
.cs-card__client { margin: 0; color: var(--cs-raspberry); font-weight: 600; font-size: 15px; }
.cs-card__title { margin: 0; padding: 0; color: var(--cs-navy); font-size: 21px; font-weight: 600; line-height: 1.3; }
.cs-card__link { color: inherit; text-decoration: none; }
.cs-card__link::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.cs-card__footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(19, 55, 87, .15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.cs-card__stat { margin: 0; color: var(--cs-navy); font-size: 14px; }
.cs-card__stat strong { font-size: 20px; margin-right: 4px; }
.cs-card .cs-arrow { width: 40px; height: 40px; font-size: 18px; }
.cs-card:hover { transform: translateY(-4px); box-shadow: 12px 12px 0 var(--cs-green); }
.cs-card:hover .cs-card__title { color: var(--cs-raspberry); text-decoration: underline; text-underline-offset: 4px; }
.cs-card:hover .cs-arrow { background: var(--cs-green); color: var(--cs-navy); box-shadow: 3px 3px 0 var(--cs-navy); }
.cs-card:focus-within { outline: 3px solid var(--cs-navy); outline-offset: 4px; }

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

@media (max-width: 991px) {
    .cs-overview__grid,
    .cs-section-text__grid,
    .cs-faq__grid,
    .cs-results__grid { grid-template-columns: 1fr; }
    .cs-team { position: static; }
    .cs-numbered__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cs-feedback__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cs-section-text__heading { margin-bottom: 8px; }
}

@media (max-width: 640px) {
    .cs-glance__list,
    .cs-numbered__list,
    .cs-screens__grid,
    .cs-related__grid,
    .cs-results__stats { grid-template-columns: 1fr; }
    .cs-feedback__grid { grid-template-columns: 1fr; }
    .cs-fb--wide, .cs-fb--large { grid-column: auto; }
    .cs-fb--image { grid-row: auto; aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
    .cs-card, .cs-related__card, .cs-arrow, .cs-card__media > img { transition: none; }
    .cs-card:hover, .cs-related__card:hover { transform: none; }
}
