/* Case study, landing-page variant.

   Structure from /litmus/ (bold Outfit headings, 1rem sentence-case eyebrows,
   check and cross lists, the split panel), colours turned round: burgundy
   leads, with cream, lilac and a navy close.

   Type rules stop at <section> so nothing shared (header, footer) inherits
   them. */

#case-study-landing {
  overflow-x: clip;

  /* One type scale for the whole page, matched to the site's other case
     studies (root 18px): page title 2.75rem as .main-title, section headings
     38px medium, body 18px at 1.8 line height. Every font-size below uses
     one of these; nothing is set ad hoc. */
  --fs-display: clamp(1.875rem, 4.6vw, 2.75rem);   /* page title; 1.875rem
                                                      keeps long titles to
                                                      about four lines on phones */
  --fs-stat: clamp(1.75rem, 3vw, 2.25rem);         /* hero figures */
  --fs-h2: clamp(1.625rem, 2.6vw, 2.111rem);       /* section headings */
  --fs-h3: 1.25rem;                                /* step and card headings */
  --fs-lead: 1.111rem;                             /* standfirst, outcome intro */
  --fs-body: 1rem;                                 /* body, lists, eyebrows, buttons */
  --fs-small: 0.875rem;                            /* meta, kickers, captions */

  & section h2 {
    font-size: var(--fs-h2);
    font-weight: var(--medium);
    color: var(--dark-blue);
    line-height: 1.25;
    margin: 0;
  }

  & section p {
    font-size: var(--fs-body);
    line-height: 1.8;
    margin: 0;
  }
}

#case-study-landing .section-eyebrow {
  font-size: var(--fs-body);
  font-weight: var(--normal);
  color: var(--burgundy);
}

/* Buttons */
#case-study-landing .buttony-link {
  margin-top: 0;
  padding: 0.5rem 1.5rem;
  font-weight: var(--medium);
}

#case-study-landing .cs-btn-primary {
  background-color: var(--coral);
  border-color: var(--coral);
  color: var(--dark-blue);
}

#case-study-landing .cs-btn-ghost {
  background-color: transparent;
  border-color: var(--cream);
  color: var(--cream);
}

.cs-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.75rem;
  align-items: center;

  @media not (min-width: 900px) {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.cs-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  min-width: 0;
}

/* Check / cross list, as .dot-list on /litmus/. */
#case-study-landing .dot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  & li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: var(--fs-body);
    line-height: 1.5;
    max-width: none;
    margin: 0;
  }

  /* One line tall, so the icon centres on the first line of text rather than
     relying on a margin nudge. Covers the webfont <i> and the <svg> that
     Font Awesome's JS swaps in (the review copy and its PDF). */
  & :is(i, svg) {
    flex-shrink: 0;
    width: 1em;
    height: 1.5em;
    line-height: inherit;
    margin-top: 0;
  }

  & a {
    color: inherit;
    text-underline-offset: 0.15em;
  }
}


/* === HERO === */

#cs-intro {
  padding: 0;
  color: var(--cream);

  & h1 {
    color: var(--cream);
    font-size: var(--fs-display);
    /* Medium, not semi-bold: at display size 600 reads as heavy. */
    font-weight: var(--medium);
    line-height: 1.1;
    margin: 0;
  }

  & .section-eyebrow { color: var(--coral); }

  & .cs-standfirst {
    font-size: var(--fs-lead);
    color: var(--cream);
    max-width: 50ch;
  }
}

.cs-intro-inner {
  display: flex;
  gap: 3.75rem;
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 3rem;

  @media not (min-width: 1000px) {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1.5rem;
    padding-top: 2.5rem;
    padding-bottom: 2rem;
  }
}

.cs-intro-text {
  flex: 0 1 640px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  /* Stacked on narrow screens the flex basis would become a 640px height. */
  @media not (min-width: 1000px) {
    flex: none;
  }
}

.cs-intro-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

/* Stack logos: official marks forced to a single cream-white so the
   mixed-colour files read as one set on burgundy. */
.cs-stack {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  padding-bottom: 2.5rem;

  @media not (min-width: 1000px) {
    flex-direction: column;
    align-items: flex-start;
  }
}

