/* ============================================================
   하늘루닌 SkyLunin — 디자인 폴리싱 레이어
   기존 디자인 토큰(sky/teal/orange) 위에 얹는 마감재.
   각 페이지의 인라인 스타일을 덮어쓰지 않고 보강만 한다.
   ============================================================ */

/* ---------- 텍스트 선택 컬러 ---------- */
::selection { background: rgba(79, 168, 216, .28); color: #0E1F2C; }
::-moz-selection { background: rgba(79, 168, 216, .28); color: #0E1F2C; }

/* ---------- 글로벌 포커스 링 (a11y + 시각 폴리싱) ---------- */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid #4FA8D8;
  outline-offset: 3px;
  border-radius: 8px;
  transition: outline-offset .15s ease;
}
:where(.btn, .chip, .nav-menu a):focus-visible {
  outline: 2px solid #1E6FA8;
  outline-offset: 4px;
}

/* ---------- 스크롤바 (Webkit) ---------- */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: #F4FAFE; }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #7FC4E8, #4FA8D8);
    border-radius: 999px;
    border: 3px solid #F4FAFE;
  }
  ::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #4FA8D8, #1E6FA8); }
}

/* ---------- 스크롤 리빌 (IntersectionObserver와 연동) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ---------- 이미지 페이드인 ---------- */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity .5s ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"][data-loaded="true"] {
  opacity: 1;
}

/* ---------- 카드 호버 마이크로 인터랙션 ---------- */
@media (hover: hover) and (pointer: fine) {
  .card, .place-card, .product-card, .post-card, .vet-card, .region-card, .feature-card {
    transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s ease, border-color .2s ease;
  }
  .card:hover, .place-card:hover, .product-card:hover,
  .post-card:hover, .vet-card:hover, .region-card:hover, .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 48px rgba(15, 70, 113, 0.16);
    border-color: #D2EBFA;
  }
}

/* ---------- 버튼 press 피드백 ---------- */
.btn:active { transform: translateY(0) scale(.98); }

/* ---------- 헤더 스크롤 시 그림자 강화 ---------- */
.nav.scrolled {
  box-shadow: 0 4px 24px rgba(15, 70, 113, .08);
  background: rgba(255, 255, 255, .96);
}

