/* Interactives inside an article (src/server/interactive.mjs): a sandboxed frame in a card like a chart's.
   Loaded only on pages that have one. static/interactive.js sets the frame's height and adds the buttons. */
.interactive, .prose .interactive {
  margin: 2em 0;
  padding: 0;
  background: #121212;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  font-family: var(--sans);
}
.interactive-box { position: relative; background: #121212; }
.interactive-frame {
  display: block;
  width: 100%;
  border: 0;
  background: #121212;
  transition: height 0.2s ease;
}
.interactive-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 14px 8px 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
}
.interactive-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.interactive-title { color: inherit; text-decoration: none; }
a.interactive-title:hover, a.interactive-title:focus-visible { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.interactive-tools { display: flex; gap: 4px; flex: none; }
.interactive-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--soft);
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.interactive-tools button:hover { border-color: var(--line-strong); color: var(--fg); }
.interactive-tools svg { width: 14px; height: 14px; }

/* Full screen: the frame takes the whole screen, the caption stays at the bottom. */
.interactive:fullscreen { display: flex; flex-direction: column; margin: 0; border: 0; border-radius: 0; background: #121212; }
.interactive:fullscreen .interactive-box { flex: 1; min-height: 0; }
.interactive:fullscreen .interactive-frame { height: 100% !important; transition: none; }

@media (max-width: 720px) {
  .prose .interactive { margin-left: calc(var(--gutter) * -0.5); margin-right: calc(var(--gutter) * -0.5); border-radius: 12px; }
  .interactive-foot { padding: 6px 8px 6px 14px; }
  .interactive-tools button span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .interactive-frame { transition: none; } }
