@charset "utf-8";
/* ==========================================================================
   rb.BoardFactory — 헤더 부품 (모든 헤더 세트가 나눠 쓴다)
   목업(mockup/css/style.css 2. 헤더)을 bf- 접두어로 옮긴 것.

   부품 마크업은 rb.theme/header.lib.php, 싣는 것은 bf_hd_assets()(order 6).
   여기 기본 배치가 곧 헤더 세트 'basic'(기본형 3단)의 모양이다. 다른 세트는
   자기 폴더 style.css 에서 배치만 바꾼다 — rb.layout_hd/{row · compact · center}.
   (예전에는 rb.layout_hd/basic/style.css 였다. 세트가 늘어 부품으로 뺐다.)

   접두어를 붙이는 이유 — 그누보드 default.css 와 리빌더 공통 CSS 가
   .logo · .inner · .search-box 같은 일반명을 이미 쓰고 있어 그대로 두면 충돌한다.

   1. 헤더 골격
   2. 유틸 바
   3. 로고
   4. 통합검색 (인기검색어 롤링 · TOP10 패널)
   5. 헤더 유틸 아이콘
   6. GNB
   7. 모바일 (드로어 · 검색 레이어)
   8. 반응형
   9. 세트 공용 — 아이콘 단추 · 글쓰기 · 검색 펼침 (row · compact · center)
   ========================================================================== */

/* ==================================================== 1. 헤더 골격 */
.bf-header {
  position: relative; z-index: 500;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

/* 리빌더 '헤더컬러 설정' — header.php 가 --hd-bg 와 클래스를 넣는다.
   헤더 안의 색 변수만 덮으므로 아래 규칙들은 그대로 둔다. 사이트 다크 모드에서는
   걸지 않는다 — 다크 헤더가 그대로 이긴다.
   .is-hd-dark 는 리빌더가 명도로 판정한 '어두운 배경'이다. 글자 · 선 · 호버 바탕을
   흰색 계열로 바꾸고 흰 로고를 쓴다. 헤더 안 드롭다운(인기검색어 · 하위 메뉴)도
   같은 바탕을 쓰므로 함께 어두워진다. */
:root:not([data-theme="dark"]) #bf_header.is-hd-custom {
  --surface: var(--hd-bg);
}
:root:not([data-theme="dark"]) #bf_header.is-hd-dark {
  --ink-900: #fff;
  --ink-800: #fff;
  --ink-700: rgba(255,255,255,.92);
  --ink-600: rgba(255,255,255,.82);
  --ink-500: rgba(255,255,255,.72);
  --ink-400: rgba(255,255,255,.56);
  --ink-200: rgba(255,255,255,.22);
  --line: rgba(255,255,255,.14);
  --line-soft: rgba(255,255,255,.08);
  --sky-50: rgba(255,255,255,.10);
  --sky-t1: #fff;
  --sky-t2: #fff;
  --sky-b2: rgba(255,255,255,.35);
  --sky-b3: rgba(255,255,255,.5);
}
:root:not([data-theme="dark"]) #bf_header.is-hd-dark .bf-logo .bf-logo-light { display: none; }
:root:not([data-theme="dark"]) #bf_header.is-hd-dark .bf-logo .bf-logo-dark  { display: block; }

.bf-ico {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

.bf-badge {
  display: inline-flex; align-items: center;
  height: 19px; padding: 0 7px;
  border-radius: var(--r-xs);
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
}
.bf-badge-line {
  background: var(--surface);
  border: 1px solid var(--sky-b2);
  color: var(--sky-t2);
}
/* 유틸 바 '회원가입' 강조 — 심볼 하늘색(작은 글자라 한 단 진한 --sky-t2, 다크에서는 밝은 하늘) */
.bf-c-point { color: var(--sky-t2) !important; font-weight: 700; }

/* ==================================================== 2. 유틸 바 */
.bf-header-top {
  background: linear-gradient(90deg, var(--sky-50), var(--surface) 55%, var(--sky-50));
  border-bottom: 1px solid var(--line-soft);
}
.bf-header-top .bf-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 38px;
}

