/* assets/core.css — 상단 머리말 공통 규격 (2026-11-20)
 *
 * 모든 자료의 머리말을 같은 규격으로 세운다.
 *   1) 홈 단추 · [개념 아이콘 + 자료 제목] · 도구 단추를 한 수직 중심선에 앉힌다.
 *   2) 제목의 개념 아이콘은 24칸 도안 · 화면 20px · 획 2(화면 1.5px) · currentColor + 테마색 한 획.
 *   3) 제목과 홈 단추 사이 간격은 한 값(10px)으로 모은다.
 *
 * 각 페이지 <style>·brand.css 뒤에 붙는다(같은 선택자면 이 파일이 이긴다).
 * 제목 안의 글자는 .jc-tt 한 덩어리로 묶는다 — 띄어쓰기·줄임표가 원래대로 남는다.
 */

:root { --jc-hic: 20px; --jc-hd-gap: 10px }

/* ---------- 1) 머리말 줄: 모두 수직 중앙 ---------- */
body[data-jc-tool] :is(.hd, .hdr, .top) { align-items: center }
body[data-jc-tool] :is(.hd, .hdr) { gap: var(--jc-hd-gap) }
body[data-jc-tool] :is(.hud, header) :is(.wrap, .jc-room) { align-items: center }
body[data-jc-tool] .bar { gap: var(--jc-hd-gap) }

/* ---------- 2) 제목: [아이콘][글자] 두 칸, 수직 중앙 ---------- */
body[data-jc-tool] :is(header:not(.hero), .top, .top-in, .hd, .hdr, .bar) :is(.brand, h1, .jc-title, .kick) {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
/* 제목 안에 링크 하나만 두는 자료(말머리 <h1><a>)도 같은 두 칸 */
body[data-jc-tool] :is(header:not(.hero), .top, .top-in, .hd, .hdr, .bar) :is(.brand, h1) > a:only-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
/* 글자 덩어리: 원래 띄어쓰기·색을 지키고, 넘치면 줄임표 */
body[data-jc-tool] :is(.brand, h1, .jc-title, .kick) > .jc-tt,
body[data-jc-tool] :is(.brand, h1) > a:only-child > .jc-tt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

/* 폰에서 접는 이름 앞머리 — 접히지 않는 폭에서는 본문 색 그대로 */
body[data-jc-tool] :is(.brand, .jc-title, h1, .kick) .ph-drop { color: inherit }

/* ---------- 3) 개념 아이콘: 한 크기·한 획·한 색 ---------- */
body[data-jc-tool] .jc-hic {
  flex: none;
  width: var(--jc-hic);
  height: var(--jc-hic);
  overflow: visible;
}

/* ---------- 4) 좁은 화면(≤430): 제목이 도구 단추에 눌리지 않게 한 값만 줄인다 ---------- */
@media (max-width: 430px) {
  body[data-jc-tool] :is(header:not(.hero), .top, .top-in, .hd, .hdr, .bar) :is(.brand, h1, .jc-title, .kick) {
    font-size: 15px !important;
    letter-spacing: -.02em;
  }
  body[data-jc-tool] :is(.hd, .hdr) { gap: 6px }
  /* 영어 제호는 폭이 넓다 */
  body[data-jc-tool="thermometer"] .hd .kick[class] { font-size: 13px !important }
  /* 이름이 긴 자료는 폰에서 앞머리(어느 기관·분야인지)를 접고 자료 이름만 남긴다 */
  body[data-jc-tool] :is(.brand, .jc-title, h1, .kick) .ph-drop { display: none }
}
