/* ==========================================================================
   layout.css — 컨테이너 / 헤더 / 푸터 / 그리드 / 섹션
   ========================================================================== */

.rl-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.rl-main {
	flex: 1 0 auto;
}

/* ── 컨테이너 ──────────────────────────────────────── */

.rl-container {
	width: 100%;
	max-width: var(--rl-container);
	margin-inline: auto;
	padding-inline: var(--rl-gutter);
	padding-block: var(--rl-space-8) var(--rl-section-y);
}

.rl-container--prose {
	max-width: calc(var(--rl-prose) + var(--rl-gutter) * 2);
}

.rl-container--wide {
	max-width: var(--rl-content);
}

/* ── 섹션 ─────────────────────────────────────────── */

.rl-section {
	padding-block: var(--rl-section-y);
}

.rl-section--alt {
	background: var(--rl-bg-subtle);
}

.rl-section--flush {
	padding-block: var(--rl-space-10) 0;
}

.rl-section__inner {
	width: 100%;
	max-width: var(--rl-container);
	margin-inline: auto;
	padding-inline: var(--rl-gutter);
}

.rl-section__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--rl-space-4);
	margin-bottom: var(--rl-space-8);
}

.rl-section__title {
	font-size: var(--rl-text-2xl);
}

.rl-section__desc {
	margin-top: var(--rl-space-2);
	color: var(--rl-text-muted);
	font-size: var(--rl-text-base);
}

.rl-section__more {
	display: inline-flex;
	align-items: center;
	gap: var(--rl-space-1);
	font-size: var(--rl-text-base);
	font-weight: var(--rl-weight-semibold);
	white-space: nowrap;
}

.rl-section__more::after {
	content: "→";
	transition: transform var(--rl-duration) var(--rl-ease);
}

.rl-section__more:hover::after {
	transform: translateX(3px);
}

/* ── 페이지 헤더 ──────────────────────────────────── */

.rl-page-head {
	margin-bottom: var(--rl-space-8);
}

.rl-page-title {
	font-size: var(--rl-text-3xl);
}

.rl-page-desc {
	margin-top: var(--rl-space-3);
	color: var(--rl-text-muted);
	font-size: var(--rl-text-lg);
	max-width: 60ch;
}

.rl-page-desc strong {
	color: var(--rl-text-strong);
	font-weight: var(--rl-weight-semibold);
}

/* ── 그리드 ───────────────────────────────────────── */

.rl-grid {
	display: grid;
	gap: var(--rl-space-5);
}

/* 분양 카드: 최소 260px 을 확보하며 자동으로 열 수를 정한다.
   미디어쿼리 없이 모든 화면에서 자연스럽게 접힌다. */
.rl-grid--cards {
	grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
}