#case-study-landing .cs-stack-label {
  font-size: var(--fs-small);
  color: var(--coral);
  margin: 0;
}

.cs-stack-logos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2.5rem;

  & img {
    display: block;
    height: var(--h);
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
  }

  @media not (min-width: 700px) {
    gap: 0.875rem 1.5rem;

    & img { height: calc(var(--h) * 0.8); }
  }
}
.cs-intro-logo {
  flex: 1;
  display: flex;
  justify-content: center;
  color: var(--cream);

  & svg {
    width: 240px;
    max-width: 100%;
    height: auto;
    fill: currentColor;
  }

  @media not (min-width: 1000px) {
    justify-content: flex-start;

    & svg { width: 110px; }
  }
}

.cs-intro-foot {
  padding: 2rem 0 5rem;
  border-top: 1px solid rgb(241 234 222 / 20%);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cs-figures {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin: 0;
  padding: 0;

  @media not (min-width: 760px) {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  & li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: none;
    margin: 0;
  }
}

.cs-figure-value {
  font-size: var(--fs-stat);
  font-weight: var(--semi-bold);
  line-height: 1.05;
  color: var(--coral);
}

.cs-figure-label {
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--cream);
  max-width: 28ch;
}

}


/* === OVERVIEW === */

#cs-overview {
  padding: 5rem 0 0;
  color: var(--dark-blue);
}

/* Same column split as the timeline below (1fr / 2fr, text inset 3.75rem),
   so the right-hand text starts on one line all the way down the page. */
.cs-overview-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: start;

  & .cs-prose { padding-left: 3.75rem; }

  @media not (min-width: 950px) {
    grid-template-columns: 1fr;
    gap: 1.5rem;

    & .cs-prose { padding-left: 0; }
  }

  & h2 { margin-top: 1rem !important; }
}

/* Pages with `landingClass: "cs-stacked"` (the Crick): heading above the
   text at every width, as on phones, instead of a left-hand column. The text
   keeps about the same line length as in the right-hand column. */
#case-study-landing.cs-stacked .cs-overview-inner {
  grid-template-columns: 1fr;
  gap: 1.5rem;

  & .cs-prose {
    padding-left: 0;
    max-width: 48rem;
  }
}

.cs-prose {
  display: flex;
  flex-direction: column;
  gap: 1rem;

  & a {
    color: var(--burgundy);
    text-underline-offset: 0.15em;
  }
}


/* === BEFORE / AFTER === */

.cs-why { padding: 5rem 0; }

/* Back-to-back prose sections share one cream band. */
.cs-why + .cs-why { padding-top: 0; }

/* The outcome sits after the timeline in its own section, set like the
   overview: heading left, intro and check list right. */
#cs-outcome {
  padding: 5rem 0;
  color: var(--dark-blue);

  & i { color: var(--burgundy); }
}

/* Same lead size and weight as the hero standfirst. */
#case-study-landing .cs-outcome-intro {
  font-size: var(--fs-lead);
}


/* === SOLUTION === */

/* One full-width burgundy band, like the other sections, so the page keeps
   the same content edges from top to bottom. */
#cs-solution {
  padding: 0;
  background: var(--burgundy);
  color: var(--cream);
}

#case-study-landing #cs-solution h2 { color: var(--cream); }
#case-study-landing #cs-solution .section-eyebrow { color: var(--coral); }

.cs-solution-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);

  @media not (min-width: 950px) {
    grid-template-columns: 1fr;
  }
}

.cs-solution-nav {
  position: relative;
  padding: 4rem 3rem 4rem 0;

  @media not (min-width: 950px) {
    padding: 3.5rem 0 2rem;
  }
}

