/*
  SERVICES (상품소개) PAGE
  biz-place.kr/services 의 실제 _services.css/_services.js를 그대로 받아 분석하여
  마크업 구조·박스 모델·rem 단위 체계와 동작을 재현했다.

  핵심 구조:
  - main.services-main 은 고정 높이(overflow:hidden)의 "창"이고, 그 안의
    div.container 가 카테고리 수 만큼 옆으로 긴 트랙이다. 트랙 맨 앞에는
    카테고리 1개 폭만큼의 빈 여백(padding-left)이 있어서, 첫 탭을 선택했을 때도
    "왼쪽으로 한 칸 이동"하는 동일한 로직을 탈 수 있게 되어 있다(홈 화면
    article.service 캐러셀과 동일한 트릭).
  - 원본은 데스크톱에서 퍼센트(-16.666% = -100vw), 모바일에서 vw 단위를 각각
    사용하지만 두 값은 수학적으로 동일한 결과(현재 idx * -100vw)이므로, 이
    프로젝트에서는 애매한 퍼센트 계산 대신 vw 단위 하나로 통일해 데스크톱/
    모바일 모두 재현했다.
  - 카테고리 탭바(section.select)는 원본에서 position:sticky(음수 top으로
    배너는 스크롤되어 사라지고 탭바만 고정되는 트릭)를 쓰지만, 이 프로젝트의
    style.css는 html,body에 overflow-x:hidden을 적용 중이라 일부 렌더링
    엔진에서 position:sticky가 정상 동작하지 않는 이슈가 있어(examples.css,
    notice.css와 동일 이슈) JS로 fixed 전환하는 is-stuck 방식으로 동일한
    룩앤필을 재현한다.
*/

.services-ctg {
  position: relative;
  width: 100%;
  background-color: #fff;
}

/* 상단 고정 헤더(10rem)에 배너가 가려지지 않도록 자리를 미리 확보한다
   (다른 페이지의 .xxx-main::before 스페이서와 동일한 역할). */
.services-ctg::before {
  content: "";
  display: block;
  width: 100%;
  height: 15rem;
}

.services-ctg .banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: center;
  margin: 0 auto;
  padding: 0 0 0 11rem;
  width: 127.2rem;
  max-width: 100%;
  height: 28.8rem;
  background-image: url('../img/services-hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.services-ctg .banner h1 {
  width: 100%;
  font-size: 3rem;
  font-weight: 500;
  color: #fff;
  line-height: 3rem;
}

.services-ctg .banner h1 b {
  font-weight: 700;
}

.services-ctg .banner h2 {
  margin: 3rem 0 0 0;
  width: 100%;
  font-size: 1.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 2.7rem;
}

/* ---------- 카테고리 탭 (JS is-stuck) ---------- */
.services-select-slot {
  position: relative;
  width: 100%;
  height: 9rem;
  background-color: #fff;
  z-index: 10;
}

.services-select {
  margin: 5rem auto 0;
  width: 127.2rem;
  max-width: 100%;
  height: 4rem;
  padding: 0 3rem;
  box-sizing: border-box;
}

.services-select.is-stuck {
  position: fixed;
  left: 0;
  top: 10rem;
  margin: 0;
  padding: 2rem 0 0 0;
  height: fit-content;
  width: 100%;
  max-width: 100%;
  transform: none;
  background-color: rgba(255, 255, 255, 0.97);
  box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.08);
  z-index: 20;
  box-sizing: border-box;
}

/* 배경/그림자는 화면 끝까지 꽉 채우고, 실제 탭 라벨은 평소(비고정) 상태와
   동일한 위치에 오도록 127.2rem 중앙 정렬 박스로 한 번 더 감싼다. */
.services-select.is-stuck div {
  margin: 0 auto;
  width: 127.2rem;
  max-width: 100%;
  padding: 0 3rem;
  box-sizing: border-box;
}

.services-select div {
  display: flex;
  flex-flow: row nowrap;
  width: auto;
  height: 4rem;
}

.services-select div input[type="radio"] {
  display: none;
}

.services-select div label {
  position: relative;
  margin: 0 6rem 0 0;
  width: max-content;
  height: 4rem;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.services-select div label:hover {
  color: var(--color-primary);
}

.services-select div label::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background-color: transparent;
  transition: background-color 0.3s ease;
}

.services-select div input[type="radio"]:checked + label {
  font-weight: 700;
  color: var(--color-primary);
}