/* 가이드·뉴스 카드: 조금 더 넓게 */
.rl-grid--posts {
	grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

/* ── 헤더 ─────────────────────────────────────────── */

.rl-header {
	position: sticky;
	top: 0;
	z-index: var(--rl-z-header);
	background: color-mix(in srgb, var(--rl-bg) 88%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	box-shadow: var(--rl-shadow-header);
}

.rl-header__inner {
	display: flex;
	align-items: center;
	gap: var(--rl-space-6);
	max-width: var(--rl-container);
	min-height: var(--rl-header-h);
	margin-inline: auto;
	padding-inline: var(--rl-gutter);
}

.rl-header__brand {
	display: flex;
	flex-direction: column;
	gap: 1px;
	flex-shrink: 0;
	color: var(--rl-text-strong);
}

.rl-header__brand:hover {
	color: var(--rl-accent);
}

.rl-header__logo {
	font-size: var(--rl-text-xl);
	font-weight: var(--rl-weight-bold);
	letter-spacing: -0.03em;
	line-height: 1;
}

.rl-header__brand-sub {
	font-size: 0.6875rem;
	color: var(--rl-text-subtle);
	font-weight: var(--rl-weight-medium);
	letter-spacing: var(--rl-ls-wide);
}

/* ── 데스크톱 내비게이션 ──────────────────────────── */

.rl-nav {
	flex: 1;
	min-width: 0;
}

.rl-nav__list {
	display: flex;
	align-items: center;
	gap: var(--rl-space-1);
}

.rl-nav__item {
	position: relative;
}

.rl-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: var(--rl-space-2) var(--rl-space-3);
	border-radius: var(--rl-radius);
	color: var(--rl-text);
	font-size: var(--rl-text-base);
	font-weight: var(--rl-weight-medium);
	white-space: nowrap;
	transition: background var(--rl-duration) var(--rl-ease),
		color var(--rl-duration) var(--rl-ease);
}

.rl-nav__link:hover,
.rl-nav__item:hover > .rl-nav__link,
.rl-nav__item:focus-within > .rl-nav__link {
	background: var(--rl-surface);
	color: var(--rl-text-strong);
}

.rl-nav__caret {
	display: inline-flex;
	color: var(--rl-text-subtle);
	transition: transform var(--rl-duration) var(--rl-ease);
}

.rl-nav__item:hover .rl-nav__caret,
.rl-nav__item:focus-within .rl-nav__caret {
	transform: rotate(180deg);
}

/* ── 메가메뉴 ──────────────────────────────────────
   노션 스타일: 떠 있는 흰 카드 + 왼쪽 비주얼 + 오른쪽 다단 링크.
   테두리 대신 그림자로 떠 있음을 표현한다(테두리는 다크에서만 아주 옅게).
   여는 방식은 CSS :hover / :focus-within 뿐 — JS 없다. */

.rl-mega {
	position: absolute;
	top: calc(100% + var(--rl-space-2));
	left: 0;
	z-index: var(--rl-z-dropdown);
	padding: var(--rl-space-4);
	background: var(--rl-bg);
	border: 1px solid var(--rl-border-subtle);
	border-radius: var(--rl-radius-lg);
	box-shadow: var(--rl-shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity var(--rl-duration-fast) var(--rl-ease),
		transform var(--rl-duration-fast) var(--rl-ease),
		visibility var(--rl-duration-fast);
}

/* 마우스가 링크와 패널 사이 빈틈에서 빠지지 않도록 위쪽을 투명하게 덮는다. */
.rl-mega::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: calc(var(--rl-space-2) * -1);
	height: var(--rl-space-2);
}

.rl-nav__item:hover > .rl-mega,
.rl-nav__item:focus-within > .rl-mega {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* 오른쪽 끝 메뉴는 패널이 화면 밖으로 나가므로 오른쪽 기준으로 붙인다. */
.rl-nav__item:nth-last-child(-n + 2) > .rl-mega {
	left: auto;
	right: 0;
}

.rl-mega__body {
	display: flex;
	gap: var(--rl-space-5);
}

/* ── 이미지 자리 (지금은 빈 박스) ──
   <img> 를 넣으면 박스를 그대로 채운다. 비율은 여기서 고정한다. */
.rl-mega__media {
	/* align-self 가 없으면 flex 의 기본 stretch 가 aspect-ratio 를 이겨서
	   박스가 링크 열 높이만큼 늘어난다. 비율을 지키려면 위쪽에 붙여야 한다. */
	align-self: flex-start;
	flex-shrink: 0;
	width: 200px;
	aspect-ratio: 4 / 3;
	background: var(--rl-surface);
	border: 1px dashed var(--rl-border);
	border-radius: var(--rl-radius-md);
	overflow: hidden;
}

.rl-mega__media > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rl-mega__cols {
	display: flex;
	gap: var(--rl-space-6);
}

.rl-mega__col {
	min-width: 0;
}

.rl-mega__col--plain {
	min-width: 116px;
}

/* 열 라벨 — 작고 물러나 있다. 클릭 대상이 아니다. */
.rl-mega__coltitle {
	margin: 0 0 var(--rl-space-2);
	padding-inline: var(--rl-space-2);
	font-size: var(--rl-text-xs);
	font-weight: var(--rl-weight-medium);
	color: var(--rl-text-subtle);
}

.rl-mega__links {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

/* 지역 메뉴 — 17개를 3열로 흘린다. */
.rl-mega__links--grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(140px, 1fr));
	gap: 1px var(--rl-space-2);
}

/* ── 아이콘 + 제목 + 설명 (컴팩트) ── */

.rl-mega__link {
	display: flex;
	align-items: flex-start;
	gap: var(--rl-space-3);
	padding: var(--rl-space-2);
	border-radius: var(--rl-radius-sm);
	color: var(--rl-text);
	transition: background var(--rl-duration-fast) var(--rl-ease);
}

.rl-mega__link:hover {
	background: var(--rl-surface-hover);
}

.rl-mega__icon {
	flex-shrink: 0;
	width: 1.5rem;
	height: 1.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--rl-surface);
	border-radius: var(--rl-radius-sm);
	font-size: var(--rl-text-sm);
	line-height: 1;
}