.cs-solution-sticky {
  position: sticky;
  top: 7rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cs-years {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  border-left: 1px solid rgb(241 234 222 / 25%);

  & li { max-width: none; margin: 0; }

  & a {
    display: block;
    padding: 0.4rem 0 0.4rem 1rem;
    margin-left: -2px;
    border-left: 3px solid transparent;
    color: rgb(241 234 222 / 65%);
    font-weight: var(--medium);
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
  }

  & a:hover { color: var(--cream); }

  & .is-active a {
    border-left-color: var(--coral);
    color: var(--cream);
  }

  @media not (min-width: 950px) {
    display: none;
  }
}

.cs-steps {
  list-style: none;
  margin: 0;
  padding: 4rem 0 4rem 3.75rem;
  color: var(--cream);
  display: flex;
  flex-direction: column;
  gap: 4.5rem;

  @media not (min-width: 950px) {
    padding: 0 0 3.5rem;
  }
}

.cs-step {
  max-width: none;
  margin: 0;
  scroll-margin-top: 7rem;

  & h3 {
    font-size: var(--fs-h3);
    font-weight: var(--semi-bold);
    line-height: 1.25;
    color: var(--cream);
    margin: 0.25rem 0 0.5rem;
  }

  & p { color: var(--cream); max-width: 56ch; }
}

/* Needs the page id to beat the "#case-study-landing section p" reset. */
#case-study-landing .cs-step p + p { margin-top: 1rem; }

#case-study-landing .cs-step-kicker {
  font-size: var(--fs-small);
  font-weight: var(--medium);
  color: var(--coral);
}

.cs-step-figure {
  --cs-figure-ratio: 16 / 10;
  margin: 1.5rem 0 0;

  & img,
  & .cs-figure-art {
    display: block;
    width: 100%;
    aspect-ratio: var(--cs-figure-ratio);
  }

  & img { object-fit: cover; }

  & figcaption {
    margin-top: 0.5rem;
    font-size: var(--fs-small);
    color: var(--light-brown);
  }
}

/* The seven inline diagrams. Same tokens as the scrollytelling layout; they
   were drawn for a dark ground and read the same on burgundy. */
.cs-figure-art {
  border: 1px solid rgb(241 234 222 / 16%);
  background: rgb(0 0 0 / 12%);

  & svg {
    display: block;
    width: 100%;
    height: 100%;
    --art-line: rgb(214 196 182 / 45%);
    --art-line-soft: rgb(214 196 182 / 20%);
    --art-fill: rgb(241 234 222 / 4%);
    --art-ink: var(--cream);
    --art-ink-soft: var(--light-brown);
    --art-accent: var(--coral);
    --art-flag: var(--yellow);
    font-family: inherit;
    font-variant-numeric: tabular-nums;
  }

  & .art-box { fill: var(--art-fill); stroke: var(--art-line); }
  & .art-box-accent { fill: rgb(234 104 126 / 14%); stroke: var(--art-accent); }
  & .art-box-muted { fill: none; stroke: var(--art-line-soft); }
  & .art-rule { stroke: var(--art-line); fill: none; }
  & .art-rule-soft { stroke: var(--art-line-soft); fill: none; }
  & .art-rule-accent { stroke: var(--art-accent); fill: none; }
  & text { fill: var(--art-ink); font-weight: 400; }
  & .art-label { font-size: 19px; }
  & .art-note { font-size: 15px; fill: var(--art-ink-soft); }
  & .art-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    fill: var(--art-ink-soft);
  }
  & .art-accent { fill: var(--art-accent); }
  & .art-flag { fill: var(--art-flag); }
  & .art-dim { opacity: 0.4; }
}


/* === WHAT WE DELIVERED === */

#cs-delivered {
  padding: 4rem 0;
  color: var(--dark-blue);
}

#case-study-landing .cs-delivered-intro { margin-top: 0.75rem; max-width: 60ch; }

#case-study-landing .cs-delivered-note {
  margin-top: 2rem;
  max-width: 70ch;
  font-weight: var(--medium);
}

/* Categories in three columns (two rows of three), no boxes: icon and name
   above a compact list, a hairline above each row. Keeps the section short
   and lets the cream band stay open. */
.cs-deliv-grid {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 2.5rem;

  @media not (min-width: 950px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  @media not (min-width: 600px) {
    grid-template-columns: 1fr;
  }
}

.cs-deliv-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid rgb(73 15 58 / 25%);
  max-width: none;
  margin: 0;

  & i { color: var(--burgundy); }
}

/* A compact spec list: small text, tight rows. With the page id to beat the
   default check list. */
#case-study-landing .cs-deliv-card > ul {
  gap: 0.375rem;

  & li {
    font-size: var(--fs-small);
    line-height: 1.45;
  }
}

