/* =========================================================================
   THEX 부동산 테마 - 사이트 공통 (머리글, 바닥글, 홈, 일반 페이지)
   매물 목록·상세 화면 스타일은 property.css 에 있다.
   ========================================================================= */

/* 기본 색 6가지(--thex-bg, surface, text, accent, header-bg, footer-bg)는 사이트 디자인 설정이 덮어쓴다.
   나머지 색은 여기서 기본 색을 섞어 계산하므로 어떤 톤에서도 어울린다. */
:root {
	--thex-bg: #fff;
	--thex-surface: #fff;
	--thex-text: #111827;
	--thex-accent: #1d4ed8;
	--thex-on-accent: #fff;
	--thex-header-bg: #fff;
	--thex-header-text: #111827;
	--thex-footer-bg: #111827;
	--thex-footer-text: #fff;
	--thex-width: 1200px;
	--thex-heading-font: inherit;

	--thex-hero: var(--thex-accent);
	--thex-accent-dark: color-mix(in srgb, var(--thex-accent) 78%, #000);
	--thex-accent-soft: color-mix(in srgb, var(--thex-accent) 10%, var(--thex-surface));
	--thex-accent-ink: color-mix(in srgb, var(--thex-accent) 82%, var(--thex-text));
	--thex-text-2: color-mix(in srgb, var(--thex-text) 80%, var(--thex-surface));
	--thex-muted: color-mix(in srgb, var(--thex-text) 62%, var(--thex-surface));
	--thex-line: color-mix(in srgb, var(--thex-text) 12%, var(--thex-surface));
	--thex-soft: color-mix(in srgb, var(--thex-text) 4%, var(--thex-bg));
	--thex-radius: 14px;
	--thex-radius-sm: calc(var(--thex-radius) * .72);
	--thex-shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 12px 32px -14px rgba(17, 24, 39, .22);
	--thex-header-h: 72px;
	--thex-sale: #dc2626;
	--thex-jeonse: #2563eb;
	--thex-monthly: #059669;
	--thex-short: #7c3aed;
	--thex-font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--thex-bg); color: var(--thex-text);
	font-family: var(--thex-font); font-size: 16px; line-height: 1.6;
	word-break: keep-all; overflow-wrap: anywhere;
	-webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--thex-accent-ink); }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, .thex-brand-name, .thex-footer-name { font-family: var(--thex-heading-font); }
