/* ─────────────────────────────────────────────────────────────
 * 홈('/') — 검색 Hero + 반려동물 정보 포털.
 * 시선 흐름: 일러스트 → 검색창 → 종별·시설 진입 → 지금 필요한 3가지 → 생활 배너와 편집 콘텐츠.
 * 그라데이션 없음. 색은 아래 토큰과 공유 디자인 토큰만 사용한다.
 * ───────────────────────────────────────────────────────────── */

/* 색·폭·간격은 style.css :root 토큰을 그대로 쓴다(홈 전용 값 없음) */
.home-landing {
  --home-primary: var(--teal);
  --home-primary-deep: var(--teal-deep);
  --home-bg: var(--paper);
  --home-soft: var(--teal-soft);
  --home-text: var(--ink);
  --home-text-2: #5F6B67;   /* 보조 글자 — 흰 면 5.6:1, 민트·복숭아 배너 4.8:1 이상(2026-09-29, 기존 #7c8985는 3.1~3.6) */
  --home-line: var(--line);
  --home-accent: var(--coral);
  --home-search-h: 54px;     /* 검색창 높이 (모바일 52px) */
  --home-search-w: calc(var(--content-w) - 200px);

  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-8) 0;
  background: var(--home-bg);
  color: var(--home-text);
}

body { background: var(--paper); overflow-x: hidden; }


/* style.css 전역 포커스 링을 홈 톤에 맞춘다. */
.home-landing a:focus-visible,
.home-landing button:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 3px;
  border-radius: var(--radius-control);
}

/* 높이가 남을 때는 Hero뿐 아니라 포털과 저작권 표기까지 함께 가운데 정렬한다. */
.home-hero {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
}


/* ── 로고(작게) ────────────────────────────────────────────── */

.home-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-1-5);
  color: var(--home-primary-deep);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── 목적 한 줄 (보이는 h1) ─────────────────────────────────
   검색이 주인공인 크기를 유지하기 위해 작은 부제목 농도로 둔다. */
