/* Interactive chart styles — supplements site /style.css */

.chart-host {
  position: relative;
  width: 100%;
  min-height: 200px;
  background: #ffffff;
  border: 1px solid #d8d0c0;
  border-radius: 4px;
  padding: 12px;
}

.chart-host-svg {
  width: 100%;
  overflow-x: auto;
}

.chart-host-svg svg {
  display: block;
  height: auto;
  max-width: 100%;
}

.chart-loading::before {
  content: "Loading chart…";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #666;
  font-size: 0.9rem;
  font-family: ui-serif, Georgia, serif;
  font-style: italic;
}

.chart-error {
  background: #faf8f5;
  border-color: #d8d0c0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dotted #ccc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: #46606b;
}

.chart-legend .legend-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend .swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.chart-legend .legend-sep {
  color: #999;
}

/* Dual-ramp legend for the heatmap — coral ramp for CAO, blue ramp for PIO */
.chart-legend-dual {
  margin-top: 14px;
  padding: 12px 0 0;
  border-top: 1px dotted #ccc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: #46606b;
}

.dual-legend-title {
  font-variant-caps: all-small-caps;
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  color: #46606b;
}

.dual-legend-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dual-bar {
  display: grid;
  grid-template-columns: 210px 1fr;
  align-items: center;
  gap: 14px;
}

.dual-bar-label {
  text-align: right;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dual-bar.cao .dual-bar-label { color: #a04848; }
.dual-bar.pio .dual-bar-label { color: #2c5f8a; }

.dual-bar-fill {
  height: 14px;
  border-radius: 2px;
  min-width: 60px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

.dual-bar.cao .dual-bar-fill {
  background: linear-gradient(to right, #f7e8e8, #b86564);
}
.dual-bar.pio .dual-bar-fill {
  background: linear-gradient(to right, #e7eff6, #4f7eaa);
}

.dual-bar-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  margin-left: 224px;
  font-size: 11px;
  color: #666;
}

@media (max-width: 600px) {
  .dual-bar {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .dual-bar-label {
    text-align: left;
  }
  .dual-bar-axis {
    margin-left: 0;
  }
}
