/* ================= Hero (FINAL) ================= */
/*
  목표
  - 홈: 슬라이더 + 중앙 문구(임팩트)
  - 서브: 고정 배너 + 중앙 문구(가독성)
  - 모바일: 서브 히어로만 풀와이드(홈과 이질감 감소)
  - transform/opacity 중복 규칙 제거(수정해도 안 먹는 현상 방지)
*/

/* -----------------------------------------------------------
  [공통 래퍼]
----------------------------------------------------------- */
.hero{
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 20px 0;
}

.hero-bg{
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1220;
}

/* -----------------------------------------------------------
  [메인 히어로(홈) : 슬라이더]
----------------------------------------------------------- */
.hero-slider{
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
}

.hero-slide-track{
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .6s ease-in-out;
}

.hero-slide{
  min-width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

/* -----------------------------------------------------------
  [서브 히어로 : 고정 이미지 1장]
----------------------------------------------------------- */
.hero.hero--sub{
  padding: 16px 20px 0; /* PC: 컨테이너형 유지 */
}

.hero--sub .hero-static{
  position: relative;
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center;
}

/* ✅ 서브 히어로 오버레이(가독성 통일) */
.hero--sub .hero-static::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.15), rgba(0,0,0,.55));
  z-index: 1;
}

/* -----------------------------------------------------------
  [텍스트 오버레이 : 공통]
  - 기본은 hidden(홈에서 애니메이션으로 등장)
  - 서브는 예외로 항상 보이게 처리
----------------------------------------------------------- */
.hero-overlay{
  position: absolute;
  color: #fff;
  pointer-events: none;
  z-index: 5;

  /* 기본: 숨김 → JS가 .hero-anim 붙이면 표시 */
  opacity: 0;

  /* 메인에서만 부드럽게 등장, 서브는 아래에서 override */
  transition: opacity .55s ease, transform .55s ease;

  /* 가독성 */
  text-shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* ===============================
   홈(메인) 오버레이: 중앙 배치 + 살짝 올라오는 효과
   =============================== */
.hero:not(.hero--sub) .hero-overlay{
  left: 60%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: min(920px, calc(100% - 40px));
  text-align: center;

  /* 애니메이션 offset (기본은 살짝 아래) */
  --hero-rise: 10px;
  transform: translate3d(-50%, calc(-50% + var(--hero-rise)), 0);
}

/* JS: .hero-anim 붙으면 등장 */
.hero:not(.hero--sub).hero-anim .hero-overlay{
  opacity: 1;
  --hero-rise: 0px;
}

/* ===============================
   서브 오버레이: 항상 중앙 고정
   =============================== */
.hero--sub .hero-overlay{
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: min(900px, calc(100% - 52px));
  text-align: center;
  transform: translate3d(-50%, -50%, 0);

  /* ✅ 서브는 항상 표시 */
  opacity: 1 !important;
  transition: none;
  z-index: 2; /* 서브 static::before 위로 */
}

/* -----------------------------------------------------------
  [타이포]
----------------------------------------------------------- */
.hero-title{
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -.01em;
}

.hero-eyebrow{
  font-size: 13px;
  opacity: .9;
}

.hero-hint{
  font-size: 12px;
  opacity: .75;
}

/* 서브는 정보성 톤(가독성) */
.hero--sub .hero-title{
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.2;
}

.hero--sub .hero-eyebrow{
  font-family: var(--font-body);
  font-weight: 700;
  opacity: .95;
}

.hero--sub .hero-desc{
  font-size: 15px;
  line-height: 1.35;
  opacity: .95;
  max-width: 28ch; /* ✅ 3줄 이상 과도 줄바꿈 방지 */
  margin-left: auto;
  margin-right: auto;
}

/* -----------------------------------------------------------
  [Hero Slider Buttons]
----------------------------------------------------------- */
.hero-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;

  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.25);
  color: #fff;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  outline: none;
}

.hero-btn.prev{ left: 16px; }
.hero-btn.next{ right: 16px; }
.hero-btn:hover{ background: rgba(0,0,0,.40); }

.hero-btn svg{
  width: 22px;
  height: 22px;
  display: block;
}

.hero-btn:focus-visible{
  box-shadow: 0 0 0 3px rgba(255,255,255,.35);
}

/* -----------------------------------------------------------
  [Hero Dots]
----------------------------------------------------------- */
.hero-dots{
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 150;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(6px);
}

.hero-dots .dot{
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.18);
  padding: 0;
  cursor: pointer;
}

.hero-dots .dot.active{
  background: rgba(255,255,255,.95);
}

