/**
 * 엔스타일투어 리뉴얼 - 지역 메인 화면 (스페인, 이탈리아 … 공통)
 * base.css 다음에 로드. 지역별 색상은 base.css 의 body[data-region] 변수로 자동 적용
 * - 지역 타이틀 밴드 / 배너(좌우 분할, 썸네일) / 여행 카테고리 / 추천 여행지(effect-bubba)
 */
/* ==========================================================
   8. 히어로 (광고 배너, 이미지 1080 x 800) - 지역 서브 테마색 배경
   - 이미지 표시 폭 최대 680px (원본 1080px 대비 약 1.6배 밀도 → 고해상도 화면에서도 선명)
   - 이미지 비율 1080:800 유지 (잘림 없음)
   - 장식 최소화: 부드러운 그림자 + 은은한 라운드, 느린 페이드/스케일 전환
   ========================================================== */
.hero {
  --hero-img: 680px; /* 이미지 표시 폭 (짙은 패널 폭 계산용) */
  position: relative;
  background: var(--region-sub);
  color: var(--text-primary);
  overflow: hidden;
}

/* 좌우 분할: 화면 오른쪽 끝 ~ 이미지 폭의 62% 지점까지 짙은 패널 (사진 대비 강화)
   패널 폭 = 컨테이너 바깥 여백 + 콘텐츠 좌우 여백 + 이미지 폭 × 0.62 */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: calc(max(0px, (100% - var(--container)) / 2) + var(--gutter) + var(--hero-img) * 0.62);
  background: var(--region-deep); /* color-mix 미지원 브라우저용 */
  background: linear-gradient(160deg, color-mix(in srgb, var(--region-deep) 88%, #ffffff) 0%, var(--region-deep) 60%);
  pointer-events: none;
}

.hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 680px);
  align-items: center;
  gap: 5rem;
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}


/* 텍스트 영역 */
.hero-info {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  min-width: 0;
  max-width: 620px;
}

/* 라벨 → 소제목 → 타이틀 → 링크 순으로 시간차 등장 */
.hero-text > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s ease, transform 0.9s var(--ease);
}

.hero-text.is-active > * { opacity: 1; transform: none; }
.hero-text.is-active > :nth-child(2) { transition-delay: 0.08s; }
.hero-text.is-active > :nth-child(3) { transition-delay: 0.16s; }
.hero-text.is-active > :nth-child(4) { transition-delay: 0.24s; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--region);
}

.hero-eyebrow::before { content: ''; width: 24px; height: 1px; background: currentColor; }

.hero-tag {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-title a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 0 95%;
  background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease);
}

.hero-title a:hover { background-size: 100% 1px; }

/* 자세히 보기: 잉크 버튼 (넓은 자간 + 화살표, 오버 시 살짝 떠오름) */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.9rem;
  height: 46px;
  padding: 0 1.6rem 0 1.8rem;
  border-radius: 2px;
  background: var(--ink);
  color: var(--ivory);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  box-shadow: 0 10px 24px -12px rgba(22, 19, 15, 0.55);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.hero-cta .icon {
  font-size: 15px;
  transition: transform var(--transition-normal);
}

.hero-cta:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -14px rgba(22, 19, 15, 0.6);
}

.hero-cta:hover .icon { transform: translateX(4px); }

/* 컨트롤: 번호 + 진행선 + 화살표 / 썸네일 */
.hero-controls { display: flex; flex-direction: column; gap: 1.1rem; }
.hero-nav { display: flex; align-items: center; gap: 1.25rem; }