.thex-icon { flex: 0 0 auto; vertical-align: middle; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.thex-skip-link:focus {
	top: 8px; left: 8px; z-index: 100001; width: auto; height: auto; margin: 0; padding: 10px 16px; clip: auto;
	border-radius: 8px; background: var(--thex-surface); color: var(--thex-text); box-shadow: var(--thex-shadow);
}

.thex-container { width: 100%; max-width: var(--thex-width); margin: 0 auto; padding: 0 20px; }
.thex-container--narrow { max-width: 840px; }

/* ---------- 버튼 ---------- */
.thex-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 12px 18px; border: 1px solid transparent; border-radius: var(--thex-radius-sm);
	font-size: 15px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
	cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.thex-btn--primary, a.thex-btn--primary { background: var(--thex-accent); color: var(--thex-on-accent); }
.thex-btn--primary:hover, a.thex-btn--primary:hover { background: var(--thex-accent-dark); color: var(--thex-on-accent); }
.thex-btn--ghost, a.thex-btn--ghost { background: var(--thex-surface); color: var(--thex-text); border-color: var(--thex-line); }
.thex-btn--ghost:hover, a.thex-btn--ghost:hover { border-color: var(--thex-accent); color: var(--thex-accent); }
.thex-btn--kakao, a.thex-btn--kakao { background: #fee500; color: #191919; }
.thex-btn--kakao:hover, a.thex-btn--kakao:hover { background: #f5dc00; color: #191919; }
.thex-btn--block { width: 100%; }

/* ---------- 머리글 ---------- */
.thex-site-header {
	position: sticky; top: 0; z-index: 60;
	border-bottom: 1px solid color-mix(in srgb, var(--thex-header-text) 12%, var(--thex-header-bg));
	background: color-mix(in srgb, var(--thex-header-bg) 94%, transparent); color: var(--thex-header-text);
	backdrop-filter: saturate(180%) blur(10px);
}
body.admin-bar .thex-site-header { top: 32px; }
.thex-header-inner { display: flex; align-items: center; gap: 28px; height: var(--thex-header-h); }
.thex-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--thex-header-text); text-decoration: none; }
.thex-brand-logo { display: block; width: auto; max-height: 44px; }
.thex-brand-mark {
	display: inline-flex; flex: 0 0 38px; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: var(--thex-radius-sm); background: var(--thex-accent); color: var(--thex-on-accent);
}
.thex-brand-name { overflow: hidden; font-size: 19px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; text-overflow: ellipsis; }

.thex-nav { margin-left: auto; }
.thex-nav ul { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.thex-nav li { position: relative; }
.thex-nav a {
	display: block; padding: 8px 14px; border-radius: 8px;
	color: var(--thex-header-text); font-size: 15px; font-weight: 600; text-decoration: none;
}
.thex-nav a:hover { background: color-mix(in srgb, var(--thex-header-text) 8%, transparent); color: var(--thex-header-accent, var(--thex-accent)); }
.thex-nav .current-menu-item > a,
.thex-nav .current_page_item > a { color: var(--thex-header-accent, var(--thex-accent)); }
.thex-nav .sub-menu {
	position: absolute; top: 100%; left: 0; z-index: 10; display: none; min-width: 180px; padding: 8px;
	flex-direction: column; align-items: stretch;
	border: 1px solid color-mix(in srgb, var(--thex-header-text) 12%, var(--thex-header-bg)); border-radius: 12px;
	background: var(--thex-header-bg); box-shadow: var(--thex-shadow);
}
.thex-nav li:hover > .sub-menu,
.thex-nav li:focus-within > .sub-menu { display: flex; }

.thex-header-call {
	display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
	background: color-mix(in srgb, var(--thex-accent) 12%, var(--thex-header-bg)); color: var(--thex-header-accent, var(--thex-accent-ink));
	font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.thex-header-call:hover { background: var(--thex-accent); color: var(--thex-on-accent); }

.thex-nav-toggle {
	display: none; position: relative; width: 44px; height: 44px; padding: 0;
	border: 1px solid color-mix(in srgb, var(--thex-header-text) 15%, var(--thex-header-bg)); border-radius: var(--thex-radius-sm);
	background: var(--thex-header-bg); cursor: pointer;
}
.thex-nav-toggle-bar,
.thex-nav-toggle-bar::before,
.thex-nav-toggle-bar::after {
	position: absolute; left: 12px; width: 18px; height: 2px; border-radius: 2px; background: var(--thex-header-text);
	transition: transform .2s, opacity .2s;
}
.thex-nav-toggle-bar { top: 21px; }
.thex-nav-toggle-bar::before, .thex-nav-toggle-bar::after { content: ""; left: 0; }
.thex-nav-toggle-bar::before { top: -6px; }
.thex-nav-toggle-bar::after { top: 6px; }
.thex-nav-toggle[aria-expanded="true"] .thex-nav-toggle-bar { background: transparent; }
.thex-nav-toggle[aria-expanded="true"] .thex-nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.thex-nav-toggle[aria-expanded="true"] .thex-nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 바닥글 ---------- */
.thex-site-footer {
	margin-top: 0; padding: 48px 0 36px; background: var(--thex-footer-bg);
	color: color-mix(in srgb, var(--thex-footer-text) 72%, var(--thex-footer-bg)); font-size: 14px;
}
.thex-site-footer a { color: inherit; text-decoration: none; }
.thex-footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; padding-bottom: 28px; border-bottom: 1px solid color-mix(in srgb, var(--thex-footer-text) 12%, var(--thex-footer-bg)); }
.thex-footer-brand { flex: 1 1 360px; max-width: 560px; }
.thex-footer-name { margin: 0; color: var(--thex-footer-text); font-size: 20px; font-weight: 800; }
.thex-footer-intro { margin: 10px 0 0; line-height: 1.7; white-space: pre-line; }
.thex-footer-contact { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.thex-footer-phone { display: inline-flex; align-items: center; gap: 8px; color: var(--thex-footer-text) !important; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.thex-footer-phone .thex-icon { width: 22px; height: 22px; }
.thex-footer-hours { display: flex; align-items: center; gap: 6px; margin: 0; }
.thex-footer-hours .thex-icon { width: 16px; height: 16px; }
.thex-footer-contact .thex-btn { margin-top: 4px; padding: 9px 14px; font-size: 14px; }
.thex-footer-nav ul { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 20px 0 0; padding: 0; list-style: none; }
.thex-footer-nav a { color: var(--thex-footer-text); font-weight: 600; }
.thex-footer-nav a:hover { text-decoration: underline; }
.thex-footer-legal { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 20px 0 0; padding: 0; list-style: none; line-height: 1.8; }
.thex-footer-legal span { color: color-mix(in srgb, var(--thex-footer-text) 45%, var(--thex-footer-bg)); }
.thex-copyright { margin: 14px 0 0; color: color-mix(in srgb, var(--thex-footer-text) 45%, var(--thex-footer-bg)); font-size: 13px; }

/* ---------- 홈 ---------- */
.thex-home-hero {
	position: relative; padding: 88px 0 72px; overflow: hidden; color: #fff;
	background: linear-gradient(135deg, var(--thex-hero), color-mix(in srgb, var(--thex-hero) 78%, #000) 60%, #0f172a) center / cover no-repeat;
}
.thex-home-hero h1 { font-family: var(--thex-heading-font); }
.thex-home-hero.has-image::before {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(to bottom, rgba(2, 6, 23, .45), rgba(2, 6, 23, .7));
}
.thex-home-hero-inner { position: relative; }
.thex-home-title { max-width: 820px; margin: 0; font-size: clamp(30px, 5vw, 52px); font-weight: 800; line-height: 1.2; letter-spacing: -.03em; }
.thex-home-text { max-width: 640px; margin: 14px 0 0; color: rgba(255, 255, 255, .85); font-size: clamp(16px, 2vw, 19px); }

.thex-home-search {
	display: grid; grid-template-columns: 170px 190px minmax(0, 1fr) auto; gap: 10px;
	max-width: 960px; margin-top: 32px; padding: 12px;
	border-radius: calc(var(--thex-radius) + 4px); background: var(--thex-surface); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5);
}
.thex-home-search select,
.thex-home-search input[type="search"] {
	width: 100%; height: 52px; padding: 0 14px;
	border: 1px solid var(--thex-line); border-radius: var(--thex-radius-sm); background: var(--thex-surface); color: var(--thex-text); font-size: 16px;
}
.thex-home-search select:focus,
.thex-home-search input:focus { border-color: var(--thex-accent); outline: 3px solid var(--thex-accent-soft); }
.thex-home-search .thex-btn { height: 52px; padding: 0 24px; font-size: 16px; }

.thex-home-deals { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.thex-home-deals a {
	display: inline-flex; align-items: baseline; gap: 10px; padding: 10px 18px; border-radius: 999px;
	background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; backdrop-filter: blur(6px);
	transition: background-color .15s;
}
.thex-home-deals a:hover { background: rgba(255, 255, 255, .26); }
.thex-home-deal-label { font-weight: 600; }
.thex-home-deals strong { font-size: 18px; }

.thex-home-section { padding: 64px 0; }
.thex-home-section--alt { background: var(--thex-soft); }
.thex-home-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.thex-home-section-head h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; }
.thex-home-section-head a { display: inline-flex; align-items: center; gap: 4px; color: var(--thex-muted); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.thex-home-section-head a:hover { color: var(--thex-accent); }
.thex-home-section-head .thex-icon { width: 16px; height: 16px; }
.thex-home-office .thex-contact--wide { background: var(--thex-soft); }

/* ---------- 일반 페이지 · 블로그 ---------- */
.thex-page { padding: 48px 0 80px; }
.thex-page-header { margin-bottom: 28px; }
.thex-page-title { margin: 0; font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; line-height: 1.3; letter-spacing: -.02em; }
.thex-page-thumb { margin: 0 0 28px; }
.thex-page-thumb img { display: block; width: 100%; border-radius: var(--thex-radius); }
.thex-post-meta { margin: 6px 0 0; color: var(--thex-muted); font-size: 14px; }

.thex-posts { display: grid; gap: 20px; }
.thex-post-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--thex-line); }
.thex-post-item:not(.has-post-thumbnail) { grid-template-columns: minmax(0, 1fr); }
.thex-post-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
.thex-post-title { margin: 0; font-size: 20px; line-height: 1.4; }
.thex-post-title a { color: var(--thex-text); text-decoration: none; }
.thex-post-title a:hover { color: var(--thex-accent); }
.thex-post-excerpt { margin: 10px 0 0; color: var(--thex-text-2); }

.entry-content { font-size: 17px; line-height: 1.85; }
.entry-content > * { margin-top: 0; margin-bottom: 1.1em; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin-top: 1.8em; line-height: 1.4; letter-spacing: -.01em; }
.entry-content img { border-radius: 10px; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--thex-accent); color: var(--thex-text-2); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--thex-line); }
.alignwide { margin-left: calc(50% - min(50vw, var(--thex-width) / 2) + 20px); margin-right: calc(50% - min(50vw, var(--thex-width) / 2) + 20px); max-width: none; }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }

.post-navigation { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--thex-line); }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 20px; }
.post-navigation a { color: var(--thex-text); font-weight: 600; text-decoration: none; }
.post-navigation a:hover { color: var(--thex-accent); }

