/* Reset & Base */
body.pique-interactive {
  font-family: var(--font-sans);
  color: var(--color-text-main);
  background-color: var(--color-bg);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* Header & Intro */
.article-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.75rem;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand-accent);
  margin-bottom: 0.5rem;
}

.title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--color-text-main);
  margin: 0 0 0.75rem;
}

.dek {
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  margin: 0 0 1.5rem;
  max-width: 920px;
}

.lead-media-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.lead-photo {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.lead-photo-caption {
  font-size: 0.8125rem;
  color: var(--color-text-faint);
  margin-top: 0.5rem;
  line-height: 1.35;
}

.lead-context {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.875rem 1rem;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-brand-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
  line-height: 1.25;
}

/* Nav Bar / Scene Tabs */
.scene-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
}

.scene-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.nav-tab {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-main);
  border-color: var(--color-border-strong);
}

.nav-tab.active {
  background: var(--color-brand-primary);
  color: #ffffff;
  border-color: var(--color-brand-primary);
}

/* Main Layout Grid */
.story-container {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 2.5rem;
  position: relative;
  align-items: start;
}

/* Narrative Flow (Left Column) */
.narrative-col {
  position: relative;
}

.scene-section {
  min-height: 85vh;
  padding: 2.5rem 0 3.5rem;
  border-bottom: 1px dashed var(--color-border);
}

.scene-section:last-child {
  border-bottom: none;
  min-height: 70vh;
}

.scene-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--color-accent-light);
  color: var(--color-brand-primary);
  margin-bottom: 0.5rem;
}

.scene-heading {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--color-text-main);
  margin: 0 0 0.875rem;
}

.scene-body {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.data-callout {
  background: var(--color-surface);
  border-left: 3px solid var(--color-brand-accent);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--color-text-main);
}

.data-callout strong {
  color: var(--color-brand-primary);
}

/* Visual Stage (Right Column) */
.stage-col {
  position: sticky;
  top: 3.75rem;
  height: calc(100vh - 4.75rem);
  max-height: 760px;
  min-height: 520px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stage-header {
  padding: 0.875rem 1.25rem 0.625rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex: 0 0 auto;
}

.stage-title {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0 0 0.25rem;
  line-height: 1.25;
}

.stage-meta {
  font-size: 0.75rem;
  color: var(--color-text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.meta-item strong {
  color: var(--color-text-muted);
}

.stage-legend {
  padding: 0.45rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  flex: 0 0 auto;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.stage-canvas-container {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.stage-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Tooltip */
.stage-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  line-height: 1.3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 40;
  max-width: 240px;
}

/* Footer / Statutory Notes */
.article-footer {
  margin-top: 3.5rem;
  border-top: 2px solid var(--color-border);
  padding-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem;
}

.footer-card h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.footer-card p, .footer-card ul {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0;
}

.footer-card ul {
  padding-left: 1.25rem;
}

.footer-card li {
  margin-bottom: 0.35rem;
}

/* Mobile Responsiveness */
@media (max-width: 820px) {
  #app {
    padding: 1rem 0.75rem 3rem;
  }
  
  .lead-media-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .story-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  
  .stage-col {
    position: sticky;
    top: 3rem;
    height: 52vh;
    min-height: 420px;
    max-height: 480px;
    z-index: 25;
    width: 100%;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  }
  
  .stage-header {
    padding: 0.6rem 0.875rem 0.4rem;
  }
  
  .stage-title {
    font-size: 0.9375rem;
  }
  
  .stage-meta {
    display: none; /* Keep mobile header clean and compact */
  }
  
  .stage-legend {
    padding: 0.35rem 0.875rem;
    gap: 0.875rem;
    font-size: 0.7rem;
  }
  
  .narrative-col {
    order: 2;
    width: 100%;
  }
  
  .scene-section {
    min-height: 65vh;
    padding: 1.5rem 0 2.25rem;
  }
  
  .title {
    font-size: 1.625rem;
  }
  
  .dek {
    font-size: 0.9375rem;
  }
}