.cs-deliv-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  & h3 {
    font-size: var(--fs-lead);
    font-weight: var(--semi-bold);
    color: var(--burgundy);
    margin: 0;
  }

  & svg {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    color: var(--burgundy);
  }
}


/* === TESTIMONIAL === */

/* The shared slider keeps its own styling, as on /litmus/. With a single
   testimonial its arrows and dots have nothing to do. */
#case-study-landing .testimonial-slider-buttons:not(:has(.testimonial-slider-button + .testimonial-slider-button)) {
  display: none;
}

/* Put the heading and quote on the page's content width rather than the
   slider's narrower centred column. */
#case-study-landing :is(.testimonial-slider-background > h2, .testimonial-slider-testimonial) {
  width: var(--central-width);
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
}

#case-study-landing .testimonial-slider-testimonial p { max-width: 70ch; margin-left: 0; margin-right: 0; }

/* Bring the slider's own heading sizes onto the page's type scale. */
#case-study-landing .testimonial-slider-background > h2 {
  font-size: var(--fs-h2);
  font-weight: var(--medium);
}

#case-study-landing .testimonial-slider-testimonial h3 {
  font-size: var(--fs-h3);
  font-weight: var(--semi-bold);
}


/* === WORK WITH US === */

#cs-cta {
  padding: 5rem 0;
  color: var(--cream);

}

#case-study-landing #cs-cta h2 { color: var(--cream); max-width: 22ch; }
#case-study-landing #cs-cta .cs-col p { color: var(--cream); max-width: 52ch; }
#case-study-landing #cs-cta .cs-col p a { color: var(--cream); text-underline-offset: 0.15em; }
.cs-highlight { color: var(--coral); }

/* Pages with `landingClass: "cs-accent-blue"` (the Crick): the closing call
   to action's highlight and button in light blue on the navy band, and the
   testimonial heading in coral. Other pages keep the defaults. */
#case-study-landing.cs-accent-blue #cs-cta .cs-highlight { color: var(--light-blue); }

#case-study-landing.cs-accent-blue .testimonial-slider-background > h2 { color: var(--coral); }

#case-study-landing.cs-accent-blue #cs-cta .cs-btn-primary {
  background-color: var(--light-blue);
  border-color: var(--light-blue);
  color: var(--dark-blue);
}

.cs-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem 3.75rem;

  & .cs-col { flex: 0 1 auto; }
  & .buttony-link { flex-shrink: 0; }

  @media not (min-width: 800px) {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* === STEP ILLUSTRATIONS ===

   The site's own spot illustrations, one per step, on a cream panel so the
   burgundy pieces in some of them don't vanish into the background. */

/* Illustrations are small accents beside the step text rather than panels
   under it, so the text leads. The figure sits in a narrow right-hand
   column spanning the step's rows. */
.cs-step:has(> .cs-step-illo) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem;
  column-gap: 2.5rem;
  align-items: start;

  & > * { grid-column: 1; }

  @media not (min-width: 560px) {
    grid-template-columns: minmax(0, 1fr) 4.5rem;
    column-gap: 1.25rem;
  }
}

.cs-step-illo {
  grid-column: 2 !important;
  grid-row: 1 / span 8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.25rem 0 0;
  padding: 0.75rem;
  aspect-ratio: 1;
  background: var(--cream);
  border-radius: 6px;

  & img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }
}



/* === DIAGRAMS, SIMPLE SET (partials/case-study/figures-brand/) ===

   Drawn straight onto the burgundy, no card: a few large shapes and two to
   four short labels each. They are there to break up the text and show the
   idea of each year, not to document the architecture; the step copy carries
   the detail. Canvas is 640 x 260, rendering at about 1:1, so the two label
   sizes land on the page scale: 22 = --fs-lead, 15.5 = --fs-small. */