.bf-top-notice { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; }
.bf-top-notice a {
  font-size: 13px; color: var(--ink-600);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bf-top-notice a:hover { color: var(--sky-t2); text-decoration: underline; }

.bf-top-util {
  display: flex; align-items: center; gap: 0; flex: none;
  margin: 0; padding: 0; list-style: none;
}
.bf-top-util li { position: relative; }
.bf-top-util li + li::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 1px; height: 10px; margin-top: -5px;
  background: var(--ink-200);
}
.bf-top-util a {
  display: block; padding: 0 12px;
  font-size: 13px; color: var(--ink-500);
}
.bf-top-util a:hover { color: var(--sky-t2); }
.bf-top-util li:last-child a { padding-right: 0; }

/* 다크 모드 토글 */
.bf-theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 0 0 12px;
  border-radius: var(--r-full);
  color: var(--ink-500);
  font-size: 13px; font-weight: 500; line-height: 1;
  transition: background .2s, color .2s;
}
.bf-theme-toggle:hover { color: var(--sky-t2); }
.bf-theme-toggle .bf-ico { width: 15px; height: 15px; stroke-width: 1.9; }

/* 지금 모드의 '반대'를 보여준다 — 누르면 무엇이 되는지 */
.bf-theme-toggle .bf-ico-sun,
.bf-theme-toggle .bf-tx-light { display: none; }
:root[data-theme="dark"] .bf-theme-toggle .bf-ico-moon,
:root[data-theme="dark"] .bf-theme-toggle .bf-tx-dark { display: none; }
:root[data-theme="dark"] .bf-theme-toggle .bf-ico-sun { display: block; }
:root[data-theme="dark"] .bf-theme-toggle .bf-tx-light { display: inline; }

/* 라이트 ↔ 다크 전환 (bf.common.js initTheme)
   화면 전체를 한 장처럼 교차 페이드한다 — View Transitions 는 찍어 둔 두 장면을 합성 단계에서
   섞으므로 요소 수와 상관없이 가볍고, 그림자 · 그라데이션 · 그림까지 한꺼번에 바뀐다.
   전환하는 동안 요소별 transition 은 끈다. 켜 두면 새 장면이 전환 중간 색으로 찍히고,
   지원하지 않는 브라우저에서는 수천 개가 따로 움직여 끊겼다. */
