/* C&T CASE STUDY TEMPLATE (Scoreboard)
   Loaded by functions.php on any post containing a block with class cs-hero. Everything else is untouched. */

body:has(.cs-hero) { --cs-navy: #282a6c; --cs-yellow: #faea9f; --cs-gap: clamp(48px, 7vw, 88px); }

/* hide the standard post furniture */
body.single:has(.cs-hero) .feature-wrapper,
body.single:has(.cs-hero) .container > .meta,
body.single:has(.cs-hero) .container > .section-title,
body.single:has(.cs-hero) .entry-footer { display: none !important; }
html:has(.cs-hero), body:has(.cs-hero) { overflow-x: clip; }
body.single:has(.cs-hero) #content { margin-top: 0 !important; margin-bottom: 0 !important; }
body.single:has(.cs-hero) article.hentry { border-top: 0 !important; padding-top: 0 !important; margin-bottom: 0 !important; }
/* the theme paints a navy band behind the top 30% of every post; the hero brings its own navy */
body.single:has(.cs-hero)::before { display: none !important; }

/* case study groups manage their own padding */
.entry-content [class*="cs-"] > .wp-block-group__inner-container { max-width: none; padding: 0; margin: 0; }
.entry-content:has(.cs-hero) p { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.65; }
.entry-content:has(.cs-hero) p:empty { display: none !important; }

/* full-bleed bands */
.entry-content .cs-hero, .entry-content .cs-cta {
  width: 100vw; max-width: 100vw;
  margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important;
  padding-left: calc(50vw - 50%); padding-right: calc(50vw - 50%);
}

/* hero */
.entry-content .cs-hero {
  background: var(--cs-navy) !important; color: #fff;
  margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 150px; padding-bottom: 72px;
}
.entry-content .cs-hero:has(+ .cs-tiles) { padding-bottom: 48px; }
.entry-content .cs-hero .cs-eyebrow {
  color: var(--cs-yellow); font-size: 13px !important; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase !important; margin: 0 0 18px;
}
.entry-content .cs-hero h1 {
  color: #fff !important; font-size: clamp(42px, 5.6vw, 84px); line-height: 1.02; margin: 0 0 24px;
  text-wrap: balance; word-break: normal !important; overflow-wrap: normal !important; hyphens: none;
}
.entry-content .cs-hero h1 * { display: inline !important; white-space: normal !important; }
.entry-content .cs-hero .cs-lede {
  color: #fff; font-size: clamp(18px, 1.7vw, 23px) !important; line-height: 1.5; max-width: 38em; margin: 0;
}

/* stat tiles: the navy carries on behind their top half */
.entry-content .cs-tiles { position: relative; z-index: 2; margin: 0 !important; gap: 14px !important; }
.entry-content .cs-tiles::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: calc(50% - 50vw);
  width: 100vw; height: 88px; background: var(--cs-navy);
}
.entry-content .cs-tiles > .wp-block-column { background: var(--cs-yellow) !important; color: var(--cs-navy); padding: 28px 28px 30px; }
.entry-content .cs-tiles .cs-num {
  font-size: clamp(38px, 4.2vw, 56px) !important; font-weight: 900;
  line-height: 1 !important; letter-spacing: -0.02em; margin: 0 0 10px;
}
.entry-content .cs-tiles .cs-num-label { font-size: 15px !important; line-height: 1.35 !important; margin: 0; }

/* fact strip */
.entry-content .cs-facts { margin: 0 !important; padding: 30px 0 28px; border-bottom: 3px solid var(--cs-yellow); gap: 24px !important; }
.entry-content .cs-label {
  font-size: 12px !important; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; margin: 0 0 4px; opacity: 0.75;
}
.entry-content .cs-fact { font-size: 17px !important; font-weight: 700; line-height: 1.3 !important; margin: 0; }

