/* 0. 스크롤바 생성/소멸 시 페이지 좌우 틀어짐(흔들림) 완벽 방지 */
html {
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

/* =====================================================================
   사이트 공통 타이포그래피 — 글꼴·크기·색은 이 파일에서만 정합니다.
   (각 페이지에서 따로 정하지 않고, 바꾸고 싶으면 아래 변수만 고치세요)
   ===================================================================== */
:root {
  --font-main: Pretendard, 'Pretendard Variable', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --fs-base: 12px;     /* 기본 글자 크기 */
  /* 상세페이지(사용자·관리자 공통) */
  --fs-d-no: 16px;      /* 매물번호 (눈에 띄게) */
  --fs-d-title: 20px;   /* 매물 제목 */
  --fs-d-price: 20px;   /* 금액 */
  --fs-d-addr: 14px;    /* 소재지 */
  --fs-d-h2: 16px;      /* 구역 제목 (매물 조건 요약, 상세 설명 …) */
  --fs-d-body: 14px;    /* 상세 설명 본문 */
  --fs-d-head: 16px;    /* 설명 안의 소제목 (✅ 금액 / ✅ 물건 …) */
  --fs-d-label: 12px;   /* 조건 요약 칸의 이름 */
  --fs-d-value: 14px;   /* 조건 요약 칸의 값 */
  --fs-title: 14px;    /* 매물 제목 */
  --fs-price: 15px;    /* 금액 */
  --fs-h3: 14px;       /* 작은 제목 (text-lg) */
  --fs-h2: 16px;       /* 제목 (text-xl) */
  --fs-h1: 18px;       /* 큰 제목 (text-2xl) */
  --fs-hero: 22px;     /* 가장 큰 제목 (text-3xl) */
  --text-color: #000000; /* 기본 글자색 (검정) */
  --c-maemae: #E11D48;  /* 매물 종류별 색 */
  --c-jutak: #059669;
  --c-sangga: #253689;
  --c-toji: #D97706;
  --c-all: #1E293B;
  --text-sub: #4b5563;   /* 보조 글자색 (짙은 회색: 요약설명 등) */
}

html { font-size: 16px; } /* rem 기준은 그대로 두고, 글자 크기는 아래에서 직접 지정 */

body, button, input, select, textarea {
  font-family: var(--font-main) !important;
  letter-spacing: -0.025em;
}
body {
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text-color);
}
input, select, textarea, button { font-size: var(--fs-base); }

/* 본문 크기 통일: xs / sm / base 및 9~13px 임의 크기 → 모두 기본 크기 */
[class*="text-xs"], [class*="text-sm"], [class*="text-base"],
[class*="text-[9px]"], [class*="text-[9.5px]"], [class*="text-[10px]"], [class*="text-[11px]"],
[class*="text-[12px]"], [class*="text-[13px]"] {
  font-size: var(--fs-base) !important;
  line-height: 1.5 !important;
}
/* 제목 크기 */
[class*="text-lg"]  { font-size: var(--fs-h3) !important; }
[class*="text-xl"]  { font-size: var(--fs-h2) !important; }
[class*="text-2xl"] { font-size: var(--fs-h1) !important; }
[class*="text-3xl"] { font-size: var(--fs-hero) !important; }

/* 매물 제목·금액 (카드, 목록, 지도 팝업 공통) */
.t-title { font-size: var(--fs-title) !important; line-height: 1.4 !important; }
.t-price { font-size: var(--fs-price) !important; line-height: 1.4 !important; }
/* 모바일(640px 미만)에서는 제목·금액을 1px씩 줄임 */
@media (max-width: 639px) {
  .t-title { font-size: calc(var(--fs-title) - 1px) !important; }
  .t-price { font-size: calc(var(--fs-price) - 1px) !important; }
}

.t-summary { color: var(--text-sub) !important; }

/* 회색 글자 → 검정 (어두운 배경의 머리말·꼬리말·슬로건은 제외) */
.text-slate-400, .text-slate-500, .text-slate-600, .text-slate-700, .text-slate-800,
.text-gray-400, .text-gray-500, .text-gray-600, .text-gray-700, .text-gray-800 {
  color: var(--text-color) !important;
}
header .text-slate-400, header .text-slate-500, header .text-slate-600,
footer .text-slate-400, footer .text-slate-500, footer .text-slate-600,
.bg-slate-900 .text-slate-400, .bg-slate-900 .text-slate-500,
.bg-slate-800 .text-slate-400, .bg-slate-800 .text-slate-500 {
  color: #cbd5e1 !important;
}

/* 줄임 표시 (카드 요약글 등) */
.clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: keep-all;
}

/* 매물 카드 썸네일 스타일 */
.property-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background-color: #f1f5f9;
}
.property-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.property-card:hover .property-card-img {
  transform: scale(1.05);
}

