/* 메뉴 시스템 — 대메뉴 드롭다운 + 브레드크럼 + 하위메뉴 내비
   main.css 이후에 로드된다. 기존 선택자는 재정의하지 않고 추가만 한다. */

/* ---------- 헤더 대메뉴 ---------- */
.primary-nav .nav-item { position: relative; }
.primary-nav .nav-item > a {
  display: inline-flex; align-items: center;
  height: var(--header-h); color: var(--c-fg);
  font-weight: 500; font-size: 15px;
}
.primary-nav .nav-item.is-current > a { color: var(--c-primary); font-weight: 600; }
.primary-nav .nav-item.has-sub > a::after {
  content: ""; width: 5px; height: 5px; margin-left: 7px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: .5;
}

.nav-sub {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(6px);
  min-width: 190px; background: var(--c-card);
  border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 8px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 120;
}
.nav-item.has-sub:hover .nav-sub,
.nav-item.has-sub:focus-within .nav-sub {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-sub ul { list-style: none; margin: 0; padding: 0; }
.nav-sub a {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--c-fg); white-space: nowrap;
}
.nav-sub a:hover { background: var(--c-tag); color: var(--c-primary); text-decoration: none; }

/* ---------- 페이지 상단(브레드크럼 + 하위메뉴) ---------- */
.page-head { border-bottom: 1px solid var(--c-line); background: var(--c-line-2); }
.page-head-inner { padding-top: 20px; padding-bottom: 0; }
.page-title { font-size: 28px; line-height: 1.25; margin: 0 0 14px; }

/* ---------- 모바일 ---------- */
@media (max-width: 768px) {
  .primary-nav .nav-item { display: block; }
  .primary-nav .nav-item > a { height: auto; display: block; }
  .primary-nav .nav-item.has-sub > a::after { display: none; }

  /* 드롭다운을 인라인 목록으로 펼친다 */
  .nav-sub {
    position: static; transform: none; opacity: 1; visibility: visible; transition: none;
    pointer-events: auto; min-width: 0; border: 0; border-radius: 0;
    box-shadow: none; background: var(--c-line-2); padding: 2px 0 6px;
  }
  .nav-sub a { padding: 10px 20px 10px 34px; font-size: 14px; border-bottom: 0; }

  .page-head-inner { padding-top: 14px; }
  .page-title { font-size: 21px; }
}

/* ---------- 모바일 아코디언 (햄버거 메뉴) ---------- */
.nav-sub-toggle { display: none; }

@media (max-width: 768px) {
  .primary-nav .nav-item { position: relative; }

  /* 대메뉴 행: 라벨 + 우측 +/− 버튼 */
  .primary-nav .nav-item > a { padding-right: 60px; }

  .nav-sub-toggle {
    display: block; position: absolute; top: 0; right: 0;
    width: 56px; height: 48px; padding: 0; margin: 0;
    background: transparent; border: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  /* +/− 아이콘 (가로선 + 세로선, 열리면 세로선만 숨김) */
  .nav-sub-toggle::before,
  .nav-sub-toggle::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 14px; height: 2px; margin: -1px 0 0 -7px;
    background: var(--c-fg); border-radius: 1px;
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav-sub-toggle::after { transform: rotate(90deg); }
  .nav-item.is-open > .nav-sub-toggle::after { transform: rotate(0deg); opacity: 0; }

  /* 하위메뉴: 기본 접힘 → 열릴 때만 펼침 */
  .nav-sub {
    position: static; transform: none; opacity: 1; visibility: visible;
    pointer-events: auto; min-width: 0; border: 0; border-radius: 0;
    box-shadow: none; padding: 0;
  }
  /* JS 가 실행된 경우에만 접는다. 실패 시 펼쳐진 채로 남아 접근 가능. */
  .has-accordion .nav-sub { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
  .has-accordion .nav-item.is-open > .nav-sub { max-height: 480px; }
  .nav-sub-toggle { display: none; }
  .has-accordion .nav-sub-toggle { display: block; }
  .nav-sub ul { padding: 2px 0 6px; }
}

/* ── 위치 표시줄 (홈 + 대메뉴/하위메뉴 드롭다운 + 브레드크럼) ──
   배너 하단에 가로 전체 폭으로 깔린다. 셀 사이는 세로 구분선으로 나눈다. */
.page-head { display: flex; flex-direction: column; justify-content: flex-end; }
.page-head-inner { flex: 1 1 auto; }

.locbar {
  margin-top: 26px;
  background: rgba(9, 15, 28, .78);
  border-top: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
          backdrop-filter: saturate(140%) blur(6px);
}
.loc-inner { display: flex; align-items: stretch; min-height: 56px; padding-top: 0; padding-bottom: 0; }

.loc-home {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 62px;
  color: rgba(255,255,255,.9);
  border-left: 1px solid rgba(255,255,255,.13);
  border-right: 1px solid rgba(255,255,255,.13);
  text-shadow: none;
}
.loc-home:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }

/* ── 드롭다운 칸 ── */
.loc-cell { position: relative; flex: 0 0 auto; border-right: 1px solid rgba(255,255,255,.13); }
.loc-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
  width: 100%; min-width: 190px; height: 100%;
  padding: 0 18px;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: #fff;
  letter-spacing: -.01em; text-align: left;
}
.loc-btn:hover { background: rgba(255,255,255,.09); }
.loc-caret { flex: 0 0 auto; opacity: .8; transition: transform .18s ease; }
.loc-cell.is-open .loc-btn { background: rgba(255,255,255,.11); }
.loc-cell.is-open .loc-caret { transform: rotate(180deg); }

