/* assets/dataset_page.css */
/* Scrollytelling dataset page styles. Cohesive with the coldparse arctic dark theme. */

/* ── Scroll reveal ───────────────────────────────────────── */
@keyframes ds-reveal {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ds-section {
  opacity: 0;
  animation: ds-reveal 0.7s ease forwards;
  min-height: 60vh;
  padding: 5rem 3rem 4rem;
  border-bottom: 1px solid #1a2a3a;
  max-width: 1100px;
  margin: 0 auto;
}

/* Stagger each section */
.ds-section:nth-child(1) { animation-delay: 0.05s; }
.ds-section:nth-child(2) { animation-delay: 0.15s; }
.ds-section:nth-child(3) { animation-delay: 0.25s; }
.ds-section:nth-child(4) { animation-delay: 0.35s; }

/* ── Section marker ──────────────────────────────────────── */
.ds-section-marker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.ds-section-line {
  display: block;
  width: 40px;
  height: 1px;
  background: #7dd4fc;
  flex-shrink: 0;
}

.ds-section-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: #7dd4fc;
  text-transform: uppercase;
}

/* ── Introduction ────────────────────────────────────────── */
.ds-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #e8f4fd;
  margin: 0 0 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.ds-meta-row {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.ds-kv {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ds-kv-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #4a7a9b;
  text-transform: uppercase;
}

.ds-kv-value {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: #a8c4d8;
}

.ds-context {
  font-size: 1rem;
  color: #7a9eb8;
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 2.5rem;
}

.ds-question-block {
  border-left: 2px solid #7dd4fc;
  padding: 1rem 1.5rem;
  background: rgba(125, 212, 252, 0.04);
  max-width: 680px;
}

.ds-question-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: #7dd4fc;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
}

.ds-question-text {
  font-size: 1.1rem;
  color: #c8dff0;
  line-height: 1.6;
  margin: 0;
  font-style: italic;
}

/* ── Cards ───────────────────────────────────────────────── */
.ds-card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ds-card {
  background: #0d1821;
  border: 1px solid #1a2a3a;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.ds-card-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: #4a7a9b;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.ds-card-body {
  font-size: 0.9rem;
  color: #a8c4d8;
}

.ds-card-note {
  font-size: 0.75rem;
  color: #4a7a9b;
  font-style: italic;
  margin-bottom: 0.75rem;
}

/* ── Repair ──────────────────────────────────────────────── */
.ds-repair-step {
  border-left: 1px solid #1a2a3a;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}

.ds-repair-step:hover {
  border-color: #7dd4fc;
}

.ds-repair-step-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: #7dd4fc;
  margin: 0 0 0.6rem;
  letter-spacing: 0.05em;
}

.ds-repair-explanation {
  color: #7a9eb8;
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0 0 1rem;
  max-width: 680px;
}

/* ── Delta indicators ────────────────────────────────────── */
.ds-delta-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ds-delta {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  gap: 0.5rem;
  min-width: 0;
}

.ds-delta-label { color: #4a7a9b; }
.ds-delta-raw   { color: #a8c4d8; text-align: right; }
.ds-delta-arrow { text-align: center; font-size: 0.9rem; }
.ds-delta-clean { color: #a8c4d8; }

.ds-delta-good  .ds-delta-arrow { color: #34d399; }
.ds-delta-warn  .ds-delta-arrow { color: #f59e0b; }
.ds-delta-neutral .ds-delta-arrow { color: #4a7a9b; }
.ds-delta-good  .ds-delta-clean { color: #34d399; }
.ds-delta-warn  .ds-delta-clean { color: #f59e0b; }

/* ── Findings ────────────────────────────────────────────── */
.ds-finding {
  margin-bottom: 4rem;
}

.ds-finding-header {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.ds-finding-number {
  font-family: 'Space Mono', monospace;
  font-size: 2rem;
  color: #1a2a3a;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.ds-finding-question {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #c8dff0;
  margin: 0;
  line-height: 1.3;
}

.ds-finding-narrative {
  color: #7a9eb8;
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 0 1.5rem;
  border-left: 2px solid #1a2a3a;
  padding-left: 1rem;
}

.ds-chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}

/* ── No data state ───────────────────────────────────────── */
.ds-no-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem;
  color: #4a7a9b;
  text-align: center;
}

.ds-no-data-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #f59e0b;
}

.ds-no-data-hint {
  font-size: 0.8rem;
  color: #2a4a6b;
  font-style: italic;
}

.ds-empty-note {
  font-size: 0.8rem;
  color: #4a7a9b;
  font-style: italic;
}

/* ── Page container ──────────────────────────────────────── */
.ds-page {
  padding-bottom: 6rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .ds-section {
    padding: 3rem 1.25rem 2.5rem;
  }

  .ds-delta {
    grid-template-columns: 140px 60px 20px 60px;
    font-size: 0.7rem;
  }

  .ds-chart-row {
    grid-template-columns: 1fr;
  }
}

/* ── Repair comparison renderers ─────────────────────────── */

/* Stats comparison */
.ds-comparison-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.ds-comparison-stats .ds-card {
  margin-bottom: 0;
}

/* Value counts side-by-side */
.ds-comparison-vc {
  margin-top: 0.75rem;
}

.ds-vc-block {
  margin-bottom: 1.5rem;
}

.ds-vc-col-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #7dd4fc;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
}

.ds-vc-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ds-vc-side-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #4a7a9b;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.35rem;
}

/* Chart pairs side-by-side */
.ds-comparison-charts {
  margin-top: 0.75rem;
}

.ds-repair-chart-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Responsive — stack on small screens */
@media (max-width: 768px) {
  .ds-vc-tables,
  .ds-repair-chart-pair {
    grid-template-columns: 1fr;
  }
}

/* ── Duplicates card — horizontal layout ─────────────────── */
.ds-dupe-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.ds-dupe-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ds-dupe-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #4a7a9b;
  text-transform: uppercase;
}

.ds-dupe-value {
  font-family: 'Space Mono', monospace;
  font-size: 1.4rem;
  color: #e8f4fd;
  line-height: 1;
}

.ds-dupe-pct {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: #7dd4fc;
}

/* ── Framed delta group ───────────────────────────────────── */
.ds-delta-framed {
  border: 1px solid #1a2a3a;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  background: #070d14;
  margin-top: 0.5rem;
}