/* OVO Nabung case-study media and outcome treatments. */
.case-figure {
  margin: var(--space-8) 0 0;
}

.case-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.case-figure {
  margin-bottom: 32px;
}

.journey-flow-diagram {
  box-sizing: border-box;
  margin: 0;
  padding: clamp(18px, 3vw, 28px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.journey-flow__title {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: var(--type-annotation);
  font-weight: 500;
}

.journey-flow {
  position: relative;
  display: grid;
  margin: 0;
  padding: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  list-style: none;
}

.journey-flow::before {
  content: "";
  z-index: 0;
  grid-column: 2 / 5;
  grid-row: 2;
  margin: -12px;
  border: 1px solid color-mix(in srgb, #e96b64 42%, var(--line));
  border-radius: calc(var(--radius-md) - 4px);
  background: color-mix(in srgb, #e96b64 14%, var(--surface));
}

.journey-step {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 52px;
  padding: 10px 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--background);
  color: var(--text);
  font-size: var(--type-annotation);
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}

.journey-step:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.journey-step:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.journey-step:nth-child(3) {
  grid-column: 3;
  grid-row: 1;
}

.journey-step:nth-child(4) {
  grid-column: 4;
  grid-row: 1;
}

.journey-step:nth-child(5) {
  grid-column: 4;
  grid-row: 2;
}

.journey-step:nth-child(6) {
  grid-column: 3;
  grid-row: 2;
}

.journey-step:nth-child(7) {
  grid-column: 2;
  grid-row: 2;
}

.journey-step:nth-child(8) {
  grid-column: 2;
  grid-row: 3;
}

.journey-step:nth-child(9) {
  grid-column: 3;
  grid-row: 3;
}

.journey-step:nth-child(10) {
  grid-column: 4;
  grid-row: 3;
}

.journey-step::after {
  position: absolute;
  display: grid;
  color: var(--text-tertiary);
  font-size: var(--type-body);
  font-weight: 400;
  place-items: center;
}

.journey-step--right::after {
  content: "→";
  width: 28px;
  inset-inline-end: -28px;
  top: 50%;
  transform: translateY(-50%);
}

.journey-step--left::after {
  content: "←";
  width: 28px;
  inset-inline-start: -28px;
  top: 50%;
  transform: translateY(-50%);
}

.journey-step--down::after {
  content: "↓";
  right: 0;
  bottom: -28px;
  left: 0;
  height: 28px;
}

.journey-step--start,
.journey-step--complete {
  border-color: #399b50;
  background: #62d273;
  color: #15351e;
}

.journey-step--friction {
  margin-top: 20px;
  border-color: color-mix(in srgb, #e96b64 55%, var(--line));
}

.journey-step__annotation {
  position: absolute;
  top: -44px;
  left: calc(-200% - 56px);
  z-index: 2;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, #e96b64 65%, var(--line));
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--type-xs);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.journey-step__annotation::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 9px;
  transform: translateX(-50%);
  background: #e96b64;
}

.journey-step__annotation::after {
  content: "";
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  width: 5px;
  height: 5px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid #e96b64;
  border-bottom: 1px solid #e96b64;
}

.story-callout {
  margin: 32px 0;
  padding: 24px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  font-size: var(--type-body);
  line-height: var(--leading-copy);
}

.impact-grid {
  display: grid;
  margin: 28px 0 24px;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  list-style: none;
}

.impact-grid li {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.impact-grid li:nth-child(odd) {
  padding-right: 20px;
}

.impact-grid li:nth-child(even) {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.impact-grid strong,
.impact-grid span {
  display: block;
}

.impact-grid strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 500;
}

.impact-grid span {
  color: var(--text-secondary);
  font-size: var(--type-annotation);
  line-height: var(--leading-sm);
}

.reflection {
  margin-top: 40px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.reflection h3 {
  margin-top: 0;
}

@media (max-width: 560px) {
  .journey-flow-diagram {
    padding: 18px;
  }

  .journey-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 0;
  }

  .journey-flow::before {
    display: none;
  }

  .journey-flow > .journey-step {
    grid-column: 1;
    grid-row: auto;
  }

  .journey-step--friction {
    margin-top: 0;
    background: color-mix(in srgb, #e96b64 14%, var(--background));
  }

  .journey-step:nth-child(5) {
    margin-top: 48px;
  }

  .journey-step__annotation {
    top: -40px;
    left: 12px;
  }

  .journey-step::after,
  .journey-step--right::after,
  .journey-step--left::after,
  .journey-step--down::after {
    content: "↓";
    top: auto;
    right: 0;
    bottom: -22px;
    left: 0;
    width: auto;
    height: 22px;
    transform: none;
  }

  .journey-step:last-child::after {
    content: none;
  }
}

@media (max-width: 480px) {
  .impact-grid {
    grid-template-columns: 1fr;
  }

  .impact-grid li:nth-child(odd),
  .impact-grid li:nth-child(even) {
    padding: 18px 0;
    border-left: 0;
  }

  .reflection {
    padding: 22px;
  }

}