.bf-theme-switching,
.bf-theme-switching *,
.bf-theme-switching *::before,
.bf-theme-switching *::after { transition: none !important; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .3s; animation-timing-function: ease; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ==================================================== 3. 로고 */
.bf-header-main .bf-inner {
  display: flex; align-items: center; gap: 28px;
  height: 84px;
}

/* 로고는 관리자(리빌더 환경설정)에 올린 이미지다.
   운영자가 어떤 비율의 그림을 올릴지 모르므로 높이만 고정하고 폭은 그림에
   맡긴다. <img> 에 width/height 속성이 박혀 있어 자리는 미리 잡힌다.
   밝은 바탕용 한 장, 어두운 바탕용(_w) 한 장을 함께 내보내고 여기서 한 장만
   보여 준다 — 우리 다크 모드는 prefers-color-scheme 이 아니라 data-theme 로
   바뀌므로 <picture media> 로는 따라갈 수 없다. */
.bf-logo { flex: none; margin: 0; }
.bf-logo a { display: flex; align-items: center; }
.bf-logo img { display: block; height: 44px; width: auto; }
.bf-logo .bf-logo-dark,
.bf-logo-sm .bf-logo-dark { display: none; }
:root[data-theme="dark"] .bf-logo .bf-logo-light,
:root[data-theme="dark"] .bf-logo-sm .bf-logo-light { display: none; }
:root[data-theme="dark"] .bf-logo .bf-logo-dark,
:root[data-theme="dark"] .bf-logo-sm .bf-logo-dark { display: block; }

/* 모바일 전체메뉴 머리의 작은 로고 */
.bf-logo-sm { display: block; flex: 1 1 auto; min-width: 0; }
.bf-logo-sm img { display: block; height: 34px; width: auto; }

/* ==================================================== 4. 통합검색 */
.bf-header-search { flex: 1 1 auto; min-width: 0; max-width: 700px; }
.bf-search-form { position: relative; }

.bf-search-box {
  display: flex; align-items: center;
  height: 52px; padding: 0 6px 0 0;
  background: var(--sky-50);
  border: 2px solid var(--sky-b1);
  border-radius: var(--r-full);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.bf-search-box:focus-within {
  background: var(--surface);
  border-color: var(--sky-b3);
  box-shadow: 0 6px 20px rgba(62,159,222,.16);
}
/* 다크 — 입력창은 바닥보다 한 단계 들어가 보이게(목업 theme.css 4절 .search-box) */
:root[data-theme="dark"] .bf-search-box { background: #101922; }

/* 인기검색어 롤링 */
.bf-rank-roll { flex: none; }
.bf-rank-roll-btn {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 12px 0 16px;
  border-right: 1px solid var(--sky-b1);
}
.bf-rank-roll-label {
  display: inline-flex; align-items: center;
  height: 21px; padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--sky-500); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
}
.bf-rank-roll-view {
  position: relative; display: block;
  width: 168px; height: 24px;
  overflow: hidden;
}
.bf-rank-roll-list { position: relative; top: 0; margin: 0; padding: 0; list-style: none; }
.bf-rank-roll-list li {
  display: flex; align-items: center; gap: 7px;
  height: 24px;
  font-size: 14px; color: var(--ink-700);
  white-space: nowrap;
}
.bf-rank-roll-list li em {
  font-size: 13px; font-weight: 700; color: var(--sky-t1); font-style: normal;
}
.bf-rank-roll-list li span { overflow: hidden; text-overflow: ellipsis; }
.bf-rank-roll .bf-ico-arw { width: 16px; height: 16px; color: var(--ink-400); transition: transform .25s; }
.bf-rank-roll.is-open .bf-ico-arw { transform: rotate(180deg); }

.bf-search-input {
  flex: 1 1 auto; min-width: 0;
  height: 48px; padding: 0 12px 0 18px;
  border: 0; background: none; outline: none;
  font: inherit; font-size: 15px; color: var(--ink-900);
}
.bf-search-input::placeholder { color: var(--ink-400); }

.bf-search-submit {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--sky-400), var(--sky-600));
  color: #fff;
  box-shadow: 0 4px 12px rgba(62,159,222,.34);
  transition: transform .18s;
}
.bf-search-submit:hover { transform: scale(1.06); }
.bf-search-submit .bf-ico { width: 21px; height: 21px; stroke-width: 2.2; }

/* TOP10 패널 */
.bf-rank-panel {
  position: absolute; left: 0; top: calc(100% + 10px); z-index: 60;
  width: 460px; padding: 18px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--sky-b1);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
}
.bf-rank-panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.bf-rank-panel-head strong { font-size: 14.5px; color: var(--ink-900); }
.bf-rank-time { font-size: 11.5px; color: var(--ink-400); }
.bf-rank-panel-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 20px; }
.bf-rank-list { margin: 0; padding: 0; list-style: none; }
.bf-rank-list li { display: flex; align-items: center; gap: 10px; height: 31px; }
.bf-rank-list li em {
  width: 15px; flex: none; font-style: normal;
  font-size: 13px; font-weight: 700; color: var(--sky-t1); text-align: center;
}
.bf-rank-list li a {
  flex: 1 1 auto; min-width: 0;
  font-size: 13.5px; color: var(--ink-700);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bf-rank-list li a:hover { color: var(--sky-t2); text-decoration: underline; }

/* ==================================================== 5. 헤더 유틸 */
.bf-header-util {
  display: flex; align-items: center; gap: 4px; flex: none;
  margin: 0; padding: 0; list-style: none;
}
.bf-header-util a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 58px; height: 58px;
  border-radius: var(--r-md);
  color: var(--ink-600);
  transition: background .2s, color .2s;
}
.bf-header-util a:hover { background: var(--sky-50); color: var(--sky-t2); }
.bf-header-util .bf-ico { width: 22px; height: 22px; }
.bf-util-txt { font-size: 11px; }
.bf-util-cnt {
  position: absolute; top: 6px; right: 10px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--point); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ==================================================== 6. GNB */
