/* ==========================================================================
   Town of Northfield, Jackson County, Wisconsin
   Shared stylesheet. One file for the whole site.
   Edit colors and sizes here; every page picks up the change.
   ========================================================================== */

:root {
  --ink:        #0d1c33;   /* darkest text */
  --pine:       #17306b;   /* headers, header bar */
  --pine-deep:  #0b1d44;
  --paper:      #f3f5f9;   /* page background */
  --card:       #ffffff;
  --rule:       #c2cadb;   /* hairlines and borders */
  --rule-soft:  #dee4ef;
  --muted:      #4c5670;   /* secondary text */
  --gold:       #c0202e;   /* accent, links on dark */
  --signal:     #b31b28;   /* notices, deadlines */
  --signal-bg:  #fdf0f1;

  --measure: 68ch;
  --shell: 1080px;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

@media (min-width: 700px) {
  body { font-size: 1.125rem; }
}

/* ---------- Skip link (keyboard + screen reader) ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--pine);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
  font-family: var(--display);
}
.skip:focus { left: 0; }

/* ---------- Masthead ---------- */
/* White, like the Town's business cards, so the logo reads properly. */
.masthead {
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}

.masthead-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.masthead .logo {
  width: 84px;
  height: auto;
  flex: none;
}

@media (min-width: 700px) {
  .masthead-inner { gap: 1.5rem; padding: 1.4rem 1.25rem; }
  .masthead .logo { width: 118px; }
}

.seal-line {
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.3rem;
}

.masthead h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--pine-deep);
}

.masthead h1 a { color: inherit; text-decoration: none; }
.masthead h1 a:hover { text-decoration: underline; text-underline-offset: 4px; }

.masthead .locale {
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0.3rem 0 0;
}

/* ---------- Navigation ---------- */
.mainnav {
  background: var(--pine);
  border-bottom: 4px solid var(--gold);
}

.mainnav ul {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 0.5rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

.mainnav a {
  display: block;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #e3e9f5;
  text-decoration: none;
  padding: 0.85rem 0.85rem;
  border-bottom: 4px solid transparent;
}

.mainnav a:hover { background: rgba(255, 255, 255, 0.09); }

.mainnav a[aria-current="page"] {
  color: var(--pine-deep);
  background: #fff;
  border-bottom-color: #fff;
}

/* ---------- Layout ---------- */
main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

section { margin-bottom: 2.75rem; }

p, li { max-width: var(--measure); }

h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.3rem, 3.4vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
  color: var(--pine-deep);
}

h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
  margin: 1.6rem 0 0.35rem;
  color: var(--pine-deep);
}

.eyebrow {
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.lede { font-size: 1.1em; color: var(--muted); }

hr.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

a { color: #16306b; text-underline-offset: 3px; }
a:hover { color: var(--signal); }

/* ---------- The notice board: the signature element ----------
   Styled after the paper notice posted at the town hall.        */
.noticeboard {
  background: var(--card);
  border: 2px solid var(--pine-deep);
  box-shadow: 0 0 0 1px var(--card) inset, 0 0 0 4px var(--pine-deep) inset,
              0 0 0 6px var(--card) inset;
  padding: 1.9rem 1.5rem 1.6rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 700px) {
  .noticeboard { padding: 2.4rem 2.5rem 2rem; }
}

.noticeboard .stamp {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 0.9rem;
}

.noticeboard h2 {
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  margin-bottom: 0.75rem;
}

.when {
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.2rem;
  color: var(--ink);
}

.where {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.posted-at {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  margin-top: 1.35rem;
  font-size: 0.94rem;
  color: var(--muted);
}

.posted-at strong { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--pine);
  color: #fff;
  padding: 0.7rem 1.15rem;
  border: 2px solid var(--pine);
  margin: 0 0.5rem 0.5rem 0;
}

.btn:hover { background: var(--pine-deep); border-color: var(--pine-deep); color: #fff; }

.btn.secondary { background: transparent; color: var(--pine-deep); }
.btn.secondary:hover { background: var(--pine-deep); color: #fff; }

/* ---------- Card grid ---------- */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 1.25rem;
}

@media (min-width: 620px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--pine);
  padding: 1.25rem 1.25rem 1.35rem;
}

.card h3 { margin-top: 0; }
.card p { margin-bottom: 0.6rem; }
.card p:last-child { margin-bottom: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1rem 0 0.5rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.97rem;
}

caption {
  text-align: left;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.5rem;
}

th, td {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

thead th {
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--pine);
  color: #fff;
  border-bottom: 0;
}

tbody tr:last-child td { border-bottom: 0; }

/* ---------- Callouts ---------- */
.callout {
  background: var(--signal-bg);
  border-left: 5px solid var(--signal);
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
}

.callout p:last-child { margin-bottom: 0; }

.callout h3 { margin-top: 0; color: var(--signal); }

.note {
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 5px solid var(--gold);
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
}

.note p:last-child { margin-bottom: 0; }

/* ---------- "Fill this in" marker ----------
   Anything wrapped in <span class="tbd"> still needs real information.
   Search the files for "tbd" to find every one. Replace the text,
   then delete class="tbd" so it stops showing the dotted underline.  */
.tbd {
  border-bottom: 2px dotted var(--signal);
  color: var(--signal);
  font-style: italic;
}

/* ---------- Definition-style contact blocks ---------- */
.deflist { margin: 0.75rem 0 0; }
.deflist dt {
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.9rem;
}
.deflist dd { margin: 0.15rem 0 0; }

/* ---------- Footer ---------- */
footer {
  background: var(--pine-deep);
  color: #ccd6e8;
  border-top: 4px solid var(--gold);
  padding: 2rem 1.25rem 2.5rem;
  font-size: 0.94rem;
}

.footer-inner { max-width: var(--shell); margin: 0 auto; }

.footer-cols {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) { .footer-cols { grid-template-columns: 1.2fr 1fr 1fr; } }

footer h2 {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #93a6c8;
  margin-bottom: 0.6rem;
}

footer a { color: #e7edf7; }
footer a:hover { color: #fff; }

footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: 0.35rem; }

.colophon {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  color: #97a7c4;
  font-size: 0.86rem;
}

/* ---------- Accessibility floor ---------- */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.mainnav :focus-visible,
footer :focus-visible {
  outline-color: #ff8d97;
}

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

/* ---------- Print: notices need to print cleanly ---------- */
@media print {
  .mainnav, .skip, footer { display: none; }
  body { background: #fff; font-size: 11pt; }
  .masthead { border-bottom: 2px solid #000; }
  .masthead h1, .masthead .locale, .seal-line { color: #000; }
  .masthead .logo { width: 90px; }
  .noticeboard { box-shadow: none; border: 2px solid #000; }
  a { color: #000; }
}
