/* Publick network home page.
   Type matches the town sites: Public Sans for text, Source Serif 4 for
   headings, both served from this site (SIL Open Font License, see /fonts).
   Colors are Publick's own "newsprint" palette; each town site uses its
   town's colors instead.
   Accessibility: sizes in rem so text scales; text and UI colors meet WCAG AA
   contrast; tap targets are at least 44px; focus is always visible. */

@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url(../fonts/public-sans-400.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 700; font-display: swap; src: url(../fonts/public-sans-700.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-display: swap; src: url(../fonts/source-serif-4-700.woff2) format("woff2"); }

:root {
  --paper: #faf7f0;         /* page background */
  --paper-dark: #f1ece1;    /* footer */
  --ink: #1c1a17;           /* text and headings */
  --accent: #2c4a63;        /* slate blue-grey: links, the P */
  --accent-dark: #1f374b;
  --muted: #5c574f;
  --line: #ddd6c8;
  --focus: #b3450b;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --measure: 68ch;
  --gutter: 1rem;
}

/* ---- Base ---- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}
.wrap { width: 100%; max-width: 48rem; margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { color: var(--ink); font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; line-height: 1.2; margin: 2.5rem 0 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.25rem; line-height: 1.3; margin: 0; }
p { max-width: var(--measure); }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 0.5rem; top: -10rem; z-index: 100;
  padding: 0.75rem 1rem; background: var(--paper); color: var(--accent); font-weight: 700;
  border: 2px solid var(--accent);
}
.skip-link:focus { top: 0.5rem; }

/* ---- Masthead: a nameplate over a double rule, like a paper's front page ---- */

.masthead { padding-top: 1.5rem; padding-bottom: 1rem; border-bottom: 4px double var(--ink); }
.brand {
  display: flex; align-items: center; gap: 0.6rem; margin: 0;
  color: var(--accent); font-size: clamp(2.2rem, 1.7rem + 2.4vw, 3.2rem); line-height: 1.05;
}
.brand img { width: 0.9em; height: 0.9em; flex: none; }
.masthead-line { margin: 0.5rem 0 0; font-size: 1.1rem; }

/* ---- Page ---- */

main { display: block; padding: 1.5rem 0 3rem; }
.lede { font-size: 1.15rem; margin: 0 0 1rem; }
.independent { margin: 0; color: var(--muted); font-weight: 700; }
.small { color: var(--muted); font-size: 0.9375rem; }

/* ---- Find your town: the network's counts, then its towns by state ---- */

h2.first { margin-top: 0.5rem; padding-top: 0; border-top: 0; }
.glance { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0 0 0.5rem; padding: 0; list-style: none; color: var(--muted); font-size: 0.9375rem; }
.glance strong { color: var(--ink); font-size: 1.05rem; }
.state { margin: 1.5rem 0 0; }
.state h3 { font-size: 1.2rem; margin: 0 0 0.6rem; }
.count { font-family: "Public Sans", system-ui, sans-serif; font-weight: 400; font-size: 0.9375rem; color: var(--muted); }
.town-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.town-cards a, .state-link a {
  display: block; min-height: 2.75rem; padding: 0.7rem 0.9rem;
  border: 1px solid var(--line); border-left: 4px solid var(--accent); background: #fff; text-decoration: none;
}
.town-cards a:hover, .state-link a:hover { border-left-color: var(--accent-dark); }
.town-cards a:hover .name, .state-link a:hover .name { text-decoration: underline; text-decoration-thickness: 2px; }
.town-cards .name { display: block; font-weight: 700; font-size: 1.1rem; color: var(--accent); }
.town-cards .domain { display: block; color: var(--muted); font-size: 0.875rem; }
.town-cards .news { display: block; margin-top: 0.3rem; color: var(--ink); font-size: 0.875rem; }
/* A state with its own page: one line, its name and how many towns. */
.state-link { margin: 1.5rem 0 0; max-width: none; }
.state-link a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.state-link .name { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--accent); }
.state-link + .state-link { margin-top: 0.6rem; }
.town-count { margin: 0 0 1.25rem; color: var(--muted); }
.back { margin: 2rem 0 0; }
.back a { display: inline-flex; align-items: center; min-height: 2.75rem; }

.actions { margin: 1.25rem 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0 1.25rem;
  background: var(--accent); color: var(--paper); font-weight: 700; text-decoration: none;
}
.button:hover { background: var(--accent-dark); color: var(--paper); text-decoration: underline; }
@media (max-width: 30rem) { .button { width: 100%; } }

/* ---- Footer ---- */

.site-footer { border-top: 1px solid var(--line); background: var(--paper-dark); color: var(--muted); font-size: 0.9375rem; padding: 1.5rem 0 2rem; }
.footer-brand { margin: 0 0 0.25rem; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.site-footer p { margin: 0 0 0.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.footer-links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.site-footer .small { margin: 0.5rem 0 0; font-size: 0.875rem; }
/* GoatCounter's counting image (the homepage's foot): nothing to see, and no space taken. */
.counter { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Network status page (status/, written by scripts/build_status.py) ---- */

.brand { font-family: var(--serif); font-weight: 700; }
.brand a { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; color: inherit; text-decoration: none; }
.brand a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.page-title { font-size: 2rem; line-height: 1.15; margin: 0.5rem 0 0.75rem; }

/* Status is always named in words; the color only repeats it. */
.badge {
  display: inline-block; padding: 0.05rem 0.5rem; border: 1px solid currentColor;
  font-family: "Public Sans", system-ui, sans-serif; font-size: 0.875rem; font-weight: 700; line-height: 1.5;
  letter-spacing: 0; white-space: nowrap; vertical-align: 0.15em; background: #fff;
}
.badge-ok { color: #1d5e36; }
.badge-attention { color: #a3290c; }
.badge-late, .badge-none { color: var(--muted); }

.table-scroll { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); background: #fff; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table-scroll caption { padding: 0.6rem 0.75rem; text-align: left; font-weight: 700; border-bottom: 1px solid var(--line); }
.table-scroll th, .table-scroll td { padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-scroll thead th { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.table-scroll tbody th { font-weight: 700; }
.table-scroll tr:last-child > * { border-bottom: 0; }
.table-scroll a { display: inline-block; padding: 0.6rem 0; margin: -0.6rem 0; }

.town-status h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.town-place { color: var(--muted); font-weight: 700; }
.town-status .town-place { margin: 0 0 0.75rem; }
.town-status .town-place a { display: inline-block; padding: 0.6rem 0; margin: -0.6rem 0; }
.problems { margin: 0.75rem 0; padding: 0.75rem 1rem 0.75rem 2rem; border-left: 4px solid #a3290c; background: #fff; }
.problems li + li { margin-top: 0.25rem; }
.plain { margin: 0; padding: 0; list-style: none; }
.plain li + li { margin-top: 0.2rem; }