/* story: numbered rows, heading left, copy right */
.entry-content .cs-story { margin-top: var(--cs-gap) !important; counter-reset: cs-step; }
.entry-content .cs-story > .wp-block-group__inner-container,
.entry-content .cs-story:not(:has(> .wp-block-group__inner-container)) {
  display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr); column-gap: clamp(24px, 4vw, 56px);
}
.entry-content .cs-story h2 {
  grid-column: 1; font-size: clamp(26px, 2.4vw, 32px) !important; line-height: 1.1;
  margin: 0 0 40px; padding-top: 22px; border-top: 3px solid var(--cs-navy);
}
.entry-content .cs-story h2::before {
  counter-increment: cs-step; content: counter(cs-step, decimal-leading-zero);
  display: block; font-size: 13px; letter-spacing: 0.14em; margin-bottom: 8px; opacity: 0.55;
}
.entry-content .cs-story > .wp-block-group__inner-container > :not(h2),
.entry-content .cs-story > :not(h2):not(.wp-block-group__inner-container) { grid-column: 2; margin: 0 0 18px; }
.entry-content .cs-story h2 + * { padding-top: 22px; }
.entry-content .cs-story .wp-block-image { grid-column: 1 / -1 !important; margin: 8px 0 40px !important; }

/* pull quote */
.entry-content .cs-quote { margin: var(--cs-gap) 0 0 !important; padding: 4px 0 4px 32px; border-left: 6px solid var(--cs-yellow); }
.entry-content .cs-quote .cs-quote-text {
  font-size: clamp(26px, 3vw, 40px) !important; font-weight: 900;
  line-height: 1.18 !important; margin: 0 0 18px; text-wrap: balance;
}
.entry-content .cs-quote .cs-cite {
  font-size: 13px !important; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0;
}

/* takeaway */
.entry-content .cs-takeaway { margin: var(--cs-gap) 0 0 !important; padding: clamp(28px, 4vw, 44px); background: var(--cs-navy) !important; color: #fff; }
.entry-content .cs-takeaway .cs-label { color: var(--cs-yellow); opacity: 1; margin-bottom: 10px; }
.entry-content .cs-takeaway p:not(.cs-label) { color: #fff; font-size: clamp(19px, 1.8vw, 24px) !important; line-height: 1.45 !important; margin: 0; }

/* closing CTA: full-bleed yellow on the footer */
.entry-content .cs-cta {
  margin-top: var(--cs-gap) !important; margin-bottom: 0 !important;
  padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(56px, 7vw, 96px);
  background: var(--cs-yellow) !important; color: var(--cs-navy);
}
.entry-content .cs-cta h2 {
  color: var(--cs-navy) !important; font-size: clamp(30px, 3.6vw, 52px) !important;
  line-height: 1.05; max-width: 16em; margin: 0 0 16px; text-wrap: balance;
}
.entry-content .cs-cta p { max-width: 36em; margin: 0 0 28px; }
.entry-content .cs-cta .wp-block-button__link {
  background: var(--cs-navy) !important; color: var(--cs-yellow) !important; border: 0 !important;
  border-radius: 0 !important; padding: 18px 32px !important; font-weight: 700; font-size: 16px;
}
.entry-content .cs-cta .wp-block-button__link:hover { background: #fff !important; color: var(--cs-navy) !important; }

/* tablet and phone */
@media (max-width: 781px) {
  .entry-content .cs-hero { padding-top: 120px; padding-bottom: 56px; }
  .entry-content .cs-hero:has(+ .cs-tiles) { padding-bottom: 40px; }
  .entry-content .cs-tiles { gap: 10px !important; }
  .entry-content .cs-tiles::before { height: 64px; }
  .entry-content .cs-facts { flex-wrap: wrap !important; row-gap: 18px !important; }
  .entry-content .cs-facts > .wp-block-column { flex-basis: calc(50% - 12px) !important; }
  .entry-content .cs-story > .wp-block-group__inner-container,
  .entry-content .cs-story:not(:has(> .wp-block-group__inner-container)) { display: block; }
  .entry-content .cs-story h2 { margin-bottom: 12px; }
  .entry-content .cs-story h2 + * { padding-top: 0; }
  .entry-content .cs-story p { margin-bottom: 32px !important; }
  .entry-content .cs-quote { padding-left: 20px; }
}
