@charset "utf-8";

/* scrolling2 - 포트폴리오 스크롤 트리거 */

.scrolling2 {
  width: 100%;
  float: left;
  position: relative;
  padding-top: 6rem;
  padding-bottom: 4rem;
  overflow: visible !important;
}

/* admin_div 오버라이드: sticky 깨지지 않도록 */
.scrolling2.admin_div,
.scrolling2.admin_div:hover {
  overflow: visible !important;
  position: relative !important;
  border: none !important;
  outline: none !important;
}

.scrolling2 .contents-container {
  width: 100% !important;
  display: block !important;
  float: none !important;
  overflow: visible !important;
}

.scrolling2 .contents-inner {
  width: 100%;
  display: block;
  overflow: visible !important;
}

/* === 스티키 타이틀 영역 (CSS sticky) ===
   contents-inner를 grid로 1열에 group-scroll/group-content 둘 다 깔아
   group-scroll이 섹션 전체 높이를 차지하도록 함.
   그 안의 textset이 sticky로 화면 중앙 고정 → 섹션 상단~하단 전 구간 유지 */
.scrolling2 .contents-inner.has-title {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.scrolling2 .contents-inner.has-title > .group-scroll,
.scrolling2 .contents-inner.has-title > .group-content {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

.scrolling2 .group-scroll {
  width: 100%;
  z-index: 5;
  pointer-events: none;
  align-self: stretch;
}

/* textset:
   - height 고정 X → 텍스트 자체 크기. sticky 부모(group-scroll)는 섹션 전체 높이
   - top: 화면 중앙 - 텍스트 높이 절반(대략 38vh) → 텍스트가 화면 중앙에 왔을 때 잡힘
   - 섹션 끝에 도달하면 sticky가 풀려 자연스럽게 같이 위로 빠져나감 */
.scrolling2 .textset {
  position: sticky;
  top: 38vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 타이틀 (GSAP가 JS에서 초기 opacity:0 세팅) */
.scrolling2 .textset .textset-tit {
  font-weight: 700;
  font-size: clamp(6rem, calc(3.125vw + 50px), 10rem);
  line-height: 1.1;
  pointer-events: auto;
}

.scrolling2 .textset .textset-desc {
  margin: 0.8rem 0 0;
  font-size: clamp(1.4rem, calc(0.156vw + 13.5px), 1.6rem);
  color: var(--text-color3, #777);
  pointer-events: auto;
}

.scrolling2 .textset .textset-btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 1rem 3rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-color, #222);
  border: 1px solid var(--text-color3, #999);
  border-radius: 10rem;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
  pointer-events: auto;
}

.scrolling2 .textset .textset-btn:hover {
  background: var(--text-color, #222);
  color: #fff;
  border-color: var(--text-color, #222);
}

/* MORE 버튼 시스템 오버라이드 */
.scrolling2 .textset .hymore_wrap {
  position: static;
  display: inline-block !important;
  float: none !important;
  margin-top: 2rem;
  pointer-events: auto;
  text-align: center;
}

/* === 이미지 그리드 영역 === */
.scrolling2 .group-content {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* group-scroll이 absolute로 오버레이되므로 음수마진 불필요.
   group-content가 자연 위치에서 시작 → 섹션 전체 높이 = 그리드 높이 */

.scrolling2 .imageset {
  overflow: hidden;
  width: clamp(30rem, calc(10.25vw + 267.2px), 43.2rem);
  height: clamp(20.8rem, calc(7.109vw + 185.25px), 30rem);
  border-radius: 1.6rem;
  cursor: pointer;
  position: relative;
}

/* 호버 딤 효과 */
.scrolling2 .imageset::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 2;
  transition: background 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}

.scrolling2 .imageset:hover::before {
  background: rgba(0, 0, 0, 0.25);
}

/* + 아이콘 (우상단) */
.scrolling2 .imageset-plus {
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  z-index: 3;
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.scrolling2 .imageset:hover .imageset-plus {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ★ 우측 상단 더보기 버튼 (txt3 텍스트, 상시 노출) */
.scrolling2 .imageset-more-btn {
  position: absolute;
  top: clamp(10px, calc(0.78vw + 7.5px), 20px);
  right: clamp(10px, calc(0.78vw + 7.5px), 20px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: clamp(8px, calc(0.31vw + 7px), 12px) clamp(12px, calc(0.63vw + 10px), 20px);
  background-color: var(--primary, #f0473e);
  color: #fff;
  border-radius: 10px;
  font-size: clamp(12px, calc(0.16vw + 11.5px), 14px);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.scrolling2 .imageset-more-btn,
.scrolling2 .imageset-more-btn * {
  color: #fff;
}
.scrolling2 .imageset:hover .imageset-more-btn {
  transform: translateY(-1px);
  opacity: 0.95;
}
.scrolling2 .imageset-more-btn .imageset-more-btn-txt {
  display: inline-block;
}
.scrolling2 .imageset-more-btn .uil {
  font-size: 1.05em;
  line-height: 1;
}

/* 썸네일 캡션 (좌하단) */
.scrolling2 .imageset-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  width: 100%;
  padding: 3rem 2rem 1.6rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0.8rem);
}

.scrolling2 .imageset .wg_img1 {
  width: 100%;
  height: 100%;
}

.scrolling2 .imageset .wg_img1 img,
.scrolling2 .imageset .wg_img1 picture {
  display: block;
  width: 100%;
  height: 100%;
}

.scrolling2 .imageset .wg_img1 img,
.scrolling2 .imageset .imageset-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 이미지 지그재그 배치 (6개 기준) */
.scrolling2 .imageset:nth-child(2) {
  margin-top: -8rem;
  margin-left: auto;
}

.scrolling2 .imageset:nth-child(3) {
  margin-top: 10rem;
  margin-left: 30.8rem;
}

.scrolling2 .imageset:nth-child(4) {
  margin-top: 10rem;
  margin-left: auto;
}

.scrolling2 .imageset:nth-child(5) {
  margin-top: -9rem;
}

.scrolling2 .imageset:nth-child(6) {
  margin-top: 11rem;
  margin-left: 30.8rem;
}

/* 7개 이상일 경우 반복 패턴 */
.scrolling2 .imageset:nth-child(6n+7) {
  margin-top: 10rem;
  margin-left: auto;
}

.scrolling2 .imageset:nth-child(6n+8) {
  margin-top: -8rem;
}

.scrolling2 .imageset:nth-child(6n+9) {
  margin-top: 10rem;
  margin-left: 30.8rem;
}

.scrolling2 .imageset:nth-child(6n+10) {
  margin-top: 10rem;
}

.scrolling2 .imageset:nth-child(6n+11) {
  margin-top: -9rem;
  margin-left: auto;
}

.scrolling2 .imageset:nth-child(6n+12) {
  margin-top: 11rem;
  margin-left: 30.8rem;
}

/* === 모달 === */
.scrolling2-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2147483000; /* 헤더(보통 999~9999)보다 확실히 위 */
}

.scrolling2-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.scrolling2-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.scrolling2-modal-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 1.2rem;
  max-width: 80rem;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  animation: scrolling2_modalIn 0.3s ease;
}

@keyframes scrolling2_modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scrolling2-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4rem;
  height: 6.4rem;
  border-bottom: 1px solid #e5e5e5;
}

.scrolling2-modal-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #222;
  margin: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scrolling2-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  border-radius: 0.6rem;
  transition: background 0.2s;
  flex-shrink: 0;
  margin-left: 1.2rem;
}

.scrolling2-modal-close:hover {
  background: #f2f2f2;
}

.scrolling2-modal-body {
  padding: 3.6rem 4rem 4rem;
  max-height: 80rem;
  overflow-y: auto;
}

.scrolling2-modal-body::-webkit-scrollbar {
  width: 4px;
}

.scrolling2-modal-body::-webkit-scrollbar-track {
  background: #e5e5e5;
}

.scrolling2-modal-body::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 10rem;
}

.scrolling2-modal-body .wg_img2 img {
  width: 100%;
  height: auto;
  display: block;
}

.scrolling2-modal-bottom {
  margin-top: 2.4rem;
  padding-top: 2.4rem;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.6rem;
}

.scrolling2-modal-desc {
  flex: 1 1 0;
  min-width: 0;
  font-size: 1.5rem;
  line-height: 1.7;
  color: #555;
}

/* 모달 우측 하단 "포트폴리오 바로가기" 버튼 */
.scrolling2-modal-link-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 1.2rem 2rem;
  background-color: var(--primary, #f0473e);
  color: #fff !important;
  border-radius: 10px;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
  margin-left: auto;
}
.scrolling2-modal-link-btn:hover,
.scrolling2-modal-link-btn:focus,
.scrolling2-modal-link-btn:visited,
.scrolling2-modal-link-btn:active {
  opacity: 0.92;
  transform: translateY(-1px);
  color: #fff !important;
}
.scrolling2-modal-link-btn span,
.scrolling2-modal-link-btn .uil,
.scrolling2-modal-link-btn i {
  color: #fff !important;
}
.scrolling2-modal-link-btn .uil {
  font-size: 1.1em;
  line-height: 1;
}


/* ========== 반응형 992px ========== */
@media (max-width: 992px) {
  .scrolling2 {
    padding-top: 5rem;
    padding-bottom: 9rem;
  }

  .scrolling2 .imageset {
    width: 24rem;
    height: 16.7rem;
    border-radius: 1rem;
  }

  .scrolling2 .imageset-plus {
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
  }

  .scrolling2 .imageset-plus svg {
    width: 18px;
    height: 18px;
  }

  .scrolling2 .imageset-more-btn {
    top: 1rem;
    right: 1rem;
    padding: 0.7rem 1.2rem;
    font-size: 1.2rem;
    gap: 4px;
  }

  .scrolling2 .imageset-caption {
    padding: 2rem 1.4rem 1.2rem;
    font-size: 1.3rem;
  }

  .scrolling2 .textset .textset-btn,
  .scrolling2 .textset .hymore_wrap {
    margin-top: 1.4rem;
  }

  .scrolling2 .textset .textset-btn {
    padding: 0.8rem 2.2rem;
    font-size: 1.3rem;
  }

  /* 모바일: 좌우 번갈아 배치 */
  .scrolling2 .group-content .imageset {
    margin-left: 0;
    margin-top: 0;
  }

  .scrolling2 .group-content .imageset:nth-child(even) {
    margin-left: auto;
  }

  .scrolling2 .group-content .imageset + .imageset {
    margin-top: 5rem;
  }

  /* 7개 이상 패턴 리셋 */
  .scrolling2 .group-content .imageset:nth-child(6n+7),
  .scrolling2 .group-content .imageset:nth-child(6n+8),
  .scrolling2 .group-content .imageset:nth-child(6n+9),
  .scrolling2 .group-content .imageset:nth-child(6n+10),
  .scrolling2 .group-content .imageset:nth-child(6n+11),
  .scrolling2 .group-content .imageset:nth-child(6n+12) {
    margin-left: 0;
    margin-top: 0;
  }

  .scrolling2 .group-content .imageset:nth-child(6n+7):nth-child(even),
  .scrolling2 .group-content .imageset:nth-child(6n+8):nth-child(even),
  .scrolling2 .group-content .imageset:nth-child(6n+9):nth-child(even),
  .scrolling2 .group-content .imageset:nth-child(6n+10):nth-child(even),
  .scrolling2 .group-content .imageset:nth-child(6n+11):nth-child(even),
  .scrolling2 .group-content .imageset:nth-child(6n+12):nth-child(even) {
    margin-left: auto;
  }

  .scrolling2 .group-content .imageset:nth-child(6n+7) + .imageset,
  .scrolling2 .group-content .imageset:nth-child(6n+8) + .imageset,
  .scrolling2 .group-content .imageset:nth-child(6n+9) + .imageset,
  .scrolling2 .group-content .imageset:nth-child(6n+10) + .imageset,
  .scrolling2 .group-content .imageset:nth-child(6n+11) + .imageset,
  .scrolling2 .group-content .imageset:nth-child(6n+12) + .imageset {
    margin-top: 5rem;
  }

  /* 모달 모바일 */
  .scrolling2-modal-header {
    padding: 0 2rem;
    height: 5.2rem;
  }

  .scrolling2-modal-title {
    font-size: 1.5rem;
  }

  .scrolling2-modal-body {
    padding: 2.8rem 2rem 2.8rem;
    max-height: 60vh;
  }

  .scrolling2-modal-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 1.2rem;
  }

  .scrolling2-modal-link-btn {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .scrolling2-modal-desc {
    font-size: 1.4rem;
  }
}
