/* ==========================================================================
   공통 기업형 홈페이지 기본 템플릿
   목차: 1.폰트 2.토큰 3.기본 4.공통(레이아웃·제목·버튼·태그·이미지) 5.HEADER
         6.MAIN VISUAL 7.ABOUT 8.SERVICES 9.PORTFOLIO 10.NEWS 11.CONTACT 12.FOOTER(12-1 팝업) 13.SUB 14.반응형
   반응형: PC ≥1024px / 태블릿 768~1023px / 모바일 ≤767px
   색상·로고 높이는 레이아웃(base.php)에서 관리자 설정값으로 덮어씁니다.
   ========================================================================== */

/* ===== 1. 폰트 (프로젝트 내 Pretendard, 외부 CDN 없음) ===== */
@font-face { font-family: 'Pretendard'; font-weight: 400; font-display: swap; src: url('/assets/site/css/font/Pretendard-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 500; font-display: swap; src: url('/assets/site/css/font/Pretendard-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 600; font-display: swap; src: url('/assets/site/css/font/Pretendard-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Pretendard'; font-weight: 700; font-display: swap; src: url('/assets/site/css/font/Pretendard-Bold.woff2') format('woff2'); }

/* ===== 2. 디자인 토큰 ===== */
:root {
    /* 색상 (기본값) */
    --c-primary: #4F7A63;
    --c-primary-dark: #3D5F4D;
    --c-primary-soft: #E8EFEA;
    --c-bg: #FFFFFF;
    --c-bg-soft: #F6F7F5;
    --c-text: #1F2522;
    --c-muted: #5F6763;
    --c-line: #E3E6E2;
    --c-dark: #1F2522;

    /* 글자 크기 */
    --fs-xs: 13px;                          /* 영문 소제목 */
    --fs-sm: 15px;                          /* 버튼, 카드 설명 */
    --fs-base: 16px;                        /* 본문 */
    --fs-lead: 19px;                        /* 강조 문단 */
    --fs-h3: 19px;                          /* 카드 제목 */
    --fs-h2: clamp(26px, 3vw, 38px);        /* 섹션 제목 */
    --fs-h1: clamp(32px, 4.4vw, 56px);      /* 메인 비주얼 제목 */

    /* 레이아웃 */
    --inner: 1200px;
    --pad-x: 24px;                          /* 좌우 여백 */
    --sec-y: 112px;                         /* 섹션 상하 여백 (태블릿 88 / 모바일 64) */
    --head-gap: 48px;                       /* 섹션 제목 ↔ 콘텐츠 */
    --gap: 24px;                            /* 카드 간격 */
    --header-h: 80px;
    --logo-h: 32px;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(20, 30, 25, .04), 0 8px 24px rgba(20, 30, 25, .06);
    --ease: cubic-bezier(.2, .6, .2, 1);
    --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

/* ===== 3. 기본 ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.7;
    color: var(--c-text);
    background: var(--c-bg);
    word-break: keep-all;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.skip { position: absolute; left: 16px; top: -100px; z-index: 1000; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--c-text); color: #fff; }
.skip:focus { top: 16px; }

/* ===== 4. 공통 ===== */
/* 4-1. 레이아웃 */
.inner { width: 100%; max-width: calc(var(--inner) + var(--pad-x) * 2); margin: 0 auto; padding: 0 var(--pad-x); }
.sec { padding: var(--sec-y) 0; }
.sec-soft { background: var(--c-bg-soft); }

/* 4-2. 섹션 제목 (영문 소제목 → 한글 제목 → 설명) */
.sec-head { margin-bottom: var(--head-gap); }
.sec-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.sec-label { margin-bottom: 12px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .16em; color: var(--c-primary); }
.sec-tit { font-size: var(--fs-h2); font-weight: 700; line-height: 1.35; letter-spacing: -.02em; }
.sec-desc { margin-top: 14px; font-size: 17px; color: var(--c-muted); }

/* 4-3. 아이콘 (더보기 화살표) */
.ico { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 4-4. 버튼 · 더보기 링크 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 24px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font-size: var(--fs-sm); font-weight: 600; line-height: 1;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-line { border-color: var(--c-line); background: #fff; }
.btn-line:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-white { background: #fff; color: var(--c-text); }
.btn-white:hover { background: var(--c-primary-soft); }

.more { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--c-muted); }
.more:hover { color: var(--c-primary); }

/* 4-5. 태그 (카테고리) */
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--c-primary-soft); color: var(--c-primary-dark); font-size: 12px; font-weight: 600; }

/* 4-6. 이미지 박스 (4:3 고정, 이미지 교체 시 비율 유지) */
.about-img, .service-img, .work-img, .news-thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--c-bg-soft); }
.about-img img, .service-img img, .work-img img, .news-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 5. HEADER ===== */
.header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .96); border-bottom: 1px solid transparent; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.header.is-scrolled { border-bottom-color: var(--c-line); box-shadow: 0 4px 16px rgba(20, 30, 25, .04); }
.header-inner { display: flex; align-items: center; gap: 40px; height: var(--header-h); }
.logo img { width: auto; height: var(--logo-h); }

