/* === PLOT site.css — 공유 셸 스타일시트 (build-site-css.cjs) === */
/* 언어·페이지 무관하게 모든 페이지에 단 1회 로드 */

/* ── 색 토큰 (정본=landing-header.cjs COLOR_TOKENS_BLOCK — 7/20 두 곳 정의 통일, 값 수정은 그쪽에서만) ── */
:root {
  --accent: #10b981;
  --accent-hover: #0fd9a0;
  --accent-dark: #059669;
  --accent-a15: rgba(16,185,129,0.082);
  --bg: #050b11;
  --bg2: #0b131c;
  --bg3: #101a24;
  --text: #e8f0ec;
  --text2: #9fb4ab;
  --text3: #5f7269;
  --border: #1d2933;
  --border2: #263442;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  /* 콘텐츠 본문 폭 — 성격별 규칙 명문화 (7/23 C안). 셸(헤더·푸터) 폭 --shell-max(1100px, NAV_CSS)와 별개 = 본문 폭.
     읽기용(faq·about·개별 블로그 글) = 좁게(가독성: 표·코드블록 포함 한 줄 최적) / 랜딩·목록·그리드(홈·blog 목록) = 넓게.
     같음은 측정 아닌 구조로: 각 페이지가 px 눈대중 대신 var()로 선택 (feedback_structure-over-measurement) */
  --max-read: 760px;
  --max-wide: 1100px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #e0e4e2;
    --bg2: #f4f6f5;
    --bg3: #e8edeb;
    --text: #0f1f1a;
    --text2: #44584f;
    --text3: #7d8d87;
    --border: #c9d3ce;
    --border2: #bccec6;
    --accent-a15: rgba(16,185,129,0.10);
  }
}

/* ── 언어별 폰트 패밀리 (전 언어 셀렉터, fontStackFor 동기화) ── */
html[lang="en"],
html[lang="ko"],
html[lang="vi"],
html[lang="it"],
html[lang="pl"],
html[lang="es"],
html[lang="pt"],
html[lang="fr"],
html[lang="de"],
html[lang="id"],
html[lang="tr"],
html[lang="uz"],
html[lang="ms"],
html[lang="ro"],
html[lang="cs"],
html[lang="hu"],
html[lang="fil"],
html[lang="sv"],
html[lang="nl"],
html[lang="da"],
html[lang="no"],
html[lang="fi"] {
  font-family: 'Pretendard Variable', Pretendard, system-ui, sans-serif;
}

html[lang="ja"] {
  font-family: 'Pretendard Variable', Pretendard, 'Noto Sans JP', system-ui, sans-serif;
}

html[lang="zh-TW"] {
  font-family: 'Noto Sans TC', system-ui, sans-serif;
}

html[lang="th"] {
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
}

html[lang="zh"] {
  font-family: 'Noto Sans SC', system-ui, sans-serif;
}

html[lang="ru"],
html[lang="uk"],
html[lang="el"],
html[lang="bg"],
html[lang="sr"] {
  font-family: 'Noto Sans', system-ui, sans-serif;
}

html[lang="ar"],
html[lang="ur"] {
  font-family: 'Noto Sans Arabic', 'Noto Naskh Arabic', system-ui, sans-serif;
}

html[lang="hi"],
html[lang="mr"] {
  font-family: 'Noto Sans Devanagari', system-ui, sans-serif;
}

html[lang="fa"] {
  font-family: 'Vazirmatn', system-ui, sans-serif;
}

html[lang="he"] {
  font-family: 'Noto Sans Hebrew', system-ui, sans-serif;
}

html[lang="bn"] {
  font-family: 'Noto Sans Bengali', system-ui, sans-serif;
}

html[lang="ta"] {
  font-family: 'Noto Sans Tamil', system-ui, sans-serif;
}

html[lang="te"] {
  font-family: 'Noto Sans Telugu', system-ui, sans-serif;
}

/* ── 기본 타이포 (html/body) ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-size: 16px; }
body { line-height: 1.5; }
a { text-decoration: none; color: inherit; }

/* ── word-break keep-all (CJK 언어) ── */
:lang(ko),
:lang(ja),
:lang(zh),
:lang(zh-TW) { word-break: keep-all; }

