/* Shared case-study foundation. Opt in with .kpdi-case-study and cs-* classes. */
.kpdi-case-study, .kpdi-case-study * {
  box-sizing: border-box;
}

.kpdi-case-study {
  --cs-ink: var(--color-neutral-900, #121212);
  --cs-text: var(--color-neutral-600, #52525a);
  --cs-surface: var(--color-neutral-50, #f7f7f8);
  --cs-line: var(--color-neutral-200, #dcdcdf);
  --cs-brand: var(--color-brand-500, #fa4616);
  margin-top: 100px;
  background: #fff;
  color: var(--cs-text);
  font: 500 16px/26px 'museo-sans', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.kpdi-case-study :is(h1,h2,h3,p,dl,dd,figure,ul,ol) {
  margin: 0;
}

.kpdi-case-study p {
  line-height: inherit;
}

.kpdi-case-study :is(h1,h2,h3) {
  color: var(--cs-ink);
  text-transform: none;
  letter-spacing: 0;
}

.kpdi-case-study :is(h1,h2), .cs-next-title {
  font-family: 'museo', Georgia, serif;
  font-weight: 700;
}

.kpdi-case-study h1 {
  font-size: 56px;
  line-height: 60px;
  max-width: var(--cs-title-width, 800px);
}

.kpdi-case-study h2 {
  font-size: 32px;
  line-height: 40px;
}

.kpdi-case-study img {
  display: block;
  max-width: 100%;
}

.kpdi-case-study a:focus-visible {
  outline: 2px solid var(--cs-brand);
  outline-offset: 5px;
}

.kpdi-case-study .cs-container {
  width: calc(100% - 160px);
  max-width: 1280px;
  margin-inline: auto;
}

.cs-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.cs-copy p {
  max-width: 680px;
}

.cs-stack {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.cs-split {
  display: grid;
  grid-template-columns: minmax(0,396fr) minmax(0,860fr);
  gap: 24px;
  align-items: start;
}

.cs-split > * {
  min-width: 0;
}

.cs-hero {
  padding: 70px 0;
}

.cs-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 80px;
  align-items: end;
  margin-bottom: 80px;
}

.cs-hero-top > :first-child {
  min-width: 0;
}

.kpdi-case-study .cs-hero-top h1 {
  max-width: min(var(--cs-title-width, 900px), 100%);
}

.kpdi-case-study .cs-eyebrow {
  margin-bottom: 32px;
  font-size: 12px;
  line-height: 14px;
  font-weight: 700;
  color: #6e6e76;
}

.cs-eyebrow a {
  color: inherit;
  text-decoration: none;
  transition: color .3s ease-in-out;
}

.kpdi-case-study .cs-eyebrow a:hover {
  color: #da380b;
}

.cs-eyebrow span {
  color: var(--color-brand-600, #da380b);
}

.cs-client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(var(--cs-logo-max-width, 200px), 100%);
  max-width: min(var(--cs-logo-max-width, 200px), 100%);
  height: 60px;
  justify-self: end;
}

.cs-hero-block {
  padding: 64px 64px 0;
  background: var(--color-brand-600, #da380b);
  border-radius: 12px;
  overflow: hidden;
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  min-height: 139px;
  margin-bottom: 32px !important;
}

.cs-stats > div {
  padding: 0 24px;
}

.cs-stats > div + div {
  border-left: 1px solid var(--color-brand-400, #fa6e47);
}

.cs-stats dt {
  color: #fff;
  font: 700 44px/52px 'museo', Georgia, serif;
}

.kpdi-case-study .cs-stats dd {
  margin-top: 8px;
  font-size: 14px;
  line-height: 18px;
  color: #ededef;
}

.cs-hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 2;
  background: #fff;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.kpdi-case-study .cs-hero-block.sc-hero-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 32px;
}

.kpdi-case-study .sc-hero-block :is(.cs-stats, .sc-stats) {
  display: grid;
  grid-template-columns: repeat(var(--cs-stat-columns, 4), minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  min-height: 139px;
  width: 100%;
  margin-bottom: 0 !important;
}

.kpdi-case-study .sc-hero-block :is(.cs-stats, .sc-stats) > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  padding: 0 24px;
}

.kpdi-case-study .sc-hero-block :is(.cs-stats, .sc-stats) dd {
  margin-top: 0;
}

.kpdi-case-study .cs-hero-visual.sc-hero-visual {
  max-width: none;
  margin: 0;
  aspect-ratio: 1152 / 576;
  flex-shrink: 0;
}

.kpdi-case-study .sc-hero-visual picture {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}

.cs-article {
  padding: 80px 0;
}

.cs-sidebar {
  max-width: 300px;
}

.cs-details {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cs-details dt {
  color: var(--cs-ink);
}

.kpdi-case-study .cs-details dd {
  margin-top: 4px;
  font-size: 14px;
  line-height: 18px;
}

.cs-sidebar-cta {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  margin-top: 48px;
  background: var(--color-brand-50, #fef0eb);
  border: 1px solid var(--color-brand-100, #fed8cd);
  border-radius: 12px;
}

.kpdi-case-study .cs-sidebar-cta h2 {
  font-size: 20px;
  line-height: 28px;
}

.cs-article-content {
  display: flex;
  flex-direction: column;
  gap: 64px;
  min-width: 0;
}

.kpdi-case-study .cs-article-content h2 {
  font-size: 24px;
  line-height: 32px;
}

.kpdi-case-study .cs-lead {
  color: var(--cs-ink);
  font-size: 18px;
  line-height: 30px;
}

.cs-signature {
  padding: 120px 0;
  border-block: 1px solid var(--cs-line);
  background: var(--cs-surface);
}

.cs-signature-head {
  max-width: 720px;
}

.kpdi-case-study .cs-signature-head h2 {
  font-size: 44px;
  line-height: 52px;
}

.cs-closing {
  padding: 100px 0;
}

.cs-closing > .cs-copy {
  max-width: 680px;
}

.kpdi-case-study .cs-checklist {
  padding: 0;
  list-style: none;
}

.cs-checklist li {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--cs-line);
}

.cs-checklist li:first-child {
  border-top: 1px solid var(--cs-line);
}

.cs-checklist img {
  flex-shrink: 0;
}

.cs-checklist span {
  min-width: 0;
}

.cs-end {
  padding-bottom: 80px;
}

.cs-end-panel {
  padding: 64px;
  border-radius: 12px;
  background: var(--cs-ink);
}

.cs-end-top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 64px;
}

.cs-end-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 736px;
}

.kpdi-case-study .cs-end h2 {
  color: #fff;
  font-size: 32px;
  line-height: 40px;
}

.cs-end-copy p {
  color: #96969d;
}

.cs-actions {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-shrink: 0;
}

.kpdi-case-study :is(.cs-button,.cs-secondary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 16px;
  line-height: 26px;
}

.kpdi-case-study .cs-button,
.kpdi-case-study .cs-button:visited {
  color: var(--cs-ink);
  background: var(--cs-brand);
  border: 1px solid var(--cs-brand);
  transition: background-color .3s ease-in-out;
}

/* Keep ink text on hover/focus — theme a:visited:hover (#d10e3c) otherwise wins. */
.kpdi-case-study .cs-button:hover,
.kpdi-case-study .cs-button:focus,
.kpdi-case-study .cs-button:visited:hover,
.kpdi-case-study .cs-button:visited:focus {
  color: var(--cs-ink);
  background: #ff683d;
}

.kpdi-case-study .cs-button-small {
  padding: 8px 16px;
  font-size: 14px;
  line-height: 18px;
}

.kpdi-case-study .cs-secondary,
.kpdi-case-study .cs-secondary:visited {
  color: #bfbfc4;
  transition: color .3s ease-in-out;
}

.kpdi-case-study .cs-secondary:hover,
.kpdi-case-study .cs-secondary:focus,
.kpdi-case-study .cs-secondary:visited:hover,
.kpdi-case-study .cs-secondary:visited:focus {
  color: #fff;
}

.kpdi-case-study .cs-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid #3a3a41;
  color: #fff;
  text-decoration: none;
  transition: color .3s ease-in-out;
}

.kpdi-case-study .cs-next:hover {
  color: #fa4616;
}

.cs-next > span:first-child {
  min-width: 0;
}

.cs-next-label {
  display: block;
  margin-bottom: 8px;
  color: #96969d;
  font-size: 14px;
  line-height: 18px;
}

.cs-next-title {
  display: block;
  font-size: 24px;
  line-height: 32px;
}

.cs-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 1px solid #3a3a41;
  border-radius: 50%;
}

@media (max-width: 1200px) {
  .cs-end-top {
      flex-direction: column;
      align-items: start;
    }
}

@media (max-width: 1024px) {
  .kpdi-case-study .cs-container {
      width: calc(100% - 48px);
    }

  .cs-hero-top {
      gap: 32px;
    }

  .kpdi-case-study h1 {
      font-size: 44px;
      line-height: 52px;
    }

  .cs-hero-block {
      padding: 32px 32px 0;
    }

  .kpdi-case-study .sc-hero-block :is(.cs-stats, .sc-stats) > div {
      padding: 0 16px;
    }

  .cs-stats > div {
      padding: 0 16px;
    }

  .cs-stats dt {
      font-size: 32px;
      line-height: 38px;
    }
}

@media (max-width: 768px) {
  .kpdi-case-study h1 {
      font-size: 36px;
      line-height: 42px;
    }

  .kpdi-case-study h2 {
      font-size: 26px;
      line-height: 32px;
    }

  .cs-hero {
      padding-bottom: 0;
    }

  .cs-hero-top {
      grid-template-columns: minmax(0,1fr);
      gap: 48px;
    }

  .cs-client-logo {
      justify-self: start;
    }

  .cs-hero-block {
      padding: 12px 12px 0;
    }

  .kpdi-case-study .cs-hero-block.sc-hero-block {
      gap: 0;
    }

  .kpdi-case-study .sc-hero-block :is(.cs-stats, .sc-stats) {
      grid-template-columns: minmax(0, 1fr);
      min-height: 0;
      padding: 0 32px;
      margin-bottom: 32px !important;
    }

  .kpdi-case-study .sc-hero-block :is(.cs-stats, .sc-stats) > div {
      padding: 24px;
    }

  .cs-stats {
      grid-template-columns: minmax(0,1fr);
      padding: 0 32px;
    }

  .cs-stats > div {
      padding: 24px;
    }

  .cs-stats > div + div {
      border-left: 0;
      border-top: 1px solid var(--color-brand-400, #fa6e47);
    }

  .cs-split {
      grid-template-columns: minmax(0,1fr);
      gap: 24px;
    }

  .cs-article {
      gap: 32px;
    }

  .cs-sidebar {
      max-width: none;
    }

  .cs-sidebar-cta {
      min-height: 166px;
    }

  .cs-article-content {
      gap: 32px;
    }

  .cs-signature {
      padding: 80px 0;
    }

  .kpdi-case-study .cs-signature-head h2 {
      font-size: 32px;
      line-height: 38px;
    }

  .cs-closing {
      padding: 80px 0;
    }

  .cs-closing > .cs-copy {
      gap: 24px;
    }

  .cs-end-panel {
      padding: 40px;
    }

  .cs-end-copy {
      gap: 24px;
    }

  .kpdi-case-study .cs-end h2 {
      line-height: 38px;
    }

  .cs-actions {
      flex-direction: column-reverse;
      width: 100%;
      gap: 24px;
    }

  .cs-actions a {
      width: 100%;
    }

  .cs-next-title {
      font-size: 22px;
      line-height: 30px;
    }
}