.bf-gnb { border-top: 1px solid var(--line-soft); }
.bf-gnb .bf-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.bf-gnb-list {
  display: flex; align-items: center; gap: 4px;
  margin: 0; padding: 0; list-style: none;
}
.bf-gnb-item { position: relative; }
.bf-gnb-link {
  position: relative;
  display: flex; align-items: center;
  height: 54px; padding: 0 24px;
  font-size: 17px; font-weight: 600; color: var(--ink-800);
  white-space: nowrap;
  transition: color .2s;
}
.bf-gnb-link::after {
  content: ''; position: absolute; left: 24px; right: 24px; bottom: 0;
  height: 3px; border-radius: 3px 3px 0 0;
  background: var(--sky-500);
  transform: scaleX(0); transform-origin: center;
  transition: transform .22s;
}
.bf-gnb-item:hover > .bf-gnb-link,
.bf-gnb-item.on > .bf-gnb-link { color: var(--sky-t2); }
.bf-gnb-item:hover > .bf-gnb-link::after,
.bf-gnb-item.on > .bf-gnb-link::after { transform: scaleX(1); }

.bf-gnb-sub {
  position: absolute; left: 0; top: 100%; z-index: 10;
  display: none;
  min-width: 190px; padding: 10px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--r-md) var(--r-md);
  box-shadow: var(--sh-md);
}
.bf-gnb-item:hover > .bf-gnb-sub,
.bf-gnb-item:focus-within > .bf-gnb-sub { display: block; }
.bf-gnb-sub ul { margin: 0; padding: 0; list-style: none; }
.bf-gnb-sub a {
  display: block; padding: 9px 20px;
  font-size: 14.5px; color: var(--ink-600);
  white-space: nowrap;
}
.bf-gnb-sub a:hover { background: var(--sky-50); color: var(--sky-t2); }

.bf-gnb-right { display: flex; align-items: center; gap: 8px; flex: none; }
/* 오늘의 인기글 — 사이트 주색(하늘)에 맞추고 불꽃 아이콘만 포인트 색으로 '인기'를 알린다.
   예전 연분홍 + 산호색 글자는 헤더에서 이 단추만 붉게 튀었다. 다크는 토큰이 알아서 바뀐다 */
.bf-gnb-hot {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 14px;
  border-radius: var(--r-full);
  background: var(--sky-100); color: var(--sky-t3);
  font-size: 13.5px; font-weight: 600;
  transition: background .18s;
}
.bf-gnb-hot:hover { background: var(--sky-200); }
.bf-gnb-hot .bf-ico { width: 15px; height: 15px; fill: currentColor; stroke: none; color: var(--point); }

/* ==================================================== 7. 모바일 */
.bf-mo-btn {
  display: none;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--ink-700);
}
.bf-mo-btn:hover { background: var(--sky-50); }
.bf-mo-btn .bf-ico { width: 23px; height: 23px; stroke-width: 1.8; }

.bf-dimmed {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(10,25,40,.5);
}

/* 전체메뉴 드로어 */
.bf-mo-drawer {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 950;
  display: none;
  width: 300px; max-width: 84vw;
  background: var(--surface);
  box-shadow: 8px 0 30px rgba(10,25,40,.18);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .28s ease;
}
.bf-mo-drawer.is-ready { display: block; }
.bf-mo-drawer.on { transform: translateX(0); }

