/* =========================================================
   CASE STUDY DETAIL
   ========================================================= */

/* ---------------------------------------------------------
   1. HEADER
   --------------------------------------------------------- */
.csd-header {
  padding-block: var(--sp-8) var(--sp-7);
  border-bottom: 1px solid var(--ink-100);
}

.csd-back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  color: var(--ink-500);
  white-space: nowrap;
}

.csd-back svg {
  flex: none;
  width: 16px;
  height: 16px;
  transition: transform var(--dur-base) var(--ease-out);
}

.csd-back:hover {
  color: var(--nasdan-navy);
}

.csd-back:hover svg {
  transform: translateX(-3px);
}

/* Stacked rows (title, then lead) each spanning 10 of 12 columns -- same
   12-column grid approach used for the case study list page's hero. */
.csd-header-copy {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--sp-5);
}

.csd-header-tag {
  display: inline-block;
  margin-bottom: var(--sp-4);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--nasdan-amber);
}

.csd-header-inner h1 {
  grid-column: 1 / 11;
  margin: 0 0 var(--sp-5);
  font-size: var(--fs-h1);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--ink-900);
}

.csd-header-lead {
  grid-column: 1 / 11;
  margin: 0;
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--ink-500);
}

@media (max-width: 767.98px) {
  .csd-header-inner h1,
  .csd-header-lead {
    grid-column: 1 / 13;
  }
}

.csd-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sp-6) var(--sp-5);
  margin-top: var(--sp-7);
  padding: var(--sp-6) var(--sp-7);
  background: var(--cloud);
  border-radius: var(--radius-lg);
}

.csd-fact {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.csd-fact span {
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--ink-400);
}

.csd-fact strong {
  font-size: 1rem;
  font-weight: var(--fw-medium);
  color: var(--ink-900);
  line-height: var(--lh-snug);
}

.csd-fact--link a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 1rem;
  font-weight: var(--fw-medium);
  color: var(--nasdan-amber-700);
  overflow-wrap: anywhere;
}

.csd-fact--link a svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 991.98px) {
  .csd-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: var(--sp-5);
  }
}

@media (max-width: 575.98px) {
  .csd-header-inner h1 {
    font-size: clamp(1.75rem, 1.4rem + 3vw, 2.25rem);
  }
  .csd-facts {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: var(--sp-5);
  }
}

/* ---------------------------------------------------------
   1b. COVER VISUAL
   --------------------------------------------------------- */
.csd-cover { padding-block: var(--sp-8) 0; }
/* aspect-ratio matches the 1200x630 cover_image dimensions (also used as
   the page's og:image / twitter:image) exactly, so object-fit has nothing
   left to crop -- the full image renders uncropped at every width instead
   of being cut off top/bottom by a fixed pixel height. max-width caps how
   wide (and therefore how tall, since the ratio is fixed) it renders at
   desktop -- ~950px lands it at ~500px tall, centered with margin either
   side, rather than stretching the full ~1240px content width to ~655px
   tall. Below ~950px viewport width this is a no-op and the image just
   fills the available width as before. */
.csd-cover-visual {
  position: relative; aspect-ratio: 1200 / 630; max-width: 950px; margin-inline: auto;
  border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(150deg, var(--nasdan-navy) 0%, var(--nasdan-navy-700) 100%);
}
/* Same pattern as the blog's .post-cover-visual -- this class is applied
   directly to the <img>; object-fit:cover is now a no-op crop-wise since
   the container ratio matches the source, but keeps the image from ever
   stretching/squashing if a differently-sized file is ever uploaded. */
img.csd-cover-visual { object-fit: cover; display: block; }

@media (max-width: 575.98px) {
  .csd-cover-visual { border-radius: var(--radius-md); }
}

/* ---------------------------------------------------------
   2. STORY BODY + SIDEBAR
   --------------------------------------------------------- */
.csd-layout {
  padding-block: var(--section-pad-y-lg);
}

/* Body column widened / sidebar narrowed and the gutter between them
   tightened so the article claims more of the middle space instead of
   losing it to whitespace. */
.csd-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 820px) 280px;
  gap: var(--sp-6);
  align-items: start;
}

.csd-prose h2 {
  margin: var(--sp-8) 0 var(--sp-4);
  font-size: var(--fs-h3);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-tight);
  color: var(--ink-900);
}

.csd-prose h2:first-child {
  margin-top: 0;
}

