/* Columbus Street Tree Interactive Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Intro */
.interactive-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, var(--color-surface-subtle) 0%, var(--color-bg) 100%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-brand-forest-light);
  margin-bottom: 0.75rem;
}

.eyebrow-badge {
  background-color: var(--color-brand-leaf-subtle);
  color: var(--color-brand-forest);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.interactive-title {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

.interactive-deck {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--color-text-secondary);
  max-width: 840px;
  margin-bottom: 1.5rem;
}

/* Photo & Easement Explainer */
.easement-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  margin: 2rem 0;
}

@media (max-width: 768px) {
  .easement-card {
    grid-template-columns: 1fr;
  }
}

.easement-image-wrap {
  position: relative;
  min-height: 240px;
  background: #e2ece6;
}

.easement-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.easement-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 22, 18, 0.88);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.35;
}

.easement-caption span {
  color: #a3b8ab;
}

.easement-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.easement-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text-primary);
}

.easement-body p {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.easement-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.easement-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--color-surface-elevated);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
}

/* Story Scenes */
.scene-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.scene-header {
  margin-bottom: 1.75rem;
}

.scene-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-brand-forest-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.scene-heading {
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.scene-subheading {
  font-size: 1rem;
  color: var(--color-text-secondary);
  max-width: 800px;
}

.data-context-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.data-context-item strong {
  color: var(--color-text-primary);
}

/* Scene 1: Status Breakdown Cards & Progress */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.status-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.status-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.status-card-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.status-card.workorder .status-card-stripe { background: var(--color-status-workorder); }
.status-card.closed .status-card-stripe { background: var(--color-status-closed); }
.status-card.received .status-card-stripe { background: var(--color-status-received); }
.status-card.canceled .status-card-stripe { background: var(--color-status-canceled); }
.status-card.reassigned .status-card-stripe { background: #8b5cf6; }

.status-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.35rem;
}

.status-card-count {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

.status-card-share {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.25rem;
  color: var(--color-text-muted);
}

.status-card-desc {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.75rem;
  line-height: 1.4;
  border-top: 1px dashed var(--color-border);
  padding-top: 0.6rem;
}

.progress-bar-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-subtle);
}

.progress-bar-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stacked-bar {
  display: flex;
  height: 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-subtle);
}

.bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  transition: width 0.4s ease;
  overflow: hidden;
  white-space: nowrap;
}

.bar-segment.workorder { background: var(--color-status-workorder); }
.bar-segment.closed { background: var(--color-status-closed); }
.bar-segment.received { background: var(--color-status-received); }
.bar-segment.canceled { background: var(--color-status-canceled); }
.bar-segment.reassigned { background: #8b5cf6; }

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Scene 2: Neighborhood Comparison */
.neighborhood-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.btn-group {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}

.filter-btn {
  border: none;
  background: transparent;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.filter-btn:hover {
  background: var(--color-surface-elevated);
}

.filter-btn.active {
  background: var(--color-brand-forest);
  color: #ffffff;
}

.sort-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.sort-select {
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
}

.neighborhood-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.neighborhood-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.neighborhood-table th {
  background: var(--color-surface-elevated);
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.neighborhood-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: middle;
}

.neighborhood-table tr:hover {
  background-color: var(--color-surface-subtle);
}

.cell-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-text-muted);
  width: 48px;
}

.cell-neighborhood {
  font-weight: 600;
  min-width: 150px;
}

