/* ============================================================
   Section 5 — Editorial Curated Cases (Before & After)
   비대칭 모자이크 + 큐레이션된 5장 + staggered reveal
   ============================================================ */

/* 원본 section5 inner 컨텐츠를 JS 로 통째 교체했으므로 원본 height 제약 풀기 */
.section_main.section5 {
  height: auto !important;
  min-height: 0 !important;
  background: #f6f5f0 !important;
  padding: 96px 0 120px !important;
  overflow: visible !important;
  position: relative;
}

.section_main.section5 .s5-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 5%;
  box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────── */

.section_main.section5 .s5-header {
  text-align: center;
  margin-bottom: 64px;
}

.section_main.section5 .s5-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  font-family: 'Pretendard Variable', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: #aa8e7d;
  text-transform: uppercase;
}

.section_main.section5 .s5-eyebrow__line {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: #aa8e7d;
  opacity: 0.6;
}

.section_main.section5 .s5-heading {
  margin: 0 0 14px;
  font-family: 'Cormorant Infant', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #2a2521;
}

.section_main.section5 .s5-heading em {
  font-style: italic;
  color: #aa8e7d;
  font-weight: 400;
}

.section_main.section5 .s5-sub {
  margin: 0;
  font-family: 'Pretendard Variable', sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: #5d5247;
  letter-spacing: -0.005em;
}

/* ── Mosaic — 비대칭 3x3 그리드 ─────────────────────────── */

.section_main.section5 .s5-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0 0 56px;
  padding: 0;
}

.section_main.section5 .s5-case {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Case 1 — large featured (col 1-2, row 1-2) */
.section_main.section5 .s5-case--featured {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
}

/* Case 2 — col 3, row 1 */
.section_main.section5 .s5-case:nth-child(2) { grid-column: 3; grid-row: 1; }
/* Case 3 — col 3, row 2 */
.section_main.section5 .s5-case:nth-child(3) { grid-column: 3; grid-row: 2; }
/* Case 4 — col 1, row 3 */
.section_main.section5 .s5-case:nth-child(4) { grid-column: 1; grid-row: 3; }
/* Case 5 — wide bottom right (col 2-3, row 3) */
.section_main.section5 .s5-case--wide {
  grid-column: 2 / 4;
  grid-row: 3;
}

@media (max-width: 980px) {
  .section_main.section5 .s5-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, minmax(180px, 1fr));
    gap: 10px;
  }
  .section_main.section5 .s5-case--featured {
    grid-column: 1 / 3;
    grid-row: 1;
  }
  .section_main.section5 .s5-case:nth-child(2) { grid-column: 1; grid-row: 2; }
  .section_main.section5 .s5-case:nth-child(3) { grid-column: 2; grid-row: 2; }
  .section_main.section5 .s5-case:nth-child(4) { grid-column: 1; grid-row: 3; }
  .section_main.section5 .s5-case--wide {
    grid-column: 2; grid-row: 3;
  }
}

/* ── Case card link ─────────────────────────────────────── */

.section_main.section5 .s5-case__link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.section_main.section5 .s5-case__link:hover {
  transform: translateY(-4px);
}

/* 이미지 */
.section_main.section5 .s5-case__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.section_main.section5 .s5-case__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
  /* 살짝 데사츄레이션 — 톤 일관성 */
  filter: saturate(0.92);
}

.section_main.section5 .s5-case__link:hover .s5-case__img img {
  transform: scale(1.06);
  filter: saturate(1);
}

/* 그라데이션 overlay */
.section_main.section5 .s5-case__link::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%),
    linear-gradient(110deg, rgba(0,0,0,0) 65%, rgba(0,0,0,0.18) 100%);
  z-index: 2;
  pointer-events: none;
  transition: background 0.4s ease;
}

.section_main.section5 .s5-case__link:hover::after {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.10) 25%, rgba(0,0,0,0.65) 100%),
    linear-gradient(110deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.22) 100%);
}

/* 메타 정보 */
.section_main.section5 .s5-case__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 24px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.section_main.section5 .s5-case__num {
  font-family: 'Cormorant Infant', serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.75);
}

.section_main.section5 .s5-case__cat {
  font-family: 'Pretendard Variable', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.section_main.section5 .s5-case__label {
  font-family: 'Cormorant Infant', serif;
  font-style: italic;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.015em;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Featured 케이스만 메타 살짝 크게 */
.section_main.section5 .s5-case--featured .s5-case__meta {
  padding: 28px 32px;
}

.section_main.section5 .s5-case--featured .s5-case__cat {
  font-size: 26px;
}

.section_main.section5 .s5-case--featured .s5-case__label {
  font-size: 16px;
}

.section_main.section5 .s5-case--featured .s5-case__num {
  font-size: 15px;
}

@media (max-width: 980px) {
  .section_main.section5 .s5-case__meta {
    padding: 16px 18px;
    gap: 2px;
  }
  .section_main.section5 .s5-case__cat,
  .section_main.section5 .s5-case--featured .s5-case__cat {
    font-size: 16px;
  }
  .section_main.section5 .s5-case__label,
  .section_main.section5 .s5-case--featured .s5-case__label {
    font-size: 12px;
  }
  .section_main.section5 .s5-case__num,
  .section_main.section5 .s5-case--featured .s5-case__num {
    font-size: 11px;
  }
}

/* ── CTA ────────────────────────────────────────────────── */

.section_main.section5 .s5-cta {
  text-align: center;
}

.section_main.section5 .s5-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 36px;
  background: #2a2521;
  color: #ffffff !important;
  font-family: 'Pretendard Variable', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none !important;
  border: 1px solid #2a2521;
  border-radius: 999px;
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.section_main.section5 .s5-cta__link:hover {
  background: #aa8e7d;
  border-color: #aa8e7d;
  transform: translateY(-2px);
}

.section_main.section5 .s5-cta__arrow {
  font-size: 15px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.section_main.section5 .s5-cta__link:hover .s5-cta__arrow {
  transform: translateX(4px);
}

.section_main.section5 .s5-cta__note {
  margin: 14px 0 0;
  font-family: 'Pretendard Variable', sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: #8d7e6e;
  letter-spacing: 0.01em;
}

/* ── Staggered reveal 인터랙션 ──────────────────────────── */

.section_main.section5 .s5-header,
.section_main.section5 .s5-case,
.section_main.section5 .s5-cta {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.section_main.section5.s5-in-view .s5-header {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.section_main.section5.s5-in-view .s5-case:nth-child(1) { transition-delay: 0.15s; }
.section_main.section5.s5-in-view .s5-case:nth-child(2) { transition-delay: 0.25s; }
.section_main.section5.s5-in-view .s5-case:nth-child(3) { transition-delay: 0.32s; }
.section_main.section5.s5-in-view .s5-case:nth-child(4) { transition-delay: 0.40s; }
.section_main.section5.s5-in-view .s5-case:nth-child(5) { transition-delay: 0.48s; }

.section_main.section5.s5-in-view .s5-case {
  opacity: 1;
  transform: translateY(0);
}

.section_main.section5.s5-in-view .s5-cta {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.62s;
}
