:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --ink: #222222;
  --ink-soft: #555555;
  --muted: #888888;
  --border: #e5e5e5;
  --border-soft: rgba(229, 229, 229, 0.7);
  --accent: #ff8000;
  --accent-soft: #feb83f;
  --dark: #222222;
  --header-h: 70px; /* = site-chrome.css --uh-header-h */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --z-sticky: 1507;
  --z-drawer: 1600;
  --font: "Pretendard Variable", Pretendard, "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  padding-top: var(--header-h);
  overflow-x: clip;
}

body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: calc(var(--z-drawer) + 1);
  background: var(--dark);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── header ──
   상단 메뉴·모바일 내비·상담 신청 CTA·하단 빠른 문의는 css/site-chrome.css
   (unithaus.co.kr 헤더 사본)에서 담당한다. 여기서는 헤더 높이만 맞춘다. */

/* 도움말 다이얼로그 등 본문에서 쓰는 다크 pill 버튼 */
.btn-consult {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 35px;
  background: #222;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  word-break: keep-all;
  transition: opacity 150ms var(--ease);
}
.btn-consult:hover { opacity: 0.88; }

.btn-consult-block {
  width: 100%;
  font-size: 14px;
  padding: 12px 16px;
  border: 0;
}

/* ── page / hero ── */
.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 72px;
}

.hero {
  position: relative;
  text-align: center;
  padding: 20px 0 4px;
}

.help-chip {
  position: absolute;
  right: 0;
  top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  max-width: min(100%, 11.5rem);
  padding: 0 14px;
  border-radius: 999px;
  background: #222;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
}
.help-chip:hover { opacity: 0.9; }

.wordmark {
  margin: 0;
  line-height: 0;
}
.wordmark img {
  display: block;
  width: clamp(10rem, 28vw, 13.05rem);
  height: auto;
  margin-inline: auto;
}

.tagline {
  margin: 10px auto 0;
  max-width: 36rem;
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  font-weight: 500;
  line-height: 1.55;
  color: #222;
  letter-spacing: -0.02em;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.tagline em {
  font-style: normal;
  color: var(--accent);
  font-weight: 700;
}

/* ── type picker ── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 22px;
}

.type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 10px 14px;
  border: 1.5px solid #111827;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  min-width: 0;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
}
.type-card:hover {
  border-color: #374151;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px) scale(1.02);
}
.type-card[aria-pressed="true"] {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-soft);
  transform: none;
}

.type-thumb-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100px;
  padding: 4px 8px;
}

.type-thumb {
  width: min(120px, 88%);
  height: 96px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  transition: transform 200ms var(--ease);
}
.type-card:hover .type-thumb {
  transform: scale(1.06);
}

.type-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.type-label-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

.type-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  word-break: keep-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-blurb {
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--muted);
  max-width: 12em;
  word-break: keep-all;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.type-info {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #6b7280;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}
.type-info:hover,
.type-info[aria-expanded="true"] {
  border-color: var(--accent-soft);
  color: #b45309;
  background: #fff8eb;
}

.type-info-panel {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 0.6875rem;
  line-height: 1.45;
  text-align: left;
  max-width: 100%;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

/* ── size filters ── */
.size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.size-chip {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: #222;
  color: #fff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
  transition: background 160ms var(--ease), opacity 160ms var(--ease);
}
.size-chip:hover { opacity: 0.88; }
.size-chip[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* ── toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  word-break: keep-all;
  flex: 1 1 auto;
  min-width: 0;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-select,
.sort-dir {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.sort-select { padding: 0 12px; }

.sort-dir {
  width: 40px;
  height: 40px;
}
.sort-dir:hover { border-color: #bbb; }

.result-count {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── house cards (closer to live catalog) ── */
.house-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}

.house-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 220ms var(--ease), border-color 220ms var(--ease);
}
.house-card:hover {
  border-color: #d4d4d4;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.house-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, #f3f3f3, #ebebeb);
  overflow: hidden;
}
.house-media-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}
.house-img-primary,
.house-img-hover,
.house-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.house-img-primary,
.house-img-hover {
  position: absolute;
  inset: 0;
  display: block;
}
.house-img-hover {
  opacity: 0;
  z-index: 1;
  transition: opacity 280ms var(--ease);
  pointer-events: none;
}
.house-card.is-media-hover .house-img-hover {
  opacity: 1;
}
.house-card.has-hover-gallery .house-img-primary {
  /* primary stays underneath */
  z-index: 0;
}

.house-title a {
  color: inherit;
  text-decoration: none;
}
.house-title a:hover { color: #555; }

.case-pill {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  word-break: keep-all;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition:
    background 160ms var(--ease),
    color 160ms var(--ease),
    border-color 160ms var(--ease),
    opacity 220ms var(--ease),
    transform 220ms var(--ease),
    visibility 220ms var(--ease);
}
.case-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Hover-capable pointers: reveal on card hover / keyboard focus */
@media (hover: hover) {
  .case-pill {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
  }
  .house-card:hover .case-pill,
  .house-card:focus-within .case-pill {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
}

.house-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 8px 18px 16px;
  background: rgba(249, 249, 249, 0.6);
}

.house-footer {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.house-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.house-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
  word-break: keep-all;
  text-wrap: balance;
}

.house-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.house-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(34, 34, 34, 0.12);
  background: rgba(34, 34, 34, 0.06);
  color: #333;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.house-area {
  color: #666;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.house-prices {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  text-align: right;
}

.house-price-line {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.35;
  color: #333;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.house-price-line strong {
  font-weight: 700;
  color: #111;
  letter-spacing: -0.01em;
}

.house-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #222;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
  transition: opacity 160ms var(--ease);
}
.house-cta:hover { opacity: 0.88; }

/* ── states ── */
.empty-state,
.error-state,
.loading-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.empty-state h2,
.error-state h2 {
  margin: 0 0 8px;
  font-size: 1.125rem;
  color: var(--ink);
}
.empty-state p,
.error-state p,
.loading-state p {
  margin: 0;
  font-size: 0.9rem;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}
.skeleton-card {
  height: 280px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #eee, #f8f8f8, #eee);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8125rem;
}
.site-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover { color: var(--ink); }

.help-form {
  margin: 0;
  padding: 20px;
  max-width: 360px;
  font-family: inherit;
}
.help-form h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.help-form ol {
  margin: 0 0 16px;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(34, 34, 34, 0.4); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .type-card:hover,
  .type-card:hover .type-thumb {
    transform: none;
  }
  .house-img-hover {
    transition: none;
  }
}

@media (max-width: 900px) {
  /* Keep all 5 type cards on one row (no 3+2 wrap) */
  .type-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }
  .type-card {
    padding: 12px 4px 10px;
    gap: 6px;
  }
  .type-thumb-wrap {
    min-height: 64px;
    padding: 2px 2px;
  }
  .type-thumb {
    width: min(88px, 92%);
    height: 64px;
  }
  .type-label {
    font-size: 0.75rem;
  }
  .type-blurb {
    font-size: 0.5625rem;
    -webkit-line-clamp: 2;
  }
  .help-chip {
    position: static;
    margin: 0 auto 14px;
    max-width: none;
  }
  .hero { padding-top: 8px; }
  .house-grid,
  .skeleton-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  }
}

