/* Prose styles for rendered note content */
.prose {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text);
  /* OpenType features for Newsreader */
  font-kerning: normal;
  font-feature-settings: 'liga' 1, 'calt' 1;
  /* Prevent any child from overflowing the content width */
  overflow-wrap: break-word;
  word-break: break-word;
  overflow-x: hidden;
}

/* H1 inside prose gets display treatment */
.prose h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--line-height-tight);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: var(--text);
  letter-spacing: -0.01em;
}

.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--line-height-snug);
  margin-top: 1.1em;
  margin-bottom: 0.3em;
  color: var(--text);
}

.prose h2 {
  font-size: var(--text-lg);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.25em;
  letter-spacing: -0.01em;
}

.prose h3 { font-size: 1.2rem; }
.prose h4 { font-size: 1.05rem; font-weight: 500; }

/* When a heading immediately follows a divider, kill the double-gap */
.prose hr + h1,
.prose hr + h2,
.prose hr + h3,
.prose hr + h4 {
  margin-top: 0.6em;
}

.prose p {
  margin-bottom: 0.9em;
}

/* Suppress empty paragraphs from markdown rendering */
.prose p:empty {
  display: none;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(155,125,245,0.35);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--transition);
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose strong {
  font-weight: 700;
  color: var(--text);
}

.prose em {
  font-style: italic;
}

.prose ul, .prose ol {
  margin-bottom: 0.9em;
  padding-left: 1.5em;
}

.prose li {
  margin-bottom: 0.35em;
}

.prose li > ul, .prose li > ol {
  margin-top: 0.35em;
  margin-bottom: 0;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5em 1.1em;
  margin: 1em 0;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  background: var(--bg-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.prose pre {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 1em 1.25em;
  overflow-x: auto;
  margin: 1em 0;
  border: 1px solid var(--border-light);
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.prose hr {
  border: none;
  text-align: center;
  margin: 0.5em 0;
  color: var(--border);
  letter-spacing: 0.5em;
}

.prose hr::after {
  content: '···';
}

.prose img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px;
  display: block;
}

/* Catch all embeddable content: iframes, videos, objects */
.prose iframe,
.prose video,
.prose object,
.prose embed {
  max-width: 100% !important;
  height: auto;
}

/* Images with explicit width/style attributes — override to fit container */
.prose img[width],
.prose img[style] {
  width: auto;
  max-width: 100% !important;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95em;
}

.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.6em 0.8em;
  text-align: left;
}

.prose th {
  background: var(--bg-surface);
  font-family: var(--font-heading);
  font-weight: 600;
}

/* ===== Font family picker overrides ===== */

/* Lora — warm, humanist serif */
[data-font="lora"] .prose {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

/* Source Serif 4 — clean, editorial */
[data-font="source-serif"] .prose {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

/* Newsreader is the default (data-font="newsreader" or unset) */

/* ===== Collapsible Transcript ===== */
.prose details {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 1.5em 0;
}

.prose details summary {
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15em;
  padding: 0.6em 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
  color: var(--text);
  user-select: none;
}

.prose details summary::-webkit-details-marker { display: none; }

.prose details summary::before {
  content: '▶';
  font-size: 0.6em;
  opacity: 0.5;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.prose details[open] summary::before {
  transform: rotate(90deg);
}

.prose details[open] summary {
  margin-bottom: 0.5em;
}