.home-title {
  margin: 0 0 var(--sp-1-5);
  color: var(--home-text);
  font-size: clamp(14px, 1.6vw, 16px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
  text-align: center;
}
.home-title em { font-style: normal; color: var(--home-primary-deep); }

.home-brand:hover { color: var(--home-primary-deep); text-decoration: none; }
.home-brand-mark { width: 38px; height: auto; flex: none; }
.home-brand-name { display: block; width: 59px; height: auto; }

/* ── 일러스트 + 검색창 (하나의 Hero) ───────────────────────── */

.home-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-illust {
  display: block;
  width: min(420px, 90%);
  height: auto;
}

/* 앞 언덕 아래쪽을 검색창이 살짝 덮어 일러스트와 이어져 보이게 한다. */
.home-search-form {
  position: relative;
  width: min(100%, var(--home-search-w));
  margin: -14px 0 0;
}

.home-search-shell {
  width: 100%;
  height: var(--home-search-h);
  display: flex;
  align-items: center;
  gap: var(--sp-2-5);
  padding: 0 var(--sp-2) 0 var(--sp-4-5);
  border: 1px solid var(--home-line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(37, 49, 46, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-search-shell:focus-within {
  border-color: #b7d6cc;
  box-shadow: 0 0 0 3px rgba(8, 118, 107, 0.08);
}

.home-search-icon,
.home-search-btn-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.home-search-icon { color: #a7b2ae; }

.home-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--home-text);
  font-family: var(--font-body);
  font-size: 14.5px;
  letter-spacing: -0.01em;
  -webkit-appearance: none;
  appearance: none;
}

.home-search-input::placeholder { color: #a3aeaa; opacity: 1; }
.home-search-input:focus,
.home-search-input:focus-visible { outline: none; box-shadow: none; }
/* WebKit 기본 지우기(x) 버튼 숨김 — 오른쪽은 검색 아이콘만 둔다 */
.home-search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.home-search-btn {
  width: var(--control-h);
  height: var(--control-h);
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--home-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.home-search-btn:hover { background: var(--home-soft); }
.home-search-btn .home-search-btn-icon { width: 19px; height: 19px; stroke-width: 2.2; }

/* 검색창 안쪽 위치(GPS) 버튼 — 제출 버튼과 같은 40px 컨트롤 높이의 원형 아이콘 버튼 */
.home-geo-btn {
  width: var(--control-h);
  height: var(--control-h);
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--home-primary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-geo-btn:hover { background: var(--home-soft); color: var(--home-primary-deep); }
.home-geo-btn:disabled { opacity: 0.55; cursor: default; }
.home-geo-icon { width: 19px; height: 19px; }

/* 위치 확인 상태·오류 안내 — 검색창 아래 작은 문구 */
.home-geo-note {
  margin: var(--sp-2) 0 0;
  padding: 0 var(--sp-4-5);
  color: var(--home-text-2);
  font-size: 11px;
  line-height: 1.4;
}

/* ── 검색 바로 아래의 다섯 업종. 검색창 본체 스타일은 위에서 그대로 유지한다. ── */
.home-category-nav {
  width: min(100%, var(--home-search-w));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: var(--sp-5);
  border-bottom: 1px solid var(--home-line);
  padding-bottom: var(--sp-4);
}
.home-category-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-width: 0;
  min-height: 48px;
  padding: var(--sp-2) var(--sp-1);
  font-family: var(--font-util);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--home-text);
  text-align: center;
  text-decoration: none;
}
.home-category-link:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  right: 0;
  width: 1px;
  background: var(--home-line);
}
.home-category-link:hover {
  color: var(--home-primary-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.home-category-icon, .home-guide-icon {
  width: 21px;
  height: 21px;
  flex: none;
  color: var(--home-primary);
}
.home-category-link span { min-width: 0; overflow-wrap: keep-all; }
/* ── 검색 포털 하단: 얇은 구분선만 쓰는 단일 기둥 ── */
.home-portal {
  width: min(calc(100% - var(--gutter) * 2), var(--home-search-w));
  margin: var(--sp-4) auto 0;
}
.home-portal h2 {
  margin: 0 0 var(--sp-3);
  color: var(--home-text);
  font-size: clamp(20px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.03em;
}
.home-region, .home-results {
  padding: var(--sp-5) 0 var(--sp-6);
  border-bottom: 1px solid var(--home-line);
}
.home-region { padding-top: 0; }
.home-results[hidden] { display: none; }
/* 검색 결과 제목과 전체 목록 링크는 한 줄, 모바일에서는 우측 정렬한 링크를 줄바꿈한다. */
.home-results-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-3);
}
.home-results-heading h2 { margin-bottom: 0; }
.home-region-form {
  display: grid;
  grid-template-columns: 1.03fr 1.03fr 1.03fr .9fr;
  align-items: end;
  gap: var(--sp-2-5);
}
.home-region-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}
.home-region-field label {
  font-family: var(--font-util);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--home-text-2);
}
.home-region-field select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--home-line);
  border-radius: var(--radius-control);
  color: var(--home-text);
  background: var(--card);
  font-family: var(--font-util);
  font-size: 14px;
  cursor: pointer;
}
.home-region-field select:disabled {
  color: var(--home-text-2);
  background: var(--paper-2);
  cursor: not-allowed;
}
.home-region-field select:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 2px;
}
.home-region-submit {
  width: 100%;
  min-height: 46px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--home-primary-deep);
  border-radius: var(--radius-control);
  color: var(--card);
  background: var(--home-primary-deep);
  font-family: var(--font-util);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.home-region-submit:hover { background: var(--home-primary); }