/* 카테고리별 마커 윤곽선 디자인 */
.marker-maemae {
  width: 20px; height: 20px; background-color: #E11D48;
  border: 2.5px solid #FFFFFF; border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.15);
  cursor: pointer; transition: transform 0.2s ease; display: block;
}
.marker-jutak {
  width: 20px; height: 20px; background-color: #059669;
  border: 2.5px solid #FFFFFF; border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.15);
  cursor: pointer; transition: transform 0.2s ease; display: block;
}
.marker-sangga {
  width: 20px; height: 20px; background-color: #253689;
  border: 2.5px solid #FFFFFF; border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.15);
  cursor: pointer; transition: transform 0.2s ease; display: block;
}
.marker-toji {
  width: 20px; height: 20px; background-color: #D97706;
  border: 2.5px solid #FFFFFF; border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,0,0,0.15);
  cursor: pointer; transition: transform 0.2s ease; display: block;
}

.marker-maemae:hover, .marker-jutak:hover, .marker-sangga:hover, .marker-toji:hover {
  transform: scale(1.3);
  z-index: 999;
}

/* 클러스터 아이콘 */
.cluster-icon {
  width: 42px; height: 42px; line-height: 36px;
  background-color: #253689; color: #ffffff;
  text-align: center; font-weight: 800; font-size: var(--fs-base);
  border-radius: 50%; border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(37, 54, 137, 0.5), 0 2px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}

/* 지도 높이 조절 스플리터 */
#map-resizer {
  height: 8px;
  background-color: #e2e8f0;
  cursor: row-resize;
  transition: background-color 0.2s;
}
#map-resizer:hover, #map-resizer.resizing {
  background-color: #253689;
}
/* 지도 클러스터(묶음) 아이콘 — index.php 에서 클래스로 사용 */
.cluster-all {
  width: 36px; height: 36px; color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: var(--fs-base); border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* 현재위치 버튼 / 안내 문구 */
#btn-my-location {
  width: 36px; height: 36px; border-radius: 8px; background: #fff; border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
#btn-my-location:hover { background: #f0f3ff; }
#btn-my-location.loading { opacity: .6; pointer-events: none; }
#my-location-toast {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30;
  background: rgba(0,0,0,.8); color: #fff; padding: 6px 12px; border-radius: 8px; display: none; white-space: nowrap;
}
.my-pos-dot {
  width: 16px; height: 16px; border-radius: 50%; background: #2563eb; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(37,99,235,.25), 0 1px 4px rgba(0,0,0,.4);
}

/* =====================================================================
   상단 메뉴 (includes/header.php)
   ===================================================================== */
