/*
  BoundBio — 3D molecular structure viewer styles
  =====================================================
  Pairs with design-system/molecule-viewer.js. Same modal language as
  design-system/intro-popup.css (backdrop scrim, white card, 22px-ish
  radius, no new color introduced) — deliberately not shared classes,
  since the two components have nothing else in common (this one has no
  once-per-visitor logic, no MailerLite dependency), but a viewer reading
  this file right after that one should recognize the pattern immediately.
*/

html.mv-lock, html.mv-lock body { overflow: hidden; }

.mv-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: rgba(11, 27, 39, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-standard);
}
.mv-backdrop.is-open { opacity: 1; pointer-events: auto; }
.mv-backdrop[hidden] { display: none; }

.mv-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100svh - 2 * var(--space-5));
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(11, 60, 90, .18);
  padding: 28px 24px 24px;
  transform: translateY(14px) scale(.98);
  transition: transform var(--dur-slow) var(--ease-standard);
}
.mv-backdrop.is-open .mv-modal { transform: translateY(0) scale(1); }

@media (prefers-reduced-motion: reduce) {
  .mv-backdrop, .mv-modal { transition: none; }
}

.mv-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line-soft);
  border: none;
  border-radius: 50%;
  color: var(--ink-2);
}
.mv-close:hover { background: var(--line); color: var(--ink); }

.mv-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: var(--ls-display);
  color: var(--ink);
  margin: 0 0 14px;
  padding-right: 30px; /* clears the close button */
}

.mv-canvas-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.mv-canvas { width: 100%; height: 100%; position: relative; }
/* 3Dmol.js paints its own canvas into this div at whatever size it is
   when created — the aspect-ratio box above is what actually reserves
   the space, this only has to fill it. */
.mv-canvas canvas { display: block; }

.mv-hint {
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  margin: 10px 0 0;
}

.mv-message {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  text-align: center;
  padding: 40px 10px;
}
.mv-loading { color: var(--ink-3); }

/* 2D fallback (2026-09-09) — PubChem's rendered structure diagram in the
   same framed box the 3D canvas uses, plus a small kind label on both so
   a diagram is never mistaken for the rotatable model. */
.mv-canvas-wrap { position: relative; }
.mv-2d-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.mv-2d { display: block; width: 100%; height: 100%; object-fit: contain; }
.mv-kind {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 3px 9px;
  pointer-events: none;
}
