/* Shared notebook theme for olive.casazza.info and embedded Marimo exports.
   Source of truth for notebook page + iframe styling. */

:root {
  --notebook-bg: transparent;
  --notebook-font: 'Courier New', Courier, monospace;
  --notebook-text: #d1d5db;
  --notebook-muted: #9ca3af;
  --notebook-primary: #5dcdbe;
  --notebook-highlight: #f0dd7d;
  --notebook-secondary: #eba798;
  --notebook-border: rgba(209, 213, 219, 0.22);
  --notebook-code-bg: rgba(0, 0, 0, 0.28);
  --notebook-width: min(42rem, calc(100vw - 1rem));
  --notebook-gap: 1.25rem;
  --notebook-line-height: 1.625;
}

html,
body {
  background: var(--notebook-bg) !important;
  color: var(--notebook-text) !important;
  font-family: var(--notebook-font) !important;
  font-size: 0.875rem;
  line-height: var(--notebook-line-height);
}

.notebook-page {
  display: flex;
  flex-direction: column;
  gap: var(--notebook-gap);
  width: 100%;
  max-width: var(--notebook-width);
  margin: 0 auto;
  min-height: calc(100vh - 4.5rem);
  padding-bottom: 1rem;
  background: var(--notebook-bg);
  color: var(--notebook-text);
  font-family: var(--notebook-font);
  font-size: 0.875rem;
  line-height: var(--notebook-line-height);
}

.notebook-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.notebook-heading {
  color: var(--notebook-primary);
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.notebook-source {
  width: fit-content;
  font-size: 0.75rem;
}

.notebook-frame-section {
  position: relative;
  min-height: 70vh;
  background: var(--notebook-bg);
}

.notebook-frame {
  display: block;
  width: 100%;
  min-height: 70vh;
  border: 0;
  background: var(--notebook-bg);
  transition: opacity 200ms ease;
}

.notebook-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.75rem;
  padding-top: 0.5rem;
  background: var(--notebook-bg);
  color: var(--notebook-muted);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.notebook-error-text {
  color: var(--notebook-secondary);
}

.notebook-loading-text::after {
  content: '';
  animation: notebook-ellipsis 1.1s steps(4, end) infinite;
}

@keyframes notebook-ellipsis {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* Marimo export internals. These selectors intentionally live here so the
   iframe uses the same dimensions/palette as the parent Nuxt page. */
body,
#root,
main,
[data-testid='app-container'],
[data-testid='read-mode-root'],
[data-testid='notebook-container'],
[data-testid='page'],
[data-testid='output-area'],
[data-testid='cell-output'] {
  background: var(--notebook-bg) !important;
}

body {
  margin: 0 !important;
  padding: 0 !important;
}

main,
#root > div,
[data-testid='app-container'],
[data-testid='notebook-container'],
[data-testid='read-mode-root'],
[data-testid='page'] {
  width: 100% !important;
  max-width: var(--notebook-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
span,
label,
div {
  color: var(--notebook-text) !important;
  font-family: var(--notebook-font) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--notebook-primary) !important;
}

a {
  color: var(--notebook-highlight) !important;
  text-decoration: underline !important;
  text-underline-offset: 0.125rem !important;
}

a:hover {
  cursor: pointer;
}

/* Hide "made with marimo" badge */
a[href="https://marimo.io"] {
  display: none !important;
}

.marimo-cell,
[data-testid='cell'] {
  margin-bottom: 2rem !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--notebook-bg) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

button,
input,
select,
textarea {
  font-family: var(--notebook-font) !important;
}

button {
  border-radius: 0 !important;
}

code,
pre {
  background: var(--notebook-code-bg) !important;
  font-family: var(--notebook-font) !important;
}

::-webkit-scrollbar {
  width: 1px;
  height: 1px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--notebook-primary);
}
