/* ==========================================================================
   자연향기조경 — layout.css
   헤더/GNB · 푸터 · 그리드 뼈대
   ========================================================================== */

#wrapper { overflow-x: clip; }

/* ---------- Header -------------------------------------------------- */
#ns_header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 500;
    height: 84px;
    display: flex;
    align-items: center;
    transition: background var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), height var(--dur-base) var(--ease-out);
}
#ns_header.is-solid,
#ns_header.is-open {
    background: rgba(255,255,255,0.96);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    box-shadow: var(--shadow-sm);
    height: 72px;
}
body.ns-subpage #ns_header { background: var(--c-white); box-shadow: var(--shadow-sm); height: 72px; }

.ns_header_inner {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--sp-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
}

#ns_logo { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
#ns_logo img { height: 34px; width: auto; }
#ns_logo .ns_logo_text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--c-white);
    transition: color var(--dur-base) var(--ease-out);
}
#ns_header.is-solid #ns_logo .ns_logo_text,
#ns_header.is-open #ns_logo .ns_logo_text,
body.ns-subpage #ns_logo .ns_logo_text { color: var(--c-primary-dark); }

#ns_gnb { flex: 1; display: flex; justify-content: center; }
#ns_gnb_list { display: flex; align-items: center; gap: var(--sp-4); }
#ns_gnb_list > li { position: relative; }
#ns_gnb_list > li > a {
    display: block;
    padding: 1.6rem 0.15rem;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    transition: color var(--dur-fast) var(--ease-out);
}
#ns_header.is-solid #ns_gnb_list > li > a,
#ns_header.is-open #ns_gnb_list > li > a,
body.ns-subpage #ns_gnb_list > li > a { color: var(--c-text); }
#ns_gnb_list > li > a:hover,
#ns_gnb_list > li.is-active > a { color: var(--c-accent); }
body.ns-subpage #ns_gnb_list > li > a:hover,
body.ns-subpage #ns_gnb_list > li.is-active > a { color: var(--c-primary); }

.ns_gnb_flyout {
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 220px;
    background: var(--c-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.6rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility var(--dur-fast);
}
#ns_gnb_list > li:hover .ns_gnb_flyout,
#ns_gnb_list > li:focus-within .ns_gnb_flyout {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.ns_gnb_flyout.ns_gnb_flyout--wide { min-width: 480px; }
.ns_gnb_flyout a {
    display: block;
    padding: 0.65rem 0.9rem;
    border-radius: 6px;
    font-size: var(--fs-sm);
    color: var(--c-text);
}
.ns_gnb_flyout a:hover { background: var(--c-bg-soft); color: var(--c-primary-dark); }
.ns_gnb_flyout--wide ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.1rem 0.5rem; }

.ns_header_side { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.ns_header_tel {
    display: flex; flex-direction: column; align-items: flex-end;
    color: rgba(255,255,255,0.9);
    font-size: var(--fs-xs);
    transition: color var(--dur-base) var(--ease-out);
}
.ns_header_tel strong { font-size: var(--fs-md); color: var(--c-white); font-weight: 700; }
#ns_header.is-solid .ns_header_tel,
#ns_header.is-open .ns_header_tel,
body.ns-subpage .ns_header_tel { color: var(--c-muted); }
#ns_header.is-solid .ns_header_tel strong,
#ns_header.is-open .ns_header_tel strong,
body.ns-subpage .ns_header_tel strong { color: var(--c-primary-dark); }

.ns_gnb_toggle {
    display: none;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
    background: none; border: 0;
    color: var(--c-white);
}
body.ns-subpage .ns_gnb_toggle,
#ns_header.is-solid .ns_gnb_toggle,
#ns_header.is-open .ns_gnb_toggle { color: var(--c-primary-dark); }

/* 모바일 GNB 패널 — position:fixed로 항상 문서 흐름 밖에 두고 translateX로 화면 밖에 숨김.
   뷰포트 폭과 무관하게 기본값이어야 데스크톱에서 인라인으로 새어나오지 않는다. */
#ns_mobile_nav {
    position: fixed; inset: 0 0 0 auto;
    width: min(86vw, 360px);
    background: var(--c-white);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--dur-base) var(--ease-out);
    z-index: 600;
    overflow-y: auto;
    padding: var(--sp-3);
}
#ns_mobile_nav.is-open { transform: translateX(0); }
#ns_mobile_scrim {
    position: fixed; inset: 0; background: rgba(20,24,15,0.5);
    opacity: 0; visibility: hidden; transition: opacity var(--dur-base);
    z-index: 590;
}
#ns_mobile_scrim.is-open { opacity: 1; visibility: visible; }

.ns_mnav_top {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: var(--sp-2);
    margin-bottom: var(--sp-2);
    border-bottom: 1px solid var(--c-line);
}
.ns_mnav_top .ns_logo_text { color: var(--c-primary-dark); font-size: var(--fs-md); }
#ns_mobile_close {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 0; background: var(--c-bg-soft);
    color: var(--c-text);
}

.ns_mnav_list > li { border-bottom: 1px solid var(--c-line); }
.ns_mnav_list > li > a {
    display: block;
    padding: 0.95rem 0.2rem;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text);
}
.ns_mnav_group_btn {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.95rem 0.2rem;
    background: none; border: 0;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text);
    text-align: left;
}
.ns_mnav_group_btn i { font-size: var(--fs-xs); color: var(--c-muted); transition: transform var(--dur-fast) var(--ease-out); }
.ns_mnav_group.is-open .ns_mnav_group_btn i { transform: rotate(180deg); }

