/* Ontario Bugs — minimal stylesheet */

:root {
  --bg:        #faf9f7;
  --surface:   #ffffff;
  --border:    #ddd9d0;
  --text:      #1a1a18;
  --muted:     #6b6860;
  --accent:    #2d6a2d;
  --accent-h:  #1f4d1f;
  --danger:    #8b1a1a;
  --radius:    4px;
  --max-w:     680px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }
a:hover { color: var(--accent-h); }

/* ── layout ── */

header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.site-name {
  font-size: 1.15rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}

.site-sub {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

/* ── search form ── */

.search-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.search-form input[type="search"] {
  flex: 1;
  font-size: 1rem;
  font-family: inherit;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.search-form input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(45,106,45,0.15);
}

.search-form button {
  font-size: 1rem;
  font-family: system-ui, sans-serif;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

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

/* ── hero ── */

.hero h1 {
  font-size: 1.7rem;
  font-weight: normal;
  margin-bottom: 0.4rem;
}

.hero p { color: var(--muted); font-size: 0.95rem; }

.examples {
  margin-top: 2rem;
  font-size: 0.88rem;
  font-family: system-ui, sans-serif;
  color: var(--muted);
}

/* ── results ── */

h2 {
  font-size: 1.1rem;
  font-weight: normal;
  margin-bottom: 1rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

h2 em { color: var(--text); font-style: normal; font-weight: bold; }

.search-bar { margin-bottom: 1.75rem; }

.results {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.result-item {
  border-bottom: 1px solid var(--border);
}

.result-item:last-child { border-bottom: none; }

.result-item a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}

.result-item a:hover { background: #f0ede8; }

.sci-name {
  font-style: italic;
  font-size: 1rem;
  flex: 1;
}

.meta {
  font-size: 0.8rem;
  font-family: system-ui, sans-serif;
  color: var(--muted);
  white-space: nowrap;
}

.no-results, .error {
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.error { color: var(--danger); border-color: #e5b8b8; background: #fdf4f4; }

/* ── bug detail ── */

.back {
  display: inline-block;
  font-size: 0.85rem;
  font-family: system-ui, sans-serif;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.back:hover { color: var(--accent); }

.bug-image {
  margin-bottom: 1.5rem;
}

.bug-image img {
  max-width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.bug-image small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-family: system-ui, sans-serif;
  color: var(--muted);
}

.bug-header h1 {
  font-size: 2rem;
  font-style: italic;
  font-weight: normal;
  line-height: 1.2;
}

.common-names {
  margin-top: 0.4rem;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--muted);
}

.ontario-status {
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
}

.badge {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: bold;
}

.badge.confirmed {
  background: #d4edda;
  color: #1a4d2e;
}

.badge.uncertain {
  background: #fff3cd;
  color: #7d5a00;
}

.occ-count { color: var(--muted); }

.taxonomy {
  margin-top: 2rem;
}

.taxonomy h2 {
  margin-bottom: 0.75rem;
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.taxonomy table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.taxonomy tr { border-bottom: 1px solid var(--border); }
.taxonomy tr:last-child { border-bottom: none; }

.taxonomy th {
  text-align: left;
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: normal;
  color: var(--muted);
  padding: 0.5rem 1rem 0.5rem 0;
  width: 110px;
  vertical-align: top;
}

.taxonomy td {
  padding: 0.5rem 0;
}

.gbif-link {
  margin-top: 2rem;
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
}

/* ── responsive ── */

@media (max-width: 480px) {
  .search-form { flex-direction: column; }
  .result-item a { flex-wrap: wrap; }
  .bug-header h1 { font-size: 1.5rem; }
}
