/* =========================================================
   Korea Hero Slider — LVMH-style fullscreen video slider
   All classes prefixed with .kh- to avoid theme conflicts.
   Loaded only on the "Korea Hero Slider" page template.

   [업데이트 내역]
   - 100vh → 100dvh 추가: 모바일 주소창에 하단 메뉴가
     가려지던 문제 해결 (구형 브라우저는 100vh로 폴백)
   - .kh-menu에 safe-area 패딩: 아이폰 하단 홈바 대응
   - 브랜드 문구가 길어져 모바일에서 크기·자간 축소
   - Contact가 링크(<a>)로 바뀌어 링크 스타일 추가
   ========================================================= */

:root{
  --kh-gold:#cbb489;
  --kh-line:rgba(255,255,255,.28);
}

/* Lock the page so the slider fills the viewport, no scroll */
body.korea-hero-page{
  margin:0;padding:0;overflow:hidden;height:100vh;height:100dvh;background:#000;
  font-family:Georgia,'Times New Roman',serif;color:#fff;
  -webkit-font-smoothing:antialiased;
}
/* Hide anything the theme might inject (admin bar handled separately) */
body.korea-hero-page #page,
body.korea-hero-page .site-header,
body.korea-hero-page .site-footer{display:none!important}

.kh-sans{font-family:'Helvetica Neue',Arial,sans-serif}
.kh-slider video,.kh-slider img{display:block;width:100%;height:100%;object-fit:cover}

/* ---------- Header ---------- */
.kh-header{
  position:fixed;top:0;left:0;right:0;z-index:60;
  display:flex;align-items:center;justify-content:space-between;
  padding:24px 44px;color:#fff;
}
/* 헤더가 position:fixed 이므로 그 안의 .kh-header-nav(absolute)는
   헤더를 기준으로 배치됩니다 (아래 2/3 지점 규칙 참고) */