.cs-figure-art.is-brand {
  aspect-ratio: 640 / 260;
  border: 0;
  background: none;
  box-shadow: none;

  & svg { font-family: inherit; overflow: visible; }

  & .sd-label { font-size: 22px; font-weight: 600; fill: var(--cream); }
  & .sd-label-dark { font-size: 22px; font-weight: 600; fill: var(--dark-blue); }
  & .sd-small { font-size: 15.5px; font-weight: 500; fill: var(--cream); }
  & .sd-dim { fill: rgb(241 234 222 / 55%); }
  & .sd-coral { fill: var(--coral); }
  & .sd-pill {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    fill: var(--dark-blue);
  }

  & .sd-block { fill: var(--cream); }
  & .sd-block-navy { fill: var(--dark-blue); }
  & .sd-block-lilac { fill: var(--lilac); }
  & .sd-ghost { fill: none; stroke: rgb(241 234 222 / 45%); stroke-width: 2; stroke-dasharray: 7 7; }
  & .sd-fill-coral { fill: var(--coral); }
  & .sd-fill-burgundy { fill: var(--burgundy); }
  & .sd-fill-soft { fill: var(--light-brown); }
  & .sd-fill-bg { fill: var(--burgundy); }

  & .sd-line { fill: none; stroke: rgb(241 234 222 / 70%); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
  & .sd-line-dim { fill: none; stroke: rgb(241 234 222 / 35%); stroke-width: 2; stroke-linecap: round; }
  & .sd-line-coral { fill: none; stroke: var(--coral); stroke-width: 3; stroke-dasharray: 8 7; stroke-linecap: round; }
  & .sd-line-coral-solid { fill: none; stroke: var(--coral); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
  & .sd-ah { fill: rgb(241 234 222 / 85%); }
  & .sd-ah-coral { fill: var(--coral); }

  /* badge.html */
  & .fg-badge-lilac { fill: var(--lilac); }
  & .fg-badge-navy { fill: var(--dark-blue); }
  & .fg-badge-burgundy { fill: var(--burgundy); }
  & .fg-badge-coral { fill: var(--coral); }
  & .fg-badge-cream { fill: var(--cream); }
  & .fg-icon { fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  & .fg-ink-dark { stroke: var(--dark-blue); }
  & .fg-ink-light { stroke: var(--cream); }
}

/* On a phone the 640-unit canvas would shrink its labels to 8-9px. Hold the
   diagram at a readable size and let it scroll sideways inside its own frame;
   the page itself never scrolls horizontally. */
@media not (min-width: 600px) {
  .cs-step-figure:has(.is-brand) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cs-figure-art.is-brand { min-width: 460px; }
}


/* === MORE POSIT WORK (its own cream section after the call to action) === */

#cs-related {
  padding: 4rem 0;
  color: var(--dark-blue);
}

#case-study-landing #cs-related h2 { color: var(--dark-blue); }

.cs-related-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 2rem 0 0;
  padding: 0;

  & li { max-width: none; margin: 0; }

  @media not (min-width: 900px) {
    grid-template-columns: 1fr;
  }
}

.cs-related-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Off-white on the cream band, as with the overview's palette. The logo
     strip stays white because the logo files carry white backgrounds. */
  background: var(--off-white);
  color: var(--dark-blue);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;

  &:hover,
  &:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -16px rgb(0 0 0 / 60%);
  }

  &:hover .cs-related-more span { transform: translateX(3px); }
}

.cs-related-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: #fff;
  border-bottom: 1px solid var(--light-brown);

  /* One card per row on phones: a shorter logo strip keeps the stack short. */
  @media not (min-width: 900px) {
    aspect-ratio: 3 / 1;
  }

  & img {
    display: block;
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
  }

  & picture { display: contents; }
}

.cs-related-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  padding: 1.25rem 1.5rem 1.5rem;

  & h3 {
    font-size: var(--fs-lead);
    font-weight: var(--semi-bold);
    line-height: 1.25;
    color: var(--dark-blue);
    margin: 0;
  }
}

#case-study-landing .cs-related-kind {
  font-size: var(--fs-small);
  font-weight: var(--medium);
  color: var(--burgundy);
}

#case-study-landing .cs-related-teaser {
  font-size: var(--fs-small);
  line-height: 1.55;
  color: rgb(12 41 61 / 80%);
}

.cs-related-more {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: var(--fs-small);
  font-weight: var(--semi-bold);
  color: var(--burgundy);

  & span { display: inline-block; transition: transform 0.2s ease; }
}


/* === GLOSSARY TOOLTIPS (added by case-study-landing.mjs) === */

/* Defined terms get a faint dotted hint, quieter than the solid link underline,
   so they stay findable (incl. on touch) without competing with the links. */
