/* GNB: PC 메가 메뉴 + 모바일 ☰ 메뉴. layout.css 다음에 읽는다. 클래스는 모두 gnb- 접두사 (styles.css 의 .chev 등과 안 겹치게) */
.gnb-mega[hidden], .gnb-drawer[hidden] { display: none !important; }
/* 아이콘 정의 SVG: styles.css 의 svg{display:block} 에 밀려 150px 로 그려지지 않게, 자리를 차지하지 않는 크기로 둔다 */
.gnb-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-nav a { display: inline-flex; align-items: center; gap: 5px; }
.site-nav a[aria-current] { color: #00866B; box-shadow: inset 0 -2px 0 #00866B; }
.gnb-ext { width: 14px; height: 14px; flex-shrink: 0; color: #7C8A86; }
.site-nav a:hover .gnb-ext, .gnb-col h3 .gnb-ext, .gnb-group-title .gnb-ext { color: #00866B; }
.gnb-col h3 .gnb-ext { width: 15px; height: 15px; margin-left: 2px; }
/* 주거검색플랫폼 버튼: 다른 외부 메뉴와 같은 새 창 아이콘, 버튼 글자색(초록) */
.housing-link { gap: 6px; }
.housing-link .gnb-ext { width: 15px; height: 15px; color: currentColor; }
.gnb-menu-btn { display: none; }

/* ── PC 메가 메뉴: 메뉴 글자 아래에 매달린 카드. 가로 위치(left)는 gnb.js 가 메뉴 가운데에 맞춰 준다 ── */
.gnb-mega { position: absolute; top: 100%; left: var(--gnb-mega-left, 50%); width: min(1000px, calc(100vw - 32px)); z-index: 31; background: #fff; border: 1px solid #E4EBED; border-top: 0; border-radius: 0 0 18px 18px; box-shadow: 0 22px 44px rgba(16, 62, 53, .13); }
.gnb-mega-inner { padding: 10px 10px 12px; display: grid; grid-template-columns: repeat(5, 1fr); }
.gnb-col { padding: 16px 14px 12px; border-left: 1px solid #EEF2F0; border-radius: 12px; min-width: 0; transition: background-color .15s; }
.gnb-col:first-child { border-left: 0; }
.gnb-col:hover, .gnb-col:focus-within { background: #F3F8F5; border-left-color: transparent; }
.gnb-col:hover + .gnb-col, .gnb-col:focus-within + .gnb-col { border-left-color: transparent; }
.gnb-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #EAF7F2; margin-bottom: 12px; }
.gnb-ic img { width: 24px; height: 24px; }
.gnb-col h3 { margin: 0; font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.gnb-col h3 a { display: inline-flex; align-items: center; color: #171C26; text-decoration: none; }
.gnb-col h3 a:hover, .gnb-col.is-current h3 a { color: #00866B; }
.gnb-col p { margin: 6px 0 10px; font-size: 12.5px; line-height: 1.55; color: #667383; }
.gnb-col ul { list-style: none; margin: 0; padding: 0; }
.gnb-col li a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 8px; margin: 0 -8px; border-top: 1px solid #EEF2F0; border-radius: 8px; font-size: 14px; font-weight: 600; color: #171C26; text-decoration: none; }
.gnb-col li:first-child a { border-top: 0; }
.gnb-col li a::after { content: ""; width: 7px; height: 7px; flex-shrink: 0; margin-right: 4px; border-right: 1.6px solid #7C8A86; border-top: 1.6px solid #7C8A86; transform: rotate(45deg); }
.gnb-col li a:hover { background: #E6F2EC; }
.gnb-col li a.is-hot { background: #EAF7F2; color: #00866B; font-weight: 750; border-top-color: transparent; }
.gnb-col li a.is-hot::after { border-color: #00866B; }
.gnb-col li a.is-hot + li a { border-top-color: transparent; }

/* 1024~1100px: 로고 배지·메뉴·버튼이 한 줄에 다 들어가지 않아 겹치던 것 → 배지를 숨기고 메뉴 간격을 조금 줄인다 */
@media (min-width: 1024px) and (max-width: 1100px) { .site-brand span { display: none; } .site-nav { gap: 16px; } }

/* ── 모바일 헤더 + ☰ 메뉴 ── */
@media (max-width: 1023px) {
  .site-nav, .gnb-mega { display: none !important; }
  .site-header-inner { grid-template-columns: 1fr auto; gap: 8px; min-height: 60px; padding: 10px 16px; }
  .site-header-inner > .housing-link { display: none; }
  .gnb-menu-btn { display: grid; place-items: center; width: 40px; height: 40px; margin-right: -8px; padding: 0; border: 0; background: none; cursor: pointer; grid-column: 2; grid-row: 1; }
  .gnb-menu-btn span { display: block; width: 22px; height: 2px; border-radius: 2px; background: #171C26; box-shadow: 0 -7px 0 #171C26, 0 7px 0 #171C26; transition: box-shadow .15s, transform .15s, background .15s; }
  .gnb-menu-btn[aria-expanded="true"] span { background: transparent; box-shadow: none; }
  .gnb-menu-btn[aria-expanded="true"] span::before, .gnb-menu-btn[aria-expanded="true"] span::after { content: ""; position: absolute; width: 22px; height: 2px; background: #171C26; border-radius: 2px; }
  .gnb-menu-btn[aria-expanded="true"] span::before { transform: rotate(45deg); }
  .gnb-menu-btn[aria-expanded="true"] span::after { transform: rotate(-45deg); }
  .gnb-menu-btn { position: relative; }
  .gnb-menu-btn span::before, .gnb-menu-btn span::after { left: 50%; top: 50%; margin: -1px 0 0 -11px; }
}

html.gnb-drawer-open { overflow: hidden; }
.gnb-drawer { position: fixed; left: 0; right: 0; bottom: 0; top: var(--gnb-header-h, 61px); z-index: 29; display: flex; flex-direction: column; background: #fff; }
.gnb-drawer-body { flex: 1; overflow: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; }
.gnb-group { padding: 14px 0; border-bottom: 1px solid #E4EBED; }
.gnb-group.is-open { padding-bottom: 12px; }
.gnb-group:last-child { border-bottom: 0; }
.gnb-group-head { display: grid; grid-template-columns: 44px 1fr 40px; gap: 12px; align-items: center; }
.gnb-group-head .gnb-ic { width: 44px; height: 44px; margin: 0; }
.gnb-group-head .gnb-ic img { width: 24px; height: 24px; }
.gnb-group-title { min-width: 0; text-decoration: none; color: inherit; }
.gnb-group-title strong { display: flex; align-items: center; gap: 5px; font-size: 17px; font-weight: 750; color: #171C26; }
.gnb-group-title small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: #667383; }
.gnb-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; }
.gnb-toggle svg { width: 20px; height: 20px; fill: none; stroke: #171C26; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.gnb-group.is-open .gnb-toggle svg { transform: rotate(180deg); }
.gnb-group-list { display: none; list-style: none; margin: 12px 0 0 56px; padding: 4px 16px; background: #F3F8F5; border-radius: 12px; }
.gnb-group.is-open .gnb-group-list { display: block; }
.gnb-group-list a { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-top: 1px solid #E1EBE6; font-size: 15px; font-weight: 600; color: #171C26; text-decoration: none; }
.gnb-group-list li:first-child a { border-top: 0; }
.gnb-group-list a::after { content: ""; width: 8px; height: 8px; margin-right: 6px; border-right: 1.5px solid #8A97A3; border-top: 1.5px solid #8A97A3; transform: rotate(45deg); }
.gnb-group-list a.is-hot { color: #00866B; font-weight: 750; }
.gnb-drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #E4EBED; background: #fff; }
.gnb-drawer-foot .housing-link { display: flex; width: 100%; min-height: 50px; font-size: 15px; }
.gnb-drawer-cta { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; margin-top: 10px; border-radius: 12px; background: #00866B; color: #fff; font-size: 16px; font-weight: 750; text-decoration: none; }
.gnb-drawer-cta:hover { background: #007058; }
.gnb-drawer-foot small { display: block; margin-top: 8px; text-align: center; font-size: 12px; color: #8A97A3; }
