/* Shared navigation and orientation layer for Library subpages. */
:root {
  --library-motion-fast: 160ms;
  --library-motion-base: 220ms;
  --library-motion-slow: 360ms;
  --library-motion-ease: cubic-bezier(.2, .75, .2, 1);
  --library-scroll-thumb: rgba(212, 175, 55, .42);
  --library-scroll-thumb-hover: rgba(212, 175, 55, .72);
  --library-scroll-track: rgba(255, 255, 255, .045);
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--library-scroll-thumb) var(--library-scroll-track);
  scrollbar-width: thin;
}
* { scrollbar-color: var(--library-scroll-thumb) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: var(--library-scroll-track); }
*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--library-scroll-thumb);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--library-scroll-thumb-hover); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
::selection { background: rgba(212, 175, 55, .28); color: #F5F5F0; }
.library-context-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 4px;
  border: 1px solid rgba(232, 228, 218, .1);
  border-radius: 14px;
  background: rgba(19, 18, 17, .72);
}
.library-context-nav a {
  min-height: 36px;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  color: var(--muted, #B8B4AA);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--library-motion-fast) var(--library-motion-ease), background-color var(--library-motion-fast) var(--library-motion-ease), box-shadow var(--library-motion-fast) var(--library-motion-ease);
}
.library-context-nav a:hover { color: var(--text, #f2f5f9); background: rgba(212, 175, 55, .08); }
.library-context-nav a[aria-current="page"] {
  color: var(--text, #f2f5f9);
  background: #2A2310;
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .24);
}
.library-context-nav a:focus-visible { outline: 2px solid var(--blue, #D4AF37); outline-offset: 2px; }
.library-subpage-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.library-back-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(212, 175, 55, .22);
  border-radius: 10px;
  background: #1A170E;
  color: var(--text, #f2f5f9);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--library-motion-fast) var(--library-motion-ease), background-color var(--library-motion-fast) var(--library-motion-ease), border-color var(--library-motion-fast) var(--library-motion-ease);
}
.library-back-link:hover { border-color: rgba(212, 175, 55, .46); background: #2A2310; }
.library-page-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin: 0 auto 22px;
  padding: 10px 13px;
  border: 1px solid rgba(232, 228, 218, .1);
  border-radius: 12px;
  background: rgba(19, 18, 17, .58);
}
.library-page-rail span { color: var(--muted-2, #8C887E); font: 700 10px/1.3 var(--mono, ui-monospace, monospace); letter-spacing: .1em; text-transform: uppercase; }
.library-page-rail a { color: var(--blue, #D4AF37); font-size: 12px; font-weight: 700; text-decoration: none; }
.library-page-rail a:hover { color: var(--text, #f2f5f9); }
.editor-home-link { color: var(--muted, #B8B4AA); font-size: 12px; font-weight: 700; text-decoration: none; }
.editor-home-link:hover { color: var(--text, #f2f5f9); }

@media (max-width: 1260px) {
  .library-context-nav { overflow-x: auto; justify-content: flex-start; scrollbar-width: thin; }
  .library-context-nav a { flex: 0 0 auto; }
  .library-context-nav a[href="candidate-review.html"] { display: none; }
}
@media (max-width: 760px) {
  .library-context-nav { width: 100%; order: 3; border-radius: 11px; }
  .library-context-nav a { min-height: 34px; padding-inline: 9px; font-size: 11px; }
  .library-page-rail { align-items: flex-start; flex-direction: column; }
  .library-subpage-tools { margin-left: 0; }
}
@media (max-width: 680px) {
  .registry-page .library-context-nav { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .library-context-nav *, .library-page-rail * { scroll-behavior: auto !important; transition: none !important; }
}