/* ---------- 백 투 톱 버튼 ---------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4FA8D8, #1E6FA8);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 8px 24px rgba(15, 70, 113, .25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, box-shadow .2s ease;
  z-index: 70;
  border: none;
  cursor: pointer;
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  box-shadow: 0 12px 32px rgba(15, 70, 113, .35);
  transform: translateY(-2px);
}
.back-to-top:focus-visible {
  outline: 3px solid #2ABFBF;
  outline-offset: 3px;
}
@media (max-width: 640px) {
  .back-to-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }
}

/* ---------- 빈 상태 ---------- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: #5A6B78;
}
.empty-state .icon {
  font-size: 56px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(79,168,216,.25));
}
.empty-state h3 {
  font-size: 18px;
  font-weight: 800;
  color: #0E1F2C;
  margin-bottom: 6px;
}
.empty-state p { font-size: 14px; }

/* ---------- 스켈레톤 시머 ---------- */
.skeleton {
  background: linear-gradient(90deg, #EAF6FD 0%, #F4FAFE 50%, #EAF6FD 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- 스킵 링크 (a11y) ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  background: #1E6FA8;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 100;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- 모션 줄이기 (시스템 설정 존중) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 인쇄 ---------- */
@media print {
  .nav, .back-to-top, footer, .ad, [class*="ad-"] { display: none !important; }
  body { color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}

/* ============================================================
   yeogi.com 스타일 카드 폴리싱 (오버라이드 레이어)
   - body 접두사로 specificity 한 단계 올려 인라인 .card 룰을 덮어씀
   ============================================================ */

/* ---------- 카드 베이스: 부드러운 라운드 + 가벼운 섀도우 ---------- */
body .product-card,
body .post-card,
body .vet-card,
body .place-card,
body .feature-card {
  border-radius: 16px;
  border: 1px solid #EEF4F9;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 70, 113, .04), 0 6px 18px rgba(15, 70, 113, .05);
  overflow: hidden;
  transition: transform .28s cubic-bezier(.2,.7,.2,1),
              box-shadow .28s ease,
              border-color .2s ease;
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  body .product-card:hover,
  body .post-card:hover,
  body .vet-card:hover,
  body .place-card:hover,
  body .feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 4px 12px rgba(15, 70, 113, .07),
                0 22px 48px rgba(15, 70, 113, .14);
    border-color: #D2EBFA;
  }
}

/* ---------- 카드 이미지: 위쪽 라운드 + 부드러운 줌인 ---------- */
body .product-card img,
body .place-card img,
body .vet-card img {
  border-radius: 16px 16px 0 0;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
@media (hover: hover) and (pointer: fine) {
  body .product-card:hover img,
  body .place-card:hover img,
  body .vet-card:hover img {
    transform: scale(1.04);
  }
}

/* ---------- 가격 강조 (yeogi 오렌지 톤) ---------- */
body .product-price,
body .price,
body .card-price,
body .product-card .price,
body .product-card strong {
  color: #FF7A45;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* ---------- 평점 별 ---------- */
body .rating,
body .card-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: #2A3E4D;
  font-size: 13px;
}
body .rating::before,
body .card-rating::before {
  content: "★";
  color: #FFB400;
  font-size: 14px;
  line-height: 1;
}

/* ---------- 태그/배지 pill ---------- */
body .badge,
body .tag,
body .chip-tag,
body .card-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #EAF6FD;
  color: #1E6FA8;
  letter-spacing: -.01em;
  white-space: nowrap;
}
body .badge.hot,
body .tag.hot,
body .card-badge.hot {
  background: #FFE8DC;
  color: #E5602B;
}
body .badge.new,
body .tag.new {
  background: #DFF7F1;
  color: #1F9B9B;
}

/* ---------- 즐겨찾기 하트 (떠 있는 액션 버튼) ---------- */
body .card-favorite,
body .fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #94A3AF;
  border: none;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(15, 70, 113, .12);
  transition: color .2s ease, transform .2s ease, background .2s ease;
}
body .card-favorite:hover,
body .fav-btn:hover {
  color: #FF7A45;
  transform: scale(1.08);
  background: #fff;
}
body .card-favorite.active,
body .fav-btn.active {
  color: #FF7A45;
}

/* ---------- 가격/할인 라인 (할인 전 가격 취소선) ---------- */
body .price-original,
body .price-was {
  text-decoration: line-through;
  color: #94A3AF;
  font-weight: 500;
  font-size: 13px;
  margin-right: 6px;
}
body .price-discount,
body .discount-rate {
  color: #FF3B30;
  font-weight: 800;
  margin-right: 6px;
}

/* ---------- 카드 메타 정보 (위치·거리 등) ---------- */
body .card-meta,
body .meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5A6B78;
  font-size: 13px;
  font-weight: 500;
}
body .card-meta::before { content: "📍"; font-size: 12px; }