.home-region-submit:disabled { opacity: .6; cursor: default; }
.home-region-status, .home-results-status {
  margin: var(--sp-2) 0 0;
  color: var(--home-text-2);
  font-family: var(--font-util);
  font-size: 12.5px;
  line-height: 1.55;
}
.home-region-status a { color: var(--home-primary-deep); }
.home-results-list {
  list-style: none;
  margin: var(--sp-3) 0 0;
  padding: 0;
  border: 1px solid var(--home-line);
  border-radius: var(--radius-control);
  background: var(--card);
}
.home-results-list[hidden], .home-results-all[hidden] { display: none; }
.home-result-row + .home-result-row { border-top: 1px solid var(--home-line); }
.home-result-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  min-height: 58px;
  padding: var(--sp-2-5) var(--sp-3);
}
.home-result-main { flex: 1; min-width: 0; }
.home-result-name {
  color: var(--home-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.home-result-meta {
  margin-top: 2px;
  color: var(--home-text-2);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.home-result-view {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 44px;
  color: var(--home-primary-deep);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.home-result-view:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-results-all {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1);
  min-height: 44px;
  margin-left: auto;
  color: var(--home-primary-deep);
  font-family: var(--font-util);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.home-results-all:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── 작은 링크로만 제공하는 실제 생활 가이드 ── */
.home-guides {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-width: 0;
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--home-line);
}
.home-guides > .home-guide-link { flex: none; }
.home-guide-links {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-guide-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-width: 0;
  min-height: 48px;
  padding: 0 var(--sp-1-5);
  color: var(--home-text);
  font-family: var(--font-util);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}
.home-guide-link + .home-guide-link { border-left: 1px solid var(--home-line); }
.home-guide-links > .home-guide-link:first-child { border-left: 1px solid var(--home-line); }
.home-guide-link:hover { color: var(--home-primary-deep); text-decoration: underline; text-underline-offset: 3px; }
.home-guide-link span:not(.home-guide-arrow) { min-width: 0; }
.home-guide-arrow { flex: none; color: var(--home-primary-deep); }
.home-secondary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-1) var(--sp-4);
  padding-top: var(--sp-3);
  font-family: var(--font-util);
}
.home-secondary a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--sp-1);
  color: var(--home-text-2);
  font-size: 12.5px;
  text-decoration: none;
}
.home-secondary a:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-copyright {
  margin: var(--sp-1) auto 0;
  color: var(--muted);
  font-family: var(--font-util);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
@media (max-width: 800px) {
  .home-category-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-category-link:nth-child(3)::after { display: none; }
  .home-category-link:nth-child(n + 4) { border-top: 1px solid var(--home-line); }
  .home-region-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-guides { align-items: flex-start; flex-direction: column; gap: var(--sp-2); }
  .home-guides > .home-guide-link { justify-content: flex-start; width: 100%; }
  .home-guide-links { width: 100%; }
  .home-guide-links > .home-guide-link:first-child { border-left: 0; }
}
@media (max-width: 640px) {
  /* 기존 모바일 검색창 높이·아이콘 위치·일러스트 배치는 변경하지 않는다. */
  .home-hero { padding-right: var(--gutter-sm); padding-left: var(--gutter-sm); }
  .home-illust { width: min(340px, 94%); }
  .home-search-shell { height: 52px; padding: 0 var(--sp-1-5) 0 var(--sp-4); border-radius: var(--radius-xl); }
  .home-search-input { font-size: var(--fs-sm); }
  .home-portal { width: min(calc(100% - var(--gutter-sm) * 2), var(--home-search-w)); }
  .home-category-nav { margin-top: var(--sp-4); }
  .home-region, .home-results { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }
  .home-region { padding-top: 0; }
  .home-region-form { gap: var(--sp-2); }
  .home-guide-link { font-size: 13.5px; padding: 0 var(--sp-1); gap: var(--sp-1); }
  .home-guide-icon { width: 19px; height: 19px; }
}
@media (max-width: 420px) {
  .home-category-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-category-link:nth-child(3)::after { display: block; }
  .home-category-link:nth-child(even)::after { display: none; }
  .home-category-link:nth-child(n + 3) { border-top: 1px solid var(--home-line); }
  .home-category-link { justify-content: flex-start; padding-left: var(--sp-3); font-size: 14px; }
  .home-region-form { grid-template-columns: minmax(0, 1fr); }
  .home-region-submit { margin-top: var(--sp-1); }
  .home-guide-links { display: flex; flex-direction: column; }
  .home-guide-link { justify-content: flex-start; padding-left: var(--sp-3); }
  .home-guide-link + .home-guide-link { border-left: 0; border-top: 1px solid var(--home-line); }
  .home-result-row { gap: var(--sp-1); padding: var(--sp-2); }
  .home-result-view { min-width: 66px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-search-shell, .home-search-btn { transition: none; }
}
