/* Case study page text sections (Kristian, 15 Oct 2026). On every case study page; the build script copies it from the bin store page head.
   Layout copied from Aimpoint Digital's case study pages: the section title sits in
   a sticky left column and the story runs in a wide right column, so the page
   no longer has an empty right half. Our twist: each title carries a numbered
   tape mark, like a measured drawing. Visual only: no words change. Load after
   site-taste.css. */

html body main .cs2-body .cs2-main,
html body main .cs2-sol .cs2-main,
html body main .cs2-results .cs2-main { max-width: none; counter-reset: none; }

body { counter-reset: cs2-sec; }

/* Two columns: sticky title left, story right. */
html body main .cs2-sec,
html body main .cs2-results .cs2-main {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  column-gap: clamp(32px, 6vw, 112px);
  align-items: start;
}
html body main .cs2-sec > *,
html body main .cs2-results .cs2-main > * { grid-column: 2; }
html body main .cs2-sec + .cs2-sec { margin-top: clamp(72px, 8vw, 112px); }

html body main :is(.cs2-sec, .cs2-results .cs2-main) > .cs2-h2:not(#st) {
  grid-column: 1;
  grid-row: 1 / span 20;
  position: sticky;
  top: 112px;
  margin: 0 !important;
  font: 500 clamp(34px, 3.6vw, 52px)/1.05 'Fraunces', Georgia, serif !important;
  letter-spacing: -0.015em;
  counter-increment: cs2-sec;
}
html body main :is(.cs2-sec, .cs2-results .cs2-main) > .cs2-h2::before {
  content: '0' counter(cs2-sec);
  display: block;
  width: 100%;
  max-width: 220px;
  margin-bottom: 18px;
  padding-top: 20px;
  font: 500 14px/1 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
  color: var(--blue);
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 10px) top left / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 50px) top left / 100% 12px no-repeat, linear-gradient(var(--ink), var(--ink)) top left / 100% 1px no-repeat;
}

/* Story text: bigger and easier to read. */
html body main .cs2-main p { font-size: 19px; line-height: 1.6; }
html body main .cs2-sec > p:first-of-type { font-size: clamp(21px, 1.8vw, 24px); line-height: 1.45; }

