/* Print-inspired sibling of PlanesAdvisor: warm paper, ink serif type,
   hairline rules, uppercase sans labels. Single stylesheet, no build step. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;

  --paper: #fcfbf8;
  --paper-raised: #ffffff;
  --paper-sunk: #f6f3ea;

  --ink: #1b1a18;
  --ink-soft: #56514a;
  --ink-faint: #6b645a;

  --rule: #e3dccd;
  --rule-strong: #c4b9a3;

  --accent: #8a1c2b;
  --accent-ink: #6c1420;
  --link: #1d3f66;
  --highlight: #f5efdf;

  --radius: 3px;
  --measure: 74ch;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1917;
    --paper-raised: #232120;
    --paper-sunk: #2b2825;
    --ink: #efece4;
    --ink-soft: #c3bdb1;
    --ink-faint: #a9a294;
    --rule: #3a3733;
    --rule-strong: #544f47;
    --accent: #e59aa2;
    --accent-ink: #f0b6bd;
    --link: #a8c4e8;
    --highlight: #3a3733;
  }
}

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

/* Author `display` on .button/.cta/.alert would otherwise beat the UA's
   [hidden] rule and leak the Load-more button into view. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--highlight); color: var(--ink); }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: .5rem 1rem; background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: .8125rem; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── Masthead ───────────────────────────────────────────────────────────── */
.masthead { border-bottom: 3px double var(--rule-strong); }

.masthead__inner {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 1rem 1.5rem;
  max-width: var(--measure); margin: 0 auto; padding: 1.6rem 1.5rem 1.25rem;
}

.wordmark { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.wordmark:hover { color: var(--ink); }
.wordmark__name { font-size: 1.625rem; font-weight: 600; line-height: 1.1; letter-spacing: .01em; }
.wordmark__events { color: var(--accent); }
.wordmark__tagline {
  margin-top: .25rem; font-family: var(--sans); font-size: .6875rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
}

/* ── Page frame ─────────────────────────────────────────────────────────── */
.page { max-width: var(--measure); margin: 0 auto; padding: 2.5rem 1.5rem 1rem; }

.page__title {
  margin: 0; padding-bottom: .6rem; border-bottom: 1px solid var(--rule-strong);
  font-size: 2rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em;
}
.page__lede { margin: .75rem 0 0; color: var(--ink-soft); }

/* ── Toolbar (search) ───────────────────────────────────────────────────── */
.toolbar {
  display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem;
  margin: 1.75rem 0; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule);
}
.toolbar__field { display: flex; flex-direction: column; gap: .3rem; }
.toolbar__wide { grid-column: 1 / -1; }

@media (min-width: 40rem) {
  .toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* "More filters" and the submit share a row, so no lone button in space. */
  .toolbar__more { grid-column: 1 / 3; align-self: end; }
  .toolbar__submit { grid-column: 3 / 4; }
}

.label {
  font-family: var(--sans); font-size: .75rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}

select, input[type="search"], input[type="checkbox"] { font: inherit; }
select, input[type="search"] {
  width: 100%; min-height: 2.75rem; padding: .55rem .7rem;
  font-size: 1rem;  /* 16px keeps iOS from zooming on focus */
  color: var(--ink); background: var(--paper-raised);
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
input[type="checkbox"] { width: 1.4rem; height: 1.4rem; accent-color: var(--accent); }
select:focus, input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.toolbar__check { display: flex; flex-direction: row; align-items: center; gap: .55rem; padding-top: .5rem; }

.toolbar__more { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: .75rem; }
.toolbar__more > summary {
  list-style: none; cursor: pointer; padding: .35rem 0;
  font-family: var(--sans); font-size: .75rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}
.toolbar__more > summary::-webkit-details-marker { display: none; }
.toolbar__more > summary::before { content: "＋ "; }
.toolbar__more[open] > summary::before { content: "− "; }
.toolbar__more > summary:hover { color: var(--accent); }
.toolbar__more .toolbar__field { margin-top: .75rem; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: .6rem 1.4rem;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: .8125rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.toolbar__submit { width: 100%; }

.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: .6rem 1.4rem;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: .8125rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
}
.cta:hover { background: var(--ink); color: var(--paper); }
/* Pagination: real links, so it works without JavaScript. */
.pager {
  display: flex; flex-wrap: wrap; gap: .75rem;
  margin: 1.75rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--rule);
}

/* ── Messages ───────────────────────────────────────────────────────────── */
.result-count {
  margin: 0 0 1.25rem; font-family: var(--sans); font-size: .8125rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint);
}
.alert {
  margin: 0 0 1.5rem; padding: .75rem 1rem; border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
  color: var(--accent-ink);
}

/* ── Event list ─────────────────────────────────────────────────────────── */
.events { list-style: none; margin: 0; padding: 0; }

.event { padding: 1.15rem 0; border-bottom: 1px solid var(--rule); }
.event:first-child { border-top: 1px solid var(--rule); }

.event__tag {
  display: inline-block; margin: 0 0 .35rem; padding: .1rem .45rem;
  border: 1px solid var(--accent); border-radius: var(--radius);
  font-family: var(--sans); font-size: .75rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.event__title { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.event__when {
  margin: .3rem 0 0; font-family: var(--sans); font-size: .875rem;
  font-weight: 600; color: var(--accent-ink);
}
.event__meta { margin: .2rem 0 0; font-size: .9375rem; line-height: 1.55; color: var(--ink-soft); }
.event__actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
  margin-top: .8rem;
}
.event__source { font-family: var(--sans); font-size: .8125rem; text-decoration: none; }
.event__source:hover { text-decoration: underline; }

/* ── Colophon ───────────────────────────────────────────────────────────── */
.colophon { margin-top: 2.5rem; border-top: 3px double var(--rule-strong); }
.colophon__inner {
  max-width: var(--measure); margin: 0 auto; padding: 1.5rem;
  font-size: .875rem; color: var(--ink-soft);
}
.colophon p { margin: 0 0 .4rem; }
.colophon p:last-child { margin-bottom: 0; }

/* ── Responsive / motion / print ────────────────────────────────────────── */
@media (max-width: 40rem) {
  .masthead__inner { padding: 1.1rem 1rem 1rem; }
  .wordmark__name { font-size: 1.4rem; }
  .page { padding: 1.75rem 1rem 1rem; }
  .page__title { font-size: 1.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media print {
  .masthead, .toolbar, .colophon, .event__actions { display: none; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
}
