/**
 * Before & After — Full Archive (106 cases)
 * /before-after 페이지 [data-ba-archive] 컨테이너 전용 스타일.
 * 다른 페이지에는 영향 없음 (.ba-archive 스코프).
 *
 * 구성:
 *  - .ba-archive            루트 컨테이너
 *  - .ba-header             eyebrow / heading / sub
 *  - .ba-filters            카테고리 chip 가로 스크롤
 *  - .ba-chip               필터 chip (label + count)
 *  - .ba-grid               case 카드 grid (PC 4-col / tablet 3-col / mobile 2-col)
 *  - .ba-card               각 카드 (이미지 + meta)
 *  - .ba-lightbox           모달 lightbox (이미지 + prev/next/close)
 */

.section--ba-archive {
  padding: 80px 0 120px;
  background: #fafaf7;
  /* JS 가 cases.json fetch 후 [data-ba-archive] innerHTML 을 교체하는 동안
     섹션이 붕괴→재확장하며 발생하던 CLS(0.33) 방지 — 섹션 자체에 공간 예약. */
  min-height: 100vh;
}
.section--ba-archive .inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.ba-archive {
  width: 100%;
  /* 그리드는 JS 가 cases.json fetch 후 innerHTML 로 채운다(0→약 1만px).
     로딩 전 공간을 예약해 푸터가 위로 당겨졌다 밀리는 CLS(0.33) 방지.
     채워지면 실제 높이가 더 커서 무해. */
  min-height: 100vh;
}

/* Header */
.ba-archive .ba-header {
  text-align: center;
  margin-bottom: 40px;
}
.ba-archive .ba-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8a7c5e;
  margin: 0 0 14px;
  font-weight: 600;
}
.ba-archive .ba-eyebrow__line {
  display: block;
  width: 28px;
  height: 1px;
  background: #c8b99c;
}
.ba-archive .ba-heading {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #1a1a1a;
  margin: 0 0 12px;
  line-height: 1.15;
}
.ba-archive .ba-sub {
  font-size: 15px;
  color: #6a6a6a;
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}
.ba-archive .ba-notice {
  margin: 36px auto 0;
  max-width: 720px;
  font-size: 12px;
  color: #999;
  text-align: center;
  line-height: 1.6;
  letter-spacing: -0.2px;
}

/* Filters */
.ba-archive .ba-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 auto 36px;
  max-width: 1100px;
}
.ba-archive .ba-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e3ddd3;
  color: #5a5040;
  padding: 9px 16px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: -0.2px;
  font-weight: 500;
  white-space: nowrap;
}
.ba-archive .ba-chip:hover {
  background: #f3eee3;
  border-color: #c8b99c;
  color: #3a3225;
}
.ba-archive .ba-chip.is-active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}
.ba-archive .ba-chip__count {
  font-size: 11px;
  background: rgba(0,0,0,0.06);
  color: inherit;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ba-archive .ba-chip.is-active .ba-chip__count {
  background: rgba(255,255,255,0.18);
}

/* Loading / error */
.ba-archive__loading {
  text-align: center;
  padding: 60px 0;
  color: #999;
  font-size: 14px;
}
.ba-archive .ba-error {
  text-align: center;
  padding: 60px 0;
  color: #c0392b;
  font-size: 14px;
}

/* Grid */
.ba-archive .ba-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) {
  .ba-archive .ba-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (max-width: 720px) {
  .ba-archive .ba-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .section--ba-archive { padding: 50px 0 80px; }
  .section--ba-archive .inner { padding: 0 14px; }
  .ba-archive .ba-header { margin-bottom: 24px; }
  .ba-archive .ba-filters { margin-bottom: 22px; gap: 6px; }
  .ba-archive .ba-chip { padding: 7px 12px; font-size: 12px; }
}

.ba-archive .ba-card {
  list-style: none;
  margin: 0;
}
.ba-archive .ba-card__btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.ba-archive .ba-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #ece8de;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.ba-archive .ba-card__btn:hover .ba-card__img-wrap {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.ba-archive .ba-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.ba-archive .ba-card__btn:hover .ba-card__img {
  transform: scale(1.04);
}
.ba-archive .ba-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding: 0 4px;
}
.ba-archive .ba-card__num {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a7c5e;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ba-archive .ba-card__cat {
  font-size: 14px;
  color: #1a1a1a;
  letter-spacing: -0.2px;
  font-weight: 500;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .ba-archive .ba-card__num { font-size: 10px; }
  .ba-archive .ba-card__cat { font-size: 12px; }
  .ba-archive .ba-card__meta { margin-top: 8px; padding: 0 2px; }
}
.ba-archive .ba-empty {
  list-style: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: #999;
  font-size: 14px;
}

/* Lightbox */
body.ba-lightbox-lock { overflow: hidden; }
.ba-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
}
.ba-lightbox.is-open {
  display: flex;
  animation: ba-fadein 0.18s ease both;
}
@keyframes ba-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.ba-lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.86);
  cursor: zoom-out;
}
.ba-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1100px);
  max-height: 94vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ba-lightbox__figure {
  margin: 0;
  width: 100%;
  text-align: center;
}
.ba-lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #fff;
  border-radius: 4px;
}
.ba-lightbox__caption {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
}
.ba-lightbox__cat {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.2px;
}
.ba-lightbox__num {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c8b99c;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ba-lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  padding: 0;
  font-family: inherit;
}
.ba-lightbox__close:hover { color: #c8b99c; }
.ba-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  padding: 0;
  padding-bottom: 4px;
  transition: background 0.18s ease;
}
.ba-lightbox__nav:hover {
  background: rgba(255,255,255,0.18);
}
.ba-lightbox__nav--prev { left: -68px; }
.ba-lightbox__nav--next { right: -68px; }
@media (max-width: 1200px) {
  .ba-lightbox__nav--prev { left: 8px; }
  .ba-lightbox__nav--next { right: 8px; }
  .ba-lightbox__close { top: 8px; right: 8px; background: rgba(0,0,0,0.5); border-radius: 50%; }
}
@media (max-width: 640px) {
  .ba-lightbox__panel { width: 100vw; }
  .ba-lightbox__img { max-height: 70vh; border-radius: 0; }
  .ba-lightbox__nav { width: 40px; height: 40px; font-size: 22px; }
  .ba-lightbox__caption { font-size: 14px; padding: 0 12px; }
}
