#case-detail-page {
  background: #f2f3f3;
  color: var(--ink, #232829);
}

.case-detail-hero {
  background:
    linear-gradient(90deg, rgb(8 16 17 / 0.78), rgb(8 16 17 / 0.38) 58%, rgb(8 16 17 / 0.66)),
    url("../images/hero-line-wide.webp") center / cover no-repeat;
}

.related-cases-section {
  overflow: hidden;
  background: #f2f3f3;
}

.related-cases-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: clamp(30px, 4vw, 48px);
}

.related-cases-head h2 {
  max-width: 760px;
  margin: 26px 0 0;
  color: var(--ink, #232829);
  font-size: var(--fs-section-title);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.related-cases-head > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 54px;
  border-radius: 999px;
  padding: 0 24px;
  color: #008f2f;
  background: #fff;
  font-size: var(--fs-body-sm);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgb(0 143 47 / 0.24);
  white-space: nowrap;
}

.related-cases-marquee {
  position: relative;
  overflow: hidden;
  padding: 0 max(24px, calc((100vw - 1520px) / 2));
}

.related-cases-marquee::before,
.related-cases-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  z-index: 2;
  width: min(12vw, 170px);
  height: 100%;
  pointer-events: none;
}

.related-cases-marquee::before {
  left: 0;
  background: linear-gradient(90deg, #f2f3f3, rgb(242 243 243 / 0));
}

.related-cases-marquee::after {
  right: 0;
  background: linear-gradient(270deg, #f2f3f3, rgb(242 243 243 / 0));
}

.related-cases-track {
  display: flex;
  width: max-content;
  gap: 22px;
  animation: relatedCaseMarquee 34s linear infinite;
  will-change: transform;
}

.related-cases-marquee:hover .related-cases-track,
.related-cases-marquee:focus-within .related-cases-track {
  animation-play-state: paused;
}

.related-case-card {
  flex: 0 0 clamp(260px, 24vw, 390px);
  overflow: hidden;
  border-radius: 8px;
  color: inherit;
  background: #fff;
  box-shadow: 0 24px 70px rgb(35 38 38 / 0.08);
}

.related-case-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1.45;
  object-fit: cover;
  background: #eef1f0;
}

.related-case-card span,
.related-case-card strong {
  display: block;
  padding-inline: 22px;
}

.related-case-card span {
  margin-top: 20px;
  color: #8a918e;
  font-size: var(--fs-mini);
  font-weight: 900;
}

.related-case-card strong {
  min-height: 88px;
  padding-top: 12px;
  padding-bottom: 24px;
  color: var(--ink, #232829);
  font-size: var(--fs-card-title);
  line-height: 1.18;
}

@keyframes relatedCaseMarquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 11px));
  }
}

@media (max-width: 900px) {
  .case-detail-hero {
    background:
      linear-gradient(180deg, rgb(8 16 17 / 0.58) 0%, rgb(8 16 17 / 0.76) 64%, rgb(8 16 17 / 0.92) 100%),
      url("../images/hero-line-mobile.jpg") center top / cover no-repeat;
  }

  .related-cases-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .related-cases-head > a {
    width: fit-content;
  }

  .related-cases-marquee {
    overflow-x: auto;
    padding: 0 28px 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .related-cases-marquee::before,
  .related-cases-marquee::after {
    display: none;
  }

  .related-cases-track {
    animation-play-state: paused;
  }

  .related-case-card {
    flex-basis: min(78vw, 340px);
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .related-cases-track {
    animation: none;
  }
}

.case-product-section {
  padding-top: 0;
  background: #f2f3f3;
}

.case-product-card {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  overflow: hidden;
  border: 1px solid #dde2e0;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(21 35 30 / 8%);
}

.case-product-card figure {
  min-height: 100%;
  margin: 0;
  background: #fff;
}

.case-product-card figure img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: contain;
  background: #fff;
}

.case-product-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 5vw, 76px);
}

.case-product-content h2 {
  max-width: 780px;
  margin: 24px 0 20px;
  font-size: clamp(36px, 4.3vw, 64px);
  line-height: 1.02;
}

.case-product-content > p {
  max-width: 720px;
  margin: 0;
  color: var(--muted, #66706c);
  font-size: var(--fs-body);
  line-height: 1.7;
}

.case-product-content dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.case-product-content dl div {
  padding-top: 16px;
  border-top: 1px solid #d9dfdc;
}

.case-product-content dt {
  color: #7b8581;
  font-size: var(--fs-mini);
  font-weight: 800;
}

.case-product-content dd {
  margin: 7px 0 0;
  color: var(--ink, #232829);
  font-weight: 800;
}

.case-product-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  min-height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  color: #fff;
  background: var(--green, #008f2f);
  font-weight: 900;
}

@media (max-width: 900px) {
  .case-product-card {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }

  .case-product-card figure img {
    min-height: 0;
    aspect-ratio: 1.25;
  }

  .case-product-content dl {
    grid-template-columns: 1fr;
  }
}
