/* 도감 상단 이동 바 — 헤더와 같은 컨테이너 폭에 정렬 */
.ph-archive-nav {
  position: relative;
  z-index: 30;
  border-bottom: 1px solid var(--line, #e4ded4);
  background: var(--paper, #f6f3ee);
  color: var(--ink, #16141b);
  font: 500 14px/1.4 var(--sans, system-ui, sans-serif);
  text-align: start;
}
.ph-archive-nav *, .ph-archive-nav { box-sizing: border-box; }
.ph-archive-nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: min(var(--container, 1320px), calc(100% - 2 * var(--gutter, 24px)));
  min-height: 56px;
  margin: 0 auto;
}
.ph-archive-nav__home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--muted, #67636e);
  text-decoration: none;
  transition: color 160ms ease;
}
.ph-archive-nav__home::before {
  content: '';
  width: 6px; height: 6px;
  border: solid currentColor; border-width: 0 0 1.5px 1.5px;
  transform: rotate(45deg);
}
.ph-archive-nav__home:hover { color: var(--ink, #16141b); }
.ph-archive-nav__switch { position: relative; }
.ph-archive-nav__switch summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong, #cfc6b8);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--ink, #16141b);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: border-color 160ms ease;
}
.ph-archive-nav__switch summary::-webkit-details-marker { display: none; }
.ph-archive-nav__switch summary::after {
  content: '';
  width: 6px; height: 6px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 200ms ease;
}
.ph-archive-nav__switch[open] summary::after { transform: translateY(2px) rotate(225deg); }
.ph-archive-nav__switch summary:hover { border-color: var(--ink, #16141b); }
.ph-archive-nav__list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  width: max-content;
  min-width: 320px;
  max-width: calc(100vw - 32px);
  max-height: min(70vh, 560px);
  overflow: auto;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line, #e4ded4);
  border-radius: 18px;
  background: var(--surface, #fff);
  color: var(--ink, #16141b);
  box-shadow: var(--shadow-lg, 0 20px 50px #0003);
  list-style: none;
}
.ph-archive-nav__list li { display: block; margin: 0; padding: 0; }
.ph-archive-nav__list a, .ph-archive-nav__list span {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.ph-archive-nav__list a:hover { background: var(--paper, #f6f3ee); }
.ph-archive-nav__list [aria-current] { background: var(--ink, #16141b); color: var(--paper, #f6f3ee); font-weight: 600; }
.ph-archive-nav__list [aria-disabled] { color: var(--muted, #67636e); }
.ph-archive-nav__list small { margin-inline-start: 6px; font-size: 12px; }
.ph-archive-nav :focus-visible { outline: 2px solid var(--ink, #16141b); outline-offset: 2px; }
@media (max-width: 480px) {
  .ph-archive-nav__list { min-width: 0; width: calc(100vw - 2 * var(--gutter, 16px)); }
}

/* ---------- catalog switcher: picture menu ---------- */
.ph-archive-nav__switch summary b { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--paper-2, #efe9df); color: var(--muted, #67636e); font-size: 11px; font-weight: 700; }
.ph-switch-panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: min(760px, calc(100vw - 32px)); max-height: min(76vh, 720px); overflow: auto;
  padding: 18px 18px 20px;
  border: 1px solid var(--line, #e4ded4); border-radius: 16px;
  background: var(--surface, #fff); color: var(--ink, #16141b);
  box-shadow: 0 24px 60px -18px rgb(0 0 0 / .35);
  overscroll-behavior: contain;
}
.ph-switch-top { position: sticky; top: -18px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -18px -18px 6px; padding: 14px 18px 12px; background: var(--surface, #fff); border-bottom: 1px solid var(--line, #e4ded4); }
.ph-switch-top strong { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.ph-switch-search { width: min(260px, 55%); min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong, #cfc6b8); border-radius: 8px;
  background: var(--paper, #f6f3ee); color: inherit; font: inherit; font-size: 14px; }
.ph-switch-search:focus { outline: 2px solid var(--ink, #16141b); outline-offset: 1px; }
.ph-switch-panel section { margin-top: 16px; }
.ph-switch-panel h3 { margin: 0 0 10px; color: var(--muted, #67636e); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.ph-switch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ph-switch-grid li[hidden], .ph-switch-panel section[hidden] { display: none; }
.ph-switch-card {
  position: relative; display: grid; align-content: end; gap: 1px;
  aspect-ratio: 12 / 7; overflow: hidden; padding: 10px 12px;
  border-radius: 10px; color: #fff; text-decoration: none; isolation: isolate;
  background: #1c1a21;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .06);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.ph-switch-card img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.ph-switch-card::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 30%, rgb(10 9 14 / .82)); }
.ph-switch-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand, #c9a465); opacity: .9; }
.ph-switch-name { font-size: 15px; font-weight: 800; letter-spacing: -.02em; text-shadow: 0 1px 8px rgb(0 0 0 / .5); }
.ph-switch-card small { overflow: hidden; color: rgb(255 255 255 / .75); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.ph-switch-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgb(0 0 0 / .55); }
.ph-switch-card:hover img { transform: scale(1.06); }
.ph-switch-card[aria-current] { box-shadow: 0 0 0 3px var(--brand, #c9a465); }
.ph-switch-card[aria-current] .ph-switch-name::after { content: '보는 중'; margin-left: 6px; padding: 2px 6px; border-radius: 5px; background: #fff; color: #16141b; font-size: 10px; font-weight: 800; vertical-align: 2px; }
@media (max-width: 640px) {
  .ph-archive-nav__switch[open]::before { content: ''; position: fixed; inset: 0; z-index: 998; background: rgb(0 0 0 / .45); }
  .ph-switch-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 999; width: auto; max-height: 82vh;
    border-radius: 18px 18px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .ph-switch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-switch-search { width: 60%; }
}
@media (prefers-reduced-motion: no-preference) {
  .ph-archive-nav__switch[open] .ph-switch-panel { animation: switch-in 220ms ease-out; }
  @keyframes switch-in { from { opacity: 0; transform: translateY(-6px); } }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 640px) {
  .ph-archive-nav__switch[open] .ph-switch-panel { animation: switch-up 260ms ease-out; }
  @keyframes switch-up { from { transform: translateY(40px); opacity: .6; } }
}
:root[data-theme="dark"] .ph-switch-search { background: #1c1a21; }
.ph-archive-nav:has(.ph-archive-nav__switch[open]) { z-index: 1000; }
