/* Gresp hero animation -- multi-domain regional demand map.
   Real historical data for 3 domains (England epidemic surveillance,
   pharmacy prescribing, taxi demand), switchable via tabs. See
   static/js/gnn-animation.js for the mount logic and
   scripts/build_hero_preview.py for where the data comes from. */

.gnn-visual-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  border-radius: 32px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(17, 17, 17, 0.06);
  box-shadow: var(--shadow);
  padding: 20px 20px 24px;
}

.gnn-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.gnn-tab {
  border: none;
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  background: transparent;
  color: #3a4241;
}

.gnn-tab.active {
  background: #1f1f1f;
  color: #fff;
}

.gnn-map-wrap {
  position: relative;
  margin-top: 16px;
}

.gnn-map-svg {
  width: 100%;
  height: auto;
  display: block;
}

.gnn-cell {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3;
  transition: fill 200ms ease;
}

.gnn-link {
  fill: none;
  stroke: rgba(17, 17, 17, 0.38);
  stroke-width: 1.6;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}

.gnn-node circle {
  cursor: pointer;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 3;
  filter: drop-shadow(0 6px 10px rgba(17, 17, 17, 0.2));
  transition: fill 200ms ease, stroke-width 160ms ease;
}

.gnn-node:hover circle.fill,
.gnn-node.selected circle.fill {
  stroke-width: 5;
}

.gnn-node circle.ring {
  fill: none;
  stroke: #1f1f1f;
  stroke-width: 2.5;
  opacity: 0;
}

.gnn-node.selected circle.ring {
  opacity: 1;
}

.gnn-node-count {
  font-size: 10.5px;
  font-weight: 900;
  fill: #ffffff;
  text-anchor: middle;
  pointer-events: none;
}

.gnn-node-count.on-light {
  fill: #111111;
}

.gnn-legend {
  position: absolute;
  right: 14px;
  top: 112px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  backdrop-filter: blur(10px);
}

.gnn-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2d3534;
  font-size: 10.5px;
  font-weight: 700;
}

.gnn-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.gnn-chip-row {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.gnn-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #1f2a24;
  font-size: 11.5px;
  font-weight: 700;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.gnn-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.18);
}

.gnn-slider-wrap {
  margin-top: 18px;
  padding: 0 4px;
}

.gnn-slider-track {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.1);
  cursor: pointer;
  padding: 10px 0;
  margin: -10px 0;
  background-clip: content-box;
}

.gnn-slider-fill {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  border-radius: 999px;
  background: var(--accent);
  pointer-events: none;
}

.gnn-slider-handle {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 3px 8px rgba(17, 17, 17, 0.25);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
}

.gnn-slider-handle:active {
  cursor: grabbing;
}

.gnn-slider-ticks {
  position: relative;
  height: 6px;
  margin-top: 5px;
  pointer-events: none;
}

.gnn-slider-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 6px;
  background: rgba(17, 17, 17, 0.2);
  transform: translateX(-50%);
}

.gnn-slider-tick.on {
  background: var(--accent);
  height: 8px;
}

.gnn-slider-endlabels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}

.gnn-slider-caption {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.gnn-city-panel {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 236px;
  z-index: 5;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(17, 17, 17, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 36px rgba(17, 17, 17, 0.14);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.gnn-city-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.gnn-city-panel-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 3px;
}

.gnn-city-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
}

.gnn-city-panel-header h4 {
  margin: 0;
  flex: 1;
  color: #111111;
  font-size: 13.5px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gnn-city-panel-sub {
  color: #5d6463;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 5px 0 18px;
}

.gnn-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  height: 78px;
  overflow: visible;
}

.gnn-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex: 1;
}

.gnn-bar-val {
  font-size: 8px;
  font-weight: 800;
  color: #343a3a;
}

.gnn-bar {
  width: 100%;
  max-width: 18px;
  border-radius: 4px 4px 2px 2px;
  background: var(--accent);
  transition: height 240ms ease;
}

.gnn-bar-day {
  font-size: 8px;
  color: #5d6463;
  font-weight: 700;
}

.gnn-city-panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
  font-size: 10.5px;
  color: #5d6463;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.gnn-city-panel-footer strong {
  font-size: 13.5px;
  color: #111;
}

@media (max-width: 768px) {
  .gnn-visual-card { max-width: 100%; }
  .gnn-legend { display: none; }
  .gnn-city-panel { width: calc(100% - 28px); }
  /* The chip row is a fixed-size overlay, but the SVG (and its node
     positions) scales down with the card -- without this, the top node
     row can end up partly behind the chips on a narrow phone. Padding
     (not the SVG's own margin-top, which collapses through this
     no-border/no-padding parent and just drags the chips down with it)
     actually creates the gap. */
  .gnn-map-wrap { padding-top: 44px; }
}
