/* ============================================
   SOMAKO HERO v5 — Campaign Showcase
   ============================================ */

/* Variables (inherit from theme or define locally) */
.hero {
  --smk-red: #d32f2f;
  --smk-red-dark: #b71c1c;
  --smk-red-light: #ffebee;
  --smk-red-10: rgba(211,47,47,0.10);
  --smk-red-20: rgba(211,47,47,0.18);
  --smk-dark: #09090b;
  --smk-gray-900: #18181b;
  --smk-gray-800: #27272a;
  --smk-gray-700: #3f3f46;
  --smk-gray-600: #52525b;
  --smk-gray-400: #a1a1aa;
  --smk-gray-300: #d4d4d8;
  --smk-gray-200: #e4e4e7;
  --smk-gray-100: #f4f4f5;
  --smk-white: #ffffff;
  --font-kr: 'Noto Sans KR', -apple-system, sans-serif;
  --font-en: 'DM Sans', sans-serif;
  --max-w: 1200px;
}

/* HERO WRAPPER */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 2rem 0;
}

.hero-stage {
  position: relative;
  background: var(--smk-dark);
  border-radius: 16px;
  overflow: hidden;
  height: 480px;
}

/* SLIDE */
.hero-slide {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  will-change: opacity;
}
.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* ---- LEFT: TEXT ---- */
.hero-text {
  padding: 3.25rem 2.5rem 3.25rem 3.5rem;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 2;
}

/* Text entrance animations */
.hero-slide .anim-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.hero-slide.active .anim-item {
  opacity: 1;
  transform: translateY(0);
}
.hero-slide.active .anim-item:nth-child(1) { transition-delay: 0.1s; }
.hero-slide.active .anim-item:nth-child(2) { transition-delay: 0.2s; }
.hero-slide.active .anim-item:nth-child(3) { transition-delay: 0.35s; }
.hero-slide.active .anim-item:nth-child(4) { transition-delay: 0.5s; }

.hero-tags {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.hero-tag-category {
  font-family: var(--font-en);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--smk-red);
  background: var(--smk-red-20);
  padding: 0.25rem 0.625rem; border-radius: 4px;
}
.hero-tag-brand {
  font-size: 0.8125rem; font-weight: 500;
  color: var(--smk-gray-400);
  background: var(--smk-gray-800);
  padding: 0.25rem 0.625rem; border-radius: 4px;
  display: flex; align-items: center; gap: 0.3125rem;
}
.hero-tag-brand .brand-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--smk-red); flex-shrink: 0;
}

.hero-title {
  font-size: 2rem; font-weight: 900;
  line-height: 1.35; color: var(--smk-white);
  word-break: keep-all; margin-bottom: 0.75rem;
  letter-spacing: -0.03em; max-width: 420px;
}

.hero-excerpt {
  font-size: 0.9375rem; line-height: 1.65;
  color: var(--smk-gray-400);
  max-width: 380px; margin-bottom: 1.75rem; word-break: keep-all;
}

.hero-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8125rem; font-weight: 700;
  color: var(--smk-white); background: var(--smk-red);
  padding: 0.625rem 1.25rem; border-radius: 6px;
  text-decoration: none; transition: all 0.2s; align-self: flex-start;
}
.hero-cta:hover { background: var(--smk-red-dark); color: var(--smk-white); }
.hero-cta svg { transition: transform 0.2s; }
.hero-cta:hover svg { transform: translateX(3px); }

/* ---- RIGHT: VISUAL ---- */
.hero-visual {
  position: relative; overflow: hidden;
}
.hero-visual-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(211,47,47,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(211,47,47,0.06) 0%, transparent 45%);
}

/* Image container (wrapper for mobile overlay) */
.hero-img-container {
  position: absolute;
  inset: 0;
}

/* Mobile-only elements: hidden on PC */
.hero-stats-overlay { display: none; }
.hero-mobile-bottom { display: none; }
.hero-mob-stat { display: none; }
.hero-mob-verdict { display: none; }

/* Campaign image — 4:3 비율 */
.hero-campaign-img {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 65%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  border: 1px solid var(--smk-gray-700);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  /* Fallback for no-image */
  background-color: var(--smk-gray-800);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--smk-gray-600);
  font-family: var(--font-en); font-weight: 500;
  letter-spacing: 0.05em;
}
.hero-slide.active .hero-campaign-img {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0.15s;
}

/* FLOATING CARDS */
.float-card {
  position: absolute; z-index: 3;
  border-radius: 10px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(24px) scale(0.92);
  transition: opacity 0.45s ease, transform 0.45s ease;
  will-change: transform, opacity;
}

