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

:root {
  --bg: #FAFAF8;
  --ink: #111111;
  --mid: #6B6B6B;
  --light: #C8C8C4;
  --blue: #3872F0;
  --border: #E2E2DE;
  --dummy: #1A1A1A;   /* 더미 카드 통일 배경 */
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ── 헤더 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.02em;
}

.header-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light);
}

.header-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 8px 20px;
  border: 1.5px solid var(--ink);
  border-radius: 100px;
  transition: background 0.2s, color 0.2s;
}
.header-cta:hover { background: var(--ink); color: var(--bg); }

/* ── 히어로 ── */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 48px 52px;
  border-bottom: 1px solid var(--border);
}

.hero-top {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.hero-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light);
}

.hero-title {
  display: flex;
  flex-direction: column;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.title-line { display: block; }
.title-accent { color: var(--mid); font-style: italic; }

.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.hero-desc {
  font-size: 13px;
  font-weight: 400;
  color: var(--light);
  line-height: 1.7;
  max-width: 340px;
}

.btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 100px;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}
.btn-apply:hover { background: var(--blue); }
.btn-arrow { font-size: 15px; font-family: 'DM Sans', sans-serif; }

/* ── 필터 바 ── */
.filter-bar {
  position: sticky;
  top: 60px;
  z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.filter-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.filter-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--light);
  flex-shrink: 0;
}

.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.filter-pills::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--mid);
  transition: all 0.15s;
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.filter-count {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--light);
  flex-shrink: 0;
  margin-left: auto;
}

/* ── 갤러리 ── */
.gallery {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 48px 100px;
}

/* 기본 그리드: 3열 균등 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* 피처드 레이아웃 (전체 5개일 때) */
.gallery-grid.featured {
  grid-template-columns: 1.6fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.gallery-grid.featured .card-featured {
  grid-row: 1 / 3;
}

/* ── 카드 ── */
.card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 6px;
  background: var(--dummy);
}

/* 피처드 카드 최소 높이 */
.gallery-grid.featured .card-featured .card-image {
  aspect-ratio: unset;
  position: absolute;
  inset: 0;
}
.gallery-grid.featured .card-featured {
  min-height: 560px;
}

.card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--dummy);
}

/* 실제 이미지 */
.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  z-index: 1;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.card:hover .card-img { transform: scale(1.04); }

/* 더미 텍스트 (이미지 없을 때) */
.card-dummy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 24px;
  z-index: 0;
}

.dummy-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.2);
}

.dummy-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.18);
}

/* hover 오버레이 */
.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  gap: 12px;
}

.card:hover .card-overlay { opacity: 1; }

.overlay-info { display: flex; flex-direction: column; gap: 4px; }

.overlay-hospital {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.overlay-pos {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
}

.overlay-view {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.card:hover .overlay-view { color: #fff; }

/* ── 하단 CTA ── */
.bottom-cta {
  border-top: 1px solid var(--border);
  background: var(--ink);
  padding: 68px 48px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.cta-sub {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
}

.cta-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(22px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--bg);
  text-align: center;
}

.cta-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cta-price {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--blue);
}

.cta-original {
  font-size: 12px;
  color: #444;
  text-decoration: line-through;
}

.cta-btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 36px;
  border-radius: 100px;
  transition: opacity 0.2s;
  margin-top: 4px;
}
.cta-btn:hover { opacity: 0.88; }

.cta-meta {
  display: flex;
  gap: 24px;
  font-size: 11px;
  color: #444;
  letter-spacing: 0.04em;
}

/* ── 라이트박스 ── */
.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 8, 8, 0.94);
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
}
.lb-overlay.open { display: flex; }

.lb-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-height: 90vh;
}

.lb-media {
  position: relative;
  flex-shrink: 0;
}

.lb-img {
  max-height: 76vh;
  max-width: min(480px, 76vw);
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

/* 라이트박스 더미 */
.lb-dummy {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  width: min(340px, 72vw);
  height: 70vh;
  border-radius: 4px;
  background: var(--dummy);
  padding: 28px;
  gap: 6px;
}

.lb-dummy-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  margin-bottom: auto;
  margin-top: 4px;
}

.lb-dummy-hospital {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
}

.lb-dummy-pos {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}

/* 라이트박스 하단 정보 */
.lb-info {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: min(480px, 76vw);
}

.lb-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
  border: 1px solid #333;
  border-radius: 100px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.lb-hospital {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.lb-position {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

.lb-cta {
  margin-left: auto;
  flex-shrink: 0;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 100px;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.lb-cta:hover { opacity: 0.85; }

/* 닫기 */
.lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.15s;
  padding: 8px;
}
.lb-close:hover { opacity: 1; }

/* 화살표 */
.lb-nav {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lb-nav:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.35);
  color: #fff;
}

/* ── 반응형 ── */
@media (max-width: 1024px) {
  .header-inner, .hero, .filter-inner, .gallery { padding-left: 32px; padding-right: 32px; }
}

@media (max-width: 860px) {
  .gallery-grid, .gallery-grid.featured {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: unset;
  }
  .gallery-grid.featured .card-featured {
    grid-row: unset;
    grid-column: 1 / 3;
    min-height: 320px;
  }
  .gallery-grid.featured .card-featured .card-image {
    aspect-ratio: 16 / 9;
    position: relative;
    inset: unset;
  }
  .hero-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .header-inner, .hero, .filter-inner, .gallery { padding-left: 20px; padding-right: 20px; }
  .header-label { display: none; }
  .gallery-grid, .gallery-grid.featured { grid-template-columns: 1fr; }
  .gallery-grid.featured .card-featured { grid-column: 1; min-height: unset; }
  .gallery-grid.featured .card-featured .card-image { aspect-ratio: 3 / 4; position: relative; inset: unset; }
  .filter-inner { gap: 12px; }
  .filter-count { display: none; }
  .bottom-cta { padding: 60px 24px 48px; }
  .lb-nav { display: none; }
}
