/* Case Body block — two-column case-study body.
   LEFT: 65ch prose column (own .sun-case__prose scope, modeled on the
   post-single reading styles). RIGHT: sticky facts sidebar ≥1200px; below,
   the sidebar stacks ABOVE the content. Tokens only, BEM .sun-case__*. */
.sun-case {
  box-sizing: border-box;
  padding: clamp(32px, 5vw, 64px) 0 clamp(48px, 6vw, 96px);
}
.sun-case *,
.sun-case *::before,
.sun-case *::after { box-sizing: border-box; }

.sun-case__inner {
  width: min(1280px, 100% - 48px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  /* NOTE: no align-items:start — the sidebar grid item must stretch to the
     full row height so its inner .sun-case__sidebar-sticky has room to pin. */
}

.sun-case__content { min-width: 0; }

/* ── Prose — 65ch reading column (post-single model, own scope) ─────── */
.sun-case__prose {
  max-width: min(65ch, 100%);
  margin-inline: auto;
  font-family: var(--wp--preset--font-family--brand);
  font-size: var(--wp--preset--font-size--md);          /* 16px — ch basis */
  line-height: 1.5;
  color: var(--sun-bluegrey);
}

/* Vertical rhythm */
.sun-case__prose > * { margin-block: 0; max-width: 100%; }
.sun-case__prose > * + * { margin-block-start: 20px; }

/* Lead paragraph reads slightly larger */
.sun-case__prose > p:first-child {
  font-size: var(--wp--preset--font-size--lg);          /* 18 */
  line-height: 1.5;
}

.sun-case__prose h2,
.sun-case__prose h3,
.sun-case__prose h4,
.sun-case__prose h5,
.sun-case__prose h6 {
  margin-block-start: 48px;
  font-family: var(--wp--preset--font-family--brand);
  font-weight: 500;
  color: var(--sun-secondary);
  scroll-margin-top: 112px;
}
.sun-case__prose > h2:first-child,
.sun-case__prose > h3:first-child { margin-block-start: 0; }
.sun-case__prose h2 + *,
.sun-case__prose h3 + *,
.sun-case__prose h4 + * { margin-block-start: 12px; }

.sun-case__prose h2 {
  font-size: var(--wp--preset--font-size--display-sm);  /* 32 */
  line-height: 1.25;
  letter-spacing: -0.32px;
}
.sun-case__prose h3 {
  font-size: var(--wp--preset--font-size--xl);          /* 24 */
  line-height: 1.3334;
}
.sun-case__prose h4,
.sun-case__prose h5,
.sun-case__prose h6 {
  font-size: var(--wp--preset--font-size--lg);          /* 18 */
  line-height: 1.3334;
}

/* Inline links */
.sun-case__prose a {
  color: var(--sun-link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  transition: color .15s ease;
}
.sun-case__prose a:hover { color: var(--sun-link-hover); }
.sun-case__prose a:focus-visible {
  outline: 2px solid var(--sun-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Lists */
.sun-case__prose ul,
.sun-case__prose ol { padding-inline-start: 24px; }
.sun-case__prose li { margin-block-start: 8px; }
.sun-case__prose li:first-child { margin-block-start: 0; }
.sun-case__prose ul > li::marker { color: var(--sun-primary); }

/* Quote */
.sun-case__prose blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--sun-primary);
  font-size: var(--wp--preset--font-size--lg);
  line-height: 1.5;
  color: var(--sun-secondary);
}

.sun-case__prose strong { color: var(--sun-secondary); font-weight: 600; }

/* Images stay inside the prose column */
.sun-case__prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
.sun-case__prose .wp-block-image { margin-block: 32px; }
.sun-case__prose .wp-block-image figcaption {
  margin-top: 8px;
  font-size: var(--wp--preset--font-size--sm);
  color: var(--sun-bluegrey);
  text-align: center;
}

/* ── Facts sidebar ──────────────────────────────────────────────────── */
.sun-case__sidebar {
  min-width: 0;
  order: -1;                       /* stacked: sidebar ABOVE the content */
}

.sun-case__facts-card {
  background: var(--sun-surface);                       /* #f5f5f5 */
  border: 1px solid var(--sun-border);                  /* #efefef */
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-family: var(--wp--preset--font-family--brand);
}

.sun-case__facts {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.sun-case__fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-block: 12px;
  border-bottom: 1px solid var(--sun-border);
}
.sun-case__fact:first-child { padding-block-start: 0; }
.sun-case__fact:last-child { border-bottom: 0; padding-block-end: 0; }
.sun-case__fact-label {
  font-size: var(--wp--preset--font-size--sm);          /* 14 */
  line-height: 1.4286;
  color: var(--sun-bluegrey);
}
.sun-case__fact-value {
  margin: 0;
  font-weight: 500;
  font-size: var(--wp--preset--font-size--md);          /* 16 */
  line-height: 1.5;
  color: var(--sun-secondary);
}

.sun-case__products {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sun-case__products-title {
  font-size: var(--wp--preset--font-size--sm);
  line-height: 1.4286;
  color: var(--sun-bluegrey);
}
.sun-case__products-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sun-case__product {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--sun-base);
  border: 1px solid var(--sun-border);
  border-radius: var(--sun-radius-button);
  font-weight: 500;
  font-size: var(--wp--preset--font-size--sm);
  line-height: 1.4286;
  color: var(--sun-secondary);
}

.sun-case__cta { justify-content: center; }

/* ── ≥1200px: two columns, sidebar sticky on the right ──────────────── */
@media (min-width: 1200px) {
  .sun-case__inner {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 64px;
  }
  .sun-case__sidebar { order: 0; }
  .sun-case__sidebar-sticky {
    position: sticky;
    top: 112px;                    /* under the sticky site header */
  }
}

@media (max-width: 700px) {
  .sun-case__facts-card { padding: 24px; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sun-case__prose a { transition: none; }
}