.hero-thumbs { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.hero-thumb {
  width: 72px;
  aspect-ratio: 1080 / 800;
  border-radius: 3px;
  overflow: hidden;
  opacity: 0.45;
  outline: 1px solid transparent;
  outline-offset: 3px;
  transition: opacity var(--transition-normal), outline-color var(--transition-normal);
}

.hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-thumb:hover { opacity: 0.8; }
.hero-thumb.is-active { opacity: 1; outline-color: var(--ink); }

.hero-count {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  flex: none;
  font-family: var(--font-serif);
  color: var(--text-tertiary);
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.hero-count em { font-style: normal; font-size: 1.35rem; font-weight: 500; color: var(--text-primary); }

.hero-progress {
  position: relative;
  flex: 0 1 180px;
  height: 1px;
  background: rgba(22, 19, 15, 0.12);
  overflow: hidden;
}

.hero-progress span {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}

.hero-progress.is-running span { animation: heroProgress 6s linear forwards; }
.hero.is-paused .hero-progress span { animation-play-state: paused; }

@keyframes heroProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.hero-arrows { display: flex; gap: 0.15rem; flex: none; }

.hero-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 18px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.hero-arrow:hover { background: rgba(22, 19, 15, 0.06); color: var(--ink); }

/* 이미지 영역: 은은한 라운드 + 넓게 퍼지는 부드러운 그림자 */
.hero-visual { position: relative; }

.hero-medias {
  position: relative;
  aspect-ratio: 1080 / 800;
  border-radius: 6px;
  overflow: hidden;
  background: var(--region-sub-deep);
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.55),
    0 16px 32px -16px rgba(0, 0, 0, 0.3);
  isolation: isolate; /* 라운드 클리핑 (translateZ 대신: 모바일에서 GPU 레이어가 저해상도로 고정되는 현상 방지) */
  touch-action: pan-y;
}

.hero-media { display: block; }

/* 전환 시 살짝 확대된 상태에서 천천히 원래 크기로 (최종 크기는 원본 비율 그대로) */
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.8s var(--ease), filter var(--transition-normal);
}

.hero-media.is-active img { transform: scale(1); }

/* 마우스 환경에서만 오버 효과 (터치 기기는 탭 후 hover 가 남아 필터가 적용된 채 흐려 보이는 현상 방지) */
@media (hover: hover) {
  .hero-media:hover img { filter: brightness(0.95); }
}

/* 모바일·터치 기기: 이미지 확대 전환 끔 (확대 애니메이션 후 저해상도로 남아 흐려 보이는 현상 방지), 페이드만 유지 */
@media (hover: none), (max-width: 1024px) {
  .hero-media img,
  .hero-media.is-active img { transform: none; transition: none; }
}

.hero-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
}

/* ==========================================================
   10. 카테고리 (기존 디자인: 테마색 배경 밴드 + 하단 라벨 카드)
   ========================================================== */
.category-band { position: relative; background: var(--region); }

/* 기존 categoroy-bg-cover : 테마색 위 어두운 커버 */
.category-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.category-band .container { position: relative; }
.category-band .sec-title { color: #eeeeee; }
.category-band .sec-sub { color: rgba(255, 255, 255, 0.72); }

/* 리뉴얼 화면 폭 전체 사용, 카드 폭은 기존 사이트 수준(약 160px)으로 자동 배치 + 왼쪽 정렬 */
.category-grid,
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  column-gap: 30px;
}

.category-grid { row-gap: 30px; }

.category-card {
  position: relative;
  display: block;
  aspect-ratio: 500 / 370;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.category-card .label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.45rem 0.4rem;
  background: rgba(0, 0, 0, 0.6);
  color: #eeeeee;
  text-align: center;
  font-size: 0.8125rem; /* 기존 13px */
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  transition: background var(--transition-normal);
}

/* 공통 효과: 줌 (기존 overlay zoom) */
.category-card:hover img { transform: scale(1.1); }
.category-card:hover .label { background: rgba(0, 0, 0, 0.78); }

/* ==========================================================
   12. 추천 여행지 (기존 effect-bubba 효과, 이미지 1080 x 800 비율)
   ========================================================== */
/* 기존 사이트 section-image: 좌우 어두운 배경 (흰 바탕 위 rgba(0,0,0,0.7) = #4d4d4d)
   + 가운데 흰색 패널 (리뉴얼 화면 폭 = --container) */
.section--spots { padding: 0; background: #4d4d4d; }

.spots-panel {
  max-width: var(--container);
  padding: var(--section-y) var(--gutter);
  background: var(--white);
}

/* 한 줄 4개 (최대 화면에서 카드 약 360px, 기존 최대 480px 이하) */
.spot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }

/* 추천 여행지가 2개일 때: 한 줄을 2개로 나눠 빈 공간 없이 표시 */
.spot-grid:has(> .spot-card:nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }

.spot-card {
  position: relative;
  display: block;
  aspect-ratio: 1080 / 800;
  overflow: hidden;
  background: #9e5406; /* 기존 effect-bubba 배경색 */
  color: var(--white);
  text-align: center;
}

.spot-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: opacity 0.35s;
}

.spot-card:hover img { opacity: 0.4; }

/* 3행 그리드: 타이틀(2행)은 정중앙보다 살짝 위 고정 위치, 설명(3행)은 그 아래 넓은 영역에서 시작
   → 설명 문구 줄 수와 관계없이 타이틀 높이 고정 + 2줄 설명도 테두리 라인 안쪽에 표시 */
