/* utils.css — shared utility classes extracted from inline styles (Phase 4) */


.hidden {
  display: none !important;
}

.flex-row-8 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-sm {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  color: #888;
  font-size: 0.7rem;
  padding: 2px 6px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.btn-ghost-icon {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.clr-green {
  color: #4ade80;
}

.clr-amber {
  color: #f59e0b;
}

.clr-blue {
  color: #60a5fa;
}

.clr-muted {
  color: #888;
}

.clr-dim {
  color: #555;
}

.clr-blue-light {
  color: #c8d8f0;
}

.text-sm-slate {
  color: #8a9ab5;
  font-size: 0.9em;
}

.text-sm-green {
  color: #4ade80;
  font-size: 0.9em;
}

.text-xs-slate {
  font-size: 0.8em;
  color: #8a9ab5;
}

.bold-amber {
  font-weight: 700;
  color: #f59e0b;
}

.link-amber {
  color: #f59e0b;
  text-decoration: none;
}

.clr-dark-blue {
  color: #2a3a50;
}

.bg-green {
  background: #4ade80;
}

.bg-amber {
  background: #f59e0b;
}

.mt-4 {
  margin-top: 4px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-14 {
  margin-top: 14px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-28 {
  margin-top: 28px;
}

.w-0pct {
  width: 0%;
}

.border-top-section {
  border-top: 1px solid #1a1a1a;
  padding-top: 40px;
}

.label-xs-upper {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.text-xs-steel {
  font-size: 0.8em;
  color: #6a8aaa;
}

.code-tag {
  font-size: 0.85em;
  background: rgba(255,255,255,0.05);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
}

/* Spacing helpers */
.mt-2  { margin-top: 2px; }
.mt-6  { margin-top: 6px; }
.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }

/* Colour helpers */
.clr-gray       { color: #444; }
.clr-near-black { color: #2a2a2a; }
.clr-purple     { color: #a78bfa; }

/* Flex helpers */
.flex-1 { flex: 1; min-width: 0; }

/* Combined text helpers */
.text-xs-dim    { color: #555; font-size: 0.72rem; }
.text-xs-gray   { color: #444; font-size: 0.72rem; }
.text-xs-purple { color: #a78bfa; font-size: 0.72rem; }
.text-sm-amber  { color: #f59e0b; font-size: 0.85em; }
.text-sm-gray   { color: #444; font-size: 0.8rem; }
.text-sm-charcoal { color: #333; font-size: 0.78rem; }
.text-sm-muted-sm { color: #555; font-size: 0.8rem; }
.info-row-sm    { font-size: 0.72rem; }
.info-row-xs    { font-size: 0.7rem; }

/* ── Nav home button (injected by nav.js on all non-homepage pages) ─────────── */
#nav-home-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  color: #444; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
#nav-home-btn:hover { color: #bbb; background: rgba(255,255,255,0.06); }
#nav-home-btn svg  { display: block; }

/* ── Nav search bar (shared across all pages) ─────────────────────────────────
   Uses high-specificity selector (.nav-search input.nav-search-input = 0,2,1)
   to override page-level input[type="text"] rules (0,1,1) that would otherwise
   make the search box full-width with wrong background/border/font.          */
.nav-search {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid #252525; border-radius: 6px;
  padding: 3px 10px; cursor: pointer;
  transition: border-color 0.2s;
  background: none;
  flex-shrink: 0;
}
.nav-search:hover { border-color: #333; }
.nav-search-icon { color: #3a3a3a; font-size: 0.7rem; user-select: none; }

/* High-specificity override — beats any page-level input[type="text"] rule */
.nav-search input.nav-search-input {
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  color: #555;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  width: 80px;
  pointer-events: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
  font-weight: normal;
  letter-spacing: normal;
  transition: none;
}
.nav-search input.nav-search-input::placeholder { color: #3a3a3a; }

/* ── Search overlay (shared across all pages) ─────────────────────────────── */
#search-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding-top: 80px;
}
#search-overlay.open { display: flex; }
#search-box {
  background: #111; border: 1px solid #2a2a2a; border-radius: 10px;
  width: 100%; max-width: 580px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
#search-input {
  width: 100%; padding: 16px 20px; background: transparent;
  border: none; outline: none; box-shadow: none;
  color: #e0e0e0; font-size: 1rem; font-family: inherit;
  box-sizing: border-box;
}
#search-input::placeholder { color: #444; }
#search-divider { height: 1px; background: #1e1e1e; }
#search-results { max-height: 400px; overflow-y: auto; }
.search-result {
  display: block; padding: 12px 20px; text-decoration: none; color: inherit;
  border-bottom: 1px solid #151515; transition: background 0.15s;
}
.search-result:hover, .search-result.active { background: #161616; }
.search-result-title { color: #e0e0e0; font-size: 0.9rem; margin-bottom: 3px; }
.search-result-snippet { color: #555; font-size: 0.78rem; line-height: 1.4; }
.search-result-snippet mark { background: none; color: #4ade80; font-style: normal; }
#search-empty { padding: 20px; text-align: center; color: #333; font-size: 0.85rem; }
#search-hint {
  padding: 8px 20px; color: #2a2a2a; font-size: 0.72rem;
  border-top: 1px solid #151515; display: flex; gap: 16px;
}


/* ── Breadcrumb nav (shared across pages) ───────────────────────────────────── */
.nav-crumbs { display: flex; align-items: center; gap: 0; flex-shrink: 0; min-width: 0; min-height: 28px; }
.crumb-sep { color: #2a2a2a; font-size: 0.78rem; padding: 0 2px; user-select: none; }
.nav-crumb { position: relative; }
.nav-crumb-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  color: #c0c0c0; font-size: 0.85rem; font-weight: 500;
  padding: 4px 7px; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.nav-crumb-btn:hover { background: rgba(255,255,255,0.06); color: #f0f0f0; }
.nav-crumb.open .nav-crumb-btn { background: rgba(255,255,255,0.06); color: #f0f0f0; }
.crumb-chevron { font-size: 0.6rem; color: #444; transition: color 0.15s, transform 0.15s; display: inline-block; }
.nav-crumb.open .crumb-chevron { color: #777; transform: rotate(180deg); }
.nav-crumb-dd {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 210px; max-width: 260px;
  max-height: 72vh; overflow-y: auto;
  background: #111; border: 1px solid #1e1e1e;
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  z-index: 200; padding: 6px;
  scrollbar-width: thin; scrollbar-color: #222 transparent;
}
.nav-crumb.open .nav-crumb-dd { display: block; }
.crumb-dd-section-header {
  padding: 6px 8px 3px; margin-top: 4px;
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.13em;
  color: #2e2e2e;
}
.crumb-dd-section-header:first-child { margin-top: 0; }
.crumb-dd-item {
  display: block; padding: 5px 8px;
  font-size: 0.8rem; color: #666;
  text-decoration: none; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.1s, color 0.1s;
}
.crumb-dd-item:hover { background: rgba(255,255,255,0.06); color: #e0e0e0; }
.crumb-dd-item.crumb-dd-active { color: #d4d4d4; font-weight: 500; }
.crumb-dd-divider { height: 1px; background: #2a2a2a; margin: 4px 8px; }
