/* ═══════════════════════════════════════════════════
   AI Adoption Chart — blog.dech.app
   Horizontal bar chart, scroll-animated, theme-aware
   ═══════════════════════════════════════════════════ */

.adoption-chart {
  margin: var(--space-xl) 0;
  padding: var(--space-lg) 0;
}

.adoption-chart__title {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.adoption-chart__subtitle {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: -0.75rem;
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

/* ─── Bar rows ─── */
.chart-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.chart-bar__label {
  font-size: 1.1rem;
  width: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.chart-bar__flag {
  font-size: 1rem;
  line-height: 1;
}

.chart-bar__track {
  flex: 1;
  height: 28px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.chart-bar__name {
  position: absolute;
  right: 8px;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.85;
  pointer-events: none;
  white-space: nowrap;
}

.chart-bar__fill {
  height: 100%;
  border-radius: 4px;
  background: var(--text-accent);
  opacity: 0.7;
  width: 0%;
  transition: none;
}

/* Highlighted bar (U.S.) */
.chart-bar--highlight .chart-bar__fill {
  background: var(--text-muted);
  opacity: 0.9;
}

.chart-bar--highlight .chart-bar__label {
  font-weight: 700;
  color: var(--text-primary);
}

.chart-bar__value {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 2rem;
  opacity: 0;
  transition: none;
}

/* ─── Animated state ─── */
.adoption-chart.animate .chart-bar__fill {
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.adoption-chart.animate .chart-bar__value {
  opacity: 1;
  transition: opacity 0.4s ease 0.6s;
}

.adoption-chart.animate .chart-bar:nth-child(1) .chart-bar__fill {
  transition-delay: 0ms;
}

.adoption-chart.animate .chart-bar:nth-child(2) .chart-bar__fill {
  transition-delay: 80ms;
}

.adoption-chart.animate .chart-bar:nth-child(3) .chart-bar__fill {
  transition-delay: 160ms;
}

.adoption-chart.animate .chart-bar:nth-child(4) .chart-bar__fill {
  transition-delay: 240ms;
}

.adoption-chart.animate .chart-bar:nth-child(5) .chart-bar__fill {
  transition-delay: 320ms;
}

.adoption-chart.animate .chart-bar:nth-child(6) .chart-bar__fill {
  transition-delay: 400ms;
}

.adoption-chart.animate .chart-bar:nth-child(7) .chart-bar__fill {
  transition-delay: 480ms;
}

.adoption-chart.animate .chart-bar:nth-child(8) .chart-bar__fill {
  transition-delay: 560ms;
}

.adoption-chart.animate .chart-bar:nth-child(9) .chart-bar__fill {
  transition-delay: 640ms;
}

/* ─── Source line ─── */
.adoption-chart__source {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: var(--space-md);
  line-height: 1.6;
}

.adoption-chart__source a {
  color: var(--text-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.adoption-chart__source a:hover {
  border-bottom-color: var(--text-link);
}


/* ─── Responsive ─── */
@media (max-width: 480px) {
  .chart-bar__label {
    width: 22px;
    font-size: 1rem;
  }

  .chart-bar__name {
    font-size: 0.65rem;
  }

  .chart-bar__track {
    height: 22px;
  }

  .chart-bar__value {
    font-size: 0.72rem;
    min-width: 1.6rem;
  }
}


/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  .adoption-chart.animate .chart-bar__fill {
    transition: none;
  }

  .adoption-chart.animate .chart-bar__value {
    transition: none;
    opacity: 1;
  }
}