/* 5-1. PC 메뉴 */
.gnb { margin-left: auto; }
.gnb-list { display: flex; gap: 8px; }
.gnb-item { position: relative; }
.gnb-link { display: flex; align-items: center; height: var(--header-h); padding: 0 16px; font-size: 16px; font-weight: 600; }
.gnb-link:hover, .gnb-item.is-open > .gnb-link { color: var(--c-primary); }
.gnb-sub {
    position: absolute; left: 50%; top: calc(100% - 8px); min-width: 180px; padding: 8px;
    border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translate(-50%, 4px);
    transition: opacity .15s var(--ease), transform .15s var(--ease), visibility .15s;
}
.gnb-item.is-open > .gnb-sub, .gnb-item:focus-within > .gnb-sub { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.gnb-sub a { display: block; padding: 10px 14px; border-radius: 6px; font-size: 15px; color: var(--c-muted); white-space: nowrap; }
.gnb-sub a:hover { background: var(--c-bg-soft); color: var(--c-primary); }

.header-util { display: flex; align-items: center; gap: 12px; }
.lang-sw { display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; }
.lang-sw a { display: grid; place-items: center; min-width: 34px; height: 32px; padding: 0 6px; border-radius: var(--radius-sm); color: var(--c-muted); letter-spacing: .04em; }
.lang-sw a:hover { color: var(--c-text); }
.lang-sw a.is-active { color: var(--c-primary); }
.m-lang { justify-content: center; margin-top: 16px; }
.m-lang a { min-width: 52px; height: 40px; }

/* 5-2. 모바일 메뉴 버튼 */
.menu-btn { display: none; position: relative; width: 44px; height: 44px; }
.menu-btn span { position: absolute; left: 11px; width: 22px; height: 2px; border-radius: 2px; background: var(--c-text); transition: transform .2s var(--ease), opacity .2s var(--ease); }
.menu-btn span:nth-child(1) { top: 15px; }
.menu-btn span:nth-child(2) { top: 21px; }
.menu-btn span:nth-child(3) { top: 27px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 5-3. 모바일 메뉴 패널 */
.m-nav { position: fixed; inset: var(--header-h) 0 0; overflow-y: auto; padding: 8px var(--pad-x) 32px; background: #fff; border-top: 1px solid var(--c-line); }
.m-nav[hidden] { display: none; }
.m-nav-list { margin-bottom: 24px; }
.m-nav-item { border-bottom: 1px solid var(--c-line); }
.m-nav-link { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 56px; font-size: 17px; font-weight: 600; text-align: left; }
.m-nav-toggle::after { content: ''; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s var(--ease); }
.m-nav-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); }
.m-nav-sub { padding: 0 0 12px 12px; }
.m-nav-sub a { display: flex; align-items: center; min-height: 44px; color: var(--c-muted); }
body.is-menu-open { overflow: hidden; }

/* 5-4. 회원 메뉴 · 검색 (기존 회원 기능·통합검색 연결) */
.member-nav { display: flex; align-items: center; font-size: 14px; color: var(--c-muted); }
.member-nav > a, .member-nav button { display: flex; align-items: center; height: 32px; padding: 0 8px; font-size: 14px; color: inherit; }
.member-nav > * + *::before { content: ''; width: 1px; height: 11px; margin-right: 8px; background: var(--c-line); }
.member-nav form { display: flex; align-items: center; }
.member-nav > a:hover, .member-nav button:hover { color: var(--c-primary); }
.search-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--c-text); }
.search-btn:hover, .search-btn[aria-expanded="true"] { background: var(--c-bg-soft); color: var(--c-primary); }
.search-btn .ico { width: 20px; height: 20px; }
.h-search { position: absolute; left: 0; right: 0; top: 100%; padding: 16px 0; background: #fff; border-top: 1px solid var(--c-line); box-shadow: 0 12px 24px rgba(20, 30, 25, .06); }
.h-search[hidden] { display: none; }
.h-search-form { display: flex; align-items: center; gap: 8px; }
.h-search-form input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); font-size: 16px; }
.h-search-form input:focus { outline: 0; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.h-search-form .btn { min-height: 48px; }
.h-search-close { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; color: var(--c-muted); }
.h-search-close:hover { color: var(--c-text); }
.skip-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.m-member { display: flex; margin-bottom: 12px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); }
.m-member > a, .m-member form, .m-member button { flex: 1; display: grid; place-items: center; min-height: 48px; font-size: 15px; font-weight: 600; }
.m-member > * + * { border-left: 1px solid var(--c-line); }
.m-member button { width: 100%; }