.site-header { background: #253689; color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.brand-name { font-size: 18px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; color: #fff; }
.brand-sub  { font-size: 10px; font-weight: 500; letter-spacing: .12em; color: #cbd5e1; margin-top: 3px; }

/* PC: 그룹 제목 */
.sn-group { position: relative; }
.sn-trigger {
  display: inline-flex; align-items: center; gap: 4px; height: 64px; padding: 0 14px;
  color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; background: transparent; border: 0;
  border-bottom: 3px solid transparent; box-sizing: border-box; transition: background .15s;
}
.sn-trigger:hover, .sn-group:hover > .sn-trigger, .sn-group:focus-within > .sn-trigger { background: rgba(255,255,255,.12); }
.sn-trigger.is-active { border-bottom-color: #fff; }
.sn-caret { font-size: 11px; opacity: .8; margin-left: 2px; }

/* PC: 펼침 메뉴 (마우스를 올리면 열림, 키보드 이동도 가능) */
.sn-panel {
  display: none; position: absolute; left: 0; top: 100%; min-width: 190px; padding: 6px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 0 0 12px 12px; box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.sn-group:hover > .sn-panel, .sn-group:focus-within > .sn-panel { display: block; }
.sn-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: transparent;
  color: #000; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.sn-item:hover { background: #f0f3ff; color: #253689; }
.sn-item.is-active { background: #253689; color: #fff; font-weight: 800; }

/* 모바일 메뉴 */
.mobile-menu { background: #fff; border-top: 1px solid #e2e8f0; max-height: calc(100vh - 64px); overflow-y: auto; box-shadow: 0 10px 20px rgba(0,0,0,.2); }
.mm-group { border-bottom: 1px solid #e2e8f0; padding: 10px 0 4px; }
.mm-title { padding: 0 16px 6px; color: #253689; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.mm-single {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px;
  color: #000; font-size: 14px; font-weight: 800; cursor: pointer; list-style: none;
}
.mm-single { border-bottom: 1px solid #e2e8f0; }
.mm-single.is-active { color: #253689; background: #f0f3ff; }
.mm-items { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.sn-item-m { flex: 1 1 calc(50% - 6px); min-height: 40px; background: #f1f5f9; border-radius: 8px; padding: 8px 12px; }
.sn-item-m[data-cat] { flex: 1 1 calc(20% - 6px); padding-left: 4px; padding-right: 4px; text-align: center; }
.sn-item-m.is-active { background: #253689; color: #fff; }

/* 검색바 '매물 종류' 칸: 선택한 종류의 색 배경 + 흰 글씨 */
#common-filter-cat { color: #fff !important; border-color: transparent !important; font-weight: 800; }
#common-filter-cat[data-cat="all"]    { background-color: var(--c-all) !important; }
#common-filter-cat[data-cat="maemae"] { background-color: var(--c-maemae) !important; }
#common-filter-cat[data-cat="jutak"]  { background-color: var(--c-jutak) !important; }
#common-filter-cat[data-cat="sangga"] { background-color: var(--c-sangga) !important; }
#common-filter-cat[data-cat="toji"]   { background-color: var(--c-toji) !important; }
#common-filter-cat option { color: #fff; font-weight: 700; }
#common-filter-cat option[value="all"]    { background-color: var(--c-all); }
#common-filter-cat option[value="maemae"] { background-color: var(--c-maemae); }
#common-filter-cat option[value="jutak"]  { background-color: var(--c-jutak); }
#common-filter-cat option[value="sangga"] { background-color: var(--c-sangga); }
#common-filter-cat option[value="toji"]   { background-color: var(--c-toji); }

/* =====================================================================
   상세페이지 글자 (detail.php / admin/adm_detail.php)  — 기본 12px 보다 크게
   ===================================================================== */
@media (max-width: 639px) {
  :root {
    --fs-d-no: 14px; --fs-d-title: 18px; --fs-d-price: 18px; --fs-d-addr: 13px;
    --fs-d-h2: 15px; --fs-d-body: 13px; --fs-d-head: 15px; --fs-d-value: 13px;
  }
}
.d-no { font-size: var(--fs-d-no) !important; font-weight: 900; letter-spacing: .03em; line-height: 1.2 !important;
        padding: 5px 12px; border-radius: 10px; background: #253689; flex-shrink: 0; white-space: nowrap; color: #fff !important; display: inline-block;
        box-shadow: 0 2px 6px rgba(37,54,137,.35); }
.d-badge { font-size: var(--fs-d-addr) !important; font-weight: 800; padding: 5px 10px; border-radius: 10px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-title { font-size: var(--fs-d-title) !important; line-height: 1.4 !important; font-weight: 900; }
.d-price { font-size: var(--fs-d-price) !important; line-height: 1.3 !important; font-weight: 900; }
.d-addr  { font-size: var(--fs-d-addr) !important; line-height: 1.5 !important; }
.d-h2    { font-size: var(--fs-d-h2) !important; line-height: 1.4 !important; font-weight: 900; }
.d-label { font-size: var(--fs-d-label) !important; }
.d-value { font-size: var(--fs-d-value) !important; line-height: 1.4 !important; font-weight: 900; }

/* 상세 설명 본문 */
.doc-custom-content { font-size: var(--fs-d-body); line-height: 1.8; color: #1e293b; word-wrap: break-word; overflow-wrap: break-word; word-break: normal; -webkit-text-size-adjust: 100%; }
.doc-custom-content p, .doc-custom-content div { display: block; clear: both; margin: 0; padding: 0; }
.doc-custom-content .doc-head { font-size: var(--fs-d-head); }
.doc-highlight-red { color: #dc2626 !important; font-weight: 800 !important; }
.doc-highlight-bold { font-weight: 800 !important; color: #0f172a !important; }
/* ✅ 금액 / ✅ 물건 / ✅ 특징 제목 아래의 항목은 들여쓰기 */
.doc-custom-content div.doc-num { margin-left: 1.4em; margin-top: 2px; margin-bottom: 2px; }

/* 계산기·소개 등 나머지 페이지: 제각각이던 크기/글자색을 같은 기준으로 */
[class*="text-[15px]"] { font-size: var(--fs-h3) !important; }                 /* 15px → 14px */
[class*="text-[#2D3748]"], [class*="text-[#374151]"] { color: var(--text-color) !important; }   /* 짙은 회색 본문 → 검정 */
.tax-help, .money-hint { font-size: var(--fs-base) !important; }

/* =====================================================================
   페이지 상단 남색 소개 박스 (about / cooperation / dev_charge 공통)
   크기·여백·위치를 한 곳에서 관리 — 글 길이가 달라도 높이가 같게 맞춤
   ===================================================================== */
.page-hero {
  background: #111C44; color: #fff; border-radius: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.06);
  padding: 2rem 1.5rem; min-height: 210px; display: flex; align-items: center;
  text-align: center; position: relative; overflow: hidden;
}
.page-hero-inner { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.page-hero-inner h1 { color: #fff; margin: 0; }
.page-hero-desc { color: #d1d5db; font-size: var(--fs-base); line-height: 1.7; font-weight: 400; margin: 0; max-width: 60rem; }
@media (min-width: 640px) {
  .page-hero { padding: 2.5rem; min-height: 230px; text-align: left; }
  .page-hero-inner { align-items: flex-start; }
}

/* 위반건축물 표시: 건축물대장처럼 노란 바탕에 검정 글씨 (작게) */
.badge-violation { background: #FFE600; color: #000; font-size: var(--fs-base); font-weight: 800; line-height: 1; padding: 4px 8px; border-radius: 4px; border: 1px solid #E0C700; }
