/* Interview Helper — live during-call reference UI.
   Layout is search-first, glanceable, and reuses the site's design tokens. */

.ih {
  /* Re-assert the dark-theme design tokens because .content-light (which wraps
     every {% block body %}) flips --text-primary etc. to light-mode values.
     The helper is always dark. */
  --bg-deep: #0b0a09;
  --bg-surface: #141312;
  --bg-elevated: #1e1c19;
  --bg-hover: #232120;
  --text-primary: #e8e4de;
  --text-secondary: #b0aba3;
  --text-tertiary: #6b665f;
  --accent-bg: rgba(200, 148, 62, 0.08);
  --border: #35312e;

  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--bg-deep);
}

.ih__header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-deep);
  border-bottom: 1px solid rgba(200, 148, 62, 0.18);
  padding: 0.75rem 0;
}

.ih__header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.ih__brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.ih__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  opacity: 0.65;
  font-size: 1.1rem;
  line-height: 1;
}

.ih__back:hover { opacity: 1; background: var(--accent-bg); }

.ih__title {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ih__spec {
  opacity: 0.7;
}

.ih__search-wrap {
  position: relative;
  flex: 1;
  max-width: 600px;
  margin-left: auto;
}

.ih__search {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(200, 148, 62, 0.25);
  color: var(--text-primary);
  font-size: 1rem;
  padding: 0.6rem 2.2rem 0.6rem 0.9rem;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ih__search:focus {
  border-color: var(--accent);
  background: rgba(200, 148, 62, 0.06);
}

.ih__shortcut {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: rgba(200, 148, 62, 0.15);
  color: var(--accent);
  border: 1px solid rgba(200, 148, 62, 0.3);
  border-radius: 4px;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  pointer-events: none;
}

.ih__layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-sm) var(--space-lg);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 768px) {
  .ih__layout {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

.ih__sidebar {
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  font-size: 0.95rem;
  padding-right: 0.5rem;
}

.ih__sidebar::-webkit-scrollbar { width: 6px; }
.ih__sidebar::-webkit-scrollbar-thumb { background: rgba(200, 148, 62, 0.25); border-radius: 3px; }

@media (max-width: 768px) {
  .ih__sidebar {
    position: static;
    max-height: 320px;
  }
}

.ih__group + .ih__group { margin-top: var(--space-sm); }

.ih__group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.55;
  margin: 0 0 0.4rem 0.6rem;
  font-weight: 600;
}

.ih__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ih__list li { margin: 0; }

.ih__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  opacity: 0.78;
  line-height: 1.3;
  border: 1px solid transparent;
  transition: background 0.1s ease, opacity 0.1s ease, border-color 0.1s ease;
}

.ih__item:hover {
  opacity: 1;
  background: rgba(200, 148, 62, 0.06);
}

.ih__item--active {
  opacity: 1;
  background: rgba(200, 148, 62, 0.12);
  border-color: rgba(200, 148, 62, 0.35);
  color: var(--accent-bright);
  font-weight: 600;
}

.ih__item-difficulty {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 0.5rem;
  flex-shrink: 0;
  background: var(--accent-muted);
}

.ih__item-difficulty--foundational { background: #5a8c5a; }
.ih__item-difficulty--intermediate { background: var(--accent); }
.ih__item-difficulty--advanced { background: #c8643e; }

.ih__no-results {
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  opacity: 0.55;
  margin: 0;
}

.ih__main {
  min-width: 0;
}

.ih__footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-sm);
  font-size: 0.78rem;
  opacity: 0.5;
  text-align: center;
  border-top: 1px solid rgba(200, 148, 62, 0.1);
}

.ih__footer a { color: var(--accent); }

/* --- Concept card --- */

.ih-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(200, 148, 62, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-md) calc(var(--space-md) + 0.5rem);
}

.ih-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.ih-card__title {
  font-family: 'Instrument Serif', serif;
  font-size: 2.1rem;
  line-height: 1.15;
  margin: 0 0 0.4rem;
  color: var(--text-primary);
  font-weight: 400;
}

.ih-card__summary {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  opacity: 0.85;
}

.ih-card__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.ih-card__difficulty {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(200, 148, 62, 0.12);
  color: var(--accent-bright);
  font-weight: 600;
}

.ih-card__difficulty--foundational { background: rgba(90, 140, 90, 0.15); color: #8fb88f; }
.ih-card__difficulty--advanced { background: rgba(200, 100, 62, 0.15); color: #d68868; }

.ih-card__pin {
  background: transparent;
  border: 1px solid rgba(200, 148, 62, 0.25);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.ih-card__pin:hover { opacity: 1; border-color: var(--accent); }

.ih-card__pin--on {
  opacity: 1;
  color: var(--accent-bright);
  border-color: var(--accent);
  background: rgba(200, 148, 62, 0.1);
}

.ih-card__bullets {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
}

.ih-card__bullets li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.5rem;
  font-size: 1.02rem;
  line-height: 1.55;
  border-bottom: 1px solid rgba(200, 148, 62, 0.08);
}

.ih-card__bullets li:last-child { border-bottom: none; }

.ih-card__bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 0.4rem;
  color: var(--accent);
  font-weight: 600;
}

.ih-card__code {
  background: #07060a;
  border: 1px solid rgba(200, 148, 62, 0.15);
  border-radius: var(--radius);
  padding: var(--space-sm);
  margin: 0 0 var(--space-md);
  overflow-x: auto;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}

.ih-card__code code {
  color: #e8e4de;
  background: transparent;
  white-space: pre;
}

.ih-card__gotchas {
  background: rgba(200, 100, 62, 0.06);
  border-left: 3px solid #c8643e;
  padding: 0.7rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: var(--space-md);
}

.ih-card__gotchas h3 {
  margin: 0 0 0.3rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d68868;
  font-weight: 600;
}

.ih-card__gotchas ul {
  margin: 0;
  padding-left: 1.2rem;
}

.ih-card__gotchas li {
  margin: 0.25rem 0;
  font-size: 0.96rem;
  line-height: 1.5;
}

.ih-card__related {
  font-size: 0.9rem;
  opacity: 0.8;
  border-top: 1px solid rgba(200, 148, 62, 0.1);
  padding-top: var(--space-sm);
}

.ih-card__related span {
  opacity: 0.6;
  margin-right: 0.4rem;
}

.ih-card__related a {
  color: var(--accent);
}

/* Hide site nav & footer on the helper for max screen real estate. .ih is
   nested inside .content-light, so a sibling selector won't reach the footer —
   use :has() on body instead. */
body:has(.ih) .nav,
body:has(.ih) .footer { display: none; }
body:has(.ih) .content-light { background: transparent; }
