/* 두리네트워크 — 베이스: 토큰 · 레이아웃 · 헤더 · 푸터 · 타이포 */

:root {
	--navy: #203597;
	--navy-d: #182b7a;
	--teal: #01add6;
	--teal-2: #3bc4e2;
	--teal-d: #0a7ea8;
	--ink: #111;
	--text: #333;
	--muted: #666;
	--line: #e6e8f4;
	--bg-soft: #f0f1f7;
	--hero-dark: #1b2140;
	--maxw: 1200px;
	--headw: 1400px;
	--header-h: 90px;
	--font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); line-height: 1.6; background: #fff; }

/* ===== 다국어 텍스트 안전장치 =====
 * keep-all은 한국어 전용 규칙. 일본어·중국어는 띄어쓰기가 없어 keep-all이면 문장이 한 덩어리(줄바꿈 불가)가 되어
 * 카드·원형·타이틀 밖으로 넘침 → 자연 줄바꿈 복원. 페이지 위젯 인라인 CSS의 keep-all !important까지 덮어야 해서 !important. */
html[lang="ja"] body[class] *, html[lang="zh-CN"] body[class] * { word-break: normal !important; }
/* 긴 단어(러시아어·영어 의학용어)가 좁은 칸(원형·2열 그리드)보다 길 때만 강제 줄바꿈 (상속, 평소엔 무영향) */
body { overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none;}
h1, h2, h3, p { margin: 0; }

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

