:root {
  --ink: #1b1b1b;
  --paper: #f7f7f5;
  --civic-blue: #0057b8;
  --civic-blue-dark: #003d82;
  --compost-green: #3f7d3f;
  --compost-green-dark: #2e5e2e;
  --ewaste-teal: #1f7a72;
  --ewaste-teal-dark: #145a54;
  --line: #dcdcd8;
  --radius: 10px;
  --content-max: 1100px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Work Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

/* Header */
.site-header {
  background: var(--civic-blue);
  color: white;
  padding: 24px 20px;
}
.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-mark {
  font-weight: 800;
  font-size: 1.1rem;
  background: white;
  color: var(--civic-blue);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.brand-name {
  font-size: 1.4rem;
  font-weight: 700;
}
.tagline {
  margin: 6px 0 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Hero */
.hero {
  max-width: var(--content-max);
  margin: 16px auto 0;
  padding: 0 20px;
  text-align: center;
}
.hero-title {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--civic-blue);
}
.hero-icon {
  display: inline-block;
  width: 80px;
  height: 80px;
  /* margin-left: 8px; */
}

.hero-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-icon object {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
.hero-subhead {
  margin: 8px 0 0;
  font-size: 1.2rem;
  color: #555;
}

/* Filter bar */
.filter-bar {
  max-width: var(--content-max);
  margin: 20px auto 0;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-group label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #555;
}
select, input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.95rem;
  min-width: 180px;
}
.toggles {
  flex-direction: row;
  gap: 10px;
  align-items: center;
}
.toggle-label {
  position: relative;
  cursor: pointer;
}
.toggle-label input {
  position: absolute;
  opacity: 0;
}
.toggle-pill {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid var(--line);
  color: #777;
  background: white;
  transition: all 0.15s ease;
}
.toggle-pill.food {
  border-color: var(--compost-green);
}
.toggle-pill.electronics {
  border-color: var(--civic-blue-dark);
}
.toggle-label input:checked + .toggle-pill.food {
  background: var(--compost-green);
  border-color: var(--compost-green-dark);
  color: white;
}
.toggle-label input:checked + .toggle-pill.electronics {
  background: var(--civic-blue);
  border-color: var(--civic-blue-dark);
  color: white;
}

/* Results area: map + list */
.results-area {
  max-width: var(--content-max);
  margin: 16px auto 40px;
  /* padding: 16px 20px; */
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
#map {
  height: 560px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Map legend control */
.map-legend {
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.legend-dot.food { background: var(--compost-green); }
.legend-dot.electronics { background: var(--civic-blue); }

/* Map marker pin: simple colored dot, matching the legend dot style */
.marker-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.results-list {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  height: 560px;
  overflow-y: auto;
}
.results-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  padding: 4px 6px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
#results-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.result-card {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid transparent;
}
.result-card:hover {
  background: #f2f2f0;
  border-color: var(--line);
}
.card-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.card-icon.food { background: #e5f0e5; }
.card-icon.electronics { background: #e2edfa; }
.card-main {
  flex: 1;
  min-width: 0;
}
.result-card .card-name {
  font-weight: 550;
  font-size: 1rem;
  color: #1b1b1b;
}
.card-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #e6e6e4;
  color: #1a4b8c;
}
.tag-type.food {
  background: #e1f0e1;
  color: var(--compost-green-dark);
}
.tag-type.electronics {
  background: #dfeaf9;
  color: var(--civic-blue-dark);
}

/* About section */
.about-section {
  max-width: var(--content-max);
  margin: 16px auto 40px;
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: 'Work Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
}
.about-title {
  margin: 0 0 12px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--civic-blue);
}
.about-section p {
  margin: 0 0 12px;
  line-height: 1.5;
}
.about-section p:last-child {
  margin-bottom: 0;
}
.about-section a {
  color: var(--civic-blue);
}
.about-section a:hover,
.about-section a:focus-visible {
  color: var(--civic-blue-dark);
}

.site-footer {
  width: 100%;
  background: var(--civic-blue);
  padding: 20px 0;
  box-sizing: border-box;
}
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  /* padding: 0 20px; */
}
.footer-brand {
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--paper);
  margin: 0;
  flex: 0 0 auto;
}
.footer-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--paper);
  text-align: right;
  flex: 1 1 auto;
}
.footer-note a {
  color: var(--paper);
  text-decoration: underline;
}

@media (max-width: 760px) {
  .results-area {
    grid-template-columns: 1fr;
  }
  #map, .results-list {
    height: 420px;
  }
}

/* Detail card: shown inline inside #results-list in place of the list view */
.detail-card[hidden] {
  display: none;
}
.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.detail-back {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--civic-blue-dark);
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  padding: 0;
}
.detail-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.detail-name {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1b1b1b;
}
.detail-address {
  margin: 0 0 10px;
  color: #555;
}
.detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tag-zip {
  background: #e6e6e4;
  color: #555;
}
.detail-divider {
  border-top: 1px solid var(--line);
  margin-bottom: 16px;
}
.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.detail-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.detail-neighborhood {
  margin-top: 16px;
}
.detail-row-icon {
  font-size: 16px;
  line-height: 1.4;
}
.detail-row-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--civic-blue-dark);
}
.detail-row-value {
  color: var(--ink);
}
.detail-app-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.detail-app-link {
  color: var(--civic-blue);
  text-decoration: underline;
}
.detail-app-link:hover,
.detail-app-link:focus-visible,
.detail-app-link:active {
  color: var(--civic-blue-dark);
}
.detail-callout {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #f2f2f0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: #444;
}
.detail-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.detail-btn {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.detail-btn-primary {
  background: var(--compost-green);
  color: white;
}
.detail-btn-secondary {
  background: white;
  border: 2px solid var(--civic-blue);
  color: var(--civic-blue-dark);
}
