/*
By Sydney Lundberg and Victoria Mache
*/

body {
  font-family: "Lato", sans-serif;
  margin: 0;
  padding: 40px;
  background-color: #f9f9f9;
}

/* Title section */
h1 {
  text-align: center;
  margin-bottom: 10px;
}

.byline {
  text-align: center;
  color: #555;
  margin-bottom: 6px;
}

/* Container styling for charts */
#chart,
#chart-hist,
#chart-map {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto 40px auto;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Ensure all SVGs scale properly and don’t distort */
#chart svg,
#chart-hist svg,
#chart-map svg {
  display: block;
  margin: 0 auto;
  width: 100%;
  height: auto;
}

/* Map path styling */
#chart-map path {
  stroke: #fff;
  stroke-width: 0.5px;
}

/* Optional hover effect */
#chart-map path:hover {
  stroke: #000;
  stroke-width: 1px;
}

/* Tooltip styling */
.tooltip {
  position: absolute;
  text-align: center;
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 4px;
  pointer-events: none;
}

/* Legend styling */
.legend {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.legend-item rect {
  stroke: #ccc;
  stroke-width: 0.5px;
}

.legend-item text {
  font-size: 12px;
  fill: #333;
  margin-left: 4px;
}

.esa-marker {
  transition: fill 0.15s ease, stroke-width 0.15s ease;
}

.esa-marker:hover {
  fill: #444;
  stroke-width: 2px;
}

/* Slider controls for stacked area */
/* Simple, clean timeline slider */
.slider-controls {
  width: 100%;
  max-width: 900px;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Neutral label */
.slider-controls label {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #6b7280;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Year window pill */
.slider-value {
  min-width: 90px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #111827;
  color: #f9fafb;
}

/* Clean range slider */
.slider-controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  background: #d1d5db;          
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

/* Chrome/Safari thumb */
.slider-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  border: 2px solid #111827;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: 0.15s ease;
}

.slider-controls input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.07);
}

/* Firefox thumb */
.slider-controls input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  border: 2px solid #111827;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: 0.15s ease;
}

.slider-controls input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.07);
}

/* Firefox track */
.slider-controls input[type="range"]::-moz-range-track {
  height: 6px;
  background: #d1d5db;
  border-radius: 999px;
}

/* Play button */
.play-button {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #f9fafb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.play-button::before {
  content: "▶";
  font-size: 11px;
}

.play-button.is-playing::before {
  content: "❚❚";
}

.play-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.3);
  background: #020617;
}

.play-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

body {
  background-image: url("nature.jpg"); 
  background-size: cover;       
  background-repeat: no-repeat;  
  background-position: center;   
  background-attachment: fixed;  
  margin: 0;
  padding: 0;
}

/* Clean header block behind title + subtitle */
.page-header {
  background: white;
  padding: 20px 0;
  text-align: center;
  margin-bottom: 40px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
}

/* Title */
.page-header h1 {
  margin: 0;
  font-size: 28px;
  color: #111;
}

/* Subtitle */
.page-header .byline {
  margin-top: 6px;
  font-size: 14px;
  color: #555;
}

.process-book {
  margin-top: 6px;
  font-size: 14px;
  text-align: center;
}

.process-book a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

.process-book a:hover {
  text-decoration: underline;
}

svg text {
  font-family: "Lato", sans-serif;
}

#chart, #chart-hist, #chart-map {
  margin-bottom: 80px;
}

#top-states-summary {
  width: fit-content;
  margin: 0 auto 20px;
  padding: 14px 20px;
  background: white;
  border-radius: 12px;
  text-align: left;
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  font-size: 14px;
  line-height: 1.45;
}
.state-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.state-detail-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.4);
  max-width: 520px;
  width: 90%;
  padding: 24px 28px;
  font-size: 14px;
  line-height: 1.5;
}

.state-detail-card h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 20px;
}

.state-detail-card .stat-row {
  margin: 4px 0;
}

.state-detail-close {
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #f9fafb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.state-mini-chart-title {
  margin-top: 14px;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
}

.header-links {
  text-align: center;
  margin-top: 4px;
  font-size: 14px;
}

.header-links a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
  margin: 0 4px;
}

.header-links a:hover {
  text-decoration: underline;
}

.header-links .divider {
  color: #444;
  margin: 0 6px;
}