.spot-caption {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1.7fr);
  justify-items: center;
  padding: 2.5rem 2.75rem;
}

.spot-caption .spot-name { grid-row: 2; }
.spot-caption .spot-desc { grid-row: 3; align-self: start; }

/* 테두리 라인: 위/아래는 가로로, 좌/우는 세로로 펼쳐짐 */
.spot-caption::before,
.spot-caption::after {
  content: '';
  position: absolute;
  inset: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}

.spot-caption::before {
  border-top: 1px solid var(--white);
  border-bottom: 1px solid var(--white);
  transform: scale(0, 1);
}

.spot-caption::after {
  border-left: 1px solid var(--white);
  border-right: 1px solid var(--white);
  transform: scale(1, 0);
}

.spot-card:hover .spot-caption::before,
.spot-card:hover .spot-caption::after {
  opacity: 1;
  transform: scale(1);
}

.spot-name {
  max-width: 100%;
  overflow-wrap: anywhere; /* 긴 영문 한 단어(예: KAKSLAUTTANEN)도 카드 안에서 줄바꿈 */
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.15;
  transform: translate3d(0, 14px, 0);
  transition: transform 0.35s;
}

.spot-desc {
  margin-top: 0.7rem;
  font-size: var(--fs-md);
  letter-spacing: 0.5px;
  line-height: 1.5;
  /* 최대 2줄 (테두리 라인 안쪽 유지) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.35s, transform 0.35s;
}

.spot-card:hover .spot-name,
.spot-card:hover .spot-desc {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 터치 기기: 호버가 없으므로 설명을 항상 표시 */
@media (hover: none) {
  .spot-card img { opacity: 0.55; }
  .spot-name, .spot-desc { opacity: 1; transform: none; }
}

/* ==========================================================
   15. 반응형 (지역 메인)
   ========================================================== */
@media (max-width: 1280px) {
  .hero { --hero-img: 560px; }
  .hero-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 3.5rem; }
  .hero-title { font-size: 1.65rem; }

  /* 추천 여행지: 2개씩 2줄 (카드 폭 확보 → 설명 문구 줄바꿈 최소화) */
  .spot-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 1024px) {
  .hero { --hero-img: calc((100% - 2 * var(--gutter) - 2.5rem) / 2); }
  .hero-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 50%); gap: 2.5rem; padding-top: 3.25rem; padding-bottom: 3.25rem; }
  .hero-title { font-size: 1.5rem; }
  .hero-tag { font-size: 0.85rem; }
  .hero-thumb { width: 60px; }

  .category-grid { column-gap: 20px; row-gap: 20px; }
}

@media (max-width: 768px) {

  /* 히어로: 이미지 위 / 텍스트 아래, 짙은 패널은 위쪽(이미지 높이의 약 60%) */
  .hero::before { left: 0; bottom: auto; width: auto; height: calc(92vw * 0.74 * 0.6 + 2rem); }
  .hero-stage { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-top: 2rem; padding-bottom: 2.25rem; }
  .hero-visual { order: -1; }
  .hero-info { gap: 1.75rem; max-width: none; }
  .hero-eyebrow { margin-bottom: 0.9rem; }
  .hero-tag { font-size: 0.85rem; margin-bottom: 0.4rem; }
  .hero-title { font-size: 1.4rem; -webkit-line-clamp: 2; }
  .hero-cta { display: none; }
  .hero-thumbs { display: none; }
  .hero-arrow { width: 38px; height: 38px; font-size: 16px; }

  .category-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); column-gap: 12px; row-gap: 12px; }
  .category-card .label { font-size: 0.78rem; padding: 0.4rem 0.3rem; }

  .spot-name { font-size: 1.25rem; }
  .spot-desc { font-size: var(--fs-sm); }
  .spot-caption { padding: 1.5rem 1.75rem; }
  .spot-caption::before, .spot-caption::after { inset: 16px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.25rem; }

  /* 추천 여행지: 가로 스크롤 */
  .spot-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .spot-grid::-webkit-scrollbar { display: none; }
  .spot-grid:has(> .spot-card:nth-child(2):last-child) { grid-template-columns: none; } /* 2개일 때도 같은 가로 넘기기 (좁은 2칸에서 제목이 잘리지 않게) */
  .spot-card { scroll-snap-align: start; }
  .spot-name { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-progress span { animation: none !important; }
}
