.cont1 {
  padding: 80px 20px;
  background-color: var(--bg-dark);
  color: var(--text-light);
  text-align: center;
  /* 제목 가운데 정렬 */
  height: auto;
  /* 기존 100% 대신 */
  min-height: 100vh;
  /* 원하는 경우 화면 전체 높이는 유지 */
}

.cont1 h2 {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  margin-bottom: 40px;
}

.cases-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* 기본: 2열 */
  gap: 2rem;
  /* 상자 사이 여백 */
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.clone-cases,
.redesign-cases {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.redesign-cases {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.case {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.case-images {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.case-images .before,
.case-images .after {
  flex: 0 1 calc(50% - 10px);
  /* ✅ 정확히 반, gap 고려 */
  max-width: calc(50% - 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.case-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid #ccc;
  border-radius: 8px;
  max-height: none;
  /* ✅ 기존 max-height 무효화 (중복 방지) */
}

.case-desc h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.case-desc p {
  font-size: 1rem;
  line-height: 1.6;
}

.modal-cont1 {
  position: fixed;
  /* ✅ 화면 전체 기준 */
  top: 0;
  /* 초기값 */
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-cont1-content {
  background-color: var(--bg-dark, #0a0a0a);
  max-width: 100%;
  max-height: 100%;
  width: 90vw;
  height: 90vh;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* ✅ 세로 스크롤 가능하게 */
}

.modal-cont1-content iframe,
.modal-cont1-content img {
  display: block;
  width: 100%;
  height: 100%;
}

.modal-cont1-content.image-only {
  padding: 0;
  text-align: center;
}

.modal-cont1-content.image-only img {
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.modal-cont1 iframe {
  flex-grow: 1;
  border: none;
  width: 100%;
  height: 100%;
}

/* 닫기 버튼 위치는 그대로 유지 */
.modal-cont1-close {
  position: fixed;
  /* ✅ 화면 기준으로 고정 */
  top: 20px;
  right: 20px;
  color: var(--accent, #00f6ff);
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  transition: 0.3s;
  transform: none;
  /* ✅ 수정 */
}

.modal-cont1-close:hover {
  color: #ff5252;
}

.case-desc button {
  margin-right: 0.5rem;
  padding: 0.5rem 1.2rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 6px;
  background-color: var(--accent);
  color: var(--color-text-dark);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.case-desc button:hover {
  background-color: #00d0ff;
}


@media (max-width: 768px) {
  .modal-cont1 {
    align-items: flex-start;
    /* 모바일은 위에서 시작 */
    padding-top: 2rem;
  }

  .modal-cont1-content {
    width: 100%;
    max-height: 90vh;
    height: 90vh !important;
    overflow-y: auto;
    padding: 1rem;
  }

  .modal-cont1-content.image-only img {
    max-height: 70vh;
  }

  .cases-wrapper {
    grid-template-columns: 1fr;
    /* 한 줄 */
    gap: 1.5rem;
    /* 좁은 화면에선 간격도 약간 줄이기 */
  }

  .clone-cases,
  .redesign-cases {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .cases-wrapper {
    flex-direction: column;
    gap: 3rem;
  }

  .cont1-inner {
    min-width: 300px;
    max-width: 768px;
    margin: 0 auto;
    text-align: center;
    padding: 0 1rem;
  }

  .case-images .before,
  .case-images .after {
    flex: 1 1 100%;
    /* ✅ 모바일에서는 세로로 */
    max-width: 100%;
  }

  .modal-cont1-content {
    max-height: 85vh;
    width: 95%;
    padding: 1rem;
  }

  .modal-cont1-content.image-only img {
    max-height: 80vh;
  }

  .modal-cont1 iframe {
    max-height: 70vh;
  }
}

.case-image {
  margin-bottom: 1rem;
  text-align: center;
}

.case-image img {
  width: 100%;
  max-width: 800px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.case-image img:hover {
  transform: scale(1.02);
}

.case-block {
  display: block;
  height: auto;
  min-height: unset;
  overflow: hidden;
  padding: 1.5rem;
  background: var(--bg-dark);
  border-radius: 10px;
  box-shadow: 0 0 10px var(--color-shadow-cyan-55);
}

.case-image img,
.case-images img {
  width: 100%;
  height: 20vh;
  /* 반드시 auto 유지 */
  object-fit: cover;
  max-height: 300px;
  /* 필요 시 최대 높이 제한 */
}

.case-images .before,
.case-images .after {
  width: 100%;
  max-width: 500px;
  margin: 0;
  padding: 0;
  text-align: center;
}

.case-images .label {
  font-size: 1rem;
  line-height: 1.2;
  margin-bottom: 0.3rem;
  /* 적당한 간격 */
}

/* CSS에 추가 */
body.modal-open {
  overflow: hidden;
}