.services-select div input[type="radio"]:checked + label::before {
  background-color: var(--color-primary);
}

/* ---------- MAIN TRACK ----------
   높이는 고정 rem 값이 아니라 JS(SERVICES.updateHeight)가 현재 활성화된
   article의 실제 렌더링 높이를 매번 측정해서 .services-main에 반영한다.
   이걸 위해 container/article은 반드시 height:auto(콘텐츠 기준)여야 한다 —
   height:100%로 고정하면 article.offsetHeight가 .services-main의 "현재"
   높이를 그대로 되돌려주는 순환 참조가 되어 측정이 무의미해진다. */
.services-main {
  position: relative;
  margin: 5rem 0 0 0;
  width: 100%;
  overflow: hidden;
  transition: height 0.3s ease;
}

.services-main .container {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-flow: row nowrap;
  align-items: flex-start;
  padding: 0 0 0 100vw;
  width: max-content;
  transition: transform 0.5s ease;
  cursor: grab;
}

.services-main .container article {
  width: 100vw;
  padding: 0 3rem;
  box-sizing: border-box;
}

.services-main .container article h1 {
  font-size: 5rem;
  font-weight: 700;
  line-height: 7rem;
  letter-spacing: -0.1rem;
}

.services-main .container article section {
  position: relative;
  margin: 10rem auto;
  width: 127.2rem;
  max-width: 100%;
}

.services-main .container article section.intro {
  height: 100rem;
}

.services-main .container article section.ex {
  margin: 0 -3rem;
  /* padding: 0 2rem; */
  padding-left: 4vw;
  padding-right: 4vw;
  width: calc(100% + 6rem);
  max-width: none;
  height: 79rem;
  background-color: rgba(244, 246, 249, 1);
}

.services-main .container article section.apply {
  height: 76rem;
}

.services-main .container article section.slogan {
  margin: 0 -3rem;
  width: calc(100% + 6rem);
  max-width: none;
  height: 44rem;
}

/* ---------- INTRO (fold 슬라이더: 이미지 + 설명 3포인트) ---------- */
.intro .fold {
  position: relative;
  margin: 9.5rem 0 0 0;
  width: 100%;
  height: 51rem;
}

.intro .fold .imgs {
  position: absolute;
  left: 0;
  top: 0;
  width: min(62.4rem, 49.06%);
  height: 47rem;
  overflow: hidden;
  border-radius: 1.6rem;
  z-index: 1;
}

.intro .fold .imgs div {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.intro .fold .imgs div.img-1 { top: 0; }
.intro .fold .imgs div.img-2 { top: 100%; }
.intro .fold .imgs div.img-3 { top: 200%; }

.intro .fold .desc {
  position: absolute;
  right: 1%;
  bottom: 0;
  width: min(75.6rem, 59.43%);
  height: 47rem;
  background-color: var(--color-primary);
  border-radius: 1.6rem;
  overflow: hidden;
}

.intro .fold .desc::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 15%;
  height: 100%;
  background-color: var(--color-primary-dark);
  clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
}

.intro .fold .desc div {
  position: absolute;
  padding: 10rem 2rem 0 17rem;
  /* padding: 10rem 2rem 0 12rem; */
  top: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  transition: transform 0.5s ease;
}

.intro .fold .desc div.desc-1 { left: 0; }
.intro .fold .desc div.desc-2 { left: 100%; }
.intro .fold .desc div.desc-3 { left: 200%; }