/* Active: staggered entrance then float */
.hero-slide.active .float-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: heroFloatGentle 4.5s ease-in-out infinite;
}
.hero-slide.active .fc-1 { transition-delay: 0.35s; animation-delay: 0s; }
.hero-slide.active .fc-2 { transition-delay: 0.5s; animation-delay: 0.6s; }
.hero-slide.active .fc-3 { transition-delay: 0.65s; animation-delay: 1.2s; }
.hero-slide.active .fc-4 { transition-delay: 0.8s; animation-delay: 0.3s; }
.hero-slide.active .fc-5 { transition-delay: 0.95s; animation-delay: 0.9s; }

@keyframes heroFloatGentle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1); }
}

/* Stat card */
.float-stat {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  padding: 0.875rem 1.125rem;
  min-width: 115px; text-align: center;
}
.float-stat-num {
  font-family: var(--font-en);
  font-size: 1.75rem; font-weight: 800;
  color: var(--smk-red); line-height: 1;
  margin-bottom: 0.25rem;
  overflow: hidden; height: 1.75rem;
  display: flex; align-items: flex-end; justify-content: center;
}
.float-stat-num .counter-wrap {
  display: inline-flex; flex-direction: column; align-items: center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.float-stat-label {
  font-size: 0.6875rem; font-weight: 500;
  color: var(--smk-gray-400);
}

/* Agency card */
.float-agency {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.625rem 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.float-agency-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--smk-gray-700);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-en);
  font-size: 0.5rem; font-weight: 800; color: var(--smk-gray-400);
}
.float-agency-text {
  font-size: 0.6875rem; color: var(--smk-gray-300); line-height: 1.3;
}
.float-agency-text strong {
  display: block; font-weight: 700;
  color: var(--smk-white); font-size: 0.75rem;
}

/* Verdict chip */
.float-verdict {
  background: var(--smk-red); border: none;
  padding: 0.5rem 1rem; color: white;
  font-size: 0.6875rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.375rem;
  box-shadow: 0 4px 20px rgba(211,47,47,0.3);
}

/* ---- Floating card positions per slide ---- */
/* Slide 1 */
.slide-1 .fc-1 { top: 2.25rem; right: 2.5rem; }
.slide-1 .fc-2 { top: 9rem; right: 15rem; }
.slide-1 .fc-3 { bottom: 6.5rem; right: 2rem; }
.slide-1 .fc-4 { bottom: 2.25rem; right: 12rem; }
.slide-1 .fc-5 { top: 2.5rem; left: 1.25rem; }

/* Slide 2 */
.slide-2 .fc-1 { top: 2rem; right: 2rem; }
.slide-2 .fc-2 { top: 2.5rem; right: 15rem; }
.slide-2 .fc-3 { bottom: 6rem; right: 2.5rem; }
.slide-2 .fc-4 { bottom: 2rem; right: 10rem; }
.slide-2 .fc-5 { top: 10rem; left: 1rem; }

/* Slide 3 */
.slide-3 .fc-1 { top: 2rem; right: 1.5rem; }
.slide-3 .fc-2 { top: 8.5rem; right: 14rem; }
.slide-3 .fc-3 { bottom: 6.5rem; right: 2rem; }
.slide-3 .fc-4 { bottom: 2rem; left: 1.5rem; }
.slide-3 .fc-5 { top: 2rem; left: 1rem; }

/* Glow pulse on stat numbers */
.hero-slide.active .float-stat-num {
  animation: heroGlowPulse 2.5s ease-in-out 1;
  animation-delay: 1.2s;
}
@keyframes heroGlowPulse {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 16px rgba(211,47,47,0.5); }
}

/* CONTROLS */
.hero-controls {
  position: absolute;
  bottom: 1.5rem; left: 3.5rem;
  z-index: 10;
  display: flex; align-items: center; gap: 1rem;
}
.hero-dots { display: flex; gap: 0.375rem; }
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.2);
  cursor: pointer; transition: all 0.3s; padding: 0;
}
.hero-dot.active {
  background: var(--smk-red);
  width: 28px; border-radius: 4px;
}
.hero-counter {
  font-family: var(--font-en);
  font-size: 0.6875rem; font-weight: 600;
  color: var(--smk-gray-600); letter-spacing: 0.05em;
}

/* Progress */
.hero-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: var(--smk-red);
  z-index: 10;
  transition: width 0.1s linear;
  border-radius: 0 2px 0 0;
}