.loc-list {
  position: absolute; left: -1px; right: -1px; top: 100%; z-index: 40;
  list-style: none; margin: 0; padding: 8px 0;
  background: #fff;
  border: 1px solid var(--c-line);
  border-top: 0;
  box-shadow: 0 16px 34px rgba(9,15,28,.22);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.loc-cell.is-open .loc-list,
.loc-cell:hover .loc-list,
.loc-cell:focus-within .loc-list { opacity: 1; visibility: visible; transform: none; }
.loc-list a {
  display: block; padding: 11px 18px;
  font-size: 14.5px; color: var(--c-fg); text-shadow: none;
  white-space: nowrap;
}
.loc-list a:hover { background: var(--c-line-2); color: var(--c-primary); text-decoration: none; }
.loc-list a.is-current { color: var(--c-primary); font-weight: 700; }

/* ── 브레드크럼 (배너 타이틀 아래) ──
   위치 표시줄에도 같은 경로가 나와 중복이라 이쪽 한 곳으로 모았다. */
.page-crumbs {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 8px;
  margin: 16px 0 0; font-size: 14px; letter-spacing: .01em;
  color: rgba(255,255,255,.78);
}
.page-crumbs i { font-style: normal; opacity: .5; }
.page-crumbs a { color: rgba(255,255,255,.78); }
.page-crumbs a:hover { color: #fff; }
.page-crumbs strong { color: #fff; font-weight: 600; }

@media (max-width: 900px) {
  .loc-btn { min-width: 0; gap: 14px; }
}
@media (max-width: 768px) {
  .locbar { margin-top: 18px; }
  /* 좁은 화면에선 좌우 여백 없이 화면 끝까지 채운다 (.container 의 16px 패딩을 이긴다) */
  .locbar .loc-inner { padding-left: 0; padding-right: 0; max-width: none; }
  .loc-home { border-left: 0; }
  .loc-cell:last-of-type { border-right: 0; }
  .loc-inner { min-height: 48px; }
  .loc-home { width: 48px; }
  .loc-home svg { width: 17px; height: 17px; }
  .loc-cell { flex: 1 1 0; min-width: 0; }
  .loc-btn { padding: 0 12px; font-size: 13.5px; }
  .loc-btn-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .loc-list a { padding: 13px 14px; font-size: 14px; white-space: normal; }
  /* 터치에서는 hover 가 눌린 채로 남는다 → 클릭 토글만 쓴다 */
  .loc-cell:hover .loc-list { opacity: 0; visibility: hidden; transform: translateY(-6px); }
  .loc-cell.is-open .loc-list { opacity: 1; visibility: visible; transform: none; }
}

@media (max-width: 768px) {
  .page-crumbs { margin-top: 12px; font-size: 12.5px; gap: 6px; }
}
