/* Only individual case study pages load this stylesheet. A sticky fact panel
   sits beside the numbered story, followed by a navy results band. */
.cs-page { --cs-panel: #f3f5f9; --cs-line: #d3d9e6; --cs-gold: #c9a96e; --cs-space: clamp(3rem, 7vw, 6rem); color: var(--ink); font-size: 1.0625rem; }
/* Matches the shared .container so the story lines up with the banner and breadcrumb. */
.cs-wrap { width: 100%; max-width: 76rem; margin-inline: auto; padding-left: max(1.25rem, env(safe-area-inset-left, 0px)); padding-right: max(1.25rem, env(safe-area-inset-right, 0px)); }
.cs-page h2 { margin: 0 0 1.25rem; font-size: clamp(1.875rem, 3.4vw, 2.75rem); line-height: 1.12; letter-spacing: -.03em; }
.cs-page h3 { margin: 0 0 .5rem; font-size: clamp(1.1875rem, 1.5vw, 1.375rem); line-height: 1.25; letter-spacing: -.015em; }
.cs-page p { margin: 0 0 1.125rem; font-size: clamp(1.0625rem, 1.15vw, 1.1875rem); line-height: 1.7; }

/* Small red step label above each story heading. */
.cs-label { display: flex; align-items: center; gap: .75rem; color: var(--accent); font-weight: 700; letter-spacing: .08em; line-height: 1.4; text-transform: uppercase; }
.cs-page .cs-label { margin: 0 0 .75rem; font-size: .9375rem; }
.cs-label span { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; height: 2.25rem; padding-inline: .375rem; background: var(--accent); color: #fff; letter-spacing: 0; }
.cs-label-light { color: #fff; }

.cs-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2.5rem, 5vw, 4.5rem); align-items: start; padding-block: clamp(2rem, 4.5vw, 3.5rem) var(--cs-space); }

/* At a glance: logo on navy above a list of property facts. */
.cs-glance { min-width: 0; border-bottom: 4px solid var(--accent); background: #fff; box-shadow: 0 18px 44px rgb(18 22 42 / .1); }
.cs-glance-logo { display: flex; align-items: center; justify-content: center; padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 2.5rem); background: var(--ink); }
.cs-glance-logo img { width: 100%; max-width: 17rem; height: auto; }
/* Dark logos on light backgrounds sit on white, ruled off from the facts below. */
.cs-glance-logo-light { border-bottom: 1px solid var(--cs-line); background: #fff; }
.cs-glance-logo-light img { max-width: 11rem; }
/* Long single-line wordmarks need more width than stacked logos. */
.cs-glance-logo-light .cs-glance-wordmark { max-width: 15rem; }
/* Logos with their own solid background fill the panel edge to edge. */
.cs-glance-logo-full { padding: 0; background: none; }
.cs-glance-logo-full img { display: block; max-width: none; }
/* Two clients split the panel, each logo on the background it was made for. */
.cs-glance-logos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--cs-line); }
.cs-logo-cell { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 8rem; padding: 1.5rem 1.25rem; background: #fff; }
.cs-logo-cell-dark { background: var(--ink); }
.cs-logo-cell img { width: 100%; max-width: 9rem; max-height: 5rem; height: auto; object-fit: contain; }
.cs-glance-body { padding: clamp(1.5rem, 2.6vw, 2.25rem); }
.cs-glance h2 { margin-bottom: 1rem; font-size: clamp(1.375rem, 1.8vw, 1.625rem); }
.cs-facts { margin: 0 0 1.75rem; }
.cs-facts div { padding-block: .8rem; border-top: 1px solid var(--cs-line); }
.cs-facts div:last-child { border-bottom: 1px solid var(--cs-line); }
.cs-facts dt { margin-bottom: .2rem; color: var(--accent); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cs-facts dd { margin: 0; font-size: 1.0625rem; line-height: 1.5; }
.cs-glance-btn { width: 100%; }

.cs-story { min-width: 0; }
.cs-section + .cs-section { margin-top: clamp(3rem, 6vw, 4.5rem); padding-top: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--cs-line); }
.cs-section > p:not(.cs-label) { max-width: 70ch; }

/* Challenge: the three issues as icon rows. */
.cs-issues { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.cs-issues li { display: flex; align-items: center; gap: 1rem; min-width: 0; padding: 1rem 1.25rem; border-left: 4px solid var(--accent); background: var(--cs-panel); font-size: 1.0625rem; font-weight: 700; line-height: 1.4; }
.cs-issues svg { flex: 0 0 auto; width: 1.75rem; height: 1.75rem; fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Solution: copy beside a framed photo, then the three patrol layers. */
.cs-solution { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 4vw, 3rem); align-items: start; }
.cs-solution-copy { min-width: 0; }
.cs-solution-copy p { margin: 0; }
.cs-page .cs-solution-copy p + p { margin-top: 1.125rem; }
.cs-solution-media { position: relative; isolation: isolate; width: 100%; max-width: 26rem; margin: 0 auto; padding: 0 1rem 1rem 0; }
.cs-solution-media::before { content: ""; position: absolute; inset: 1rem 0 0 1rem; z-index: -1; background: var(--accent); }
.cs-solution-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center; }
/* Landscape photos sit full width under the copy instead of beside it. */
.cs-solution-media-subject-right img { object-position: 82% center; }
.cs-solution-stacked .cs-solution-media { max-width: none; }
.cs-solution-stacked .cs-solution-media img { aspect-ratio: 16 / 9; object-position: right 70%; }
.cs-layers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: clamp(2rem, 4vw, 3rem) 0 0; padding: 0; list-style: none; counter-reset: layer; }
.cs-layers li { position: relative; min-width: 0; padding: clamp(1.5rem, 2.4vw, 2rem); padding-top: 4.25rem; border: 1px solid var(--cs-line); border-top: 4px solid var(--ink); background: #fff; counter-increment: layer; }
.cs-layers li::before { content: counter(layer, decimal-leading-zero); position: absolute; top: 1.25rem; left: clamp(1.5rem, 2.4vw, 2rem); color: var(--accent); font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; line-height: 1; }
.cs-page .cs-layers p { margin: 0; color: var(--muted); font-size: 1.0625rem; line-height: 1.6; }

/* Program: a two-column checklist of duties. */
.cs-checklist { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem 2rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.cs-checklist li { position: relative; min-width: 0; padding-left: 2rem; font-size: 1.0625rem; line-height: 1.5; }
.cs-checklist + p { margin-top: 1.5rem; }
.cs-checklist li::before { content: ""; position: absolute; top: .35em; left: .2rem; width: .45rem; height: .8rem; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Result: navy band with the outcomes as checked rows. */
.cs-result { padding-block: var(--cs-space); background: var(--ink); color: #fff; }
.cs-result-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.cs-result-intro { min-width: 0; }
.cs-result-intro p:not(.cs-label) { max-width: 62ch; color: rgb(255 255 255 / .86); }
.cs-result-intro p:last-child { margin: 0; }
.cs-result-intro h3 { margin-top: 2rem; }
.cs-outcomes { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.cs-outcomes li { position: relative; min-width: 0; padding: 1.25rem 1.25rem 1.25rem 3.75rem; border: 1px solid rgb(255 255 255 / .16); background: rgb(255 255 255 / .05); font-family: var(--font-heading); font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); font-weight: 700; line-height: 1.35; }
.cs-outcomes li::before { content: ""; position: absolute; top: 50%; left: 1.25rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); transform: translateY(-50%); }
.cs-outcomes li::after { content: ""; position: absolute; top: 50%; left: calc(1.25rem + .55rem); width: .4rem; height: .72rem; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-62%) rotate(45deg); }

/* Closing call to action and the way back to the case study list. */
.cs-cta { padding-block: var(--cs-space) clamp(2rem, 4vw, 3rem); background: var(--cs-panel); }
.cs-cta-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; align-items: center; }
.cs-cta h2 { margin-bottom: .75rem; }
.cs-cta p { margin: 0; color: var(--muted); }
.cs-cta-actions { display: flex; flex-wrap: wrap; gap: .875rem; }
.cs-back { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; margin-top: clamp(1.75rem, 3.5vw, 2.5rem); color: var(--accent); font-weight: 700; text-decoration: none; }
.cs-back:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .cs-back:not([aria-disabled="true"]):hover { text-decoration: underline; } }

@media (max-width: 39.999rem) {
  .cs-cta-actions .page-btn { flex: 1 1 100%; }
}
@media (min-width: 40rem) {
  .cs-layers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-issues { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cs-issues li { flex-direction: column; align-items: flex-start; }
  .cs-checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .cs-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 21rem); }
  /* The fact panel follows the story on wide screens but leads it on narrow ones. */
  .cs-glance { position: sticky; top: 7rem; grid-column: 2; grid-row: 1; }
  .cs-story { grid-column: 1; grid-row: 1; }
  .cs-solution:not(.cs-solution-stacked) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  /* A side photo stays in view while longer plan copy scrolls past it. */
  .cs-solution:not(.cs-solution-stacked) .cs-solution-media { position: sticky; top: 7rem; }
  .cs-result-inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .cs-cta-inner { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (min-width: 80rem) {
  .cs-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 23rem); }
}