/* ===== 6. MAIN VISUAL ===== */
.visual { position: relative; background: var(--c-bg-soft); }
.visual-swiper { position: relative; }
.visual-slide { position: relative; display: flex; align-items: center; height: clamp(480px, 72vh, 720px); overflow: hidden; }
.visual-img, .visual-img img { position: absolute; inset: 0; width: 100%; height: 100%; }
.visual-img img { object-fit: cover; }
/* 글자 대비: 왼쪽에서 오른쪽으로 옅어지는 그림자 */
.visual-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 30, 25, .55) 0%, rgba(20, 30, 25, .15) 65%, rgba(20, 30, 25, 0) 100%); }
.visual-txt { position: relative; z-index: 1; color: #fff; }
.visual-label { margin-bottom: 16px; font-size: 14px; font-weight: 600; letter-spacing: .14em; opacity: .9; }
.visual-tit { max-width: 680px; font-size: var(--fs-h1); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
.visual-desc { max-width: 560px; margin: 20px 0 36px; font-size: clamp(16px, 1.4vw, 19px); opacity: .92; }

/* 6-1. 슬라이드 조작 (도트 · 이전/일시정지/다음) */
.visual-ctrl { position: absolute; left: 0; right: 0; bottom: 40px; z-index: 2; display: flex; align-items: center; gap: 12px; color: #fff; }
.visual-dots { position: static !important; display: flex; gap: 8px; width: auto !important; }
.visual-dots .swiper-pagination-bullet { width: 28px; height: 3px; margin: 0 !important; border-radius: 2px; background: #fff; opacity: .4; transition: opacity .2s; }
.visual-dots .swiper-pagination-bullet-active { opacity: 1; }
.visual-btns { display: flex; gap: 8px; }
.visual-arrow { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%; color: #fff; transition: background-color .2s var(--ease); }
.visual-arrow:hover { background: rgba(255, 255, 255, .15); }
.visual-arrow svg { width: 18px; height: 18px; }
.visual-play svg { fill: currentColor; }
.visual-play .ico-play, .visual-play[aria-pressed="true"] .ico-pause { display: none; }
.visual-play[aria-pressed="true"] .ico-play { display: block; }

/* ===== 7. ABOUT ===== */
.about-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center; }
.about-img { border-radius: var(--radius); }
.about-lead { margin-top: 24px; font-size: var(--fs-lead); font-weight: 500; line-height: 1.6; }
.about-body { margin-top: 16px; color: var(--c-muted); }
.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 36px 0; border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }
.about-stat { padding: 22px 0; }
.about-stat + .about-stat { padding-left: 24px; border-left: 1px solid var(--c-line); }
.about-stat dt { font-size: 14px; color: var(--c-muted); }
.about-stat dd { margin-top: 4px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--c-primary); }

/* ===== 8. SERVICES ===== */
.service-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.service-item a { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--c-line); border-radius: var(--radius); background: #fff; overflow: hidden; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.service-item a:hover { border-color: transparent; box-shadow: var(--shadow); }
.service-body { display: flex; flex-direction: column; flex: 1; padding: 24px; }
.service-tit { font-size: var(--fs-h3); font-weight: 700; }
.service-desc { margin-top: 10px; font-size: var(--fs-sm); color: var(--c-muted); }
.service-body .more { margin-top: auto; padding-top: 20px; color: var(--c-primary); }

/* ===== 9. PORTFOLIO ===== */
.work-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.work-item a { display: block; }
.work-img { border-radius: var(--radius); }
.work-img img { transition: transform .4s var(--ease); }
.work-item a:hover .work-img img { transform: scale(1.03); }
.work-info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 16px; }
.work-tit { font-size: 17px; font-weight: 600; }

/* ===== 10. NEWS ===== */
.news-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.news-box { padding: 32px; border: 1px solid var(--c-line); border-radius: var(--radius); background: #fff; }
.news-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; margin-bottom: 8px; border-bottom: 2px solid var(--c-text); }
.news-head h3 { font-size: 20px; font-weight: 700; }
.news-list li + li { border-top: 1px solid var(--c-line); }
.news-list a { display: flex; align-items: center; gap: 16px; padding: 16px 0; }
.news-list .news-tit { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.news time { flex-shrink: 0; font-size: 14px; color: var(--c-muted); }
.news a:hover .news-tit { color: var(--c-primary); }
.news-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-top: 16px; }
.news-cards a { display: block; }
.news-thumb { margin-bottom: 12px; border-radius: var(--radius-sm); }
.news-cards .news-tit { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; line-height: 1.5; }
.news-cards time { display: block; margin-top: 6px; }
.news-sum { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: .875rem; line-height: 1.5; color: var(--c-text-muted); }
.news a:not([href]) { cursor: default; }   /* 링크 없는 기본 글 */

/* ===== 11. CONTACT ===== */
.contact-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; }
.contact-list { margin-top: 36px; border-top: 1px solid var(--c-line); }
.contact-list > div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--c-line); }
.contact-list dt { font-size: 14px; font-weight: 600; color: var(--c-muted); }
.contact-list a:hover { color: var(--c-primary); }

