.case-page {
  background-color: #ffffff;
  background-image: url("../images/case-bg.jpg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  padding: 28px 0 48px;
}

.case-container {
  width: 1200px;
  max-width: calc(100% - 32px);
  margin: 0 auto;
}

.case-section {
  padding: 0;
  scroll-margin-top: 96px;
}

.case-section + .case-section {
  position: relative;
  margin-top: 100px;
  padding-top: 32px;
}

.case-section + .case-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1200px;
  max-width: calc(100% - 32px);
  height: 1px;
  background: #e5e5e5;
  transform: translateX(-50%);
}

.case-panel {
  padding: 34px 58px 30px;
  border-radius: 2px;
  overflow: hidden;
}

.case-panel--school {
  position: relative;
}

.case-panel--school::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 190px;
  background: url("./images/banner.jpg") center top / cover no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.case-title {
  display: block;
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 26px;
  background: #fff0;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0%);
}

.case-title--laundry {
  margin-bottom: 34px;
}

.case-title h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: #222222;
  letter-spacing: 1px;
}

.case-title p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #666666;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 18px;
  position: relative;
  z-index: 1;
}

.case-page .case-card {
  margin: 0;
  display: block;
}

.case-page .case-card__media {
  overflow: hidden;
  background: #f3f5f7;
}

.case-page .case-card__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.case-page .case-card--laundry .case-card__media img {
  height: auto;
}

.case-page .case-card__caption {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  text-align: center;
  color: #555555;
}

.case-pager {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.case-pager__btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #d8e3ec;
  border-radius: 50%;
  background: #ffffff;
  color: #7d94aa;
  font-size: 14px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.case-pager__btn:hover {
  color: #3e6d97;
  border-color: #b7c8d8;
}

.case-carousel__viewport {
  overflow: hidden;
  position: relative;
}

.case-grid {
  display: flex;
  gap: 18px;
  position: relative;
  z-index: 1;
  will-change: transform;
}

.case-page .case-card {
  margin: 0;
  flex: 0 0 calc((100% - 54px) / 4);
  min-width: 0;
}

.case-page .case-card--laundry {
  flex: 0 0 calc((100% - 54px) / 4);
}

.case-carousel__viewport--school {
  overflow: hidden;
}

.case-school-track {
  display: flex;
  transition: transform 0.4s ease;
  will-change: transform;
}

.case-school-slide {
  flex: 0 0 100%;
  width: 100%;
}

.case-step-track {
  display: flex;
  gap: 0;
  transition: transform 0.4s ease;
  will-change: transform;
}

.case-step-slide {
  flex: 0 0 100%;
  width: 100%;
}

.case-grid--school {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 18px;
}

.case-grid--step {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px 18px;
}

.case-grid--school .case-card {
  min-width: 0;
}

.case-grid--step .case-card {
  min-width: 0;
}


@media (max-width: 1024px) {
  .case-grid--school {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-grid--step {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-page .case-section[data-carousel-mode="step"] .case-grid--laundry > .case-card {
    flex: 0 0 calc((100% - 24px) / 3);
  }
}

@media (max-width: 768px) {
  .case-panel {
    padding: 20px 12px 24px;
  }

  .case-panel--school::before {
    height: 120px;
  }

  .case-grid--school {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
    width: 100%;
  }

  .case-carousel__viewport--school {
    width: 100%;
    overflow: hidden;
  }

  .case-school-track {
    display: flex;
    width: 100%;
  }

  .case-school-slide {
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
  }

  .case-grid--step {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
    width: 100%;
  }

  .case-section[data-carousel-mode="step"] .case-carousel__viewport {
    width: 100%;
    overflow: hidden;
  }

  .case-step-track {
    display: flex;
    width: 100%;
  }

  .case-step-slide {
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
  }

  .case-page .case-school-slide .case-card,
  .case-page .case-step-slide .case-card {
    display: block;
    width: auto;
    flex: none;
    min-width: 0;
  }

  .case-page .case-card__media img,
  .case-page .case-card--laundry .case-card__media img {
    height: auto;
  }
}