/* ─────────────────────────────────────────────────────────────
   Basics in Mass Spectrometry — series styles
   Extends the main NS Note style.css (light theme).
   Adds: two-column layout with left sidebar (desktop),
   collapsible hamburger nav (mobile), and figure containers.
   ───────────────────────────────────────────────────────────── */

:root {
  /* reuse the site tokens; redeclare a few for local use */
  --ms-accent: #1a5c3a;
  --ms-accent-light: #e8f2ec;
  --ms-border: #e0ddd6;
  --ms-fig-bg: #ffffff;
}

/* ─── Layout: sidebar + content ─── */
.ms-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

/* Sidebar */
.ms-sidebar {
  flex: 0 0 240px;
  position: sticky;
  top: 72px;              /* below the sticky nav */
  align-self: flex-start;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding: 1.5rem 0 2rem;
}

.ms-sidebar h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 1.25rem 0 0.5rem;
}
.ms-sidebar h3:first-child { margin-top: 0; }

.ms-sidebar ul {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.ms-sidebar li { margin: 0; }

.ms-sidebar a {
  display: block;
  font-size: 14px;
  color: var(--text2);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ms-sidebar a:hover {
  background: var(--ms-accent-light);
  color: var(--ms-accent);
}

.ms-sidebar a.active {
  background: var(--ms-accent-light);
  color: var(--ms-accent);
  border-left-color: var(--ms-accent);
  font-weight: 500;
}

.ms-sidebar .ms-back {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ms-border);
  font-size: 13px;
}

/* Content column */
.ms-content {
  flex: 1 1 auto;
  min-width: 0;          /* allow canvas to shrink */
  padding-top: 1.5rem;
}

/* ─── Mobile hamburger ─── */
.ms-menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--ms-border);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  margin: 1rem 0;
}
.ms-menu-toggle svg { width: 18px; height: 18px; }

/* ─── Equation callout ───
   Subtle emphasis for a physics/math relationship inside prose.
   Not a big banner — just enough that the eye catches on it and
   registers "this is the key relationship", not ordinary text. */
.ms-eq {
  display: inline-block;
  margin: 0.15rem 0;
  padding: 3px 12px;
  background: var(--ms-accent-light);
  border-left: 3px solid var(--ms-accent);
  border-radius: 0 5px 5px 0;
  font-family: var(--serif, Georgia, serif);
  font-style: italic;
  font-size: 1.02em;
  color: var(--ms-accent);
  white-space: nowrap;
}
/* When the whole line is the equation (its own centered block) */
.ms-eq-block {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0.9rem 0;
  padding: 7px 16px;
  overflow-x: auto;
}

/* ─── Figure block ─── */
.ms-figure {
  margin: 1.5rem 0 2.5rem;
}

.ms-figure-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.ms-figure-note {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.65;
  margin-bottom: 0.9rem;
}

/* Canvas host: white card that sits nicely on the cream page */
.ms-stage {
  position: relative;
  width: 100%;
  background: var(--ms-fig-bg);
  border: 1px solid var(--ms-border);
  border-radius: 12px;
  overflow: hidden;
}
.ms-stage canvas { width: 100%; display: block; }

/* Controls row above/below a stage */
.ms-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 0.9rem;
}

.ms-btn {
  padding: 7px 15px;
  border: 1px solid var(--ms-border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ms-btn:hover { background: var(--ms-accent-light); border-color: var(--ms-accent); }
.ms-btn.active { background: var(--ms-accent-light); border-color: var(--ms-accent); color: var(--ms-accent); }

.ms-control-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text2);
}
.ms-control-inline input[type=range] { width: 150px; accent-color: var(--ms-accent); }
.ms-control-inline input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ms-accent); }

.ms-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text2);
}
.ms-legend .dot {
  display: inline-block;
  border-radius: 50%;
  vertical-align: 1px;
  margin-right: 5px;
}

/* ─── Responsive ─── */
@media (max-width: 820px) {
  .ms-layout { flex-direction: column; gap: 0; padding: 0 1.25rem; }
  .ms-menu-toggle { display: inline-flex; }
  .ms-sidebar {
    flex-basis: auto;
    width: 100%;
    position: static;
    max-height: none;
    padding: 0.5rem 0 1rem;
    border-bottom: 1px solid var(--ms-border);
    margin-bottom: 1rem;
    display: none;
  }
  .ms-sidebar.open { display: block; }
  .ms-content { padding-top: 0.5rem; }
}

/* FT-ICR and other multi-part canvases now stack their sub-plots
   vertically inside a normal .ms-stage, so no special wide/scroll
   handling is needed — the canvas is always width:100% of the column. */