@media (max-width: 560px) {
  .page {
    width: min(1120px, calc(100% - 24px));
    padding: 12px 0 48px;
  }

  .site-footer {
    width: min(1120px, calc(100% - 24px));
    margin-bottom: 28px;
  }

  .wordmark img {
    width: clamp(8rem, 46vw, 10.5rem);
  }

  .tagline {
    margin-top: 8px;
    font-size: 0.875rem;
    max-width: 20rem;
    padding-inline: 4px;
  }

  .sort-controls {
    flex-shrink: 0;
  }

  .toolbar {
    align-items: flex-start;
    margin-bottom: 8px;
  }

  .hint { font-size: 0.8125rem; }

  .type-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin: 16px 0 14px;
  }

  .type-card {
    padding: 8px 2px 6px;
    gap: 4px;
    border-radius: var(--radius-sm);
  }

  .type-thumb-wrap {
    min-height: 44px;
    padding: 0;
  }

  .type-thumb {
    width: min(56px, 96%);
    height: 44px;
  }

  .type-info {
    width: 14px;
    height: 14px;
    font-size: 0.5625rem;
  }

  .type-label {
    white-space: normal;
    font-size: 0.6875rem;
    word-break: keep-all;
  }

  .type-blurb {
    display: none;
  }

  .type-badge {
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    font-size: 0.625rem;
  }

  .size-row {
    gap: 6px;
    margin-bottom: 12px;
  }

  .size-chip {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.8125rem;
  }

  .house-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .skeleton-card { height: 220px; }

  .house-media { aspect-ratio: 3 / 2; }

  .house-body {
    gap: 10px;
    padding: 8px 12px 12px;
  }

  .house-footer {
    gap: 8px;
  }

  .house-title { font-size: 1rem; }
  .house-price-line { font-size: 0.75rem; }

  .house-cta {
    min-height: 44px;
  }

  .case-pill {
    right: 8px;
    bottom: 8px;
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.6875rem;
  }
}