/* the_posts_pagination() 출력 */
.navigation.thex-pagination { margin-top: 40px; }
.navigation.thex-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.navigation.thex-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px;
	border: 1px solid var(--thex-line); border-radius: var(--thex-radius-sm); background: var(--thex-surface); color: var(--thex-text); text-decoration: none;
}
.navigation.thex-pagination .page-numbers.current { border-color: var(--thex-accent); background: var(--thex-accent); color: var(--thex-on-accent); }
.navigation.thex-pagination .dots { border: 0; }

.search-form { display: flex; gap: 8px; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--thex-line); border-radius: var(--thex-radius-sm); background: var(--thex-surface); color: var(--thex-text); }
.search-form .search-submit { height: 44px; padding: 0 18px; border: 0; border-radius: var(--thex-radius-sm); background: var(--thex-accent); color: var(--thex-on-accent); font-weight: 600; cursor: pointer; }

.thex-404 { text-align: center; }
.thex-404-code { margin: 0; color: var(--thex-accent); font-size: 88px; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.thex-404 .thex-page-title { margin-top: 12px; }
.thex-404 > p { color: var(--thex-muted); }
.thex-404-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }

/* ---------- 반응형 ---------- */
@media (max-width: 1024px) {
	.thex-home-search { grid-template-columns: 1fr 1fr; }
	.thex-home-search input[type="search"] { grid-column: 1 / -1; }
	.thex-home-search .thex-btn { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
	.thex-header-inner { gap: 12px; }
	.thex-nav-toggle { display: block; margin-left: auto; }
	.thex-header-call { margin-left: auto; padding: 8px 12px; }
	.thex-header-call + .thex-nav-toggle { margin-left: 0; }
	.thex-nav {
		position: absolute; top: 100%; left: 0; right: 0; display: none; margin: 0; padding: 12px 20px 20px;
		border-bottom: 1px solid color-mix(in srgb, var(--thex-header-text) 12%, var(--thex-header-bg));
		background: var(--thex-header-bg); box-shadow: 0 16px 24px -16px rgba(0, 0, 0, .2);
	}
	.thex-nav.is-open { display: block; }
	.thex-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
	.thex-nav a { padding: 12px 10px; font-size: 16px; }
	.thex-nav .sub-menu { position: static; display: flex; padding: 0 0 0 14px; border: 0; box-shadow: none; }
}

@media (max-width: 782px) {
	body.admin-bar .thex-site-header { top: 46px; }
}

@media (max-width: 600px) {
	body.admin-bar .thex-site-header { top: 0; }
	:root { --thex-header-h: 62px; }
	.thex-brand-name { font-size: 17px; }
	.thex-header-call span { display: none; }
	.thex-header-call { width: 44px; height: 44px; justify-content: center; padding: 0; }
	.thex-home-hero { padding: 56px 0 48px; }
	.thex-home-search { grid-template-columns: minmax(0, 1fr); }
	.thex-home-section { padding: 44px 0; }
	.thex-post-item { grid-template-columns: minmax(0, 1fr); }
	.thex-page { padding: 32px 0 64px; }
}