/* ---------- 빠른 보기 / CTA 버튼 부드러운 마감 ---------- */
body .btn,
body button.btn,
body .cta-btn {
  border-radius: 12px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
body .btn-primary,
body .btn.primary {
  background: linear-gradient(135deg, #4FA8D8, #1E6FA8);
  color: #fff;
  box-shadow: 0 6px 16px rgba(30, 111, 168, .25);
}
body .btn-primary:hover,
body .btn.primary:hover {
  box-shadow: 0 10px 24px rgba(30, 111, 168, .35);
  transform: translateY(-1px);
}

/* ---------- 카드 그리드 간격 일관화 ---------- */
@media (min-width: 768px) {
  body .product-grid,
  body .place-grid,
  body .vet-grid,
  body .post-grid {
    gap: 20px;
  }
}

/* ============================================================
   ─────── 디자인 디렉션 레이어: "Pet-Warm Sky" ───────
   하늘색 브랜드 × 따뜻한 크림 × 발자국 모티프 × 의도된 모션
   ============================================================ */

/* ---------- (1) 스크롤 진행 표시줄 ---------- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: var(--scroll-progress, 0%);
  background: linear-gradient(90deg, #4FA8D8 0%, #2ABFBF 50%, #FF7A45 100%);
  z-index: 200;
  pointer-events: none;
  transition: width .12s linear;
  box-shadow: 0 1px 4px rgba(79, 168, 216, .35);
}

/* ---------- (2) 분위기: 발자국 패턴 배경 (subtle) ---------- */
body .hero,
body section.regions,
body .features,
body section.featured {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80' width='80' height='80'><g fill='%231E6FA8' opacity='0.045'><ellipse cx='40' cy='52' rx='9' ry='10'/><ellipse cx='26' cy='38' rx='4' ry='5'/><ellipse cx='54' cy='38' rx='4' ry='5'/><ellipse cx='32' cy='28' rx='4' ry='5'/><ellipse cx='48' cy='28' rx='4' ry='5'/></g></svg>"),
    linear-gradient(180deg, #F4FAFE 0%, #FFFFFF 100%);
  background-repeat: repeat, no-repeat;
  background-size: 160px, 100% 100%;
}

/* ---------- (3) 섹션 타이틀 강조 바 ---------- */
body .section-title {
  position: relative;
  padding-bottom: 16px;
}
body .section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 64px; height: 4px;
  background: linear-gradient(90deg, #FF7A45 0%, #4FA8D8 100%);
  border-radius: 999px;
  transform-origin: left center;
  transform: scaleX(.35);
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
body .section-head.in .section-title::after,
body .section-head.reveal.in .section-title::after {
  transform: scaleX(1);
}

/* ---------- (4) 섹션 eyebrow 발자국 액센트 ---------- */
body .section-eyebrow {
  display: inline-flex;
  align-items: center;
}
body .section-eyebrow::before {
  content: "🐾";
  display: inline-block;
  margin-right: 8px;
  font-size: .9em;
  transform: translateY(-1px);
  filter: drop-shadow(0 1px 2px rgba(79, 168, 216, .35));
}

/* ---------- (5) 타이포 리파인 (한국어 최적화) ---------- */
body .hero h1,
body .section-title {
  font-feature-settings: 'kern' 1, 'liga' 1, 'palt' 1;
  word-break: keep-all;
  text-wrap: balance;
}
body .hero p.lead,
body .section-sub {
  word-break: keep-all;
  text-wrap: pretty;
}

/* ---------- (6) HERO 로드 시퀀스 (메모러블 모먼트) ---------- */
@media (prefers-reduced-motion: no-preference) {
  body .hero .hero-badge { animation: heroIn .8s cubic-bezier(.2,.7,.2,1) both; }
  body .hero h1            { animation: heroIn 1s   cubic-bezier(.2,.7,.2,1) .08s both; }
  body .hero p.lead        { animation: heroIn 1s   cubic-bezier(.2,.7,.2,1) .22s both; }
  body .hero-actions       { animation: heroIn 1s   cubic-bezier(.2,.7,.2,1) .36s both; }
  body .hero .map-card     { animation: heroMap 1.3s cubic-bezier(.2,.7,.2,1) .2s both; }
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroMap {
  from { opacity: 0; transform: translateY(40px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- (7) HERO 떠다니는 발자국 데코 (의도된 한두 가지) ---------- */
body .hero .container {
  position: relative;
}
body .hero .container::before,
body .hero .container::after {
  content: "🐾";
  position: absolute;
  font-size: 28px;
  opacity: .14;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
body .hero .container::before {
  top: 14%;
  left: -32px;
  animation: pawDriftA 7s ease-in-out infinite;
}
body .hero .container::after {
  bottom: 10%;
  right: -8px;
  animation: pawDriftB 9s ease-in-out infinite;
}
@keyframes pawDriftA {
  0%, 100% { transform: rotate(-18deg) translateY(0); }
  50%      { transform: rotate(-18deg) translateY(-12px); }
}
@keyframes pawDriftB {
  0%, 100% { transform: rotate(22deg) translateY(0); }
  50%      { transform: rotate(22deg) translateY(-10px); }
}
body .hero .container > * {
  position: relative;
  z-index: 1;
}

/* ---------- (8) 카드 호버 디테일 강화 ---------- */
@media (hover: hover) and (pointer: fine) {
  body .product-card,
  body .post-card,
  body .vet-card,
  body .place-card,
  body .feature-card {
    background-image: linear-gradient(180deg, rgba(255, 252, 248, .8) 0%, #fff 80px);
  }
  body .product-card:hover,
  body .post-card:hover,
  body .vet-card:hover,
  body .place-card:hover,
  body .feature-card:hover {
    border-color: transparent;
    box-shadow:
      0 0 0 1px rgba(79, 168, 216, .25),
      0 4px 12px rgba(15, 70, 113, .08),
      0 22px 48px rgba(15, 70, 113, .16);
  }
}

/* ---------- (9) 네비 active indicator ---------- */
body .nav-menu a { position: relative; }
body .nav-menu a.is-active,
body .nav-menu a[aria-current="page"] {
  color: var(--sky-700, #1E6FA8);
  font-weight: 700;
}
body .nav-menu a.is-active::after,
body .nav-menu a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  background: linear-gradient(90deg, #4FA8D8, #2ABFBF);
  border-radius: 999px;
}

/* ---------- (10) 버튼 sheen (호버 시 한 번) ---------- */
@media (hover: hover) and (pointer: fine) {
  body .btn-primary,
  body .btn-orange {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  body .btn-primary::after,
  body .btn-orange::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.32) 50%, transparent 70%);
    transform: translateX(-110%);
    transition: transform .65s cubic-bezier(.2,.7,.2,1);
    pointer-events: none;
  }
  body .btn-primary:hover::after,
  body .btn-orange:hover::after {
    transform: translateX(110%);
  }
}

/* ---------- (11) 모션 줄이기 가드 ---------- */
@media (prefers-reduced-motion: reduce) {
  body .hero .hero-badge,
  body .hero h1,
  body .hero p.lead,
  body .hero-actions,
  body .hero .map-card,
  body .hero .container::before,
  body .hero .container::after,
  body .section-title::after,
  body .btn-primary::after,
  body .btn-orange::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  body .section-title::after { transform: scaleX(1) !important; }
}

/* ============================================================
   (12) 다크모드 토글 버튼
   ============================================================ */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-50), #fff);
  border: 2px solid var(--sky-300);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: transform .25s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
  margin-right: 6px;
  line-height: 1;
  color: var(--ink-700);
  box-shadow: 0 2px 8px rgba(79,168,216,.15);
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.1); background: var(--sky-100); box-shadow: 0 4px 14px rgba(79,168,216,.3); }
[data-theme="dark"] .theme-toggle {
  background: linear-gradient(135deg, var(--sky-50), var(--bg-soft));
  border-color: var(--sky-300);
  box-shadow: 0 2px 8px rgba(168, 210, 238, .2);
}

/* ============================================================
   (13) 다크모드 카드/배경 보정 — 인라인 #fff 카드 자동 다크화
   ============================================================ */
[data-theme="dark"] .place,
[data-theme="dark"] .vet-card,
[data-theme="dark"] .post-card,
[data-theme="dark"] .post-modal-inner,
[data-theme="dark"] .hub-card,
[data-theme="dark"] .feature,
[data-theme="dark"] .search-card,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .stat,
[data-theme="dark"] .stop,
[data-theme="dark"] .review,
[data-theme="dark"] .route-summary,
[data-theme="dark"] .day-tabs,
[data-theme="dark"] .place-toolbar,
[data-theme="dark"] .board-sidebar,
[data-theme="dark"] .board-search,
[data-theme="dark"] .board-table,
[data-theme="dark"] .board-pagination button,
[data-theme="dark"] .product-card,
[data-theme="dark"] .mall-toolbar,
[data-theme="dark"] .write-form input,
[data-theme="dark"] .write-form textarea,
[data-theme="dark"] .write-form select {
  background-color: var(--card-bg) !important;
  border-color: var(--line) !important;
  color: var(--ink-700);
}
[data-theme="dark"] .board-table thead th { background-color: var(--bg-soft) !important; }
[data-theme="dark"] .board-table tbody tr:hover { background-color: var(--sky-50) !important; }
[data-theme="dark"] .place-body h4,
[data-theme="dark"] .vet-name,
[data-theme="dark"] .post-modal-title,
[data-theme="dark"] .feature h3,
[data-theme="dark"] .post-title-link,
[data-theme="dark"] .section-title,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 { color: var(--ink-900); }
[data-theme="dark"] footer { background: #050E16 !important; border-top: 1px solid var(--line); }
[data-theme="dark"] .vet-emergency-banner { background: linear-gradient(135deg, #2A1A12, #2F2014) !important; border-color: #4A2A18 !important; }
[data-theme="dark"] .page-hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%) !important;
}
[data-theme="dark"] .nav-burger { background: var(--sky-50); }
[data-theme="dark"] .nav-burger span,
[data-theme="dark"] .nav-burger span::before,
[data-theme="dark"] .nav-burger span::after { background: var(--sky-700); }

/* ============================================================
   (13b) 다크모드 카드 가독성 보강 — 인라인 스타일이 라이트 톤 #fff/var(--ink-X)를
        직접 박은 카드들에서 자식 텍스트가 묻히는 문제 해결
   ============================================================ */
[data-theme="dark"] .vet-card,
[data-theme="dark"] .place,
[data-theme="dark"] .place-card,
[data-theme="dark"] .product-card,
[data-theme="dark"] .post-card,
[data-theme="dark"] .region-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .hub-card,
[data-theme="dark"] .stat {
  background: #1A2D44 !important;
  border-color: rgba(127,211,245,.18) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.32) !important;
}
[data-theme="dark"] .vet-card .vet-name,
[data-theme="dark"] .vet-card .vet-card-head,
[data-theme="dark"] .place-card h3,
[data-theme="dark"] .place-card h4,
[data-theme="dark"] .place .title,
[data-theme="dark"] .place strong,
[data-theme="dark"] .product-card .name,
[data-theme="dark"] .product-card strong,
[data-theme="dark"] .post-card .title,
[data-theme="dark"] .post-card .post-title,
[data-theme="dark"] .region-card h3,
[data-theme="dark"] .region-card .name,
[data-theme="dark"] .feature-card h3,
[data-theme="dark"] .feature-card .title,
[data-theme="dark"] .hub-card h3,
[data-theme="dark"] .stat .num {
  color: #F0F4F8 !important;
}
[data-theme="dark"] .vet-card .vet-info,
[data-theme="dark"] .vet-card .vet-info .row,
[data-theme="dark"] .vet-card .vet-info .val,
[data-theme="dark"] .place-card .desc,
[data-theme="dark"] .place-card .meta,
[data-theme="dark"] .place-card p,
[data-theme="dark"] .place .desc,
[data-theme="dark"] .place .meta,
[data-theme="dark"] .product-card .meta,
[data-theme="dark"] .product-card p,
[data-theme="dark"] .post-card .meta,
[data-theme="dark"] .post-card .preview,
[data-theme="dark"] .region-card .desc,
[data-theme="dark"] .region-card p,
[data-theme="dark"] .feature-card p,
[data-theme="dark"] .stat .label {
  color: #B8C5D1 !important;
}
[data-theme="dark"] .vet-card .vet-info .lbl,
[data-theme="dark"] .place-card .lbl,
[data-theme="dark"] .product-card .lbl,
[data-theme="dark"] .region-card .lbl {
  color: #8A9AA8 !important;
}
[data-theme="dark"] .vet-region,
[data-theme="dark"] .region-card .region-tag {
  background: rgba(127,211,245,.18) !important;
  color: #7FD3F5 !important;
}
[data-theme="dark"] .vet-actions { border-top-color: rgba(127,211,245,.15) !important; }
[data-theme="dark"] .vet-map {
  background: rgba(127,211,245,.10) !important;
  color: #7FD3F5 !important;
  border-color: rgba(127,211,245,.25) !important;
}
[data-theme="dark"] .vet-call {
  background: #2BA8DC !important;
  color: #FFFFFF !important;
}
[data-theme="dark"] .vet-disclaimer {
  background: #0F2238 !important;
  color: #8A9AA8 !important;
}
[data-theme="dark"] .vet-emergency-text p { color: #C8D2DA !important; }

/* ============================================================
   (14) 모바일 반응형 보강 — 터치 타겟·간격·타이포
   ============================================================ */
@media (max-width: 720px) {
  .theme-toggle { width: 36px; height: 36px; font-size: 16px; }
  .nav-cta .btn { padding: 8px 14px; font-size: 13px; }
  .nav-inner { gap: 8px; height: 60px; }
  .logo { font-size: 17px; }
  .logo small { display: none; }
  body { font-size: 15px; }
  .hero { padding: 40px 0 50px; }
  .hero h1 { font-size: clamp(26px, 7vw, 36px); }
  .hero p.lead { font-size: 15px; }
  .section-title { font-size: clamp(22px, 6vw, 30px); }
  .section-sub { font-size: 14px; }
  .container { width: min(1200px, 94%); }
  .btn, .nav-menu a, .chip, .region-chip, .cat-chip, .place-fav { min-height: 40px; }
}
@media (max-width: 480px) {
  .hero { padding: 28px 0 40px; }
  .hero h1 { font-size: clamp(24px, 7.5vw, 30px); letter-spacing: -0.5px; }
  .section-head { gap: 8px; }
  .place-grid, .vet-grid, .feature-grid { gap: 12px; }
  .nav-cta .btn-primary { padding: 8px 12px; font-size: 12px; }
}

/* ============================================================
   (15) 홈 Hero 인상적 강화 — 그라데이션 텍스트 애니메이션·stat sweep
   ============================================================ */
.hero h1 .accent {
  background: linear-gradient(135deg, var(--sky-500), var(--teal), var(--orange));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-gradient-shift 8s ease infinite;
}
@keyframes hero-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero .stat { position: relative; overflow: hidden; }
.hero .stat::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  transition: left .6s ease;
  pointer-events: none;
}
.hero .stat:hover::before { left: 100%; }
[data-theme="dark"] .hero .stat::before {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 .accent { animation: none; }
  .hero .stat::before { display: none; }
}

/* ===== Mobile hamburger menu ===== */
@media (max-width: 720px) {
  .nav-menu {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--nav-bg, #ffffff);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 20px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
    box-shadow: 0 10px 28px rgba(14,31,44,.10);
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    z-index: 79;
  }
  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-menu a {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
    border-bottom: 1px solid var(--line);
  }
  .nav-menu a:last-child { border-bottom: none; }
  .nav-burger { display: inline-flex !important; cursor: pointer; border: none; }
  .nav-burger span,
  .nav-burger span::before,
  .nav-burger span::after { transition: transform .22s ease, background .22s ease, top .22s ease; }
  .nav-burger.open span { background: transparent; }
  .nav-burger.open span::before { top: 0; transform: rotate(45deg); }
  .nav-burger.open span::after { top: 0; transform: rotate(-45deg); }
}
[data-theme="dark"] .nav-menu { background: #14202b; border-bottom-color: rgba(255,255,255,.08); }
[data-theme="dark"] .nav-menu a { border-bottom-color: rgba(255,255,255,.06); }
[data-theme="dark"] .nav-burger { background: rgba(127,211,245,.15); }
[data-theme="dark"] .nav-burger span,
[data-theme="dark"] .nav-burger span::before,
[data-theme="dark"] .nav-burger span::after { background: #7FD3F5; }

/* ===== Loading Skeleton (TourAPI/Kakao 응답 대기 깜빡임 방지) ===== */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton, .skeleton-text {
  background: linear-gradient(90deg, var(--bg-soft) 0%, var(--line) 50%, var(--bg-soft) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-text.long { width: 100%; }
.skeleton-card { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px; }
.skeleton-card .skeleton-img { width: 100%; height: 140px; border-radius: 8px; margin-bottom: 14px; }
[data-theme="dark"] .skeleton, [data-theme="dark"] .skeleton-text {
  background: linear-gradient(90deg, #1A2D44 0%, rgba(127,211,245,.18) 50%, #1A2D44 100%);
  background-size: 200% 100%;
}

/* ===== Fade In Up (페이지 진입 부드러운 등장) ===== */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fade-in-up .35s ease both; }
.fade-in-up-1 { animation-delay: .04s; }
.fade-in-up-2 { animation-delay: .08s; }
.fade-in-up-3 { animation-delay: .12s; }
.fade-in-up-4 { animation-delay: .16s; }
.fade-in-up-5 { animation-delay: .20s; }
@media (prefers-reduced-motion: reduce) {
  .fade-in-up, .skeleton, .skeleton-text { animation: none !important; }
}

/* ===== Card hover micro-interaction (옵트인 유틸 클래스) ===== */
.card-elevate { transition: transform .18s ease, box-shadow .22s ease, border-color .18s ease; }
.card-elevate:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(14,31,44,.12); border-color: var(--sky-300); }
[data-theme="dark"] .card-elevate:hover { box-shadow: 0 10px 28px rgba(0,0,0,.45); border-color: rgba(127,211,245,.45); }

/* ===== Focus visible (키보드 접근성) ===== */
:focus-visible {
  outline: 3px solid var(--sky-500);
  outline-offset: 2px;
  border-radius: 6px;
}
button:focus-visible, a:focus-visible { outline-color: var(--sky-700); }

/* ============================================================
   (16) Mobile Polish — 가로 스크롤 방지·터치 타겟·iOS Safe area
   ============================================================ */
html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
body {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img, video, iframe { max-width: 100%; }
table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
pre, code { word-break: break-all; }

/* iOS input zoom 방지 (16px 이상 유지) */
input, textarea, select { font-size: 16px; }

/* 더 빠른 탭 반응 */
a, button, .btn, .chip { touch-action: manipulation; }

/* iOS Safe-area inset 대응 (홈 인디케이터 영역) */
@supports (padding: max(0px)) {
  .back-to-top {
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
  }
  footer { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
  /* 매우 좁은 화면: hero-stats 패딩·폰트 축소 */
  .hero-stats { gap: 8px !important; }
  .hero-stats .stat { padding: 12px 10px; }
  .hero-stats .stat strong { font-size: 18px; }
  .hero-stats .stat span { font-size: 11px; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .container { width: min(1200px, 96%); }
  section { padding: 48px 0; }
  .section-head { margin-bottom: 22px; }
  .map-card { aspect-ratio: 4/3; }
  .map-floating { right: 6px; top: 14px; padding: 8px 10px; }
  .map-floating .av { width: 30px; height: 30px; font-size: 16px; }
}

@media (max-width: 360px) {
  .hero-stats { grid-template-columns: 1fr !important; }
  .hero-stats .stat strong { font-size: 20px; }
  .hero-stats .stat span { font-size: 13px; }
}

/* nav-cta가 햄버거 메뉴와 충돌 안 하게 */
@media (max-width: 720px) {
  .nav-cta .btn-primary { padding: 8px 14px; font-size: 13px; }
  .nav-cta .theme-toggle { width: 36px; height: 36px; }
  /* 검색 카드 패딩 축소 */
  .search-card { padding: 14px; }
  .search-bar { padding: 4px 4px 4px 14px; }
  .search-bar input { font-size: 16px; height: 42px; }
  /* chips 줄 간격 축소 */
  .chips { gap: 6px; margin-top: 12px; }
  .chip { padding: 7px 12px; font-size: 12px; }
  /* 카드 그림자 약화 (배터리/렌더링 비용) */
  body .product-card, body .post-card, body .vet-card, body .place-card, body .feature-card {
    box-shadow: 0 1px 2px rgba(15, 70, 113, .06), 0 4px 12px rgba(15, 70, 113, .06);
  }
  /* 모달 하단 여백 (safe-area) */
  .post-modal-inner, .modal-inner, [class*="-modal-inner"] {
    max-height: 90vh;
    margin: 12px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* ===== Language switcher (i18n) ===== */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-bg, #fff);
  font-size: 12px;
}
.lang-switcher button {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--ink-500);
  font-weight: 700;
  font-size: 12px;
  background: transparent;
  cursor: pointer;
  min-height: 30px;
  min-width: 30px;
}
.lang-switcher button.active {
  background: var(--sky-700);
  color: #fff;
}
.lang-switcher button:hover:not(.active) {
  background: var(--sky-50);
  color: var(--sky-700);
}
@media (max-width: 720px) {
  .lang-switcher { padding: 2px 3px; gap: 0; }
  .lang-switcher button { padding: 3px 5px; font-size: 11px; min-width: 24px; min-height: 26px; }
}
@media (max-width: 480px) {
  /* 매우 좁은 화면에선 가운데 두 글자만 (KO/EN) 보이고 ja/zh는 숨김 — 자동 감지로 충분 */
  .lang-switcher { display: none; }
}
[data-theme="dark"] .lang-switcher { background: var(--card-bg); border-color: var(--line); }