.cs-term {
  position: relative;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  cursor: help;
  outline: none;
}

.cs-term:hover {
  text-decoration-color: var(--coral);
}

/* Links get a normal solid underline (the site default is dotted, which made
   them look like the defined terms). */
#case-study-landing :is(p, li) a:not(.buttony-link, .cs-related-card, .cs-years a) {
  text-decoration-line: underline;
  text-decoration-style: solid;
}

.cs-term:focus-visible {
  border-radius: 2px;
  box-shadow: 0 0 0 2px var(--coral);
}

.cs-tip {
  --shift: 0px;
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: min(280px, 80vw);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: var(--dark-blue);
  border: 1px solid rgb(193 217 234 / 45%);
  box-shadow: 0 10px 24px -12px rgb(0 0 0 / 60%);
  color: var(--cream);
  font-size: var(--fs-small);
  font-weight: var(--normal);
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(calc(-50% + var(--shift)), 4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.cs-term:hover .cs-tip,
.cs-term:focus .cs-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(calc(-50% + var(--shift)), 0);
}

/* Bold lead-ins keep their weight; the tooltip text does not inherit it. */
strong .cs-tip { font-weight: var(--normal); }


/* === CLIENT LOGO ON A TILE === */

/* For marks that only come on white: a cream-edged white tile, so the logo
   isn't cut out against burgundy. */
.cs-intro-logo.is-image img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;

  @media not (min-width: 1000px) { width: 150px; }
}


.cs-intro-logo.is-file img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;

  @media not (min-width: 1000px) { width: 120px; }
}


/* === PATHWAY === */

/* The course list as a flow: one row per track, stages left to right with an
   arrow between them. Below 900px each track stacks and the arrows point
   down. */
#cs-pathway {
  padding: 5rem 0;
  background: var(--burgundy);
  color: var(--cream);
}

#case-study-landing #cs-pathway h2 { color: var(--cream); }
#case-study-landing #cs-pathway .section-eyebrow { color: var(--coral); }
#case-study-landing .cs-pathway-prose a { color: var(--cream); }

.cs-pathway-notes { margin-top: 3rem; }

.cs-tracks {
  margin: 3.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

#case-study-landing .cs-tracks-caption {
  font-size: var(--fs-body);
  color: var(--coral);
}

.cs-track {
  padding-top: 1.5rem;
  border-top: 1px solid rgb(241 234 222 / 20%);
}

#case-study-landing .cs-track-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  /* Same size as the related card titles. */
  font-size: var(--fs-lead);
  font-weight: var(--semi-bold);
  color: var(--cream);

  & svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--coral);
    flex-shrink: 0;
  }
}

.cs-track-flow {
  --arrow: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--arrow);

  @media not (min-width: 900px) {
    grid-template-columns: 1fr;
    --arrow: 2rem;
  }
}

.cs-stage {
  position: relative;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  /* The connector to the next stage. */
  &:not(:last-child)::after {
    content: "";
    position: absolute;
    /* Halfway down the course boxes, below the stage label (1.6rem line
       plus the 0.75rem gap). */
    top: calc(2.35rem + (100% - 2.35rem) / 2);
    right: calc(var(--arrow) * -1);
    width: var(--arrow);
    height: 0.75rem;
    transform: translateY(-50%);
    background:
      linear-gradient(var(--coral), var(--coral)) left center / calc(100% - 0.5rem) 2px no-repeat,
      conic-gradient(from 225deg at 100% 50%, var(--coral) 90deg, transparent 0) right center / 0.5rem 100% no-repeat;
  }

  @media not (min-width: 900px) {
    &:not(:last-child)::after {
      top: auto;
      bottom: calc(var(--arrow) * -1);
      right: auto;
      left: 1.25rem;
      width: 0.75rem;
      height: var(--arrow);
      transform: none;
      background:
        linear-gradient(var(--coral), var(--coral)) center top / 2px calc(100% - 0.5rem) no-repeat,
        conic-gradient(from 315deg at 50% 100%, var(--coral) 90deg, transparent 0) center bottom / 100% 0.5rem no-repeat;
    }
  }
}

