/* Townledge
   Palette: paper #FFFFFF, ink #1B2430, slate #5B6573, field #F2F3F5, line #D5D9DF, signal #1F6FEB
   Type: Public Sans (the U.S. Web Design System's civic typeface)
   Light theme only: the site stays light even when the visitor's device is in dark mode. */

:root {
  --paper: #ffffff;
  --ink: #1b2430;
  --slate: #5b6573;
  --field: #f2f3f5;
  --line: #d5d9df;
  --hover: #eef0f3;
  --signal: #1f6feb;
  --signal-dark: #1558c7;
  --danger: #b42318;
  --overlay: rgba(27, 36, 48, 0.45);
  --font: "Public Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --radius-field: 10px;
  --radius-dialog: 14px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--signal); }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  padding: .5rem .875rem; border-radius: 6px;
  background: var(--ink); color: var(--paper); text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---- Header ---------------------------------------------------------- */
.site-header { padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem); }

.logo {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--ink); text-decoration: none;
}
.logo-mark {
  width: 30px; height: 30px;
  fill: none; stroke: var(--signal); stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.logo-word { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; }

/* ---- Main ------------------------------------------------------------- */
.site-main { flex: 1; display: flex; flex-direction: column; }

.finder {
  flex: 1;
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(4rem, 22vh, 12rem) 1.25rem 6rem;
}

/* ---- Search ---------------------------------------------------------- */
.search { position: relative; width: 100%; max-width: 38rem; }

.search-field {
  position: relative;
  display: flex; align-items: center;
  height: 3.75rem;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-field);
  box-shadow: 0 1px 2px rgba(27, 36, 48, .06), 0 6px 18px -8px rgba(27, 36, 48, .18);
  transition: border-color .15s, box-shadow .15s;
}
.search-field:focus-within {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 18%, transparent);
}

.search-icon {
  width: 1.5rem; height: 1.5rem; margin: 0 .25rem 0 1.25rem; flex: none;
  fill: none; stroke: var(--slate); stroke-width: 2; stroke-linecap: round;
}
.search-field:focus-within .search-icon { stroke: var(--ink); }

.search-field input {
  flex: 1; min-width: 0; height: 100%;
  padding: 0 .75rem;
  border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 1.25rem;
}
.search-field input::placeholder { color: var(--slate); opacity: 1; }

.search-clear {
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; margin-right: .5rem;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.search-clear:hover { background: var(--hover); }
.search-clear svg, .modal-close svg {
  width: 1.25rem; height: 1.25rem;
  fill: none; stroke: var(--slate); stroke-width: 2; stroke-linecap: round;
}

.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  margin: 0; padding: .375rem 0; list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  box-shadow: 0 14px 34px -12px rgba(27, 36, 48, .28);
  max-height: min(24rem, 60vh); overflow-y: auto;
}

.result {
  display: flex; align-items: center; gap: .9rem;
  padding: .65rem 1.25rem;
  cursor: pointer; font-size: 1.125rem;
}
.result[aria-selected="true"] { background: var(--hover); }
.result-pin { width: 1.15rem; height: 1.15rem; flex: none; fill: var(--slate); }
.result-name { color: var(--ink); }
.result-name mark { background: none; color: inherit; font-weight: 600; }
.result-state { color: var(--slate); }
.result-live {
  margin-left: auto; font-size: .8125rem; font-weight: 600; color: var(--signal);
}
.results-empty { padding: .9rem 1.25rem; color: var(--slate); }

/* ---- Modal ------------------------------------------------------------ */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1.25rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); }