/* Headline figure: a dark panel with a large light blue number. */
html body main .cs2-stat {
  display: grid;
  gap: 10px;
  margin: 36px 0 !important;
  padding: clamp(28px, 3vw, 40px);
  border-radius: 20px;
  background: var(--ink);
}
html body main .cs2-stat b { font: 500 clamp(52px, 6vw, 88px)/1 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: -0.03em; color: #AFC4DD; }
html body main .cs2-stat span { max-width: 34em; font-size: 19px; color: var(--paper); }

/* Quotes: a Charcoal card of their own (Consulting Blue is never a large fill, design.md §3), so the words stand apart from the copy around them (Kristian, 15 Oct 2026). */
html body main .cs2-quote { margin: clamp(40px, 4vw, 56px) 0 0 !important; padding: clamp(28px, 3.4vw, 44px) clamp(24px, 3.4vw, 48px) !important; border: 0 !important; border-radius: 20px; background: var(--ink); }
html body main .cs2-quote blockquote { margin: 0 !important; }
html body main .cs2-quote blockquote p { margin: 0 !important; font: 400 clamp(24px, 2.4vw, 32px)/1.3 'Fraunces', Georgia, serif !important; color: #FAFAF8 !important; }
html body main .cs2-quote figcaption { margin-top: 20px !important; font-size: 15px !important; color: #AFC4DD !important; }

/* What we built: a two by two grid of cards, the bold label as the card title. */
html body main .cs2-h3:not(#st) { margin: 40px 0 16px !important; font: 500 24px/1.2 'Fraunces', Georgia, serif !important; }
html body main .cs2-built { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
html body main .cs2-built li { padding: 24px; border-radius: 16px; background: rgba(229, 229, 226, 0.55) !important; font-size: 17px; }
html body main .cs2-built b { display: block; margin-bottom: 8px; font: 500 21px/1.25 'Fraunces', Georgia, serif; }

/* Results: numbered rows with the number large in light blue mono. */
html body main .cs2-res li { grid-template-columns: 88px minmax(0, 1fr); padding: 28px 0; }
html body main .cs2-res__n { font: 500 40px/1 'IBM Plex Mono', ui-monospace, monospace !important; color: var(--blue) !important; }
html body main .cs2-res h3:not(#st) { font-size: clamp(24px, 2.2vw, 30px) !important; }
html body main .cs2-res li:first-child { border-top: 0; padding-top: 0; }

@media (max-width: 900px) {
  html body main .cs2-sec,
  html body main .cs2-results .cs2-main { grid-template-columns: minmax(0, 1fr); }
  html body main .cs2-sec > *,
  html body main .cs2-results .cs2-main > * { grid-column: 1; }
  html body main :is(.cs2-sec, .cs2-results .cs2-main) > .cs2-h2:not(#st) { grid-row: auto; position: static; margin-bottom: 20px !important; }
  html body main .cs2-built { grid-template-columns: minmax(0, 1fr); }
  html body main .cs2-sec > p:first-of-type { font-size: 20px; }
  html body main .cs2-res li { grid-template-columns: 56px minmax(0, 1fr); }
  html body main .cs2-res__n { font-size: 28px !important; }
}

/* ---- Second pass (Kristian, 15 Oct 2026): every case study page ---- */

/* Hero: the case study's own photo on the right, text left, key results across. */
body[data-cs-page] .cs2-hero .v3-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  column-gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
body[data-cs-page] .cs2-hero .v3-wrap > * { grid-column: 1; }
body[data-cs-page] .cs2-hero .cs2-hero__img {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 360px;
  max-height: 520px;
  object-fit: cover;
  border-radius: 20px;
}
body[data-cs-page] .cs2-hero .cs2-keys { grid-column: 1 / -1; }
body[data-cs-page] .cs2-hero h1:not(#st) { max-width: 13em; }
@media (max-width: 900px) {
  body[data-cs-page] .cs2-hero .v3-wrap { grid-template-columns: minmax(0, 1fr); }
  body[data-cs-page] .cs2-hero .cs2-hero__img { grid-column: 1; grid-row: auto; order: 5; height: auto; min-height: 0; aspect-ratio: 4 / 3; margin-top: 32px; }
  body[data-cs-page] .cs2-hero .cs2-keys { order: 6; }
}

/* Facts strip: the numbers set large, labels readable. */
body[data-cs-page] .cs2-side { padding: clamp(24px, 2.6vw, 36px); border-radius: 20px; row-gap: 24px; }
body[data-cs-page] .cs2-side dt { font-size: 14px; }
body[data-cs-page] .cs2-side dd { margin-top: 8px; font: 500 clamp(18px, 1.5vw, 22px)/1.25 'Fraunces', Georgia, serif; }
@media (max-width: 900px) {
  body[data-cs-page] .cs2-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-cs-page] .cs2-side div { padding: 0; border-left: 0; }
}

/* More case studies: a See all link beside the arrows. */
.cs2-more__top { justify-content: flex-start !important; }
.cs2-more__top .cs2-h2 { margin-right: auto !important; }
.cs2-more__all { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); font: 600 17px 'Source Sans 3', system-ui, sans-serif; text-decoration: underline; text-decoration-color: #AFC4DD; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.cs2-more__all::after { content: '\2192'; transition: translate 200ms ease; }
@media (hover: hover) and (pointer: fine) { .cs2-more__all:hover::after { translate: 4px 0; } }

/* Close, Datasparq layout as on /case-studies: headline left, next steps right. */
html body main > section.cx-close:not(#st) { padding: clamp(64px, 9vw, 128px) 0 !important; }
.cx-close__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 112px); align-items: start; }
html body main .cx-close__h:not(#st) { margin: 0 !important; max-width: 14ch; font: 500 clamp(40px, 5.2vw, 72px)/1.04 'Fraunces', Georgia, serif !important; letter-spacing: -0.01em; color: var(--ink); }
.cx-close__p { margin: 24px 0 0 !important; max-width: 46ch; font-size: 19px; line-height: 1.5; color: var(--steel); }
.cx-close .cx-end__ask { margin-top: 32px; }
.cx-close__list { margin: 0 !important; padding: 0; list-style: none; border-top: 1px solid #E5E5E2; }
.cx-close__list li { border-bottom: 1px solid #E5E5E2; }
.cx-close__list a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 0 12px; border-radius: 10px; color: var(--ink); font: 500 clamp(21px, 1.9vw, 26px)/1.2 'Fraunces', Georgia, serif; text-decoration: none; transition: background-color 200ms ease, padding 260ms cubic-bezier(0.23, 1, 0.32, 1); }
.cx-close__list a::after { content: '\2192'; font-family: 'Source Sans 3', system-ui, sans-serif; font-size: 22px; transition: translate 200ms ease; }
.cx-close__list li:first-child a { background: var(--ink); color: var(--paper); padding: 0 20px; }
.cx-close__list a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .cx-close__list a:hover { background: #AFC4DD; padding-left: 20px; }
  .cx-close__list li:first-child a:hover { background: #1B3A5B; }
  .cx-close__list a:hover::after { translate: 4px 0; }
}
@media (max-width: 900px) {
  .cx-close__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cx-close__grid > div { display: contents; }
  .cx-close__list { order: 3; margin-top: 32px !important; }
  .cx-close .cx-end__ask { order: 4; }
}
/* Facts strip: two rows of three, so long values like "Under NDA: Main contractor" fit. */
body[data-cs-page] .cs2-side { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
body[data-cs-page] .cs2-side div:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
@media (max-width: 900px) { body[data-cs-page] .cs2-side { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
/* Five facts since the price row went (Kristian, 16 Oct 2026): one row of five on wide screens. */
@media (min-width: 1100px) {
  body[data-cs-page] .cs2-side:has(> div:nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  body[data-cs-page] .cs2-side:has(> div:nth-child(5):last-child) > div:nth-child(4) { padding-left: 20px; border-left: 1px solid rgba(88, 96, 105, 0.25); }
}
/* Results quote: under the list, set apart from the numbered results (Kristian, 15 Oct 2026). */
html body main .cs2-results .cs2-res + .cs2-quote { margin-top: clamp(40px, 4vw, 56px) !important; }
