/* ty-find docs — custom mdbook overrides */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --ty-accent: #0ea5e9;
  --ty-accent-dim: #0284c7;
  --ty-accent-glow: rgba(14, 165, 233, 0.12);
}

body { font-family: var(--font-sans) !important; }
code, pre, .hljs { font-family: var(--font-mono) !important; }
.content main { font-size: 0.95rem; line-height: 1.7; }

/* --- Sidebar --- */
.sidebar { font-family: var(--font-sans) !important; font-size: 0.85rem !important; }

.sidebar .chapter-item.spacer {
  height: 1px !important; margin: 12px 16px !important; padding: 0 !important;
  list-style: none; opacity: 0.15; background: currentColor;
}

.sidebar .chapter-item .part-title, .sidebar .part-title {
  text-transform: uppercase; font-size: 0.65rem !important; font-weight: 600 !important;
  letter-spacing: 0.1em; opacity: 0.5; margin-top: 18px !important;
  margin-bottom: 4px !important; padding-left: 16px; pointer-events: none;
}

.sidebar .chapter-item a, .sidebar ol.chapter a {
  padding: 5px 16px !important; margin: 1px 8px !important; border-radius: 6px !important;
  display: block; transition: background 0.15s ease, color 0.15s ease;
  font-weight: 400; text-decoration: none !important;
}

.sidebar .chapter-item a:hover, .sidebar ol.chapter a:hover {
  background: var(--ty-accent-glow);
}

.sidebar .chapter-item a.active, .sidebar ol.chapter a.active {
  background: var(--ty-accent-glow) !important; font-weight: 500 !important;
  border-left: 3px solid var(--ty-accent) !important; padding-left: 13px !important;
}

.sidebar ol.chapter li.chapter-item ol a {
  padding-left: 32px !important; font-size: 0.82rem; opacity: 0.8;
}
.sidebar ol.chapter li.chapter-item ol a:hover { opacity: 1; }

.sidebar .section-number {
  opacity: 0.35; font-size: 0.78em; font-variant-numeric: tabular-nums;
}

/* --- Content headings --- */
.content main h1 {
  font-weight: 600; font-size: 1.8rem; letter-spacing: -0.02em;
  margin-top: 0; padding-bottom: 0.3em; border-bottom: 2px solid var(--ty-accent);
}
.content main h2 { font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; margin-top: 2em; }
.content main h3 { font-weight: 500; font-size: 1.1rem; }

/* --- Code blocks --- */
.content pre {
  border-radius: 8px !important; padding: 1em 1.2em !important;
  font-size: 0.85rem !important; line-height: 1.6 !important;
  border: 1px solid rgba(128, 128, 128, 0.15);
}
.content code:not(pre code) {
  padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.88em; font-weight: 500;
}

/* --- Tables --- */
.content table {
  border-collapse: separate; border-spacing: 0; border-radius: 8px;
  overflow: hidden; border: 1px solid rgba(128, 128, 128, 0.2); width: 100%;
}
.content table th {
  font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.content table td, .content table th {
  padding: 0.6em 1em; border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}
.content table tr:last-child td { border-bottom: none; }

/* --- Links --- */
.content a {
  text-decoration: underline; text-decoration-color: var(--ty-accent);
  text-underline-offset: 2px; transition: color 0.15s ease;
}
.content a:hover { color: var(--ty-accent) !important; }
.content dt strong, .content p strong code { color: var(--ty-accent); }

/* --- Theme-specific accent colors --- */
.navy  { --ty-accent: #38bdf8; --ty-accent-dim: #0ea5e9; --ty-accent-glow: rgba(56, 189, 248, 0.1); }
.ayu   { --ty-accent: #39bae6; --ty-accent-dim: #59c2ff; --ty-accent-glow: rgba(57, 186, 230, 0.1); }
.coal  { --ty-accent: #38bdf8; --ty-accent-dim: #0ea5e9; --ty-accent-glow: rgba(56, 189, 248, 0.08); }
.light { --ty-accent: #0284c7; --ty-accent-dim: #0369a1; --ty-accent-glow: rgba(2, 132, 199, 0.08); }
.rust  { --ty-accent: #f59e0b; --ty-accent-dim: #d97706; --ty-accent-glow: rgba(245, 158, 11, 0.1); }

/* --- Menu bar & nav --- */
#menu-bar { border-bottom: 1px solid rgba(128, 128, 128, 0.15); }
#menu-bar .icon-button { transition: color 0.15s ease; }
#menu-bar .icon-button:hover { color: var(--ty-accent) !important; }
.nav-chapters { transition: color 0.2s ease; }
.nav-chapters:hover { color: var(--ty-accent) !important; }

/* --- Responsive --- */
@media (max-width: 1080px) { .content main { font-size: 0.92rem; } }
@media (max-width: 600px) { .sidebar .chapter-item a, .sidebar ol.chapter a { margin: 1px 4px !important; } }