#case-study-landing .cs-stage-label {
  font-size: var(--fs-small);
  line-height: 1.6rem;
  color: var(--yellow);
}

.cs-stage-courses {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;

  /* Stages with fewer courses centre them, so each arrow runs from the
     middle of one stage to the middle of the next. */
  @media (min-width: 900px) {
    flex: 1;
    justify-content: center;
  }
}

.cs-course {
  position: relative;
  max-width: none;
  margin: 0;
}

.cs-course-node {
  display: block;
  width: 100%;
  min-height: 2.8rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgb(241 234 222 / 35%);
  border-radius: 6px;
  background: rgb(241 234 222 / 6%);
  color: var(--cream);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: var(--medium);
  line-height: 1.4;
  text-align: left;
}

button.cs-course-node {
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cs-course:is(:hover, :focus-within, .is-open) button.cs-course-node {
  border-color: var(--coral);
  background: rgb(234 104 126 / 14%);
}

button.cs-course-node:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* The course card. Opens below its node; padding-top bridges the gap so the
   pointer can travel into it without it closing. */
.cs-course-card {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  width: min(320px, 85vw);
  padding: 0.6rem 0 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;

  /* The visible card is a pseudo-layer under the content, so the bridge
     stays transparent. */
  &::before {
    content: "";
    position: absolute;
    inset: 0.6rem 0 0;
    z-index: -1;
    border-radius: 6px;
    background: var(--dark-blue);
    border: 1px solid rgb(193 217 234 / 45%);
    box-shadow: 0 10px 24px -12px rgb(0 0 0 / 60%);
  }

  & > * { padding-inline: 0.9rem; }
  & > :first-child { padding-top: 0.75rem; }
  & > :last-child { padding-bottom: 0.8rem; }

  & p {
    font-size: var(--fs-small) !important;
    line-height: 1.5 !important;
    color: var(--cream);
    margin-top: 0.4rem !important;
  }

  & a {
    display: block;
    margin-top: 0.5rem;
    font-size: var(--fs-small);
    font-weight: var(--medium);
    color: var(--yellow);
    text-decoration: underline solid;
    text-underline-offset: 0.15em;
  }
}

/* Cards in the last stage open leftwards so they stay on screen. */
@media (min-width: 900px) {
  .cs-stage:last-child .cs-course-card { left: auto; right: 0; }
}

#case-study-landing .cs-course-title {
  margin-top: 0 !important;
  font-weight: var(--semi-bold);
  color: var(--cream);
}

#case-study-landing .cs-course-meta { color: var(--coral); }

.cs-course:is(:hover, :focus-within, .is-open) .cs-course-card {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Closed with Escape: stays shut while the course keeps focus. */
.cs-course.is-dismissed .cs-course-card {
  opacity: 0;
  visibility: hidden;
}

/* Raise the open course above its neighbours' nodes. */
.cs-course:is(:hover, :focus-within, .is-open) { z-index: 21; }

@media (prefers-reduced-motion: reduce) {
  .cs-course-card { transition: none; }
}


/* === IMPACT === */

#cs-impact {
  padding: 5rem 0;
  color: var(--dark-blue);
}

#cs-before-after {
  padding: 4rem 0 5rem;
  color: var(--dark-blue);
}

/* Before and after as paired rows, cross then check, hairline between. */
.cs-ba {

  & .cs-ba-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    padding: 1rem 0;
    border-top: 1px solid rgb(12 41 61 / 18%);

    @media not (min-width: 700px) {
      grid-template-columns: 1fr;
      gap: 0.5rem;
    }
  }

  & .cs-ba-row p {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
  }

  /* One line tall at the paragraph's line height, so the icon centres on the
     first line of text. Covers the webfont <i> and Font Awesome's <svg>. */
  & :is(i, svg) {
    flex-shrink: 0;
    width: 1em;
    height: 1.8em;
    line-height: 1.8em;
    display: flex;
    align-items: center;
  }

  & .fa-circle-xmark { color: rgb(12 41 61 / 45%); }
  & .fa-circle-check { color: var(--burgundy); }

  & .cs-ba-head {
    border-top: 0;
    padding-top: 0;

    & p { font-weight: var(--semi-bold); color: var(--burgundy); }

    @media not (min-width: 700px) { display: none; }
  }
}