.rl-mega__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.rl-mega__text strong {
	font-size: var(--rl-text-sm);
	font-weight: var(--rl-weight-semibold);
	color: var(--rl-text-strong);
	white-space: nowrap;
}

.rl-mega__text em {
	font-size: var(--rl-text-xs);
	font-style: normal;
	color: var(--rl-text-subtle);
	white-space: nowrap;
}

/* ── 설명 없는 평문 링크 열 ── */

.rl-mega__plain {
	display: block;
	padding: var(--rl-space-2);
	border-radius: var(--rl-radius-sm);
	font-size: var(--rl-text-sm);
	color: var(--rl-text);
	white-space: nowrap;
	transition: background var(--rl-duration-fast) var(--rl-ease),
		color var(--rl-duration-fast) var(--rl-ease);
}

.rl-mega__plain:hover {
	background: var(--rl-surface-hover);
	color: var(--rl-text-strong);
}

/* ── 하단 전체보기 ── */

.rl-mega__all {
	display: block;
	margin-top: var(--rl-space-3);
	padding: var(--rl-space-3) var(--rl-space-2) 0;
	border-top: 1px solid var(--rl-border-subtle);
	font-size: var(--rl-text-sm);
	font-weight: var(--rl-weight-medium);
	color: var(--rl-link);
	white-space: nowrap;
}

.rl-mega__all:hover {
	color: var(--rl-link-hover);
}

/* ── 헤더 우측 액션 ───────────────────────────────── */

.rl-header__actions {
	display: flex;
	align-items: center;
	gap: var(--rl-space-2);
	flex-shrink: 0;
	margin-left: auto;
}

.rl-header__toggle {
	display: none;
	width: 40px;
	height: 40px;
	border-radius: var(--rl-radius);
	border: 1px solid var(--rl-border);
	position: relative;
}

.rl-header__toggle-bar,
.rl-header__toggle-bar::before,
.rl-header__toggle-bar::after {
	position: absolute;
	left: 50%;
	width: 18px;
	height: 2px;
	background: var(--rl-text);
	border-radius: 2px;
	transform: translateX(-50%);
	transition: transform var(--rl-duration) var(--rl-ease),
		opacity var(--rl-duration) var(--rl-ease);
}

.rl-header__toggle-bar {
	top: 50%;
	margin-top: -1px;
}

.rl-header__toggle-bar::before {
	content: "";
	top: -6px;
}

.rl-header__toggle-bar::after {
	content: "";
	top: 6px;
}

.rl-header__toggle[aria-expanded="true"] .rl-header__toggle-bar {
	background: transparent;
}

.rl-header__toggle[aria-expanded="true"] .rl-header__toggle-bar::before {
	top: 0;
	transform: translateX(-50%) rotate(45deg);
}

