/* 메인 레이어 팝업 (index.php 전용) */
.ks_pop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ks_pop.on {
  display: flex;
}
html.ks_pop_lock,
html.ks_pop_lock body {
  overflow: hidden;
}
.ks_pop_inner {
  width: 100%;
  max-width: 480px;
}
.ks_pop .swiper {
  width: 100%;
}
.ks_pop_item,
.ks_pop_item.swiper-slide {
  max-width: none; /* common.css 의 .swiper-slide 폭 제한 해제 */
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-sizing: border-box;
}
.ks_pop_img {
  display: block;
  width: 100%;
  background: #fff;
}
.ks_pop_img img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(80vh - 110px);
  object-fit: contain;
}
/* 관리자 에디터에서 들어오는 내용 정리 */
.ks_pop_img a {
  display: block;
}
.ks_pop_img p {
  margin: 0;
  padding: 0;
}
.ks_pop_img br {
  display: none;
}
.ks_pop_btns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1b1d24;
}
.ks_pop_btns button {
  flex: 1;
  height: 48px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
  line-height: 48px;
  font-family: inherit;
  cursor: pointer;
}
.ks_pop_btns button + button {
  flex: 0 0 96px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}
.ks_pop_btns button:hover,
.ks_pop_btns button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}
/* 태블릿·모바일: 1장씩 넘기고 버튼은 아래 한 줄(전체 적용) */
.ks_pop_item .ks_pop_btns {
  display: none;
}
.ks_pop_bar {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
}
.ks_pop_page {
  position: static;
  margin-top: 10px;
  text-align: center;
  line-height: 1;
}
.ks_pop_page .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  margin: 0 4px;
  background: #fff;
  opacity: 0.5;
}
.ks_pop_page .swiper-pagination-bullet-active {
  opacity: 1;
}

/* PC: 나란히, 팝업별 버튼. 높이는 이미지 비율(--r)로 맞춘다 (index.php 스크립트가 설정) */
@media (min-width: 1400px) {
  .ks_pop {
    padding: 40px;
  }
  .ks_pop_inner {
    width: 100%;
    max-width: min(calc(100vw - 80px), calc(56vh * var(--sum, 1.5) + 24px * (var(--n, 1) - 1)));
  }
  .ks_pop .swiper {
    overflow: visible;
  }
  .ks_pop .swiper-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
    transform: none !important;
    height: auto !important;
  }
  .ks_pop_item.swiper-slide {
    flex: var(--r, 1.5) 1 0 !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
  }
  .ks_pop_img img {
    max-height: none;
  }
  .ks_pop_item .ks_pop_btns {
    display: flex;
  }
  .ks_pop_bar,
  .ks_pop_page {
    display: none;
  }
}
