/**
 * Atlas Vertical – Transcript module
 * Collapsible transcript block and auto-generated Key Takeaways.
 */

/* -----------------------------------------------------------
   Key Takeaways (auto-generated from transcript text)
   ----------------------------------------------------------- */

.atlas-key-takeaways {
  border-left: 4px solid var(--color-accent);
  border-radius: 0 8px 8px 0;
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  background: var(--color-bg-alt);
}

.atlas-key-takeaways__title {
  margin: 0 0 var(--space-md);
  font-size: var(--font-size-lg);
  font-weight: 700;
  line-height: var(--line-height-tight);
}

.atlas-key-takeaways__list {
  margin: 0;
  padding-left: var(--space-lg);
}

.atlas-key-takeaways__list li {
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

.atlas-key-takeaways__list li:last-child {
  margin-bottom: 0;
}

/* -----------------------------------------------------------
   Transcript module (collapsible)
   ----------------------------------------------------------- */

.atlas-transcript-module {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin: var(--space-xl) 0;
  background: var(--color-bg-alt);
  overflow: hidden;
}

/* Header row: heading + toggle */
.atlas-transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
}

.atlas-transcript-heading {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

/* Toggle button */
.atlas-transcript-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: var(--space-xs) var(--space-md);
  font-family: inherit;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-accent);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background-color 0.2s;
}

.atlas-transcript-toggle:hover {
  border-color: var(--color-accent);
  background: rgba(0, 102, 204, 0.05);
}

[data-theme="dark"] .atlas-transcript-toggle:hover {
  background: rgba(77, 159, 255, 0.1);
}

.atlas-transcript-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Collapsed content — max-height is set by JS to the actual scrollHeight
   for a proportional transition; falls back to 0 when collapsed. */
.atlas-transcript-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
  padding: 0 var(--space-lg);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
  white-space: pre-wrap;
}

/* Expanded content — JS sets max-height to scrollHeight, then to 'none'
   after transition completes so content reflows naturally. */
.atlas-transcript-module.is-open .atlas-transcript-content {
  padding: 0 var(--space-lg) var(--space-lg);
}

/* Paragraphs inside transcripts */
.atlas-transcript-content p {
  margin: 0 0 var(--space-md);
}

.atlas-transcript-content p:last-child {
  margin-bottom: 0;
}

/* Reduced motion: skip the transition, instant reveal */
@media (prefers-reduced-motion: reduce) {
  .atlas-transcript-content {
    transition: none;
  }

  .atlas-transcript-module.is-open .atlas-transcript-content {
    max-height: none !important;
  }
}