.ns_mnav_sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-base) var(--ease-out);
}
.ns_mnav_group.is-open .ns_mnav_sub { max-height: 600px; }
.ns_mnav_sub li a {
    display: block;
    padding: 0.7rem 0.2rem 0.7rem 1rem;
    font-size: var(--fs-sm);
    color: var(--c-muted);
}
.ns_mnav_sub li a:hover { color: var(--c-primary); }

@media (max-width: 1024px) {
    #ns_gnb { display: none; }
    .ns_header_tel { display: none; }
    .ns_gnb_toggle { display: inline-flex; }
}

/* 소형 화면: 로고+버튼+햄버거가 한 줄에 들어가도록 간격을 줄인다.
   (폭 320px대 기기에서 햄버거 버튼이 화면 밖으로 밀려나던 문제 대응) */
@media (max-width: 480px) {
    .ns_header_inner { padding: 0 var(--sp-2); gap: var(--sp-1); }
    #ns_logo { flex-shrink: 1; min-width: 0; gap: 0.5rem; }
    #ns_logo img { height: 30px; flex-shrink: 0; }
    #ns_logo .ns_logo_text { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ns_header_side { gap: 0.25rem; }
    .ns_header_side .ns-btn--sm { height: 38px; padding: 0 0.85rem; }
}
@media (max-width: 359px) {
    #ns_logo img { height: 28px; }
    #ns_logo .ns_logo_text { font-size: 1rem; }
}

/* ---------- Footer ---------------------------------------------------- */
#ns_footer {
    background: var(--c-bg-deep);
    color: rgba(255,255,255,0.72);
    padding: var(--sp-6) 0 var(--sp-3);
}
.ns_footer_top {
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 1fr 1.1fr;
    gap: var(--sp-4);
    padding-bottom: var(--sp-5);
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
#ns_footer .ns-notice-list a { display: flex; justify-content: space-between; gap: var(--sp-1); padding: 0.5rem 0; border-bottom: 1px dashed rgba(255,255,255,0.12); font-size: var(--fs-xs); }
#ns_footer .ns-notice-list a:first-child { padding-top: 0; }
#ns_footer .ns-notice-title { color: rgba(255,255,255,0.78); }
#ns_footer .ns-notice-list a:hover .ns-notice-title { color: var(--c-accent); }
#ns_footer .ns-notice-date { color: rgba(255,255,255,0.4); }
#ns_footer .ns-empty { font-size: var(--fs-xs); color: rgba(255,255,255,0.4); }
.ns_footer_brand .ns_logo_text { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--c-white); }
.ns_footer_brand p { margin-top: var(--sp-2); font-size: var(--fs-sm); line-height: 1.9; }
.ns_footer_brand p.ns_footer_bizinfo { margin-top: var(--sp-2); font-size: var(--fs-xs); color: rgba(255,255,255,0.45); line-height: 1.7; }
.ns_footer_col h3 { font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: var(--sp-2); }
.ns_footer_col ul li { margin-bottom: 0.6rem; }
.ns_footer_col a:hover { color: var(--c-accent); }
.ns_footer_col address { font-style: normal; font-size: var(--fs-sm); line-height: 1.9; }
.ns_footer_bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: var(--sp-3);
    font-size: var(--fs-xs);
    color: rgba(255,255,255,0.4);
    flex-wrap: wrap; gap: var(--sp-1);
}
.ns_footer_bottom a:hover { color: rgba(255,255,255,0.8); }
#ns_top_btn {
    position: fixed; right: var(--sp-3); bottom: var(--sp-3);
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--c-primary);
    color: var(--c-white);
    border: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity var(--dur-base), transform var(--dur-base), visibility var(--dur-base);
    z-index: 400;
}
#ns_top_btn.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

@media (max-width: 768px) {
    .ns_footer_top { grid-template-columns: 1fr; gap: var(--sp-4); }
}

/* ---------- 공통 섹션 뼈대 --------------------------------------------- */
.ns-section { padding: var(--sp-7) 0; }
.ns-section--soft { background: var(--c-bg-soft); }
.ns-section--deep { background: var(--c-bg-deep); color: rgba(255,255,255,0.85); }
.ns-section-head { max-width: 640px; margin-bottom: var(--sp-5); }
.ns-section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.ns-section-head h2 { font-size: var(--fs-3xl); margin-top: var(--sp-2); }

/* 서브페이지 상단 페이지 헤더 */
.ns-page-header {
    position: relative;
    margin-top: 84px;
    height: 320px;
    display: flex; align-items: flex-end;
    color: var(--c-white);
    background-size: cover;
    background-position: center;
}
.ns-page-header::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,24,15,0.35) 0%, rgba(20,24,15,0.72) 100%);
}
.ns-page-header-inner { position: relative; z-index: 1; padding-bottom: var(--sp-4); width: 100%; }
.ns-page-header h1 { font-family: var(--font-display); font-size: var(--fs-3xl); }
.ns-breadcrumb { font-size: var(--fs-xs); color: rgba(255,255,255,0.75); margin-bottom: var(--sp-1); display: flex; gap: 0.4rem; align-items: center; }
.ns-breadcrumb a:hover { color: var(--c-white); }

@media (max-width: 768px) {
    .ns-page-header { height: 220px; }
    .ns-section { padding: var(--sp-5) 0; }
}
