/* Notebook layout - Jupyter notebook pages (doc-style page-hero) */

/* Actions row: notebook buttons + share (flex) */
.page-hero__actions:has(.page-hero__notebook-actions) {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Notebook action buttons (Download, Binder, Colab) */
.page-hero__notebook-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.page-hero__notebook-action {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(180deg,
      var(--color-surface, var(--color-bg-elevated)),
      var(--color-bg-secondary));
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-medium, 6px);
  color: var(--color-text-secondary);
  font-size: var(--text-xs, 0.75rem);
  font-weight: var(--weight-medium, 500);
  text-decoration: none;
  transition: all var(--transition-fast, 0.15s);
  white-space: nowrap;
}

.page-hero__notebook-action:hover {
  color: var(--color-link);
  border-color: var(--color-link);
}

.notebook-content {
  margin-top: 0; /* docs-content handles spacing */
}

/* =============================================================================
   NOTEBOOK OUTPUT (stream, execute_result, display_data)
   Compact, terminal-like styling — smaller than code blocks
   ============================================================================= */

.notebook-content .nb-output {
  margin-block: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  line-height: var(--line-height-snug, 1.35);
  border-radius: var(--radius-md);
  border-inline-start: 3px solid var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 4%, var(--color-bg-code));
  overflow-x: auto;
}

/* Output hugs code block above */
.notebook-content .highlight + .nb-output,
.notebook-content pre + .nb-output {
  margin-top: calc(-1 * var(--space-2));
}

.notebook-content .nb-output pre {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  border-radius: 0;
  font-size: inherit;
  line-height: inherit;
  animation: none;
  box-shadow: none;
}

/* Error output */
.notebook-content .nb-output--error,
.notebook-content .nb-output .notebook-error {
  border-inline-start-color: var(--color-danger);
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.notebook-content .nb-output--error pre,
.notebook-content .nb-output .notebook-error {
  padding: var(--space-3) var(--space-4);
}

/* Image output */
.notebook-content .nb-output--image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--elevation-low);
  display: block;
}

/* HTML output (tables, rich content) */
.notebook-content .nb-output--html {
  border-inline-start: none;
  background: transparent;
  overflow-x: auto;
}

.notebook-content .nb-output--html table {
  font-size: var(--text-xs);
}

/* Reduced motion: no animations on output */
@media (prefers-reduced-motion: reduce) {
  .notebook-content .nb-output pre {
    animation: none;
  }
}