/* ============================================
   RESPONSIVE — TABLET (769px ~ 1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-stage { height: 400px; }
  .hero-title { font-size: 1.625rem; }
  .hero-text { padding: 2.5rem 2rem 2.5rem 2.5rem; }
  .float-card { transform: scale(0.85) translateY(24px) !important; }
  .hero-slide.active .float-card { transform: scale(0.85) translateY(0) !important; }
  .hero-slide.active .float-card { animation: none; }
  .hero-campaign-img { width: 60%; }
}

/* ============================================
   RESPONSIVE — MOBILE (max-width: 768px)
   ============================================
   A안: 이미지 4:3 풀너비 + 수치 오버레이
   ┌──────────────────────────┐
   │  TEXT (tags/title/excerpt)│
   │                          │
   │  ┌─ 4:3 IMG 풀너비 ────┐ │
   │  │                      │ │
   │  │ [stat1][stat2][stat3]│ │  ← 하단 오버레이
   │  └──────────────────────┘ │
   │                          │
   │  [→ verdict]  [해부읽기→] │
   │                          │
   │     ● ● ●  01 / 03      │
   └──────────────────────────┘
   실행사 카드: 숨김 (상단 브랜드 태그에 포함)
   ============================================ */
@media (max-width: 768px) {
  .hero { padding: 0.75rem 1rem 0; }

  .hero-stage {
    height: auto;
    min-height: 0;
    border-radius: 12px;
  }

  /* 슬라이드: absolute → relative, display 토글 */
  .hero-slide {
    position: relative !important;
    inset: auto !important;
    display: none !important;
  }
  .hero-slide.active {
    display: block !important;
  }

  /* ---- TEXT ---- */
  .hero-text {
    padding: 1.75rem 1.25rem 1rem;
    display: flex; flex-direction: column; justify-content: center;
  }
  .hero-tags { margin-bottom: 0.75rem; }
  .hero-title {
    font-size: 1.375rem;
    max-width: 100%;
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }
  .hero-excerpt {
    font-size: 0.8125rem;
    max-width: 100%;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
  }

  /* CTA: 텍스트 영역에서 숨김 → 하단 .hero-mobile-bottom으로 이동 */
  .hero-text .hero-cta {
    display: none !important;
  }

  /* ---- VISUAL: 4:3 이미지 + 수치 오버레이 ---- */
  .hero-visual {
    position: relative;
    overflow: visible;
    min-height: 0;
    display: block !important;
    padding: 0 1.25rem;
  }
  .hero-visual-bg {
    display: none;
  }

  /* 이미지 컨테이너: absolute → relative로 전환 */
  .hero-img-container {
    position: relative;
    inset: auto;
    border-radius: 12px;
    overflow: hidden;
  }

  /* 캠페인 이미지: 4:3 풀너비 */
  .hero-campaign-img {
    position: relative !important;
    top: auto !important; left: auto !important;
    right: auto !important; bottom: auto !important;
    transform: none !important;
    width: 100%;
    aspect-ratio: 16 / 9;
    z-index: 1;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .hero-slide.active .hero-campaign-img {
    transform: none !important;
    opacity: 1;
  }

  /* -- PC용 플로팅 카드 전부 숨김 -- */
  .hero-visual .float-card {
    display: none !important;
  }

  /* -- 모바일 수치 오버레이: 이미지 하단 -- */
  .hero-stats-overlay {
    display: flex !important;
    position: absolute;
    bottom: 0.75rem; left: 0.75rem; right: 0.75rem;
    z-index: 3;
    gap: 0.5rem; flex-wrap: wrap;
  }
  .hero-mob-stat {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.0625rem;
    background: rgba(9,9,11,0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    padding: 0.4rem 0.625rem;
  }
  .hero-mob-stat-num {
    font-family: var(--font-en);
    font-size: 1rem; font-weight: 800;
    color: var(--smk-red); line-height: 1;
    white-space: nowrap;
  }
  .hero-mob-stat-label {
    font-size: 0.5625rem; font-weight: 500;
    color: var(--smk-gray-400); white-space: nowrap;
  }

  /* ---- 하단 영역: verdict만 (CTA 숨김) ---- */
  .hero-mobile-bottom {
    display: none !important;
  }

  /* 전략 키워드: 이미지 좌상단 오버레이 */
  .hero-mob-verdict {
    display: flex !important;
    position: absolute;
    top: 0.75rem; left: 0.75rem;
    z-index: 3;
    background: var(--smk-red); border: none;
    padding: 0.375rem 0.75rem; color: white;
    font-size: 0.6875rem; font-weight: 700;
    border-radius: 6px;
    align-items: center; gap: 0.3125rem;
    box-shadow: 0 2px 8px rgba(211,47,47,0.3);
  }

  /* ---- CONTROLS ---- */
  .hero-controls {
    position: relative;
    bottom: auto; left: auto;
    display: flex;
    justify-content: center;
    padding: 0.75rem 0 1rem;
    z-index: 10;
  }

  .hero-progress {
    position: absolute;
    bottom: 0; left: 0;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-slide .anim-item {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .float-card {
    transition: none !important;
    animation: none !important;
  }
  .hero-slide.active .float-card {
    animation: none !important;
  }
  .hero-campaign-img {
    transition: none !important;
  }
}
