/* Pesticide Exposure & Respiratory Health — site styles */

:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --border: #30363d;
  --success: #3fb950;
  --warning: #d29922;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.site-header h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.tagline {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Main content */
main {
  flex: 1;
  padding-bottom: 3rem;
}

main section {
  margin-bottom: 2rem;
}

main h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--text);
}

main ul {
  margin: 0 0 1rem 0;
  padding-left: 1.25rem;
}

main li {
  margin-bottom: 0.5rem;
}

main p {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
}

.cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.cta p {
  margin-bottom: 1rem;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

.button:hover {
  background: var(--accent-hover);
}

.disclaimer p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Map page */
.map-page .container {
  max-width: 100%;
  padding: 0 1rem;
}

.map-header {
  margin-bottom: 1rem;
}

.map-header h1 {
  font-size: 1.35rem;
  margin: 0 0 0.25rem 0;
}

.map-header p {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
}

.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;
}

.map-toolbar-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.map-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  min-width: 220px;
  cursor: pointer;
}

.map-search,
.map-state,
.map-download {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.map-search-input {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  min-width: 260px;
}

.map-search-input:focus {
  border-color: var(--accent);
  outline: none;
}

.map-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.map-btn:hover,
.map-btn:focus {
  border-color: var(--accent);
  outline: none;
}

.map-select:hover,
.map-select:focus {
  border-color: var(--accent);
  outline: none;
}

.map-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

/* Map + “what to do next” sidebar */
.map-layout {
  display: grid;
  gap: 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

.map-main {
  min-width: 0;
}

.map-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
  position: sticky;
  top: 1rem;
}

.map-sidebar-heading {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  line-height: 1.35;
  color: var(--text);
}

.map-sidebar-intro {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.map-sidebar-resources {
  list-style: none;
  margin: 0;
  padding: 0;
}

.map-sidebar-resources li {
  margin: 0 0 0.55rem 0;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.map-sidebar-resources li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.map-resource-label {
  font-weight: 600;
  color: var(--text);
}

.map-resource-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  word-break: break-word;
}

.map-resource-link:hover,
.map-resource-link:focus {
  color: var(--accent-hover);
  text-decoration: underline;
}

@media (min-width: 960px) {
  .map-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  }
}

@media (max-width: 959px) {
  .map-sidebar {
    position: static;
    order: 1;
  }

  .map-main {
    order: 0;
  }
}

#map {
  width: 100%;
  height: 70vh;
  min-height: 400px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.map-legend {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.map-legend strong {
  color: var(--text);
}

.map-legend-meta {
  margin: 0.65rem 0 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.info-panel {
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  min-width: 180px;
}

.info-panel h3 {
  margin: 0 0 0.35rem 0;
  font-size: 0.95rem;
}

.info-panel p {
  margin: 0 0 0.35rem 0;
  color: var(--text-muted);
}

.info-panel p:last-child {
  margin-bottom: 0;
}

.info-panel .fips {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.info-panel .muted {
  font-size: 0.85rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-top: auto;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer code {
  background: var(--surface);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Model specifics page */
.model-specifics-page {
  max-width: 920px;
}

.model-specifics-page .intro h2 {
  margin-top: 0;
}

.model-section {
  margin-bottom: 2.5rem;
}

.model-section h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.h3-compact {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem 0;
  color: var(--text);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.75rem 0 1rem 0;
}

.spec-table th,
.spec-table td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.spec-table th[scope="row"] {
  width: 11rem;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.metrics-table thead th {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.metrics-table tbody td {
  color: var(--text-muted);
}

.doc-links {
  list-style: none;
  padding-left: 0;
}

.doc-links li {
  margin-bottom: 1rem;
}

.doc-desc {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.model-figure {
  margin: 1rem 0 2rem 0;
}

.model-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Model specifics: keep large PNGs readable without dominating the viewport */
main.model-specifics-page.container {
  max-width: min(100vw - 2.5rem, 52rem);
}

.model-specifics-page .model-figure {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.model-specifics-page .model-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 640px);
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-sizing: border-box;
}

/* Inline equity SVG: explicit width/aspect avoids collapse when embedded in HTML */
.model-specifics-page .model-figure svg.equity-gap-chart {
  display: block;
  width: 100%;
  max-width: 1040px;
  height: auto;
  aspect-ratio: 1040 / 559;
  max-height: min(72vh, 640px);
  margin-left: auto;
  margin-right: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-sizing: border-box;
}

.model-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.muted-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.model-specifics-page code {
  background: var(--surface);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
}