.kh-brand{
  font-family:'Helvetica Neue',Arial,sans-serif;font-weight:300;
  font-size:26px;letter-spacing:.44em;text-transform:uppercase;  /* 19px × 1.5 ≈ 28px */
  white-space:nowrap;
}
.kh-header-right{
  font-size:11px;letter-spacing:.24em;text-transform:uppercase;opacity:.9;cursor:pointer;
}
a.kh-header-right{color:#fff;text-decoration:none;transition:opacity .3s}
a.kh-header-right:hover{opacity:1}

/* ---------- Slider ---------- */
.kh-slider{position:relative;height:100vh;height:100dvh;width:100vw}
.kh-slide{
  position:absolute;inset:0;opacity:0;visibility:hidden;
  transition:opacity 1.1s ease,visibility 1.1s ease;
}
.kh-slide.active{opacity:1;visibility:visible}
.kh-media{position:absolute;inset:0;background:#000}
.kh-slide::after{
  content:"";position:absolute;inset:0;z-index:2;
  background:linear-gradient(180deg,rgba(0,0,0,.4) 0%,rgba(0,0,0,0) 30%,rgba(0,0,0,.12) 58%,rgba(0,0,0,.72) 100%);
}

/* slide copy */
.kh-copy{
  position:absolute;z-index:5;left:0;right:0;bottom:13vh;text-align:center;padding:0 24px;
  transform:translateY(34px);opacity:0;transition:transform 1s ease .25s,opacity 1s ease .25s;
}
.kh-slide.active .kh-copy{transform:none;opacity:1}
.kh-num{
  font-family:'Helvetica Neue',Arial,sans-serif;font-size:11px;letter-spacing:.4em;
  color:var(--kh-gold);margin-bottom:22px;
}
.kh-copy h1{font-weight:400;font-size:clamp(40px,7vw,98px);line-height:1.03;letter-spacing:.01em;margin:0}
.kh-copy h1 em{font-style:italic;color:#ecdfc6}
.kh-copy p{
  font-family:'Helvetica Neue',Arial,sans-serif;font-weight:300;max-width:440px;margin:22px auto 0;
  font-size:14px;line-height:1.75;opacity:.86;
}
.kh-cta{
  display:inline-block;margin-top:30px;color:#fff;text-decoration:none;
  font-family:'Helvetica Neue',Arial,sans-serif;font-size:11px;letter-spacing:.26em;
  text-transform:uppercase;border-bottom:1px solid var(--kh-line);padding-bottom:7px;transition:border-color .3s;
}
.kh-cta:hover{border-color:#fff}

/* ---------- Arrows 제거됨 — 아래 메뉴 버튼으로만 이동 ---------- */

/* ---------- Bottom menu / progress ---------- */
.kh-menu{
  position:fixed;left:0;right:0;bottom:0;z-index:50;
  display:flex;justify-content:center;
  border-top:1px solid rgba(255,255,255,.16);
  background:linear-gradient(180deg,transparent,rgba(0,0,0,.35));
  padding-bottom:env(safe-area-inset-bottom); /* 아이폰 하단 홈바 대응 */
}
.kh-menu button{
  flex:1;max-width:300px;background:transparent;border:none;cursor:pointer;color:#fff;
  padding:22px 12px 24px;position:relative;
  font-family:'Helvetica Neue',Arial,sans-serif;letter-spacing:.24em;text-transform:uppercase;
  font-size:11px;opacity:.6;transition:opacity .35s;
}
.kh-idx{display:block;font-size:9px;letter-spacing:.3em;color:var(--kh-gold);margin-bottom:8px;opacity:.9}
.kh-menu button:hover{opacity:1}
.kh-menu button.active{opacity:1}
.kh-menu button.active::before{
  content:"";position:absolute;top:-1px;left:0;height:2px;background:var(--kh-gold);
  width:100%;transform-origin:left;animation:khFill var(--kh-dur,7s) linear forwards;
}
@keyframes khFill{from{transform:scaleX(0)}to{transform:scaleX(1)}}

.kh-counter{
  position:fixed;left:44px;bottom:96px;z-index:50;
  font-family:'Helvetica Neue',Arial,sans-serif;font-size:11px;letter-spacing:.2em;opacity:.7;
}
.kh-counter b{font-weight:600}

/* keep clear of the WP admin bar when logged in */
.admin-bar .kh-header{top:32px}

@media (prefers-reduced-motion:reduce){
  .kh-slide,.kh-copy{transition:none}
  .kh-menu button.active::before{animation:none;transform:scaleX(1)}
}
@media(max-width:680px){
  /* 헤더 브랜드/패딩은 아래 768px 블록에서 통합 관리 */
  /* 메뉴가 5개로 늘어 모바일 자간·글자 크기 추가 축소 */
  .kh-menu button{letter-spacing:.08em;font-size:8.5px;padding:16px 4px 18px}
  .kh-idx{display:none}
  .kh-counter{display:none}
  .kh-copy{bottom:16vh}
  .admin-bar .kh-header{top:46px}
}

/* ============================================================
   헤더 우측 내비 (Check List Before Flight / About / Contact)
   — 이전에 중복돼 있던 3개 블록을 하나로 정리한 최종 버전
   ※ functions.php에서 hero.css 버전 번호 올리는 것 잊지 마세요.
   ============================================================ */

/* 우측 내비 컨테이너
   ── 데스크톱: [Checklist] [국기 3개] [About] [Contact] 를 한 줄로,
      모든 항목 사이 간격을 동일하게(gap 하나로 통일).
      전체를 오른쪽으로 살짝 이동 (left 58% + margin-left 86px).
      ※ HTML 소스 순서는 Checklist→About→Contact→국기 이지만,
        데스크톱에서는 order로 국기를 Checklist 바로 오른쪽에 끼워넣음. */
.kh-header-nav{
  display:flex;
  align-items:center;
  gap:32px;                  /* ★ 모든 항목 사이 간격 — 이 값 하나로 전체 조절 */
  position:absolute;
  right:44px;                /* ★ 전체를 오른쪽 끝에서 이만큼 띄움.
                                값을 줄이면 더 오른쪽, 키우면 더 왼쪽.
                                (이전보다 오른쪽으로 이동 = 44px로 오른쪽 여백 최소화) */
  top:50%;
  transform:translateY(-50%);
}
/* 데스크톱(769px↑) 항목 순서: Checklist → 국기 → About → Contact
   (모바일은 HTML 소스 순서 그대로: Checklist → About → Contact → 국기) */
@media (min-width:769px){
  .kh-nav-checklist{ order:1; }
  .kh-lang{ order:2; }
  .kh-header-nav .kh-nav-link{ order:3; }
}

/* Checklist Before Flight — 파란색 bold "한 줄"
   위치·간격은 .kh-header-nav 규칙이 담당 (margin 제거해 gap으로 통일) */
.kh-nav-checklist{
  font-size:24px;            /* ① 글자 크기 — 더 키우려면 이 값만 수정 */
  font-weight:700;
  white-space:nowrap;        /* 한 줄 고정 (줄바꿈 방지) */
  letter-spacing:.04em;
  color:#3B9EFF;
  text-decoration:none;
  text-shadow:0 1px 8px rgba(0,0,0,.35);
  transition:color .25s;
}
.kh-nav-checklist:hover{ color:#7FC1FF; }

/* About / Contact — 검은색 텍스트 링크 */
.kh-nav-link{
  color:#111;                /* 검은색 */
  text-decoration:none;
  font-size:13px;
  letter-spacing:.14em;
  text-transform:uppercase;
  transition:opacity .25s;
}
.kh-nav-link:hover{ opacity:.6; }

/* 언어 전환 국기 버튼 그룹 */
.kh-lang{
  display:flex;
  align-items:center;
  gap:10px;                  /* 국기끼리의 간격 (항목 간 큰 간격과 별개) */
}
.kh-flag{
  display:inline-flex;
  width:24px; height:24px;   /* 국기 크기 — 키우려면 이 값과 위 svg width/height */
  border-radius:50%;
  overflow:hidden;
  box-shadow:0 1px 6px rgba(0,0,0,.35);
  transition:transform .2s, box-shadow .2s;
}
.kh-flag svg{ display:block; width:100%; height:100%; }
.kh-flag:hover{
  transform:translateY(-2px) scale(1.08);
  box-shadow:0 3px 10px rgba(0,0,0,.5);
}

/* ── 중간 화면 (1440px 이하) ──
   국기가 추가돼 노트북 화면에서 겹칠 수 있어 단계적 축소 */
@media (max-width:1440px){
  .kh-brand{ font-size:22px; letter-spacing:.3em; }
  .kh-nav-checklist{ font-size:16px; }
  /* 노트북: 오른쪽 여백 동일, 간격만 축소 */
  .kh-header-nav{ right:32px; gap:22px; }
  .kh-flag{ width:20px; height:20px; }
}

/* ── 모바일 세로 (768px 이하) ──
   [DESIGN YOUR TRAVEL KOREA]  ← 상단, 크기 축소
   [Checklist Before Flight] [About] [Contact]  ← 바로 아래 한 줄
   [🇬🇧 🇯🇵 🇨🇳]  ← 그 아래 국기 줄
   모두 화면 폭 안에 들어오도록 정렬. */
@media (max-width:768px){
  /* 헤더를 세로 컬럼으로: 브랜드가 위, 내비가 바로 아래 */
  .kh-header{
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
    padding:16px 18px;
  }
  /* 브랜드 크기 — 세로화면 한 줄 유지 최대치 (21px, 일반 폰 390px에 딱 맞음) */
  .kh-brand{
    font-size:21px;
    letter-spacing:.08em;
    white-space:nowrap;
  }

  /* 내비: 데스크톱의 absolute 해제, 헤더 흐름 안에서 줄바꿈 허용 */
  .kh-header-nav{
    position:static;          /* 데스크톱 고정 위치 해제 */
    transform:none;
    left:auto; top:auto;
    width:100%;
    display:flex;
    flex-wrap:wrap;           /* 공간 부족하면 자동 줄바꿈 */
    align-items:center;
    gap:10px 14px;            /* 세로 10 / 가로 14 간격 */
  }

  /* Checklist — 브랜드 바로 밑, 1행 왼쪽 */
  .kh-nav-checklist{
    font-size:16px;
    white-space:nowrap;
    flex:0 0 auto;
  }
  /* About / Contact — Checklist 오른쪽 (같은 1행) */
  .kh-nav-link{
    font-size:12px;
    letter-spacing:.1em;
    flex:0 0 auto;
  }

  /* 국기 줄 — 소스상 마지막 + 100% 폭 → 자동으로 2행에 배치 */
  .kh-lang{
    flex:1 0 100%;
    justify-content:flex-start;
    gap:12px;
    margin-top:2px;
  }
  .kh-flag{ width:24px; height:24px; }
}

/* ── 아주 좁은 폰 (400px 이하) — 21px 브랜드가 한 줄에 들어오도록 자간만 축소 ── */
@media (max-width:400px){
  .kh-brand{ letter-spacing:.02em; }   /* 21px 유지, 자간만 좁혀 한 줄 확보 */
  .kh-nav-checklist{ font-size:15px; }
  .kh-nav-link{ font-size:11px; letter-spacing:.08em; }
  .kh-header-nav{ gap:10px 12px; }
}

/* ── 모바일 가로 (landscape) ──
   높이가 낮은 가로 화면에서 헤더 글씨가 슬라이드 문구와
   겹치던 문제 해결: 헤더를 한 줄로 눕히고 크기를 확 줄여
   상단에 얇게 고정, 아래 슬라이드 영역과 분리. */
@media (max-height:500px) and (orientation:landscape){
  .kh-header{
    flex-direction:row;              /* 다시 가로 한 줄 */
    align-items:center;
    justify-content:space-between;
    padding:8px 20px;
    background:linear-gradient(180deg,rgba(0,0,0,.45),transparent); /* 가독성 */
  }
  /* 브랜드 21px (세로와 동일). 아주 좁은 가로폰에선 내비와 겹치지
     않도록만 살짝 축소 (넓은 가로폰은 21px 유지) */
  .kh-brand{ font-size:clamp(15px,2.7vw,21px); letter-spacing:.08em; white-space:nowrap; }

  .kh-header-nav{
    position:static; transform:none; left:auto; top:auto; right:auto;
    width:auto;
    flex-wrap:nowrap;                /* 가로 화면은 폭이 넉넉하니 한 줄 유지 */
    gap:14px;
  }
  .kh-nav-checklist{ font-size:13px; }
  .kh-nav-link{ font-size:11px; letter-spacing:.1em; }
  .kh-lang{ flex:0 0 auto; gap:7px; }
  .kh-flag{ width:18px; height:18px; }

  /* 슬라이드 문구 — 가로 화면에서 더 위로 올림 (bottom 값 키울수록 위로).
     본문(<p>)은 숨기지 않고 작게 유지 (요청사항). */
  .kh-copy{ bottom:32vh; }
  .kh-num{ margin-bottom:6px; }
  .kh-copy h1{ font-size:clamp(24px,5.5vw,40px); line-height:1.05; }
  .kh-copy p{
    display:block;                    /* 다시 보이게 */
    font-size:11px;
    line-height:1.5;
    margin-top:8px;
    max-width:80vw;
  }
  .kh-cta{ margin-top:12px; }
}