.rl-header__toggle[aria-expanded="true"] .rl-header__toggle-bar::after {
	top: 0;
	transform: translateX(-50%) rotate(-45deg);
}

/* ── 모바일 내비게이션 ───────────────────────────── */

.rl-mnav {
	display: none;
	position: fixed;
	inset: var(--rl-header-h) 0 0;
	z-index: var(--rl-z-mobile);
	background: var(--rl-bg);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.rl-mnav.is-open {
	display: block;
}

.rl-mnav__inner {
	padding: var(--rl-space-4) var(--rl-gutter) var(--rl-space-16);
}

.rl-mnav__top,
.rl-mnav__group > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--rl-space-4) 0;
	border-bottom: 1px solid var(--rl-border-subtle);
	font-size: var(--rl-text-lg);
	font-weight: var(--rl-weight-semibold);
	color: var(--rl-text-strong);
	cursor: pointer;
	list-style: none;
}

.rl-mnav__group > summary::-webkit-details-marker {
	display: none;
}

.rl-mnav__group > summary::after {
	content: "＋";
	color: var(--rl-text-subtle);
	font-weight: var(--rl-weight-regular);
}

.rl-mnav__group[open] > summary::after {
	content: "−";
}

.rl-mnav__links {
	display: flex;
	flex-direction: column;
	padding: var(--rl-space-2) 0 var(--rl-space-4);
}

.rl-mnav__links a {
	display: flex;
	align-items: center;
	gap: var(--rl-space-2);
	padding: var(--rl-space-3) var(--rl-space-4);
	border-radius: var(--rl-radius);
	color: var(--rl-text-muted);
	font-size: var(--rl-text-md);
}

.rl-mnav__links a:hover {
	background: var(--rl-surface);
	color: var(--rl-text-strong);
}

.rl-mnav__foot {
	display: flex;
	flex-direction: column;
	gap: var(--rl-space-3);
	margin-top: var(--rl-space-8);
}

/* ── 푸터 ─────────────────────────────────────────── */

.rl-footer {
	margin-top: var(--rl-section-y);
	background: var(--rl-surface);
	border-top: 1px solid var(--rl-border);
}

.rl-footer__inner {
	max-width: var(--rl-container);
	margin-inline: auto;
	padding: var(--rl-space-16) var(--rl-gutter) var(--rl-space-8);
}

.rl-footer__top {
	display: grid;
	grid-template-columns: minmax(240px, 1fr) 2fr;
	gap: var(--rl-space-12);
	padding-bottom: var(--rl-space-10);
	border-bottom: 1px solid var(--rl-border);
}

.rl-footer__logo {
	display: block;
	font-size: var(--rl-text-xl);
	font-weight: var(--rl-weight-bold);
	letter-spacing: -0.03em;
	color: var(--rl-text-strong);
}

.rl-footer__tagline {
	margin-top: var(--rl-space-2);
	color: var(--rl-text-muted);
	font-size: var(--rl-text-base);
}

.rl-footer__phone {
	display: inline-block;
	margin-top: var(--rl-space-5);
	font-size: var(--rl-text-2xl);
	font-weight: var(--rl-weight-bold);
	color: var(--rl-text-strong);
	letter-spacing: -0.02em;
}

.rl-footer__phone:hover {
	color: var(--rl-accent);
}

.rl-footer__hours {
	margin-top: var(--rl-space-1);
	font-size: var(--rl-text-sm);
	color: var(--rl-text-subtle);
}

.rl-footer__cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: var(--rl-space-8);
}

.rl-footer__col {
	display: flex;
	flex-direction: column;
	gap: var(--rl-space-2);
}

.rl-footer__col h3 {
	margin-bottom: var(--rl-space-2);
	font-size: var(--rl-text-sm);
	font-weight: var(--rl-weight-semibold);
	color: var(--rl-text-strong);
	letter-spacing: var(--rl-ls-wide);
}