.bf-mo-drawer-head {
  display: flex; align-items: center; gap: 10px;
  height: 66px; padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.bf-mo-drawer-head .bf-logo-sm img { height: 36px; }
.bf-mo-close { width: 34px; height: 34px; color: var(--ink-500); }

.bf-mo-nav ul { margin: 0; padding: 0; list-style: none; }
.bf-mo-1d {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px; font-weight: 700; color: var(--ink-800);
  text-align: left;
}
.bf-mo-1d .bf-ico { width: 18px; height: 18px; color: var(--ink-400); transition: transform .2s; }
.bf-mo-1d[aria-expanded="true"] { color: var(--sky-t2); }
.bf-mo-1d[aria-expanded="true"] .bf-ico { transform: rotate(180deg); }

.bf-mo-2d { background: var(--sky-50); }
.bf-mo-2d a {
  display: block; padding: 12px 18px 12px 30px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px; color: var(--ink-600);
}
.bf-mo-2d a:hover { color: var(--sky-t2); }

.bf-mo-drawer-foot {
  display: flex; flex-wrap: wrap; gap: 0;
  padding: 16px 18px 30px;
  border-top: 1px solid var(--line);
}
.bf-mo-drawer-foot > a {
  position: relative; padding: 0 12px;
  font-size: 13px; color: var(--ink-500);
}
.bf-mo-drawer-foot > a:first-child { padding-left: 0; }
.bf-mo-drawer-foot > a + a::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 1px; height: 10px; margin-top: -5px;
  background: var(--ink-200);
}
/* 토글은 링크 줄 아래 한 줄을 통째로 쓴다. 부모가 nowrap 이면 끼어들어
   글자가 두 줄로 깨지므로 flex-basis 100% 와 부모 wrap 을 같이 준다. */
.bf-theme-toggle-wide {
  flex: 0 0 100%;
  justify-content: center;
  height: 46px; margin-top: 16px; padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px; white-space: nowrap;
}
.bf-theme-toggle-wide .bf-ico { width: 18px; height: 18px; }

/* 전체메뉴 회원 영역 (목업 .mo-drawer-login) — 비회원: 로그인 · 가입, 회원: 마이 · 로그아웃 · 쪽지 · 장바구니 · 새글 */
.bf-mo-member { padding: 18px; background: var(--sky-50); }
.bf-mo-member p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-600); }
.bf-mo-member p strong { color: var(--ink-900); font-weight: 700; }
.bf-mo-member-btns { display: flex; gap: 6px; margin-top: 12px; }
.bf-mo-member-btns .bf-btn { flex: 1 1 0; }
.bf-mo-member-links { display: flex; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.bf-mo-member-links li { flex: 1 1 0; }
.bf-mo-member-links a {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  height: 38px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-700);
}
.bf-mo-member-links .bf-ico { width: 16px; height: 16px; color: var(--sky-t1); }
.bf-mo-member-links em {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--point); color: #fff;
  font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; text-align: center;
}

/* 모바일 하단 탭바 (목업 .mo-tabbar) — 900px 이하에서만. 푸터 아래 여백(footer.css 90px)이 이 높이를 비워 둔다 */
.mo-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  display: none;
  height: 58px;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: var(--sh-up);
}
.mo-tabbar a {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-400);
}
.mo-tabbar a.on { color: var(--sky-t2); }
.mo-tabbar .bf-ico { width: 21px; height: 21px; }
.mo-tabbar span { font-size: 10.5px; font-weight: 500; }
:root[data-theme="dark"] .mo-tabbar { background: rgba(21,31,41,.96); }

