/* Shared by the home page and the guides: the nav's search and theme buttons, and the quick search panel. */

.nav-tools { display: flex; align-items: center; gap: 4px; }
.nav-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; min-width: 38px; padding: 0 10px; border-radius: 100px; border: 0;
  background: transparent; color: var(--body); font: 500 0.82rem 'Inter', system-ui, sans-serif; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.nav-icon-btn:hover { background: rgba(9,9,11,0.05); color: var(--text); }
.nav-icon-btn:focus-visible { outline: 2px solid var(--c5); outline-offset: 2px; }
.nav-icon-btn svg { width: 18px; height: 18px; flex: none; }
.nav-search kbd { font: 600 0.68rem 'Inter', system-ui, sans-serif; color: var(--muted); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--borderStrong); }
@media (max-width: 900px) { .nav-search kbd { display: none; } .nav-icon-btn { padding: 0; } }

/* sun in dark mode (tap for light), moon in light mode (tap for dark) */
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* Quick search */
.qs { width: min(640px, calc(100% - 24px)); max-height: min(560px, calc(100dvh - 120px)); margin: 88px auto auto; padding: 0; border: 0; border-radius: 22px;
  background: var(--surface); color: var(--text); overflow: hidden; display: none; flex-direction: column;
  box-shadow: 0 0 0 0.5px var(--borderStrong), 0 30px 80px -20px rgba(9,9,11,0.45); }
.qs[open] { display: flex; animation: qsIn 0.18s ease-out; }
.qs::backdrop { background: rgba(9,9,11,0.32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes qsIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.qs-bar { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.qs-bar svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.qs-input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 500 1.06rem 'Inter', system-ui, sans-serif; }
.qs-input::placeholder { color: var(--muted); }
.qs-esc { font: 600 0.68rem 'Inter', system-ui, sans-serif; color: var(--muted); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--borderStrong); background: none; cursor: pointer; }
.qs-list { overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.qs-group { font: 600 0.72rem 'Inter', system-ui, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 6px; }
.qs-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--text); text-decoration: none; }
.qs-item[aria-selected="true"] { background: rgba(77,168,255,0.12); }
.qs-item img, .qs-glyph { width: 34px; height: 34px; border-radius: 9px; flex: none; object-fit: cover; }
.qs-glyph { display: grid; place-items: center; background: linear-gradient(135deg, var(--c1), var(--c6)); color: #fff; }
.qs-glyph svg { width: 17px; height: 17px; }
.qs-t { font-weight: 600; font-size: 0.93rem; line-height: 1.3; display: block; }
.qs-d { font-size: 0.8rem; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-txt { min-width: 0; }
.qs-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 0.92rem; }
.qs-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 0.74rem; color: var(--muted); }
.qs-foot kbd { font: 600 0.68rem 'Inter', system-ui, sans-serif; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--borderStrong); margin-right: 4px; }
@media (max-width: 600px) { .qs { margin-top: 12px; max-height: calc(100dvh - 24px); } .qs-foot { display: none; } }
@media (prefers-reduced-motion: reduce) { .qs[open] { animation: none; } }

[data-theme="dark"] .nav-icon-btn:hover { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .qs { box-shadow: 0 0 0 0.5px rgba(255,255,255,0.14), 0 30px 80px -20px rgba(0,0,0,0.8); }
[data-theme="dark"] .qs::backdrop { background: rgba(0,0,0,0.55); }
[data-theme="dark"] .qs-item[aria-selected="true"] { background: rgba(77,168,255,0.18); }
.qs-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