.rl-footer__col a {
	color: var(--rl-text-muted);
	font-size: var(--rl-text-base);
}

.rl-footer__col a:hover {
	color: var(--rl-text-strong);
}

.rl-footer__col--regions {
	grid-column: span 2;
}

.rl-footer__regions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rl-space-2) var(--rl-space-4);
}

.rl-footer__regions a {
	font-size: var(--rl-text-sm);
}

.rl-footer__empty {
	font-size: var(--rl-text-sm);
	color: var(--rl-text-subtle);
}

.rl-footer__bottom {
	padding-top: var(--rl-space-6);
}

.rl-footer__legal {
	max-width: 80ch;
	font-size: var(--rl-text-sm);
	line-height: var(--rl-lh-relaxed);
	color: var(--rl-text-subtle);
}

.rl-footer__legal strong {
	color: var(--rl-text-muted);
	font-weight: var(--rl-weight-semibold);
}

.rl-footer__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--rl-space-4);
	margin-top: var(--rl-space-6);
}

.rl-footer__policy {
	display: flex;
	gap: var(--rl-space-4);
	flex-wrap: wrap;
}

.rl-footer__policy a {
	font-size: var(--rl-text-sm);
	color: var(--rl-text-muted);
}

.rl-footer__copy {
	font-size: var(--rl-text-sm);
	color: var(--rl-text-subtle);
}

/* ── 모바일 하단 고정 CTA ─────────────────────────── */

.rl-fcta {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: var(--rl-z-fcta);
	gap: var(--rl-space-2);
	padding: var(--rl-space-3) var(--rl-space-4)
		calc(var(--rl-space-3) + env(safe-area-inset-bottom, 0px));
	background: color-mix(in srgb, var(--rl-bg) 92%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-top: 1px solid var(--rl-border);
}

.rl-fcta__btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--rl-space-2);
	min-height: 48px;
	border-radius: var(--rl-radius-md);
	font-size: var(--rl-text-md);
	font-weight: var(--rl-weight-semibold);
}

.rl-fcta__btn--call {
	background: var(--rl-surface-2);
	color: var(--rl-text-strong);
	border: 1px solid var(--rl-border);
}

.rl-fcta__btn--form {
	background: var(--rl-accent);
	color: var(--rl-gray-0);
}

.rl-fcta__btn--form:hover {
	background: var(--rl-accent-hover);
	color: var(--rl-gray-0);
}

/* ── 브레드크럼 ───────────────────────────────────── */

.rl-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--rl-space-2);
	margin-bottom: var(--rl-space-5);
	font-size: var(--rl-text-sm);
	color: var(--rl-text-subtle);
}

.rl-breadcrumb li:not(:last-child)::after {
	content: "/";
	margin-left: var(--rl-space-2);
	color: var(--rl-border-strong);
}

.rl-breadcrumb a {
	color: var(--rl-text-muted);
}

.rl-breadcrumb a:hover {
	color: var(--rl-accent);
}

/* ── 반응형 ───────────────────────────────────────── */

@media (max-width: 1100px) {
	.rl-nav {
		display: none;
	}
	.rl-header__toggle {
		display: block;
	}
	.rl-header__phone {
		display: none;
	}
}

@media (max-width: 860px) {
	.rl-footer__top {
		grid-template-columns: 1fr;
		gap: var(--rl-space-8);
	}
	.rl-footer__col--regions {
		grid-column: span 1;
	}
}

@media (max-width: 640px) {
	.rl-fcta {
		display: flex;
	}
	/* 고정 CTA 에 콘텐츠가 가리지 않도록 여백 확보 */
	.rl-site {
		padding-bottom: 76px;
	}
	.rl-section__head {
		align-items: flex-start;
	}
	.rl-header__actions .rl-btn--sm {
		display: none;
	}
}
