/* =====================================================
   Replacing Nerd Jobs — shared site stylesheet
   Import this on every page:
     root pages:    <link rel="stylesheet" href="./site.css">
     subpages:      <link rel="stylesheet" href="../site.css">
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap');

/* ── TOKENS ── */
:root {
  --bg:     #fff8dc;
  --ink:    #2c2e25;
  --mid:    #595b4a;
  --faint:  #e8e0c0;
  --hover:  #f0e8c8;
  --border: 1.5px solid #2c2e25;

  /* service-area palette */
  --svc-1-bg:  #d4e4c8;  --svc-1-dot: #6a9e5a;  /* Administration              */
  --svc-2-bg:  #f5d8e8;  --svc-2-dot: #c07aa8;  /* Arts, Culture & Recreation  */
  --svc-3-bg:  #c9dae1;  --svc-3-dot: #5a8a9e;  /* Education & Human Services  */
  --svc-4-bg:  #f0e8c0;  --svc-4-dot: #a89030;  /* Livable & Inclusive         */
  --svc-5-bg:  #e8cccc;  --svc-5-dot: #b05858;  /* Public Safety               */
  --svc-6-bg:  #c8e0d4;  --svc-6-dot: #5a9e7a;  /* Utilities, Trans & Env      */
}

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

body {
  font-family: 'DM Mono', monospace;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

/* ── SITE HEADER ── */
.site-header {
  border-bottom: 2px solid var(--ink);
  padding: 18px 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.site-header h1 { font-size: 1rem; font-weight: 500; letter-spacing: 0.03em; }
.site-header p  { font-size: 0.68rem; color: var(--mid); }

.back-link {
  font-size: 0.68rem;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px solid var(--mid);
}
.back-link:hover { color: var(--ink); border-color: var(--ink); }

/* ── YEAR / PILL TABS ── */
.year-tabs {
  display: flex;
  border-bottom: 2px solid var(--ink);
  overflow-x: auto;
}
.year-tab {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  padding: 9px 18px;
  border: none;
  border-right: 1.5px solid var(--ink);
  background: transparent;
  color: var(--mid);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}
.year-tab:hover  { background: var(--hover); color: var(--ink); }
.year-tab.active { background: var(--ink);   color: var(--bg); }

/* ── PAGE WRAPPER ── */
.main { max-width: 1280px; margin: 0 auto; padding: 32px; }

/* ── SECTION LABEL ── */
.section-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--mid);
  margin-bottom: 14px;
}

/* ── DOG CARD GRID ── */
.dog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: var(--border);
  border-left: var(--border);
  margin-bottom: 40px;
}
.dog-card {
  border-right: var(--border);
  border-bottom: var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 14px;
  transition: filter 0.15s;
  cursor: default;
}
.dog-card:hover { filter: brightness(0.97); }
.dog-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  margin-bottom: 10px;
}
.dog-service {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mid);
  text-align: center;
  margin-bottom: 4px;
}
.dog-total {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  text-align: center;
}
.dog-count {
  font-size: 0.6rem;
  color: var(--mid);
  margin-top: 4px;
  text-align: center;
}

/* ── PANEL ── */
.panel { border: var(--border); margin-bottom: 32px; }
.panel-head {
  border-bottom: var(--border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--ink);
  color: var(--bg);
}
.panel-head h2 {
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.panel-body { padding: 24px; }

/* ── CONTROLS / FILTERS ── */
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-label { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 1px; color: var(--bg); opacity: 0.65; }

select, input[type="text"] {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  padding: 5px 10px;
  border: 1.5px solid var(--bg);
  background: var(--ink);
  color: var(--bg);
  outline: none;
  min-width: 150px;
  cursor: pointer;
}
select:focus, input:focus { background: #444630; }
option { background: var(--ink); }

/* ── CHART ── */
.chart-wrap { position: relative; height: 400px; }

/* ── TABLE ── */
table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
thead th {
  background: var(--ink);
  color: var(--bg);
  padding: 9px 14px;
  text-align: left;
  font-weight: 400;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-right: 1px solid #444630;
}
thead th:last-child { border-right: none; }
thead th.sorted-asc::after  { content: " ↑"; }
thead th.sorted-desc::after { content: " ↓"; }
tbody tr { border-bottom: 1px solid var(--faint); }
tbody tr:hover { background: var(--hover); }
tbody td { padding: 8px 14px; }
.amount-cell { text-align: right; font-variant-numeric: tabular-nums; }

.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── PAGER ── */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 0.68rem;
  color: var(--mid);
  border-top: var(--border);
}
.pager button {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  padding: 4px 12px;
  border: var(--border);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.pager button:hover    { background: var(--hover); }
.pager button:disabled { opacity: 0.3; cursor: not-allowed; }

.no-data { text-align: center; padding: 32px; color: var(--mid); font-size: 0.78rem; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .dog-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 16px; }
  .site-header { padding: 14px 16px; }
}
@media (max-width: 440px) {
  .dog-grid { grid-template-columns: 1fr 1fr; }
}