/* ===== 헤더 (fixed 오버레이 → 스크롤 시 흰 배경, 원본 재현) ===== */
.site-header {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 100;
	height: var(--header-h);
	transition: background .3s ease, box-shadow .3s ease;
}
.site-header-inner {
	margin: 0 auto;
	height: 100%;
	padding: 0 56px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
/* 로고: 흰/검정 2장 겹침(원본 방식), 스크롤 상태로 토글 */
.site-logo { display: block; line-height: 0; position: relative; flex-shrink: 0; }
.site-logo img { display: block; width: 209px; height: 67px; max-width: none; }
.site-logo .logo-dark { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; }
.site-header.scrolled { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.site-header.scrolled .logo-white { opacity: 0; }
.site-header.scrolled .logo-dark { opacity: 1; }

.site-nav .primary-nav {
	display: flex;
	gap: 54px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.site-nav a { color: #fff; text-decoration: none; font-size: 18px; font-weight: 700; white-space: nowrap; transition: color .3s ease; }
.site-header.scrolled .site-nav a { color: #212121; }

/* 네비 묶음(우측 정렬) — 언어 스위처는 형제 요소로 뒤따름(모바일에서 헤더 바에 남기기 위해 패널 밖) */
.header-nav-wrap { display: flex; align-items: center; gap: 48px; margin-left: auto; }

/* 대메뉴 hover 드롭다운 */
.primary-nav .has-sub { position: relative; }
.primary-nav .has-sub > a { display: inline-flex; align-items: center; gap: 6px; }
.sub-caret { width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .25s ease; opacity: .75; }
.has-sub:hover .sub-caret { transform: rotate(225deg) translateY(1px); }
.has-sub::after { content: ""; position: absolute; top: 100%; left: -10px; right: -10px; height: 20px; } /* hover 간극 브릿지 */
.sub-menu {
	position: absolute; top: 100%; left: 50%;
	margin: 0; padding: 10px; list-style: none; min-width: 190px;
	background: #fff; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.15);
	opacity: 0; visibility: hidden; transform: translate(-50%, 8px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s;
	z-index: 60;
}
.has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu { opacity: 1; visibility: visible; transform: translate(-50%, 14px); }
.sub-menu li { margin: 0; }
.sub-menu a { display: block; padding: 11px 16px; font-size: 15px; font-weight: 600; color: #333 !important; white-space: nowrap; border-radius: 9px; transition: background .2s, color .2s; }
.sub-menu a:hover { background: #f0f7fa; color: var(--teal-d) !important; }

/* 다국어 선택 */
.lang-switch { position: relative; margin-left: 48px; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 2px; cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; transition: color .3s ease; }
.site-header.scrolled .lang-btn { color: #212121; }
.lang-globe { flex-shrink: 0; }
.lang-caret { width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .75; }
.lang-switch::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 18px; }
.lang-menu {
	position: absolute; top: 100%; right: 0;
	margin: 0; padding: 8px; list-style: none; min-width: 155px;
	background: #fff; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.15);
	opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s;
	z-index: 60;
}
.lang-switch:hover .lang-menu, .lang-switch:focus-within .lang-menu,
.lang-switch.is-open .lang-menu { opacity: 1; visibility: visible; transform: translateY(14px); } /* .is-open = 클릭/탭 토글(header.php) */
.lang-menu li { margin: 0; }
.lang-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 14px; font-weight: 500; color: #333; border-radius: 9px; transition: background .2s; }
.lang-menu a b { color: var(--teal-d); font-weight: 700; font-size: 12px; min-width: 22px; }
.lang-menu a:hover { background: #f0f7fa; }
.lang-menu .is-current a { background: #f0f7fa; color: var(--teal-d); font-weight: 700; } /* 현재 언어 */

/* 모바일 토글 */
.nav-toggle { display: none; width: 40px; height: 40px; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; justify-content: center; align-items: center; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; transition: .25s; }

/* 중간 화면(태블릿~노트북): 다국어로 네비 길어질 때 로고 유지 + 네비 축소 */
@media (max-width: 1400px) {
	.site-header-inner { padding: 0 32px; }
	.header-nav-wrap { gap: 30px; }
	.lang-switch { margin-left: 30px; }
	.site-nav .primary-nav { gap: 30px; }
	.site-nav a { font-size: 16px; }
	.lang-btn { font-size: 14px; }
}
@media (max-width: 1140px) {
	/* 영문·러시아어 네비(About the Doori ENT Network / Информация об операции)가 1024px대에서 언어버튼을 밀어냄 → 로고·간격·글자 한 단계 더 축소 */
	.site-header-inner { padding: 0 20px; }
	.site-logo img { width: 160px; height: 51px; }
	.header-nav-wrap { gap: 16px; }
	.lang-switch { margin-left: 12px; }
	.lang-cur { display: none; } /* 1001~1140px: 러시아어 네비가 꽉 차 'Language' 텍스트가 꺾임 → 아이콘만(모바일 블록에서 다시 표시) */
	.site-nav .primary-nav { gap: 14px; }
	.site-nav a { font-size: 13px; }
}

/* 햄버거 전환 900→1000px: 축소해도 900~1000px 구간에선 영문·러시아어 네비가 안 들어감 */
@media (max-width: 1000px) {
	/* 모바일: 헤더 흰 배경 고정, 로고 검정, 높이·여백 최적화 */
	.site-header { background: #fff; box-shadow: 0 1px 8px rgba(0,0,0,.06); height: 62px; }
	.site-header-inner { padding: 0 18px; }
	.site-logo img { width: 132px; height: 42px; }
	.site-logo .logo-white { opacity: 0; }
	.site-logo .logo-dark { opacity: 1; }
	.nav-toggle { display: flex; width: 34px; height: 34px; }
	.nav-toggle span { background: #212121; }
	/* 토글 메뉴 = 네비 + 다국어 묶음 */
	.header-nav-wrap {
		position: fixed; inset: 62px 0 auto 0;
		flex-direction: column; align-items: stretch; gap: 0;
		background: #fff; box-shadow: 0 8px 16px rgba(0,0,0,.08);
		max-height: 0; overflow: hidden; overflow-y: auto; transition: max-height .3s ease;
	}
	.nav-open .header-nav-wrap { max-height: 82vh; }
	.site-nav .primary-nav { flex-direction: column; gap: 0; padding: 6px 0; }
	.site-nav a { display: block; padding: 15px 20px; color: #212121; border-bottom: 1px solid #f0f0f0; font-size: 16px; white-space: normal; word-break: keep-all; }
	.sub-caret, .lang-caret { display: none; }
	/* 하위메뉴: 정적 펼침(들여쓰기) */
	.has-sub::after { display: none; }
	/* hover/focus-within 선택자까지 포함 — 데스크탑 hover 규칙(0,3,0)이 모바일 탭(hover 고착)에서 translate(-50%)로 옆으로 밀던 문제 */
	.sub-menu, .has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		min-width: 0; padding: 0; border-radius: 0; box-shadow: none; background: #f7f9fb;
	}
	.sub-menu a { padding: 12px 20px 12px 38px !important; font-size: 14px !important; font-weight: 500 !important; border-bottom: 1px solid #edf1f4; white-space: normal; word-break: keep-all; }
	/* 다국어: 헤더 바에서 햄버거 왼쪽 버튼(🌐 KR) + 탭하면 드롭다운. hover/focus로는 안 열림(모바일 hover 고착 방지) → .is-open만 */
	.lang-switch { margin-left: auto; margin-right: 2px; z-index: 5; }
	.lang-switch::after { display: none; }
	.lang-btn { padding: 8px 8px; gap: 5px; color: #212121; font-size: 14px; }
	.lang-cur { display: inline; } /* 모바일은 '🌐 Language' 텍스트 표시 */
	.lang-switch:hover .lang-menu, .lang-switch:focus-within .lang-menu { opacity: 0; visibility: hidden; transform: translateY(8px); }
	.lang-switch.is-open .lang-menu { opacity: 1; visibility: visible; transform: translateY(6px); }
	.lang-menu a { padding: 10px 14px; }
	/* 햄버거 → X */
	.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
	.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ===== 푸터 (검정 배경 통일 + 흰 로고) ===== */
.site-footer { background: #1a1a1a; }
.site-footer-main { max-width: var(--headw); margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 20px; }
.footer-logo { line-height: 0; }
.footer-logo img { display: block; width: 209px; height: 67px; }
.footer-info { font-size: 16px; line-height: 1.6; color: #aaa; margin: 0; }
.site-footer-copy { background: #111; border-top: 1px solid rgba(255,255,255,.08); }
.site-footer-copy-inner { max-width: var(--headw); margin: 0 auto; padding: 18px 20px; }
.site-footer-copy p { font-size: 12px; line-height: 1.6; color: rgba(255,255,255,.55); letter-spacing: .3px; margin: 0; }

@media (max-width: 768px) {
	.site-footer-main { padding: 36px 20px; gap: 16px; }
	.footer-logo img { width: 170px; height: 54px; }
	.footer-info { font-size: 14px; }
}