.csd-prose p {
  margin: 0 0 var(--sp-4);
  font-size: 1.0625rem;
  line-height: var(--lh-relaxed);
  color: var(--ink-700);
}

.csd-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin: var(--sp-6) 0 var(--sp-6);
}

.csd-feature {
  padding: var(--sp-5);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  background: var(--surface-page);
}

.csd-feature-num {
  display: block;
  margin-bottom: var(--sp-3);
  font-size: 0.8125rem;
  font-weight: var(--fw-semibold);
  color: var(--nasdan-amber-700);
  font-variant-numeric: tabular-nums;
}

.csd-feature h4 {
  margin: 0 0 var(--sp-2);
  font-size: 1.0625rem;
  font-weight: var(--fw-semibold);
  color: var(--ink-900);
}

.csd-feature p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: var(--lh-relaxed);
  color: var(--ink-500);
}

.csd-pullquote {
  margin: var(--sp-7) 0;
  padding: var(--sp-6) var(--sp-7);
  border-left: 3px solid var(--nasdan-amber);
  background: var(--surface-page);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-size: 1.25rem;
  font-weight: var(--fw-light);
  line-height: var(--lh-snug);
  color: var(--ink-900);
}

.csd-pullquote cite {
  display: block;
  margin-top: var(--sp-4);
  font-style: normal;
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  color: var(--ink-500);
}

.csd-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.csd-stack-chip {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--ink-200);
  background: var(--white);
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  color: var(--ink-700);
}

/* ---- Sidebar ---- */
.csd-sidebar {
  position: sticky;
  top: calc(72px + var(--sp-6));
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.csd-toc {
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}

.csd-toc-label {
  display: block;
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: var(--sp-4);
}

.csd-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-3);
  counter-reset: csdtoc;
}

.csd-toc li {
  counter-increment: csdtoc;
}

.csd-toc a {
  display: flex;
  gap: var(--sp-3);
  font-size: 0.875rem;
  color: var(--ink-500);
  line-height: var(--lh-snug);
}

.csd-toc a::before {
  content: counter(csdtoc, decimal-leading-zero);
  flex: none;
  font-size: 0.75rem;
  color: var(--nasdan-amber-700);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}

.csd-toc a:hover {
  color: var(--nasdan-navy);
}

.csd-cta-card {
  position: relative;
  overflow: hidden;
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  background: var(--nasdan-navy);
  color: var(--white);
}

.csd-cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 100% 0%, rgba(255, 193, 7, 0.2), transparent 55%);
}

.csd-cta-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 var(--sp-3);
  font-size: 1.0625rem;
  font-weight: var(--fw-semibold);
  color: var(--white);
}

.csd-cta-card p {
  position: relative;
  z-index: 1;
  margin: 0 0 var(--sp-5);
  font-size: 0.875rem;
  color: var(--paper-300);
}

.csd-cta-card .btn-nasdan {
  position: relative;
  z-index: 1;
  width: 100%;
  justify-content: center;
}

.csd-process-card {
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}

.csd-process-card h4 {
  margin: 0 0 var(--sp-3);
  font-size: 0.9375rem;
  font-weight: var(--fw-semibold);
  color: var(--ink-900);
}

.csd-process-card p {
  margin: 0 0 var(--sp-4);
  font-size: 0.875rem;
  line-height: var(--lh-relaxed);
  color: var(--ink-500);
}

@media (max-width: 1199.98px) {
  .csd-layout-grid {
    grid-template-columns: minmax(0, 760px) 250px;
    gap: var(--sp-5);
  }
}

@media (max-width: 991.98px) {
  .csd-layout-grid {
    grid-template-columns: 1fr;
  }
  .csd-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .csd-toc,
  .csd-cta-card,
  .csd-process-card {
    flex: 1 1 260px;
  }
}

@media (max-width: 767.98px) {
  .csd-features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .csd-sidebar {
    flex-direction: column;
  }
  .csd-pullquote {
    padding: var(--sp-5);
    font-size: 1.0625rem;
  }
}

/* ---------------------------------------------------------
   3. RELATED CASE STUDIES
   --------------------------------------------------------- */
.csd-related {
  padding-block: var(--section-pad-y-lg);
  background: var(--surface-muted);
  border-top: 1px solid var(--ink-100);
}

/* section-head already carries the gap down to the slider -- avoid
   double-spacing on top of .resources-slider's own margin-top. */
.csd-related .resources-slider {
  margin-top: 0;
}
