/* ==========================================================================
   Physiology clips (components/neuro-video.js)

   Tabs for a set of short clips, the native video frame, a "Next clip"
   button, and a list of the clip's steps with the note and sources.
   ========================================================================== */

.nvid {
  margin: 1.25rem 0;
  max-width: 880px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--text-color);
  overflow: hidden;
}

.nvid-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0.5rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nvid-tabs::-webkit-scrollbar { display: none; }
.nvid-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.4rem 0.85rem 0.4rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.nvid-tab:hover { background: var(--surface-2); color: var(--text-color); }
.nvid-tab[aria-selected="true"] { border-color: var(--border-color); background: var(--surface-2); color: var(--text-color); }
.nvid-tab-n {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--surface-3, var(--surface-2));
  font-size: 0.75rem;
}
.nvid-tab[aria-selected="true"] .nvid-tab-n { background: var(--accent-color); color: #fff; }
body.dark .nvid-tab[aria-selected="true"] .nvid-tab-n { color: #2b2140; }
.nvid-tab:focus-visible, .nvid-step:focus-visible, .nvid-next:focus-visible, .nvid-more summary:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.nvid-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.65rem 1rem 0.5rem;
}
.nvid-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text-color); }
.nvid-dur { color: var(--text-secondary); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.nvid-frame { background: #f4f2f8; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.nvid-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #f4f2f8;
}

.nvid-next {
  display: block;
  margin: 0.75rem 1rem;
  min-height: 40px;
  padding: 0.4rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent-color);
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}
body.dark .nvid-next { color: #2b2140; }
.nvid-next[hidden] { display: none; }

.nvid-more { border-top: 1px solid var(--border-color); }
.nvid-more summary {
  padding: 0.65rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}
.nvid-steps {
  margin: 0 !important;
  padding: 0 0.5rem 0.4rem !important;
  list-style: none;
}
.nvid-steps li { margin: 0 !important; padding: 0 !important; }
.nvid-steps li::before { content: none !important; }
.nvid-step {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-color);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}
.nvid-step:hover { background: var(--surface-2); }
.nvid-step.is-current { background: color-mix(in srgb, var(--accent-color) 10%, transparent); }
.nvid-step-time { flex: 0 0 2.4rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.nvid-step-body strong { display: block; font-weight: 700; }
.nvid-step-body span { color: var(--text-secondary); }
.nvid-note, .nvid-sources {
  margin: 0 !important;
  padding: 0.35rem 1rem 0.6rem;
  color: var(--text-secondary);
  font-size: 0.8rem !important;
  line-height: 1.5;
}
.nvid-sources { padding-bottom: 0.9rem; }
.nvid-sources a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.nvid sub { font-size: 0.72em; }

@media (max-width: 640px) {
  .nvid { margin-left: -0.25rem; margin-right: -0.25rem; }
  .nvid-head { padding-left: 0.75rem; padding-right: 0.75rem; }
}