/* 모바일 검색 레이어 */
.bf-mo-search-layer {
  position: fixed; left: 0; right: 0; top: 0; z-index: 960;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-md);
}
.bf-mo-search-layer form {
  display: flex; align-items: center; gap: 6px;
  height: 60px; padding: 0 10px;
}
.bf-mo-search-layer input[type="search"] {
  flex: 1 1 auto; min-width: 0;
  height: 42px; padding: 0 14px;
  border: 0; border-radius: var(--r-full);
  background: var(--sky-50);
  font: inherit; font-size: 15px; color: var(--ink-900);
  outline: none;
}
.bf-mo-search-layer button {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  color: var(--ink-600);
}
.bf-mo-search-layer button[type="submit"] { background: var(--sky-500); color: #fff; }

/* ==================================================== 8. 반응형 */
@media (max-width: 1280px) {
  .bf-header-main .bf-inner { gap: 20px; }
  .bf-rank-roll-view { width: 130px; }
  .bf-header-util a { width: 52px; }
}

@media (max-width: 1080px) {
  .bf-rank-roll { display: none; }
  .bf-search-input { padding-left: 20px; }
  .bf-rank-panel { display: none !important; }
  .bf-util-txt { display: none; }
  .bf-header-util a { width: 44px; height: 44px; }
}

@media (max-width: 900px) {
  .bf-header-top { display: none; }

  .bf-header-main .bf-inner { height: 58px; gap: 4px; }
  .bf-mo-btn { display: inline-flex; }
  .bf-mo-menu { margin-left: -10px; }

  .bf-logo { flex: 1 1 auto; min-width: 0; }
  .bf-logo img { height: 34px; }

  .bf-header-search { display: none; }
  .bf-header-util li:not(:last-child) { display: none; }

  .bf-gnb { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bf-gnb::-webkit-scrollbar { display: none; }
  .bf-gnb .bf-inner { padding-right: 0; }
  .bf-gnb-list { flex-wrap: nowrap; }
  .bf-gnb-link { padding: 0 13px; line-height: 46px; font-size: 15px; }
  .bf-gnb-link::after { left: 13px; right: 13px; }
  .bf-gnb-sub { display: none !important; }
  .bf-gnb-right { display: none; }
}

@media (max-width: 420px) {
  .bf-logo img { height: 30px; }
}

/* ==================================================== 9. 세트 공용
   한 줄형(row) · 스크롤 축소형(compact) · 중앙 로고형(center)이 쓴다. basic 은 쓰지 않는다. */

/* 아이콘만 있는 단추 — 검색 펼침 · 축소 막대의 검색 */
.bf-hd-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: none;
  border-radius: var(--r-md);
  color: var(--ink-600);
  transition: background .2s, color .2s, box-shadow .2s;
}
.bf-hd-icon:hover { background: var(--sky-50); color: var(--sky-t2); }
.bf-hd-icon[aria-expanded="true"] {
  background: var(--sky-50); color: var(--sky-t2);
  box-shadow: inset 0 0 0 1px var(--sky-b1);
}
.bf-hd-icon .bf-ico { width: 21px; height: 21px; }

/* 글쓰기 — 지금 게시판(쓸 수 있을 때) 또는 기본 게시판으로 (header.lib.php bf_hd_write_href) */
.bf-hd-write {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none;
  height: 38px; padding: 0 16px;
  border-radius: var(--r-full);
  background: var(--sky-500); color: #fff;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(62,159,222,.3);
  transition: background .2s;
}
.bf-hd-write:hover { background: var(--sky-600); color: #fff; }
.bf-hd-write .bf-ico { width: 15px; height: 15px; stroke-width: 2.2; }

/* 검색 펼침 — 헤더 맨 아래. 단추가 hidden 을 뗐다 붙였다 한다(bf.common.js 11).
   검색 결과 화면에서는 늘 펼쳐져 있다(data-keep). */
.bf-hd-drop {
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}
.bf-hd-drop > .bf-inner {
  display: flex; justify-content: center;
  padding-top: 20px; padding-bottom: 18px;
}
.bf-hd-drop-search { width: 100%; max-width: 720px; }
.bf-hd-drop:not([data-keep]):not([hidden]) { animation: bfHdDrop .22s ease; }
@keyframes bfHdDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bf-hd-drop:not([data-keep]):not([hidden]) { animation: none; }
}

/* 인기 낱말 줄 — 펼친 검색창 아래 */
.bf-search-keyword {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin: 10px 0 0; padding-left: 18px;
  font-size: 13px;
}
.bf-search-keyword > span { color: var(--ink-400); font-weight: 600; }
.bf-search-keyword a { color: var(--ink-500); }
.bf-search-keyword a:hover { color: var(--sky-t2); }

@media (max-width: 1080px) {
  .bf-hd-write { width: 38px; padding: 0; }
  .bf-hd-write-txt { display: none; }
  .bf-hd-write .bf-ico { width: 17px; height: 17px; }
}

/* 모바일 — 검색은 모바일 검색 레이어가 맡는다. 결과 화면의 펼침은 남긴다 */
@media (max-width: 900px) {
  .mo-tabbar { display: flex; }
  .bf-top { right: 14px; bottom: 72px; }   /* 탭바 위로 */
  .bf-hd-search-btn,
  .bf-hd-write { display: none; }
  .bf-hd-drop:not([data-keep]) { display: none !important; }
  .bf-hd-drop > .bf-inner { padding-top: 10px; padding-bottom: 12px; }
}