.intro .fold .desc div h4 {
  font-size: clamp(1rem, calc(0.095rem + 1.34vw), 1.8rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}

.intro .fold .desc div h2 {
  margin: 1rem 0 3rem 0;
  font-size: clamp(1.85rem, calc(-0.242rem + 3.1vw), 3.7rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2rem;
  line-height: 3.5vw;
}

.intro .fold .desc div h3 {
  padding: 0 5rem 0 0;
  font-size: clamp(1.15rem, calc(-0.15rem + 1.93vw), 2.3rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
  line-height: 3.2rem;
  word-break: break-word;
}

.intro .fold button {
  position: absolute;
  bottom: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6rem;
  height: 6rem;
  font-size: 3rem;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.intro .fold button:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.intro .fold button.prev { right: 13rem; }
.intro .fold button.next { right: 5rem; }
.intro .fold button.prev::before { content: "\2039"; }
.intro .fold button.next::before { content: "\203A"; }
.intro .fold button.disable { opacity: 0.35; pointer-events: none; }

/* ---------- EXAMPLES (ex 슬라이더: 사례 1개씩) ---------- */
.ex { padding: 15rem 0 0 0; }

.ex h1 {
  margin: 0 auto;
  width: 127.2rem;
  max-width: 100%;
}

.ex .ex-carousel {
  position: relative;
  margin: 5rem 0 0;
  width: 100%;
  height: 38rem;
}

.ex .wrapper {
  position: relative;
  margin: 0 auto;
  width: 127.2rem;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
}

.ex .wrapper div.card {
  position: absolute;
  display: flex;
  align-items: center;
  top: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.ex .wrapper div.card.ex-1 { left: 0; }
.ex .wrapper div.card.ex-2 { left: 100%; }
.ex .wrapper div.card.ex-3 { left: 200%; }

.ex .wrapper div.card .ex-thumb {
  flex: 0 0 38rem;
  width: 38rem;
  height: 38rem;
  border-radius: 1.6rem;
  margin-right: 8rem;
}

.ex .wrapper div.card .ex-info {
  flex: 1 1 auto;
}

.ex .wrapper div.card h2 {
  width: 100%;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--color-text);
}

.ex .wrapper div.card .stats {
  display: flex;
  gap: 4rem;
  margin: 2.4rem 0 3rem 0;
}

.ex .wrapper div.card h3 {
  position: relative;
  min-width: 14rem;
  padding: 2.6rem 0 0 0;
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 3rem;
}

.ex .wrapper div.card h3::before {
  content: attr(data-title);
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.ex .wrapper div.card h4 {
  max-width: 55rem;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--color-sub);
  line-height: 2.7rem;
}

.ex button {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  font-size: 4rem;
  padding-bottom: 5px;
  color: var(--color-sub);
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.12);
  transition: color 0.3s ease, background-color 0.3s ease;
  transform: translateY(-50%);
}

.ex button:hover {
  color: #fff;
  background: var(--gradient);
}

.ex button.prev { left: max(0.5rem, calc((100% - 127.2rem) / 2 - 6.2rem)); }
.ex button.next { right: max(0.5rem, calc((100% - 127.2rem) / 2 - 6.2rem)); }
.ex button.prev::before { content: "\2039"; }
.ex button.next::before { content: "\203A"; }
.ex button.disable { opacity: 0.35; pointer-events: none; }

/* ---------- APPLY (CTA) ---------- */
.apply {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: center;
  height: 76rem;
}

.apply .apply-text {
  flex: 0 0 60rem;
  padding-top: 5rem;
}

.apply h1 {
  width: 100%;
  font-size: 4.2rem;
  font-weight: 600;
  line-height: 5.6rem;
}

.apply h1 b {
  font-weight: 800;
}

.apply h2 {
  margin: 4rem 0 5rem 0;
  width: 100%;
  font-size: 1.9rem;
  font-weight: 400;
  color: var(--color-sub);
  line-height: 2.8rem;
}

.apply a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 26rem;
  height: 5.8rem;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  background: var(--gradient);
  border-radius: 2.9rem;
  transition: transform 0.2s ease;
}

.apply a:hover {
  transform: translateY(-0.2rem);
}

.apply .apply-visual {
  flex: 0 0 46rem;
  align-self: center;
  width: 46rem;
  height: 46rem;
  border-radius: 2rem;
}

/* ---------- SLOGAN ---------- */
.slogan {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 44rem;
  background: var(--gradient);
  overflow: hidden;
}

.services-main .container article section.slogan h1 {
  width: max-content;
  max-width: 100rem;
  font-size: clamp(1.8rem, calc(-0.022rem + 2.85vw), 3.6rem);
  font-weight: 600;
  color: #fff;
  text-align: center;
  line-height: 5.4rem;
}

.slogan h1 b {
  font-weight: 800;
}

/* ---------- 카테고리별 그라디언트 (실제 사진 에셋 대체) ---------- */
.shorts-theme { background: linear-gradient(135deg, #ff0000, #ff5e3a); }
.reels-theme { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.naver-theme    { background: linear-gradient(135deg, #00c73c, #03c75a); }
.danggeun-theme { background: linear-gradient(135deg, #ff6f0f, #ff9020); }

/* ---------- 폴드 슬라이드 좌측 이미지 (포인트별 개별) ---------- */
.img-1.shorts-theme { background: url('../img/services-shorts-point-01-visual.jpg') center/cover; }
.img-2.shorts-theme { background: url('../img/services-shorts-point-02-visual.jpg') center/cover; }
.img-3.shorts-theme { background: url('../img/services-shorts-point-03-visual.jpg') center/cover; }
.img-1.reels-theme  { background: url('../img/services-reels-point-01-visual.jpg')  center/cover; }
.img-2.reels-theme  { background: url('../img/services-reels-point-02-visual.jpg')  center/cover; }
.img-3.reels-theme  { background: url('../img/services-reels-point-03-visual.jpg')  center/cover; }
.img-1.naver-theme    { background: url('../img/services-naver-point-01-visual.jpg')    center/cover; }
.img-2.naver-theme    { background: url('../img/services-naver-point-02-visual.jpg')    center/cover; }
.img-3.naver-theme    { background: url('../img/services-naver-point-03-visual.jpg')    center/cover; }
.img-1.danggeun-theme { background: url('../img/services-danggeun-point-01-visual.jpg') center/cover; }
.img-2.danggeun-theme { background: url('../img/services-danggeun-point-02-visual.jpg') center/cover; }
.img-3.danggeun-theme { background: url('../img/services-danggeun-point-03-visual.jpg') center/cover; }

/* ---------- Apply CTA 비주얼 (카테고리별) ---------- */
.apply-visual.shorts-theme { background: url('../img/services-apply-shorts-visual.jpg') center/cover; }
.apply-visual.reels-theme  { background: url('../img/services-apply-reels-visual.jpg')  center/cover; }
.apply-visual.naver-theme    { background: url('../img/services-apply-naver-visual.jpg')    center/cover; }
.apply-visual.danggeun-theme { background: url('../img/services-apply-danggeun-visual.jpg') center/cover; }

/* ---------- 사례 캐러셀 썸네일 (카테고리×예제별) ---------- */
.ex-1 .ex-thumb.shorts-theme { background: url('../img/services-ex-shorts-01-thumb.jpg') center/cover; }
.ex-2 .ex-thumb.shorts-theme { background: url('../img/services-ex-shorts-02-thumb.jpg') center/cover; }
.ex-3 .ex-thumb.shorts-theme { background: url('../img/services-ex-shorts-03-thumb.jpg') center/cover; }
.ex-1 .ex-thumb.reels-theme  { background: url('../img/services-ex-reels-01-thumb.jpg')  center/cover; }
.ex-2 .ex-thumb.reels-theme  { background: url('../img/services-ex-reels-02-thumb.jpg')  center/cover; }
.ex-3 .ex-thumb.reels-theme  { background: url('../img/services-ex-reels-03-thumb.jpg')  center/cover; }
.ex-1 .ex-thumb.naver-theme    { background: url('../img/services-ex-naver-01-thumb.jpg')    center/cover; }
.ex-2 .ex-thumb.naver-theme    { background: url('../img/services-ex-naver-02-thumb.jpg')    center/cover; }
.ex-3 .ex-thumb.naver-theme    { background: url('../img/services-ex-naver-03-thumb.jpg')    center/cover; }
.ex-1 .ex-thumb.danggeun-theme { background: url('../img/services-ex-danggeun-01-thumb.jpg') center/cover; }
.ex-2 .ex-thumb.danggeun-theme { background: url('../img/services-ex-danggeun-02-thumb.jpg') center/cover; }
.ex-3 .ex-thumb.danggeun-theme { background: url('../img/services-ex-danggeun-03-thumb.jpg') center/cover; }

/* ---------- responsive ---------- */
@media (max-width: 675px) {
  .intro .fold .desc {
    right: 3%;
  }

  .services-ctg::before {
    height: 6rem;
  }

  .services-ctg .banner {
    margin: 0 auto;
    padding: 0 0 0 2rem;
    width: calc(100% - 3rem);
    height: 13rem;
    border-radius: 1.4rem;
  }

  .services-ctg .banner h1 {
    font-size: 2rem;
    line-height: 2.4rem;
  }

  .services-ctg .banner h2 {
    margin: 1.2rem 0 0 0;
    padding: 0 2rem 0 0;
    font-size: 1.1rem;
    line-height: 1.8rem;
  }

  .services-select-slot {
    height: 7rem;
  }

  .services-select {
    margin: 3rem auto 0;
    padding: 0 0 0 1.5rem;
    width: 100%;
    height: 4rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
  }

  .services-select.is-stuck {
    left: 0;
    top: 5rem;
    margin: 0;
    padding: 2rem 0 0 0;
    width: 100%;
    max-width: 100%;
    transform: none;
  }

  .services-select::-webkit-scrollbar {
    display: none;
  }

  .services-select div {
    width: max-content;
  }

  .services-select div label {
    margin: 0 4rem 0 0;
    font-size: 1.5rem;
  }

  .services-main {
    margin: 3rem 0 0 0;
  }

  .services-main .container article {
    padding: 0;
  }

  .services-main .container article h1 {
    font-size: 2.5rem;
    line-height: 3.5rem;
    letter-spacing: -0.05rem;
    text-align: center;
  }

  .services-main .container article section {
    width: calc(100% - 3rem);
    margin: 4rem auto;
  }

  .services-main .container article section.intro { height: 68rem; }
  .services-main .container article section.ex { margin: 0; width: 100%; max-width: 100%; height: 70rem; }
  .services-main .container article section.apply { height: 66rem;  }
  .services-main .container article section.slogan { margin: 0; width: 100%; max-width: 100%; height: 32rem; }

  /* INTRO */
  .intro .fold {
    margin: 4.75rem 0 0 0;
    height: 48rem;
  }

  .intro .fold .imgs {
    left: 4%;
    top: -2rem;
    width: 85%;
    height: 26rem;
  }

  .intro .fold .desc {
    width: 85%;
    height: 28rem;
  }

  .intro .fold .desc::after {
    width: 100%;
    height: 4rem;
    clip-path: polygon(0 0, 100% 0, 89% 96%, 0 100%);
  }

  .intro .fold .desc div {
    padding: 6rem 5rem 0 4rem;
  }

  .intro .fold .desc div h4 {
    letter-spacing: 0;
    line-height: 1rem;
  }

  .intro .fold .desc div h2 {
    margin: 1rem 0 3rem 0;
    letter-spacing: -0.1rem;
    line-height: 2.6rem;
  }

  .intro .fold .desc div h3 {
    padding: 0;
    line-height: 1.6rem;
  }

  .intro .fold button {
    width: 3rem;
    height: 3rem;    
    font-size: 2rem;
  }

  .intro .fold button.prev {
    right: 5.5rem;
    bottom: 2rem;
  }
  .intro .fold button.next { 
    right: 2rem; 
    bottom: 2rem; 
  }

  /* EXAMPLES */
  .ex { padding: 6rem 0 0 0; }

  .ex h1 { padding: 0 1.5rem; width: 100%; }

  .ex .ex-carousel {
    margin: 3rem 0 0;
    width: 100%;
    height: 54rem;
  }

  .ex .wrapper {
    margin: 0;
    width: 100%;
    height: 100%;
  }

  .ex .wrapper div.card {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 1.5rem;
  }

  .ex .wrapper div.card .ex-thumb {
    flex: 0 0 auto;
    margin: 0 0 2rem 0;
    width: 100%;
    max-width: 32rem;
    height: auto;
    aspect-ratio: 1 / 1;
    align-self: center;
  }

  .ex .wrapper div.card h2 { font-size: 1.8rem; }
  .ex .wrapper div.card .stats { gap: 3rem; margin: 1.6rem 0 2rem 0; }
  .ex .wrapper div.card h3 { min-width: 11rem; font-size: 2rem; padding-top: 2rem; }
  .ex .wrapper div.card h3::before { font-size: 1.1rem; }
  .ex .wrapper div.card h4 { font-size: 1.3rem; line-height: 2rem; }

  .ex button { top: 30%; width: 4rem; height: 4rem; }
  .ex button.prev { left: -0.5rem; }
  .ex button.next { right: -0.5rem; }

  /* APPLY */
  .apply {
    flex-direction: column-reverse;
    justify-content: center;
    padding-top: 3rem;
  }

  .apply .apply-text {
    flex: none;
    padding-top: 3rem;
    text-align: center;
  }

  .apply h1 { font-size: 2.3rem; line-height: 3.2rem; text-align: center; }
  .apply h2 { margin: 1.6rem 0 3rem 0; font-size: 1.3rem; line-height: 2rem; text-align: center; }
  .apply a { margin: 0 auto; width: 100%; max-width: 30rem; }
  .apply .apply-visual { flex: none; width: 100%; max-width: 28rem; height: 28rem; margin: 0 auto; }

  /* SLOGAN */
  .slogan { padding: 0 2rem; width: 100%; height: 28rem; }
  .slogan h1 { line-height: 2.9rem; }
}