.community-pill {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  margin-left: 0.5rem;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.mini-bar-cell {
  min-width: 180px;
}

.mini-bar-track {
  display: flex;
  height: 14px;
  background: var(--color-surface-elevated);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.mini-bar-track > div {
  height: 100%;
}

.mini-bar-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.cell-response-time {
  min-width: 140px;
  white-space: nowrap;
}

.response-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.response-badge.faster {
  background: var(--color-status-closed-bg);
  color: var(--color-status-closed);
}

.response-badge.neutral {
  background: var(--color-surface-elevated);
  color: var(--color-text-secondary);
}

.response-badge.slower {
  background: #fef2f2;
  color: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  .response-badge.slower {
    background: #371717;
    color: #f87171;
  }
}

.response-benchmark {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 0.2rem;
}

/* Mobile responsive reflow for neighborhood list */
@media (max-width: 680px) {
  .neighborhood-table thead {
    display: none;
  }
  .neighborhood-table, .neighborhood-table tbody, .neighborhood-table tr, .neighborhood-table td {
    display: block;
    width: 100%;
  }
  .neighborhood-table tr {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
    position: relative;
  }
  .neighborhood-table td {
    padding: 0.2rem 0;
    border: none;
  }
  .neighborhood-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
  }
  .neighborhood-mobile-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text-primary);
  }
  .neighborhood-mobile-rank {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-surface-elevated);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
  }
  .neighborhood-mobile-total {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--color-brand-forest);
  }
  .neighborhood-mobile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--color-border-subtle);
  }
}

/* Scene 3: Geospatial Map */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

.map-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  position: relative;
}

.map-toolbar {
  padding: 0.75rem 1rem;
  background: var(--color-surface-elevated);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.map-toolbar-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.map-chip {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.map-chip.active {
  background: var(--color-brand-forest);
  color: #ffffff;
  border-color: var(--color-brand-forest);
}

.map-chip.workorder.active {
  background: var(--color-status-workorder);
  border-color: var(--color-status-workorder);
}

.map-chip.closed.active {
  background: var(--color-status-closed);
  border-color: var(--color-status-closed);
}

.map-chip.received.active {
  background: var(--color-status-received);
  border-color: var(--color-status-received);
}

/* Map legend inside map card */
.map-inmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 0.4rem 0 0.1rem;
  border-top: 1px solid var(--color-border-subtle);
}

.map-inmap-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

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

.map-stage-container {
  position: relative;
  width: 100%;
  height: 520px;
  background: #f0f5f2;
}

@media (prefers-color-scheme: dark) {
  .map-stage-container {
    background: #111a14;
  }
}

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

.map-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  fill: var(--color-text-primary);
  paint-order: stroke fill;
  stroke: var(--color-surface);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  pointer-events: none;
}

.map-river-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  fill: #1d4ed8;
  paint-order: stroke fill;
  stroke: var(--color-surface);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .map-label {
    stroke: #111a14;
    fill: #ecf3ee;
  }
  .map-river-label {
    stroke: #111a14;
    fill: #60a5fa;
  }
}

.map-side-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-subtle);
}

.map-side-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: 0.5rem;
}

.map-detail-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-elevated);
}

.map-detail-case {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-brand-forest-light);
  margin-bottom: 0.35rem;
}

.map-detail-address {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.map-detail-community {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.map-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  padding: 0.25rem 0;
  border-top: 1px dashed var(--color-border);
}

.map-detail-label {
  color: var(--color-text-muted);
}

.map-detail-value {
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Quick neighborhood buttons */
.quick-hood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.quick-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-chip:hover, .quick-chip.active {
  background: var(--color-brand-leaf-subtle);
  color: var(--color-brand-forest);
  border-color: var(--color-brand-leaf);
}

/* Map tooltip */
.map-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  max-width: 250px;
}

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

/* Caveats Section */
.caveats-section {
  padding: 2.5rem 0;
  background: var(--color-surface-subtle);
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
}

.caveats-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.caveats-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.caveats-text {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.caveats-text p:not(:last-child) {
  margin-bottom: 0.75rem;
}

/* Accessibility & Reduced Motion */
@media (prefers-reduced-motion: reduce), (update: slow) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html[data-pique-reduced-motion="reduce"] * {
  animation: none !important;
  transition: none !important;
}

/* Focus outlines */
button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--color-brand-leaf);
  outline-offset: 2px;
}

/* Mobile responsive reflows */
@media (max-width: 600px) {
  .interactive-title {
    font-size: 1.6rem;
  }
  .data-context-bar {
    flex-direction: column;
    gap: 0.5rem;
  }
  .neighborhood-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-group {
    width: 100%;
  }
  .filter-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }
  .map-stage-container {
    height: 400px;
  }
}