/* ── 워드마크 ── */
.wordmark { font-weight: 700; letter-spacing: 0; color: var(--accent); }

/* ── LED 도트 신호 장치 ── */
.led {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
  flex-shrink: 0;
}
.led.off { background: var(--text3); box-shadow: none; }
@keyframes ledBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }


/* ── 셸 구조 변수 (헤더·푸터 폭, 콘텐츠 페이지 nav 배경) ── */
:root {
  --shell-max: 1100px;
  --nav-bg: var(--bg);
  --nav-border: var(--border);
}
@media (prefers-color-scheme: light) {
  :root {
    --nav-bg: var(--bg2, #ffffff);
    --nav-border: var(--border, #d8e6e0);
  }
}


  /* === site-header (landing-header.cjs — 홈 정본 동기화) === */
  /* 색·라운딩 토큰은 SHELL_TOKENS_CSS가 전담(상시 주입) — 여기선 셸 구조 변수만 (7/11 중앙화, 구 자기참조 폴백 제거) */
  :root {
    /* 셸(헤더·푸터) 폭은 페이지 본문 폭(--max)과 분리 — faq(760)·about 등 좁은 문서형 페이지가 셸을 좁히던 사고 수리 7/11 */
    --shell-max: 1100px;
    /* 콘텐츠 페이지: 히어로 배경 없음 → 솔리드 배경 */
    --nav-bg: var(--bg);
    --nav-border: var(--border);
  }
  @media (prefers-color-scheme: light) {
    :root {
      --nav-bg: var(--bg2, #ffffff);
      --nav-border: var(--border, #d8e6e0);
    }
  }
  .wordmark { font-weight: 700; letter-spacing: 0; color: var(--accent); }
  .led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); flex-shrink: 0; }
  .site-header {
    position: sticky; top: 0; left: 0; right: 0; z-index: 200;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    padding: 0 28px; height: 60px;
    display: flex; align-items: center;
    margin-bottom: 40px;
  }
  .header-inner {
    max-width: var(--shell-max, 1100px); width: 100%; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
  }
  .header-logo { display: flex; align-items: center; gap: 10px; font-size: 17px; text-decoration: none; color: inherit; }
  .header-nav { display: flex; align-items: center; gap: 28px; }
  .header-nav a { font-size: 13px; font-weight: 500; color: var(--text2); transition: color 0.2s; text-decoration: none; }
  .header-nav a:hover { color: var(--text); }
  .header-nav a[aria-current="page"] { color: var(--text); font-weight: 700; }
  .header-right { display: flex; align-items: center; gap: 14px; }
  /* === 언어 선택기 (앱 renderLangSheet 동형: 검색 input + 필터 목록, 2026-08-02) === */
  .lang-switch { position: relative; }
  .lang-switch > summary.lang-summary {
    list-style: none; cursor: pointer;
    font-size: 12px; font-weight: 600; color: var(--text3);
    border: 1px solid var(--border2); padding: 6px 12px; border-radius: var(--r-sm);
    display: inline-flex; align-items: center; gap: 6px;
    transition: border-color 0.2s, color 0.2s; background: transparent;
  }
  .lang-switch > summary.lang-summary::-webkit-details-marker { display: none; }
  .lang-switch > summary.lang-summary:hover { border-color: var(--accent); color: var(--accent); }
  .lang-switch[open] > summary.lang-summary { border-color: var(--accent); color: var(--accent); }
  .lang-summary .lang-caret { font-size: 10px; opacity: 0.7; }
  /* 기본(데스크톱 + no-JS 폴백) = 트리거 아래 팝오버. overlay=위치 래퍼, menu=패널.
     ⚠️ 홈 헤더는 position:fixed + backdrop-filter라 fixed 하위요소의 containing block이 됨
     → 바텀시트를 fixed로 두면 뷰포트가 아닌 헤더에 갇힘(홈 한정 함정). 그래서 기본은 absolute
     드롭다운으로 두고, 모바일 바텀시트는 JS가 overlay를 body로 포털한 뒤(.lang-portaled)에만 fixed 적용. */
  .lang-overlay { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 300; }
  .lang-menu {
    display: flex; flex-direction: column;
    width: min(300px, calc(100vw - 20px)); max-height: 60vh; overflow: hidden;
    background: var(--bg3); border: 1px solid var(--border2); border-radius: var(--r);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  }
  .lang-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
  .lang-menu-title { font-size: 13px; font-weight: 700; color: var(--text); }
  .lang-close { background: none; border: none; color: var(--text3); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: var(--r-sm); }
  .lang-close:hover { color: var(--text); }
  .lang-search-wrap { padding: 0 14px 10px; }
  .lang-search {
    width: 100%; box-sizing: border-box;
    background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--r-sm);
    padding: 9px 11px; color: var(--text); font-size: 13px; font-family: inherit;
  }
  .lang-search::placeholder { color: var(--text3); }
  .lang-search:focus { outline: none; border-color: var(--accent); }
  .lang-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .lang-sec { padding: 10px 14px 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text3); }
  .lang-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 42px; padding: 8px 14px;
    color: var(--text2); font-size: 13.5px; text-decoration: none;
    border-bottom: 1px solid var(--border);
  }
  .lang-item:hover { background: var(--accent-a15); color: var(--accent); }
  .lang-item[aria-current="true"] { color: var(--accent); font-weight: 700; }
  .lang-item .name { flex: 1; text-align: start; line-height: 1.3; }
  .lang-item .en { color: var(--text3); font-weight: 400; font-size: 12px; margin-inline-start: 6px; }
  .lang-item[aria-current="true"] .en { color: var(--accent); opacity: 0.75; }
  .lang-check { color: var(--accent); font-weight: 800; font-size: 14px; margin-inline-start: 8px; flex-shrink: 0; }
  .lang-empty { display: none; padding: 20px 14px; text-align: center; color: var(--text3); font-size: 13px; }
  /* 모바일 바텀시트 = JS가 overlay를 body로 포털하고 .lang-portaled를 붙였을 때만 적용(홈 헤더 containing-block 함정 탈출).
     backdrop + 하단 고정 패널(앱 시트풍). 미디어쿼리 아님 — 포털 여부(=모바일 판정한 JS)가 스위치. */
  .lang-overlay.lang-portaled {
    position: fixed; inset: 0; z-index: 4000;
    display: flex; flex-direction: column; justify-content: flex-end;
    background: rgba(0,0,0,0.5);
  }
  .lang-portaled .lang-menu {
    width: 100%; max-width: 100%; max-height: 80vh;
    border-radius: 18px 18px 0 0;
    border-left: none; border-right: none; border-bottom: none;
  }
  .lang-portaled .lang-menu-head { padding: 16px 16px 10px; }
  .lang-portaled .lang-menu-title { font-size: 15px; }
  .lang-portaled .lang-search-wrap { padding: 0 16px 10px; }
  .header-cta {
    font-size: 13px; font-weight: 700;
    background: var(--accent); color: #fff;
    padding: 8px 18px; border-radius: var(--r-sm);
    transition: background 0.2s; text-decoration: none;
  }
  .header-cta:hover { background: var(--accent-dark); }
  /* 모바일 드로어 안에서만 쓰는 CTA 사본 (nav-cta-mobile) — 데스크탑에선 숨김 */
  .header-nav .nav-cta-mobile { display: none; }
  /* 햄버거 토글 — 체크박스 해킹(JS 불요), 접근성 트리에서 숨김 처리는 opacity+크기0으로 */
  .nav-toggle { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
  .nav-hamburger {
    display: none; align-items: center; gap: 6px; cursor: pointer;
    border: 1px solid var(--border2); border-radius: var(--r-sm);
    padding: 6px 10px 6px 8px; color: var(--text); user-select: none;
    transition: border-color 0.2s;
  }
  .nav-hamburger .bars { display: flex; flex-direction: column; gap: 3px; width: 15px; height: 12px; justify-content: center; flex-shrink: 0; }
  .nav-hamburger .bars span { display: block; height: 2px; border-radius: 2px; background: var(--text); transition: transform 0.2s, opacity 0.2s; }
  .nav-hamburger .nav-hamburger-text { font-size: 12px; font-weight: 600; white-space: nowrap; }
  .nav-toggle:checked ~ .header-inner .nav-hamburger { border-color: var(--accent); }
  .nav-toggle:focus-visible ~ .header-inner .nav-hamburger { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-toggle:checked ~ .header-inner .nav-hamburger .bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .nav-toggle:checked ~ .header-inner .nav-hamburger .bars span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .header-inner .nav-hamburger .bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
  @media (max-width: 900px) {
    /* 모바일 = 로고 + 언어선택 + 햄버거만 상시노출, 메뉴·CTA는 드로어 안으로 (7/22 수리 — 구: header-nav 전체 display:none) */
    .nav-hamburger { display: flex; }
    .header-right .nav-cta-desktop { display: none; }
    .header-nav {
      position: fixed; top: 60px; left: 0; right: 0; z-index: 199;
      display: flex; flex-direction: column; align-items: stretch; gap: 0;
      background: var(--nav-bg); border-bottom: 1px solid var(--nav-border);
      max-height: 0; overflow: hidden; opacity: 0; visibility: hidden;
      padding: 0 20px; transition: max-height 0.25s ease, opacity 0.2s ease, visibility 0.25s;
    }
    .header-nav a { padding: 14px 2px; font-size: 14px; border-bottom: 1px solid var(--border); }
    .header-nav .nav-cta-mobile {
      display: block; text-align: center; margin: 14px 0 16px; border-bottom: none;
    }
    .nav-toggle:checked ~ .header-inner .header-nav {
      max-height: 70vh; opacity: 1; visibility: visible; padding-top: 8px;
    }
  }
  @media (max-width: 680px) {
    .site-header { padding: 0 16px; }
    .header-nav { gap: 16px; }
  }
  [dir="rtl"] .nav-toggle:checked ~ .header-inner .nav-hamburger .bars span:nth-child(1) { transform: translateY(5px) rotate(-45deg); }
  [dir="rtl"] .nav-toggle:checked ~ .header-inner .nav-hamburger .bars span:nth-child(3) { transform: translateY(-5px) rotate(45deg); }


  /* === 4-column sitemap footer (landing-header.cjs) === */
  /* display·width 명시 = 페이지별 일반 선택자(footer{display:flex} 류) 간섭 차단 — 7/11 blog 폭 쪼그라듦 실사고 */
  .site-footer { display: block; width: 100%; border-top: 1px solid var(--border); background: var(--bg); padding: 56px 28px 40px; }
  .footer-inner { display: block; max-width: var(--shell-max, 1100px); margin: 0 auto; }
  .footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
  .footer-brand { display: flex; flex-direction: column; gap: 12px; }
  .footer-logo { font-size: 18px; display: flex; align-items: center; gap: 9px; }
  .footer-tagline { font-size: 13px; color: var(--text2); line-height: 1.55; max-width: 220px; }
  .footer-col-title { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text); margin-bottom: 16px; }
  .footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
  .footer-col a { font-size: 13px; color: var(--text2); transition: color 0.2s; }
  .footer-col a:hover { color: var(--accent); }
  .footer-bottom { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--border); padding-top: 28px; }
  .footer-legal { font-size: 12px; color: var(--text3); line-height: 1.6; }
  .footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
  .footer-links a { font-size: 12px; color: var(--text3); transition: color 0.2s; }
  .footer-links a:hover { color: var(--accent); }
  @media (max-width: 900px) {
    .footer-top { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    /* .header-nav 모바일 처리는 NAV_CSS(햄버거+드로어, 7/22)로 이관 — 여기서 display:none 재정의 금지 */
  }
  @media (max-width: 600px) {
    .footer-top { grid-template-columns: 1fr; }
  }


/* ── RTL 레이아웃 보정 ── */
/* 7/22 수리: flex-direction:row는 dir=rtl에서 이미 자동으로 main-start/end가 반전됨(CSS 스펙).
   여기 추가로 row-reverse를 걸면 이중반전으로 상쇄돼 언어선택·햄버거 순서가 도로 LTR 상대순서로
   돌아가버림(대표 실측 발견 — RTL에서 로고→메뉴→언어 순으로 읽혀 LTR "로고→언어→메뉴"와 불일치).
   row-reverse 제거 → 자동반전만으로 진짜 거울대칭(읽는 순서 유지, 좌우만 반전). */
[dir="rtl"] .lang-menu { inset-inline-end: 0; }
[dir="rtl"] .footer-top { direction: rtl; }
[dir="rtl"] .footer-bottom { direction: rtl; }