/* 11-1. 문의 양식 (카드형) */
.contact-form { padding: 40px; border-radius: var(--radius); background: var(--c-bg-soft); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.form-field .req { color: var(--c-primary); }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: #fff; transition: border-color .2s var(--ease); }
.form-field textarea { min-height: 140px; resize: vertical; }
.form-field :is(input, select, textarea):focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.form-field.is-invalid :is(input, textarea) { border-color: #B54A3C; }
.form-check { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 24px; font-size: 14px; color: var(--c-muted); }
.form-check input { flex-shrink: 0; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--c-primary); }
.form-check a { text-decoration: underline; }
.form-msg { min-height: 1.7em; margin-top: 14px; font-size: 14px; text-align: center; color: var(--c-primary-dark); }
.form-msg.is-error { color: #B54A3C; }
/* 11-2. 접수 완료 안내 (접수번호·복사·조회 안내, front.js showReceipt) — 좁은 화면은 줄바꿈, 번호는 잘리지 않음 */
.form-receipt { display: block; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-primary-soft); color: var(--c-text); line-height: 1.6; overflow-wrap: anywhere; }
.form-receipt-no { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; font-size: 15px; }
.form-receipt-no strong { font-size: 22px; letter-spacing: .02em; color: var(--c-primary-dark); }
.form-receipt-copy { min-height: 32px; padding: 4px 12px; border: 1px solid var(--c-primary); border-radius: var(--radius-sm); background: #fff; color: var(--c-primary-dark); font-size: 13px; cursor: pointer; }
.form-receipt-copy:hover { background: var(--c-primary); color: #fff; }
.form-receipt-guide { display: block; margin-top: 6px; font-size: 13px; color: var(--c-muted); }
.form-receipt-guide a { text-decoration: underline; color: var(--c-primary-dark); }

/* ===== 12. FOOTER ===== */
.footer { padding: 56px 0 40px; background: var(--c-dark); color: rgba(255, 255, 255, .7); font-size: 14px; }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer-logo { width: auto; height: 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.footer-links a:hover, .footer-info a:hover { color: #fff; }
.footer-links .is-strong { color: #fff; font-weight: 600; }
.footer-info { padding: 28px 0; font-style: normal; line-height: 1.9; }
.footer-info span { display: inline-block; margin-right: 20px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-copy { color: rgba(255, 255, 255, .5); }
.footer-sns { display: flex; gap: 8px; }
.footer-sns a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .08); transition: background-color .2s var(--ease); }
.footer-sns a:hover { background: var(--c-primary); }
.footer-sns svg { width: 18px; height: 18px; fill: #fff; }

/* 12-1. 메인 팝업 (front/partials/popup) — 화면 전체 고정 층(클릭은 팝업만), 너비·좌표는 관리자 값(인라인) */
.popup-layer { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.popup-layer[hidden], .popup[hidden] { display: none; }
.popup {
    position: absolute; display: flex; flex-direction: column; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px);
    overflow: hidden; border-radius: var(--radius-sm); background: #fff; box-shadow: 0 12px 40px rgba(20, 30, 25, .24); pointer-events: auto;
}
.popup.is-center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.popup-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.popup-body img { display: block; width: 100%; height: auto; }   /* 비율 유지 */
.popup-text { padding: 24px; font-size: 15px; line-height: 1.7; word-break: keep-all; }
.popup-text img { max-width: 100%; height: auto; }
.popup-foot { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; height: 44px; padding: 0 6px 0 4px; background: var(--c-dark); }
.popup-foot button { height: 100%; padding: 0 12px; color: rgba(255, 255, 255, .78); font-size: 14px; transition: color .2s var(--ease); }
.popup-foot button:hover, .popup-foot button:focus-visible { color: #fff; }
.popup-foot .popup-close { font-weight: 600; color: #fff; }

/* ===== 13. SUB (서브페이지 공통) ===== */
/* 13-1. 상단 비주얼 — 메인 비주얼과 같은 배경 처리·글자 구성(작은 제목 → 큰 제목 → 설명), 브레드크럼은 아래쪽 */
.sub-head { position: relative; display: flex; align-items: center; height: clamp(300px, 42vh, 420px); overflow: hidden; background: var(--c-dark) var(--sub-bg) center / cover no-repeat; color: #fff; }
.sub-head::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 30, 25, .55) 0%, rgba(20, 30, 25, .15) 65%, rgba(20, 30, 25, 0) 100%); }
.sub-head-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.sub-head.has-tabs .sub-head-inner { padding-bottom: 32px; }   /* 겹치는 서브메뉴 자리 */
.sub-label { margin-bottom: 12px; font-size: 14px; font-weight: 600; letter-spacing: .14em; opacity: .9; }
.sub-title { max-width: 680px; font-size: clamp(30px, 3.6vw, 46px); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
.sub-desc { max-width: 560px; margin-top: 16px; font-size: clamp(15px, 1.3vw, 18px); opacity: .92; }

.crumb { position: absolute; left: var(--pad-x); bottom: 32px; font-size: 13px; }
.sub-head.has-tabs .crumb { bottom: 64px; }
.crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crumb li { display: flex; align-items: center; gap: 8px; opacity: .8; }
.crumb li + li::before { content: ''; width: 5px; height: 5px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); opacity: .7; }
.crumb .ico { width: 15px; height: 15px; }
.crumb a:hover { opacity: 1; text-decoration: underline; }
.crumb [aria-current] { opacity: 1; font-weight: 600; }

/* 13-2. 서브메뉴 — 비주얼 아래쪽에 겹치는 흰 카드, 현재 메뉴는 메인 버튼과 같은 색 */
.sub-nav { position: relative; z-index: 2; margin-top: -32px; }
.sub-nav-list { display: flex; gap: 4px; overflow-x: auto; padding: 8px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); scrollbar-width: none; }
.sub-nav-list::-webkit-scrollbar { display: none; }
.sub-nav-list li { flex-shrink: 0; }
.sub-nav-list a { display: flex; align-items: center; height: 48px; padding: 0 22px; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600; color: var(--c-muted); white-space: nowrap; transition: background-color .2s var(--ease), color .2s var(--ease); }
.sub-nav-list a:hover { background: var(--c-bg-soft); color: var(--c-text); }
.sub-nav-list a.is-active { background: var(--c-primary); color: #fff; }

/* 13-3. 본문 영역 (기존 콘텐츠 뷰를 감쌈) */
.sub-body { padding: 64px 0 var(--sec-y); }
/* 기존 콘텐츠 래퍼(#contents·.bo_cont)·비전의 자체 여백은 .sub-body 여백과 중복되므로 제거 */
.sub-body #contents,
.sub-body .bo_cont { padding: 0; }
.sub-body .vision { padding-top: 0; }
.sub-body .history { padding-top: 40px; }   /* 연혁 원형 장식(::before/::after) 자리 */

/* ===== 14. 반응형 ===== */
/* 14-1. 작은 PC (1024~1199) */
@media (max-width: 1199px) {
    .header-inner { gap: 24px; }
    .gnb-link { padding: 0 12px; font-size: 15px; }
}

/* 14-2. 태블릿 (≤1023) */
@media (max-width: 1023px) {
    :root { --sec-y: 88px; --header-h: 68px; }
    .gnb, .header-btn, .member-nav { display: none; }
    .menu-btn { display: block; }
    .header-util > .lang-sw { display: none; }
    .header-util { margin-left: auto; }

    .about-inner, .contact-inner { grid-template-columns: 1fr; gap: 40px; }
    .service-list, .work-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-wrap { grid-template-columns: 1fr; }

    .sub-head { height: 300px; }
    .sub-body { padding-top: 48px; }
}
@media (min-width: 1024px) {
    .m-nav { display: none !important; }
}

/* 14-3. 모바일 (≤767) */
@media (max-width: 767px) {
    :root { --sec-y: 64px; --pad-x: 20px; --header-h: 60px; --head-gap: 32px; --fs-base: 15px; --gap: 20px; }
    .logo img { height: calc(var(--logo-h) * .85); }

    /* 메인 비주얼: 글자를 아래쪽에 두고 위로 옅어지는 그림자 */
    .visual-slide { align-items: flex-end; height: clamp(460px, 78vh, 600px); padding-bottom: 104px; }
    .visual-slide::after { background: linear-gradient(0deg, rgba(20, 30, 25, .7) 0%, rgba(20, 30, 25, .2) 70%, rgba(20, 30, 25, .1) 100%); }
    .visual-desc { margin: 14px 0 24px; }
    .visual-ctrl { bottom: 28px; }
    .visual-prev, .visual-next { display: none; }

    .sec-head-row { flex-direction: column; align-items: flex-start; gap: 16px; }
    .sec-desc { font-size: 15px; }
    .about-lead { font-size: 17px; }
    .about-stat dd { font-size: 24px; }
    .about-stat + .about-stat { padding-left: 14px; }

    .service-list, .work-list { grid-template-columns: 1fr; }
    .service-body { padding: 20px; }

    .news-box { padding: 24px 20px; }
    .news-cards { gap: 14px; }

    .contact-list > div { grid-template-columns: 80px 1fr; }
    .contact-form { padding: 24px 20px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }

    .footer-top, .footer-bottom { flex-direction: column; align-items: flex-start; }
    .footer-info span { display: block; margin-right: 0; }

    .sub-head { height: 240px; }
    .sub-head::after { background: rgba(20, 30, 25, .45); }
    .sub-head.has-tabs .sub-head-inner { padding-bottom: 24px; }
    .sub-label { margin-bottom: 8px; font-size: 12px; }
    .sub-title { font-size: 28px; }
    .sub-desc { margin-top: 10px; font-size: 14px; }
    .crumb { bottom: 20px; font-size: 12px; }
    .sub-head.has-tabs .crumb { bottom: 44px; }
    .sub-nav { margin-top: -24px; }
    .sub-nav-list { padding: 6px; }
    .sub-nav-list a { height: 42px; padding: 0 16px; font-size: 14px; }
    .sub-body { padding-top: 36px; }

    /* 팝업: 좌표 무시하고 가운데, 화면 너비에 맞춤 (여러 개면 우선순위 높은 팝업이 위) */
    .popup { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); }
    .popup-foot button { padding: 0 10px; font-size: 13px; }
}

/* 움직임 줄이기 설정 존중 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