.modal-dialog {
  position: relative;
  width: 100%; max-width: 28rem;
  padding: 2.5rem 2.25rem 2.25rem;
  background: var(--paper);
  border-radius: var(--radius-dialog);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45);
  text-align: center;
}
@media (prefers-reduced-motion: no-preference) {
  .modal:not([hidden]) .modal-backdrop { animation: fade .18s ease-out; }
  .modal:not([hidden]) .modal-dialog { animation: rise .22s cubic-bezier(.2, .8, .3, 1); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.modal-close {
  position: absolute; top: .75rem; right: .75rem;
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.modal-close:hover { background: var(--hover); }

.modal-dialog h2 {
  margin: 0 0 .5rem;
  font-size: 1.5rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em;
  text-wrap: balance;
}
.modal-dialog h2:focus { outline: none; }
.modal-sub { margin: 0 0 1.75rem; color: var(--slate); font-size: 1.0625rem; }

#request-form { text-align: left; }

.input {
  display: block; width: 100%;
  height: 3.1rem; padding: 0 1rem;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-size: 1.0625rem;
}
.input::placeholder { color: var(--slate); opacity: 1; }
.input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }

.field-error { margin: .5rem 0 0; color: var(--danger); font-size: .9375rem; }

.check {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.1rem 0 1.4rem; cursor: pointer; font-size: 1.0625rem;
}
.check input { width: 1.375rem; height: 1.375rem; margin: 0; accent-color: var(--signal); cursor: pointer; }

.btn-primary {
  display: block; width: 100%;
  height: 3.4rem;
  border: 0; border-radius: 8px;
  background: var(--signal); color: #fff;
  font: inherit; font-size: 1.125rem; font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--signal-dark); }
.btn-primary:disabled { opacity: .65; cursor: progress; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Footer ----------------------------------------------------------- */
.site-footer { background: var(--field); padding: 1.4rem 1rem; }
.site-footer ul {
  display: flex; flex-wrap: wrap; justify-content: center;
  margin: 0; padding: 0; list-style: none;
}
.site-footer li + li::before { content: "|"; color: var(--slate); padding: 0 1.25rem; }
.site-footer a { color: var(--ink); text-decoration: none; font-size: 1rem; }
.site-footer a:hover { text-decoration: underline; }
.site-footer a[aria-current="page"] { font-weight: 600; }

/* ---- Text pages ----------------------------------------------------- */
.prose {
  width: 100%; max-width: 40rem; margin: 0 auto;
  padding: clamp(2rem, 8vh, 5rem) 1.25rem 5rem;
  font-size: 1.0625rem; line-height: 1.65;
}
.prose h1 { font-size: 2.25rem; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 1.25rem; }
.prose h2 { font-size: 1.25rem; line-height: 1.3; margin: 2rem 0 .5rem; }
.prose p { margin: 0 0 1rem; }
.contact-email { font-size: 1.375rem; font-weight: 600; }

/* ---- Mobile ------------------------------------------------------------ */
@media (max-width: 560px) {
  .finder { padding-top: 18vh; }
  .search-field { height: 3.4rem; }
  .search-field input { font-size: 1.0625rem; }
  .result { font-size: 1.0625rem; padding: .7rem 1rem; }
  .modal-dialog { padding: 2.25rem 1.25rem 1.5rem; }
  .modal-dialog h2 { font-size: 1.3rem; }
  .site-footer li + li::before { padding: 0 .75rem; }
}

/* ---- Admin ------------------------------------------------------------ */
.page-admin { padding: 2rem 1.25rem; }
.admin, .admin-login { max-width: 72rem; margin: 0 auto; width: 100%; }
.admin-login { max-width: 22rem; display: grid; gap: 1rem; margin-top: 12vh; }
.admin-login label { display: grid; gap: .35rem; font-weight: 500; }
.admin-bar h1, .admin-login h1 { margin: 0 0 .25rem; font-size: 1.75rem; }
.admin-bar p { margin: 0 0 1.5rem; color: var(--slate); }
.admin-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.admin-tabs a { padding: .6rem 0; color: var(--slate); text-decoration: none; border-bottom: 2px solid transparent; }
.admin-tabs a[aria-current="page"] { color: var(--ink); border-color: var(--signal); font-weight: 600; }
.admin-error { color: var(--danger); }
.admin-notice { color: var(--signal); font-weight: 500; }
.admin-empty { color: var(--slate); }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.admin-table th, .admin-table td { text-align: left; padding: .75rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { color: var(--slate); font-weight: 600; }
.admin-table details ul { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--slate); }
.inline { display: flex; gap: .5rem; align-items: center; margin-top: .25rem; }
.input-sm { height: 2.25rem; font-size: .875rem; min-width: 16rem; }
.btn-small { height: 2.25rem; padding: 0 .9rem; border: 0; border-radius: 6px; background: var(--signal); color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-link { border: 0; background: none; color: var(--danger); font: inherit; cursor: pointer; padding: 0; }
