/* Tupelo Free Press. Plain CSS, no JavaScript. WCAG AA contrast in light and dark.
   Fonts are self-hosted (SIL OFL; see /static/font-licenses.txt). */
@font-face { font-family: "Newsreader"; src: url("/static/newsreader-v5.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/static/newsreader-italic-v5.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/static/public-sans-v5.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #fffdf8;
  --text: #1c1b19;
  --muted: #5a564e;
  --rule: #e2ddd1;
  --accent: #7a1f1f;
  --accent-soft: #f6ebe6;
  --panel: #f5f1e8;
  --link: #7a1f1f;
  --focus: #1a5fb4;
  --ink: #1c1b19;      /* footer band */
  --ink-text: #e9e5dc;
  --serif: "Newsreader", Charter, "Bitstream Charter", Cambria, Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
/* Dark mode is the reader's choice (the button in the masthead), not the system's. */
:root[data-theme="dark"] {
  --bg: #141311;
  --text: #ece8e0;
  --muted: #b7b1a5;
  --rule: #34312b;
  --accent: #e85d52;  /* TFP red, lightened only enough to read on dark (5.4:1) */
  --accent-soft: #2a1d1b;
  --panel: #1d1b18;
  --link: #e85d52;
  --focus: #8cc4ff;
  --ink: #0b0a09;
  --ink-text: #d9d4ca;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.15rem/1.62 var(--serif); font-optical-sizing: auto; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1rem; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--bg); padding: 0.5rem 1rem; z-index: 2; }
.skip:focus { left: 0.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Masthead ---------------------------------------------------------------------- */
/* The brand red stays the same in dark mode: it is the logo's colour, not a link colour. */
.masthead { border-top: 4px solid #7a1f1f; background: var(--bg); }
.masthead .bar { padding-top: 1.1rem; padding-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.theme-toggle { flex: none; width: 2.6rem; height: 2.6rem; display: inline-grid; place-items: center; border: 1px solid var(--rule); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.theme-toggle svg { width: 1.2rem; height: 1.2rem; fill: currentColor; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .moon { stroke: none; }
.theme-toggle .sun, :root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
.theme-toggle[hidden] { display: none; }
.brand { display: inline-grid; grid-template-columns: auto auto; align-items: center; column-gap: 0.85rem; color: var(--text); text-decoration: none; }
/* Tile height = the text block (name + tagline), so their top and bottom edges line up. */
.brand .logo { width: 3.6rem; height: 3.6rem; }
.brand-text { display: flex; flex-direction: column; justify-content: space-between; height: 3.6rem; padding: 0.1rem 0 0.05rem; }
.brand-name { font: 700 2.15rem/1 var(--serif); letter-spacing: -0.015em; }
.brand-line { font: 600 0.7rem/1 var(--sans); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 34rem) {
  .brand .logo { width: 2.75rem; height: 2.75rem; }
  .brand-text { height: 3rem; }
  .brand-name { font-size: 1.75rem; }
}
@media (max-width: 34rem) { .bl-more { display: none; } }
.mainnav { border-top: 1px solid var(--rule); border-bottom: 3px double var(--rule); font-family: var(--sans); }
.mainnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.4rem; margin: 0 auto; }
.mainnav a { display: inline-block; padding: 0.6rem 0 0.5rem; color: var(--muted); text-decoration: none; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 3px solid transparent; }
.mainnav a:hover { color: var(--text); }
.mainnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
/* "main.wrap", not "main": .wrap sets padding too, and the class would win (this was the bug
   that put page titles 6px under the menu). */
main.wrap { padding-top: 2rem; padding-bottom: 3rem; }

/* ---- Type ---------------------------------------------------------------------------- */
h1, h2, h3 { line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.8vw, 2.7rem); margin: 0.35rem 0 0.6rem; }
h2 { font-size: 1.4rem; margin: 2rem 0 0.5rem; }
p { margin: 0 0 1.05rem; }
.kicker, .meta, .cite, .byline, .when, .doc-list, .small, table, .section-h, .figures h2, .note { font-family: var(--sans); }
.kicker { display: inline-flex; align-items: center; gap: 0.45rem; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 700; color: var(--accent); margin: 0; }
.kicker::before { content: ""; width: 0.55rem; height: 0.55rem; background: var(--accent); }
.dek { font-size: 1.25rem; line-height: 1.45; color: var(--muted); margin-bottom: 1rem; }
.meta, .small { font-size: 0.88rem; color: var(--muted); }
.section-h { display: flex; align-items: center; gap: 0.6rem; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; margin: 2.4rem 0 0.4rem; }
.section-h::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
/* A section that opens the page doesn't add its own top space on top of the page's. */
main > .sr-only:first-child + .section-h, main > .section-h:first-child { margin-top: 0; }

/* Section pages (About, Corrections, Meetings): a smaller title than a story headline */
/* The menu tab already says which page this is, so the title is for screen readers only
   (editor, Nov 7) and the page opens with its lead sentence. */
.page-head { margin: 0 0 1.4rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--rule); }
.page-head h1:not(.sr-only) { font-size: clamp(1.7rem, 1.35rem + 1.3vw, 2.15rem); margin: 0 0 0.4rem; }
.page-head .dek { font-size: 1.22rem; line-height: 1.45; color: var(--text); margin: 0; }
.mtg-head h1 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2rem); }

/* ---- Article ------------------------------------------------------------------------- */
article > header { margin-bottom: 0.25rem; }
.byline { display: flex; gap: 0.8rem; align-items: center; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0.75rem 0; margin: 1.1rem 0 0.8rem; font-size: 0.9rem; line-height: 1.45; }
.byline img { flex: none; width: 40px; height: 40px; }
.byline p { margin: 0; }

/* Sources under each paragraph, grouped by document; every page its own link */
.cite { font-size: 0.8rem; color: var(--muted); margin: -0.45rem 0 1.4rem; line-height: 2.15; }
.cite .lbl { font-weight: 700; margin-right: 0.4rem; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem; }
.cite .src { white-space: nowrap; margin-right: 0.55rem; }
.cite a { display: inline-block; min-width: 1.95rem; min-height: 1.65rem; padding: 0 0.35rem; margin: 0 0.08rem; border-radius: 4px; background: var(--accent-soft); color: var(--link); text-align: center; text-decoration: none; font-weight: 600; line-height: 1.65rem; font-variant-numeric: tabular-nums; }
.cite a:hover { outline: 1px solid var(--link); }

/* By the numbers */
.figures { background: var(--panel); border-radius: 6px; margin: 1.6rem 0 2rem; padding: 1rem 1.1rem 0.3rem; }
.figures h2 { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 0.2rem; }
.figures .note { font-size: 0.84rem; line-height: 1.4; color: var(--muted); margin: 0 0 0.4rem; }
.figures ul { list-style: none; margin: 0; padding: 0; }
.figures li { padding: 0.85rem 0 0.15rem; border-top: 1px solid var(--rule); }
.figures li:first-child { border-top: 0; }
.figures .amt { font: 700 clamp(1.7rem, 1.3rem + 1.6vw, 2.2rem)/1.05 var(--serif); margin: 0 0 0.25rem; font-variant-numeric: lining-nums tabular-nums; color: var(--accent); letter-spacing: -0.01em; }
.figures .what { font-size: 1rem; line-height: 1.45; margin: 0 0 0.45rem; }
.figures .cite { margin: 0 0 0.6rem; }

ul.items { padding-left: 1.2rem; font-size: 1rem; }
ul.items li { margin-bottom: 0.5rem; }

/* Collapsed sections ("Also on the agenda", "How this story was made"): <details>, no JS */
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary h2 { display: inline; margin: 0; }
details > summary::after { content: " +"; font: 700 1.2rem/1 var(--sans); color: var(--accent); }
details[open] > summary::after { content: " −"; }
details.more { margin: 2rem 0 1rem; padding: 0.8rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
details.more[open] > summary { display: block; margin-bottom: 0.75rem; }
details.more .count { font: 400 0.92rem var(--sans); color: var(--muted); }
.how, .notice { background: var(--panel); border-left: 4px solid var(--accent); border-radius: 0 6px 6px 0; padding: 0.9rem 1.25rem; margin: 2.2rem 0 1rem; font-size: 1rem; }
.how > summary h2 { font-size: 1.15rem; }
.how[open] > summary { display: block; margin-bottom: 0.75rem; }
.how ul.sources { padding-left: 1.2rem; font-family: var(--sans); font-size: 0.9rem; }
.notice { margin: 0 0 1.5rem; }
.notice h2 { font: 700 0.95rem/1.3 var(--sans); margin: 0 0 0.25rem; }
.notice p:last-child { margin-bottom: 0; }

/* ---- Lists of stories ---------------------------------------------------------------- */
.list { list-style: none; padding: 0; margin: 0; }
.list li { border-bottom: 1px solid var(--rule); padding: 1rem 0; }
.list h2, .list h3 { margin: 0.25rem 0 0.35rem; font-size: 1.3rem; }
.list h3 { font-size: 1.15rem; }
.list h2 a, .list h3 a, .lead-story h2 a { color: var(--text); text-decoration: none; }
.list h2 a:hover, .list h3 a:hover, .lead-story h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.list p { margin: 0; }
.when { font-size: 0.8rem; color: var(--muted); }

/* Home: lead story with its biggest number */
.lead-story { padding: 0.25rem 0 1.4rem; border-bottom: 1px solid var(--rule); }
.lead-story h2 { font-size: clamp(1.75rem, 1.25rem + 2.2vw, 2.35rem); margin: 0.45rem 0 0.5rem; }
.lead-story .dek { margin-bottom: 1rem; }
.lead-num { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; background: var(--panel); border-left: 4px solid var(--accent); border-radius: 0 6px 6px 0; padding: 0.8rem 1rem; }
.lead-num .amt { font: 700 clamp(1.7rem, 1.3rem + 1.6vw, 2.2rem)/1 var(--serif); color: var(--accent); margin: 0; font-variant-numeric: lining-nums; }
.lead-num .what { flex: 1 1 14rem; margin: 0; font-size: 0.98rem; line-height: 1.4; }
.lead-num .go { flex-basis: 100%; margin: 0.2rem 0 0; font: 600 0.85rem var(--sans); }

/* Meetings: calendar tiles */
.mtgs { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.mtgs li { display: flex; gap: 0.9rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.datetile { flex: none; width: 3.6rem; text-align: center; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; font-family: var(--sans); background: var(--bg); }
.datetile .m { display: block; background: var(--accent); color: #fff; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; padding: 0.15rem 0; }
.datetile .d { display: block; font: 700 1.45rem/1.2 var(--serif); color: var(--text); }
.datetile .w { display: block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); padding-bottom: 0.2rem; }
:root[data-theme="dark"] .datetile .m { color: #fff; }
.mtgs .t { display: block; font-weight: 600; line-height: 1.3; }
.mtgs .t a { color: var(--text); text-decoration: none; }
.mtgs .t a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
/* A link right after a list ("All meetings and the city's documents") gets breathing room. */
.mtgs + .small, .list + .small { margin-top: 0.9rem; }
.mtgs .sub { display: block; font: 0.82rem/1.4 var(--sans); color: var(--muted); margin-top: 0.15rem; }
.mtg-head { display: flex; gap: 1rem; align-items: center; margin: 0.6rem 0 1.2rem; }
.mtg-head h1 { margin: 0; }
.mtg-head .datetile { width: 4.4rem; }
.mtg-head .datetile .d { font-size: 1.9rem; }

.doc-list { padding-left: 1.2rem; }
.doc-list li { margin-bottom: 0.4rem; }
.steps { padding-left: 1.3rem; }
.steps li { margin-bottom: 0.5rem; }
.steps li::marker { font: 700 1rem var(--sans); color: var(--accent); }
.panel { background: var(--panel); border-left: 4px solid var(--accent); border-radius: 0 6px 6px 0; padding: 0.9rem 1.15rem; margin: 0.4rem 0 1.25rem; font-size: 1.05rem; }
.panel p:last-child { margin-bottom: 0; }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 0 0 1.5rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.5rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; }
caption { text-align: left; caption-side: bottom; padding-top: 0.5rem; }
img.mark { vertical-align: middle; margin-right: 0.4rem; }

/* ---- Footer -------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--ink-text); font: 0.9rem/1.55 var(--sans); padding: 1.8rem 0 2.2rem; margin-top: 2rem; }
.site-footer a { color: var(--ink-text); }
.foot-brand { display: flex; align-items: center; gap: 0.6rem; font: 700 1.25rem/1 var(--serif); color: #fff; margin-bottom: 0.9rem; }
.foot-links { list-style: none; padding: 0; margin: 0.9rem 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-weight: 600; }
.site-footer .fine { font-size: 0.78rem; opacity: 0.8; margin: 0; }

@media print {
  .mainnav, .skip, .site-footer { display: none; }
  .cite a::after { content: " (" attr(href) ")"; word-break: break-all; }
  details > summary::after { content: ""; }
}
