/* ===================================================
   포트폴리오 에디토리얼 & 룩북 스타일시트
   - 통일된 단일 폰트: Pretendard
   - 눈이 편안한 소프트 뉴트럴 웜그레이 톤
   - 딱딱하지 않은 부드러운 곡률(Round Outline)과 은은한 소프트 섀도우
   - 텍스트 가독성 극대화 및 이미지와의 조화로운 2분할 배치
=================================================== */

/* 1. 디자인 토큰 및 리셋 */
:root {
  /* 배경 & 서페이스 톤 (따뜻하고 감성적인 매거진 룩북 컬러) */
  --bg-page: #eeede8;
  --surface-card: #fbfbf9;
  --surface-image-stage: #f2f1ec;
  --surface-tag: #e4e3dd;

  /* 텍스트 컬러 (가독성을 위한 소프트 차콜 & 웜 그레이) */
  --text-primary: #212326;
  --text-secondary: #585c63;
  --text-muted: #8b8f97;

  /* 악센트 & 하이라이트 */
  --accent-color: #2c2f35;
  --accent-soft: rgba(44, 47, 53, 0.08);
  --border-subtle: rgba(33, 35, 38, 0.09);
  --border-card: rgba(33, 35, 38, 0.06);

  /* 부드러운 아웃라인 (딱딱하지 않은 곡률) */
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  /* 자연스러운 앰비언트 섀도우 */
  --shadow-card: 0 18px 45px rgba(28, 30, 33, 0.06), 0 2px 10px rgba(28, 30, 33, 0.02);
  --shadow-hover: 0 22px 50px rgba(28, 30, 33, 0.1), 0 4px 14px rgba(28, 30, 33, 0.04);
  --shadow-img: 0 8px 24px rgba(0, 0, 0, 0.07);

  /* 트랜지션 */
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 통일된 단일 폰트 적용 (Pretendard) */
body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 2. 상단 헤더 */
.header {
  width: 100%;
  padding: 1.5rem 2.5rem;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
}

.brand-logo {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.brand-logo:hover {
  opacity: 0.7;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}

.meta-dot {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* 3. 메인 컨테이너 */
.main-wrapper {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2.5rem 3.5rem;
}

.editorial-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* 4. 메인 쇼케이스 카드 (2분할 에디토리얼 룩) */
.showcase-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 42% 58%;
  overflow: hidden;
  min-height: 580px;
}

/* 좌측 텍스트 패널 */
.text-panel {
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border-card);
}

.text-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.category-badge {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  background: var(--surface-tag);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.project-id {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.project-title {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  letter-spacing: -0.5px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 메타 정보 (연도, 역할) */
.meta-info-grid {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.meta-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.divider-line {
  height: 1px;
  background: var(--border-subtle);
  margin-bottom: 1.75rem;
  width: 100%;
}

/* 프로젝트 본문 설명 (가독성 최적화) */
.project-description {
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.2px;
  transition: opacity 0.3s ease;
}

/* 슬라이더 컨트롤러 (카운터 & 부드러운 원형 화살표) */
.slider-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.counter-box {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  font-weight: 600;
}

.current-num {
  font-size: 1.35rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.sep {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 2px;
}

.total-num {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.arrow-buttons {
  display: flex;
  gap: 0.6rem;
}

.nav-arrow {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.nav-arrow:hover {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
  transform: translateY(-2px);
}

.nav-arrow:active {
  transform: translateY(0);
}

/* 프로그레스 바 & 자동재생 */
.progress-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  gap: 1rem;
}

.progress-bar-bg {
  flex: 1;
  height: 3px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 33.33%;
  background: var(--text-primary);
  border-radius: var(--radius-pill);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.autoplay-toggle {
  background: none;
  border: none;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0;
  transition: color 0.2s ease;
}

.autoplay-toggle:hover {
  color: var(--text-primary);
}

/* 우측 비주얼 패널 (이미지 캔버스) */
.visual-panel {
  background: var(--surface-image-stage);
  padding: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.image-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 440px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-img);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.image-stage:active {
  cursor: grabbing;
}

.image-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.image-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  user-select: none;
}

.image-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: transform 0.4s ease;
  cursor: zoom-in;
}

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

/* 클릭하여 확대 뱃지 */
.zoom-badge {
  position: absolute;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: var(--transition-fast);
}

.zoom-badge:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* 5. 하단 룩북 인덱스 그리드 (첨부 사진의 매거진 아카이브 스타일) */
.gallery-index-section {
  padding-top: 1rem;
}

.section-title-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.85rem;
}

.section-heading {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--text-primary);
}

.section-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}

.index-card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.index-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(33, 35, 38, 0.18);
}

.index-card.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1.5px var(--text-primary), var(--shadow-hover);
}

.index-thumb-frame {
  width: 100%;
  aspect-ratio: 16 / 11;
  background: #ffffff;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-card);
}

.index-thumb-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.4s ease;
}

.index-card:hover .index-thumb-frame img {
  transform: scale(1.04);
}

.index-card-info {
  padding: 1.25rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.index-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.index-card-cat {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.index-card-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* 6. 라이트박스 모달 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 32, 36, 0.75);
  backdrop-filter: blur(8px);
}

.lightbox-modal {
  position: relative;
  z-index: 1001;
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lightbox-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  z-index: 10;
}

.lightbox-close-btn:hover {
  background: rgba(0, 0, 0, 0.12);
}

.lightbox-body {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 90vh;
  overflow-y: auto;
}

.lightbox-img {
  max-width: 82vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-img);
}

.lightbox-meta {
  margin-top: 1.5rem;
  text-align: center;
}

.lightbox-meta h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.lightbox-meta p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* 7. 푸터 */
.footer {
  margin-top: auto;
  padding: 2rem 2.5rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.5px;
}

/* 8. 반응형 레이아웃 (태블릿 & 모바일 대응) */
@media (max-width: 980px) {
  .showcase-card {
    grid-template-columns: 1fr;
  }

  .text-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-card);
    padding: 2.5rem 2rem;
  }

  .visual-panel {
    padding: 2rem;
    min-height: 380px;
  }

  .index-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .header {
    padding: 1.25rem 1.25rem;
  }

  .main-wrapper {
    padding: 0.5rem 1.25rem 2.5rem;
  }

  .text-panel {
    padding: 2rem 1.5rem;
  }

  .project-title {
    font-size: 1.65rem;
  }

  .project-description {
    font-size: 0.94rem;
  }

  .visual-panel {
    padding: 1.25rem;
    min-height: 280px;
  }

  .index-grid {
    grid-template-columns: 1fr;
  }

  .header-meta {
    display: none;
  }
}
