/* ============================================================
   카드 그리드 레이아웃 — 그리드 / 스와이프 / 슬라이더 3모드
   - 래퍼에 svc-mode-grid|swipe|slider 클래스로 전환
   - 한 화면 카드 수는 --nsc-cols (인라인 style) 로 제어
   - 카드 자체 디자인은 style.css(.pcard)가 담당, 여기선 배치만
   - 슬라이더는 assets/js/service-slider.js (외부 의존성 없음)
   ============================================================ */
.svc-mode-grid, .svc-mode-swipe, .svc-mode-slider { --nsc-gap: 18px; }
.nsc-stage { position: relative; }

/* 카드 한 장 너비 = (전체 - 간격들) / 카드수 */
.svc-mode-grid .item, .svc-mode-swipe .item, .svc-mode-slider .item {
  --nsc-w: calc((100% - (var(--nsc-cols, 3) - 1) * var(--nsc-gap)) / var(--nsc-cols, 3));
}

/* ---- 그리드: 한 화면에 모두 (여러 줄) ---- */
.svc-mode-grid .nsc-track {
  display: grid;
  grid-template-columns: repeat(var(--nsc-cols, 3), 1fr);
  gap: var(--nsc-gap);
}

/* ---- 스와이프: 밀어서 넘김 (JS 없음) ---- */
.svc-mode-swipe .nsc-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 10px;
}
.svc-mode-swipe .nsc-track { display: flex; gap: var(--nsc-gap); }
.svc-mode-swipe .item { flex: 0 0 var(--nsc-w); scroll-snap-align: start; }

/* ---- 슬라이더: 자동넘김·화살표·점 (service-slider.js) ---- */
.svc-mode-slider .nsc-viewport { overflow: hidden; }
.svc-mode-slider .nsc-track {
  display: flex;
  gap: var(--nsc-gap);
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.svc-mode-slider .item { flex: 0 0 var(--nsc-w); }

/* 화살표 (nsc-stage 기준으로 카드 영역 중앙) */
.nsc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--rule, #e7d8f6);
  background: #fff;
  color: var(--ink, #1c1230);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 3;
  transition: border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.nsc-prev { left: -6px; }
.nsc-next { right: -6px; }
.nsc-arrow:hover { border-color: var(--accent, #9333ea); color: var(--accent, #9333ea); }
.nsc-arrow[disabled] { opacity: 0.3; cursor: default; }

/* 점(dots) */
.nsc-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.nsc-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--rule, #d9c7f2);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease, border-radius 0.2s ease;
}
.nsc-dots button.is-active {
  width: 22px;
  border-radius: 5px;
  background: var(--accent, #9333ea);
}

/* ---- 반응형: 태블릿 2장 / 모바일 1장 (인라인 --nsc-cols 덮어씀) ----
   슬라이더 JS는 실제 카드 폭을 측정하므로 자동으로 맞춰집니다. */
@media (max-width: 920px) {
  .svc-mode-grid, .svc-mode-swipe, .svc-mode-slider { --nsc-cols: 2 !important; }
}
@media (max-width: 560px) {
  .svc-mode-grid, .svc-mode-swipe, .svc-mode-slider { --nsc-cols: 1 !important; }
  .nsc-prev { left: 2px; }
  .nsc-next { right: 2px; }
}
