/**
 * Story Map — D3 swimlane timeline visualization
 */

/* Break out of the 740px content-area constraint */
.node-type-page:has(.story-map-page) .content-area {
  max-width: 100%;
  padding: 0 var(--sf-space-md);
}

.story-map-page {
  max-width: 100%;
}

.story-map-header {
  text-align: center;
  margin-bottom: var(--sf-space-xl);
}

.story-map-title {
  font-family: var(--sf-font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  margin: 0 0 var(--sf-space-sm);
}

.story-map-subtitle {
  font-size: 0.85rem;
  color: var(--sf-muted);
}

/* SVG container */
.story-map-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.story-map-container svg {
  display: block;
}

/* Era bands — opaque pastel fills (colors set in JS) */
.era-band {
  opacity: 1;
}

/* Swimlane labels */
.swimlane-label {
  font-family: var(--sf-font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  fill: var(--sf-muted);
}

/* Stop markers */
.stop-line {
  stroke: var(--sf-border);
  stroke-dasharray: 4 3;
  stroke-width: 1;
}

.stop-label {
  font-family: var(--sf-font-mono);
  font-size: 9px;
  fill: var(--sf-muted);
  text-anchor: middle;
}

/* Node dots */
.node-dot {
  cursor: pointer;
  transition: r 150ms ease, opacity 150ms ease;
}

.node-dot:hover {
  r: 7;
}

.node-dot--visited {
  opacity: 1;
}

.node-dot--unvisited {
  opacity: 0.7;
}

/* Connection lines */
.connection-line {
  stroke-width: 0.8;
  opacity: 0.3;
  fill: none;
}

.connection-line--cross {
  stroke-width: 0.5;
  opacity: 0.12;
  stroke-dasharray: 3 2;
}

/* Tooltip */
.map-tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--sf-dark-surface, #0a1a1a);
  color: var(--sf-text, #eee);
  border: 1px solid var(--sf-border);
  padding: 8px 12px;
  font-family: var(--sf-font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  max-width: 240px;
  z-index: 100;
  opacity: 0;
  transition: opacity 100ms ease;
  border-radius: 2px;
}

.map-tooltip.visible {
  opacity: 1;
}

.map-tooltip-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.map-tooltip-meta {
  color: var(--sf-muted);
  font-size: 0.65rem;
}

/* Back link */
.story-map-nav {
  margin-top: var(--sf-space-lg);
  text-align: center;
}

.story-map-nav a {
  font-family: var(--sf-font-mono);
  font-size: 0.8rem;
  color: var(--sf-accent);
}

/* Legend */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sf-space-md);
  justify-content: center;
  margin-bottom: var(--sf-space-lg);
  font-family: var(--sf-font-mono);
  font-size: 0.7rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot--unvisited {
  background: none;
  border: 1.5px solid var(--sf-muted);
}

.legend-dot--visited {
  background: var(--sf-muted);
}

/* Hscroll only kicks in when SVG exceeds viewport (mobile) */
.story-map-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