/* =========================================================
   HERO Interactions
   ========================================================= */

/* 슬라이드 페이드 + 켄번스 */
.hero-slide{
  opacity: 0;
  transition: opacity .55s ease;
  will-change: opacity, transform;
}

.hero-slide.active{
  opacity: 1;
  animation: heroKenBurns 8s ease-out forwards;
}

@keyframes heroKenBurns{
  0%   { transform: scale(1.02) translate3d(0,0,0); }
  100% { transform: scale(1.08) translate3d(-1.2%, -0.8%, 0); }
}

/* 스크롤 reveal (JS가 hero-reveal / is-revealed 제어) */
.hero.hero-reveal{
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .7s ease, transform .7s ease;
}

.hero.hero-reveal.is-revealed{
  opacity: 1;
  transform: translateY(0);
}

/* 모션 최소화 설정 존중 */
@media (prefers-reduced-motion: reduce){
  .hero.hero-reveal,
  .hero-overlay,
  .hero-slide{
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* -----------------------------------------------------------
  [Mobile]
  - 슬라이더 dots/buttons 숨김
  - 서브 히어로만 풀와이드(컨테이너 느낌 제거)
----------------------------------------------------------- */
@media (max-width: 760px){
  .hero-dots{ display: none !important; }
  .hero-btn{ display: none !important; }
}

@media (max-width: 768px){
  /* ✅ 서브 히어로 풀와이드 */
  .hero.hero--sub{
    max-width: none;
    margin: 0;
    padding: 0; /* 기존 20px 제거 */
  }

  .hero--sub .hero-bg{
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .hero--sub .hero-static{
    height: 220px; /* 200~240 취향 */
    background-position: center; /* 필요 시: center 35% */
  }

  .hero--sub .hero-title{ font-size: 22px; }
  .hero--sub .hero-eyebrow{ font-size: 13px; margin-bottom: 6px; }
  .hero--sub .hero-desc{ font-size: 13px; max-width: 28ch; }
}

@media (max-width: 768px){

  /* 1️⃣ hero 자체는 이미 풀와이드 OK */
  .hero.hero--sub{
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* 2️⃣ 문제의 핵심: hero-bg 카드 해제 */
  .hero.hero--sub .hero-bg{
    border-radius: 0;
    border: 0;
    overflow: visible;
    background: transparent;
  }

  /* 3️⃣ 실제 이미지 영역을 진짜 풀와이드로 */
  .hero.hero--sub .hero-static{
    width: 100vw;              /* 🔥 화면 기준 */
    height: 220px;             /* 원하는 높이 */
    margin-left: 50%;
    transform: translateX(-50%);
    background-size: cover;
    background-position: center;
  }
}
/* =========================================================
   PC 서브 히어로(heroSub)도 풀와이드로 (모바일처럼)
   - 홈(hero)에는 영향 없음
   ========================================================= */

/* 1) 서브 히어로 컨테이너 해제 */
@media (min-width: 769px){
  .hero.hero--sub{
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important; /* 기존 20px 패딩 제거 */
  }

  /* 2) 카드 느낌(라운드/보더) 제거 */
  .hero.hero--sub .hero-bg{
    border-radius: 0 !important;
    border: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }

  /* 3) 실제 이미지 영역을 화면 기준으로 풀폭 */
  .hero.hero--sub .hero-static{
    width: 100vw !important;
    height: 280px;              /* PC 높이: 필요하면 260~340 조절 */
    margin-left: 50% !important;
    transform: translateX(-50%) !important;

    background-size: cover;
    background-position: center;
  }
}
/* 모바일에서 서브 히어로 아래 여백 제거 */
@media (max-width: 768px) {
  .hero-sub + .page-head {
    padding-top: 0;
    margin-top: 0;
  }
}
@media (max-width: 768px) {
  .page-head h1 {
    margin-top: 0;
  }
}
/* ✅ 모바일: 서브히어로(.hero-bg/.hero-static) 아래 여백 제거 */
@media (max-width: 768px) {
  /* hero 섹션 바로 다음이 페이지 타이틀(캠핑존/주변관광지/공지사항 등)인 경우 */
  section.hero-bg + .page-head,
  section.hero-bg + .section-block.page-head,
  section.hero-bg + .section-block {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* 혹시 hero 아래에 바로 컨테이너/메인이 오는 구조면 이것도 같이 */
  section.hero-bg + main.container,
  section.hero-bg + .container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}
@media (max-width: 768px) {
  .page-head h1,
  .page-head .page-title {
    margin-top: 0 !important;
  }
}
