/* SPFPA Local 320 - one stylesheet for every page.
   Palette and type: brand/README.md. Colors come from our own "Still in the Fight"
   flyer (navy, red, cream) and sit beside SPFPA's seal. */

/* Fonts ship with the site (SIL Open Font License, fonts/OFL-*.txt); nothing loads from Google. */
@font-face { font-family: "Anton"; src: url("../fonts/Anton-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #152649;
  --navy-deep: #0f1c39;
  --red: #c1121f;
  --red-bright: #e23744;
  --cream: #f5f1e6;
  --ink: #14171f;
  --muted: #5a6275;
  --rule: #d8d2c4;
  --head: "Anton", Impact, "Arial Narrow Bold", "Helvetica Neue Condensed", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 60rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 1.0625rem/1.55 var(--body);
}

a { color: var(--red); }
a:hover, a:focus-visible { color: var(--navy); }
:focus-visible { outline: 3px solid var(--red-bright); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.1;
  text-transform: uppercase;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }

/* ---- header and tabs ---- */
.site-head { background: var(--navy); color: var(--cream); border-bottom: 6px solid var(--red); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--cream); text-decoration: none; }
.brand img { width: 56px; height: 56px; }
.brand span { font-family: var(--head); font-size: 1.6rem; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.brand small { display: block; font-family: var(--body); font-size: .8rem; letter-spacing: .14em; color: #c9cfdc; margin-top: .25rem; }
.brand:hover, .brand:focus-visible { color: var(--cream); }

.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin-left: auto; padding: 0; list-style: none; }
.tabs a {
  display: block; padding: .45rem .8rem;
  color: var(--cream); text-decoration: none;
  font-family: var(--head); font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase;
  border-bottom: 3px solid transparent;
}
.tabs a:hover, .tabs a:focus-visible { border-bottom-color: var(--red-bright); color: var(--cream); }
.tabs a[aria-current="page"] { border-bottom-color: var(--red-bright); }

/* ---- page body ---- */
/* Footer pinned to the bottom: the page is a column at least one screen tall, and main takes the slack. */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > * { flex-shrink: 0; }
main { padding: 2rem 0 3rem; flex: 1 0 auto; }
main h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); margin: 0 0 .75rem; color: var(--navy); }
main h1 em { font-style: normal; color: var(--red); }
main h2 { font-size: 1.6rem; color: var(--navy); margin: 2rem 0 .5rem; }
.lede { font-size: 1.2rem; max-width: 40rem; }

.hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); color: var(--cream); padding: 2.65rem 0 1.7rem; }
.hero h1 { margin: 0 0 .67em; }   /* no top margin: the padding alone sets the blue above */
.hero .lede { margin-bottom: .8rem; }
.hero h1 { color: var(--cream); }
.hero h1 em { color: var(--red-bright); }
.band { background: var(--red); color: var(--cream); font-family: var(--head); font-size: 1.4rem; text-transform: uppercase; padding: .6rem 0; letter-spacing: .02em; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1rem; margin: calc(2rem + 1em) 0 1.5rem; }   /* top = main's 2rem padding + a paragraph's 1em: the gap above Home's text, repeated below it (Holden 23 Nov) */
.card { background: #fff; border: 1px solid var(--rule); border-top: 5px solid var(--navy); padding: 1rem 1.1rem; }
.card h2, .card h3 { margin: 0 0 .4rem; font-size: 1.35rem; color: var(--navy); }
.card p { margin: .25rem 0 .5rem; }

.note { border-left: 4px solid var(--red); background: #fff; padding: .6rem .9rem; }

/* news list */
.news { list-style: none; padding: 0; margin: 0; }
.news li { border-bottom: 1px solid var(--rule); padding: 1rem 0; }
.news time { font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.news h2 { margin: .2rem 0 .3rem; }

.news figure { margin: .75rem 0 0; }
.news figure img { display: block; max-width: 100%; height: auto; max-height: 34rem; width: auto; border: 1px solid var(--rule); background: #fff; }
.news figcaption { font-size: .85rem; color: var(--muted); margin-top: .3rem; }

/* officers */
.officers { list-style: none; padding: 0; margin: 1em 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1em; }
.officers li { background: #fff; border: 1px solid var(--rule); border-top: 5px solid var(--red); padding: .9rem 1.1rem; }
.officers .role { display: block; font: 1rem var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.officers .name { display: block; font: 1.6rem var(--head); text-transform: uppercase; color: var(--navy); margin-top: .15rem; }
.officers .contact { display: block; margin-top: .4rem; overflow-wrap: anywhere; }

/* footer */
.site-foot { background: var(--navy-deep); color: #c9cfdc; font-size: .9rem; padding: 1.25rem 0; }
.site-foot a { color: var(--cream); }
.site-foot p { margin: .25rem 0; }

/* ---- Weingarten card ---- */
.wcard-pair { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0 .5rem; }
.wcard {
  width: 3.5in; min-height: 2in; max-width: 100%;
  padding: .14in .16in;
  background: #fff; color: var(--ink);
  border: 1px dashed var(--muted);
  font-size: 8.4pt; line-height: 1.3;
}
.wcard h3 { font-size: 11pt; margin: 0 0 .05in; color: var(--navy); }
.wcard p { margin: 0 0 .05in; }
.wcard ul { margin: 0; padding-left: 1.1em; }
.wcard .who { font-size: 7pt; color: var(--muted); margin-top: .05in; }
.wcard-front { border-top: 4px solid var(--red); }

.btn {
  display: inline-block; padding: .55rem 1rem;
  background: var(--red); color: var(--cream); border: 0;
  font: 1.05rem var(--head); text-transform: uppercase; letter-spacing: .04em;
  cursor: pointer; text-decoration: none;
}
.btn:hover, .btn:focus-visible { background: var(--navy); color: var(--cream); }

/* ---- game window ---- */
.window { max-width: 440px; max-width: min(440px, calc((100vh - 3.25rem) * 2 / 3)); max-width: min(440px, calc((100dvh - 3.25rem) * 2 / 3)); margin: 1rem auto; border: 2px solid var(--navy-deep); background: var(--navy-deep); box-shadow: 0 6px 24px rgba(15, 28, 57, .35); }
.window-bar { display: flex; align-items: center; gap: .5rem; padding: .35rem .6rem; background: var(--navy); color: var(--cream); font: 1rem var(--head); letter-spacing: .06em; text-transform: uppercase; }
.window-bar i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--red-bright); display: inline-block; }
.window-bar i + i { background: var(--cream); }
.window canvas { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.keys { text-align: center; color: var(--muted); font-size: .95rem; }
/* Red underline, drawn as a border so it looks the same in every browser and in print */
/* Red underline as a border on an inline-block, so the line is exactly the text's width in every browser and
   the heading stays a plain heading (display: table on an h2 can cost it its heading role in screen readers). */
.redline, .news time { display: inline-block; border-bottom: 3px solid var(--red); padding-bottom: .12em; }

/* ---- downloads ---- */
.downloads { list-style: none; padding: 0; margin: 1em 0 0; }   /* 1em = the gap under the other headings (a paragraph's top margin) */
.downloads li { background: #fff; border: 1px solid var(--rule); border-left: 5px solid var(--navy); padding: .75rem 1rem; margin-bottom: 1em; }
.downloads a { font-weight: 700; font-size: 1.1rem; }
.downloads .meta { display: block; font-size: .85rem; color: var(--muted); margin-top: .1rem; }
.downloads p { margin: .4rem 0 0; }

/* ---- leaderboard ---- */
.board { max-width: 440px; margin: 1.5rem auto 0; }
.board h2 { margin: 0 0 .5rem; text-align: center; }
.scores { margin: 0; padding: 0; list-style: none; counter-reset: rank; background: #fff; border: 1px solid var(--rule); border-top: 5px solid var(--navy); }
.scores li { counter-increment: rank; display: flex; align-items: baseline; gap: .75rem; padding: .35rem .9rem; border-bottom: 1px solid var(--rule); font-size: 1.1rem; }
.scores li:last-child { border-bottom: 0; }
.scores li::before { content: counter(rank) "."; width: 2rem; color: var(--muted); }
.scores .who { font: 1.35rem var(--head); letter-spacing: .12em; color: var(--navy); }
.scores .pts { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.scores li.new { background: #fff3c4; }
.scores li.empty { color: var(--muted); font-size: 1rem; }
.scores li.empty::before { content: none; }
.entry { background: var(--navy); color: var(--cream); padding: .8rem .9rem; margin-bottom: .75rem; border-top: 5px solid var(--red); }
.entry label { display: block; margin-bottom: .5rem; }
.entry-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; }
.entry input { width: 5.5rem; font: 1.6rem var(--head); letter-spacing: .2em; text-transform: uppercase; text-align: center; padding: .2rem .3rem; border: 0; color: var(--navy); }
.btn-quiet { background: transparent; border: 1px solid var(--cream); }
.btn-quiet:hover, .btn-quiet:focus-visible { background: var(--navy-deep); }
.entry[hidden] { display: none; }
.entry-msg { margin: .5rem 0 0; min-height: 1.2em; font-size: .95rem; }
.entry-msg:empty { display: none; }
.btn:disabled { opacity: .6; cursor: wait; }

kbd { font: .85rem/1 ui-monospace, monospace; border: 1px solid var(--muted); border-bottom-width: 2px; border-radius: 3px; padding: .1rem .35rem; background: #fff; }

@media (max-width: 40rem) {
  .tabs { margin-left: 0; width: 100%; }
  .brand span { font-size: 1.35rem; }
}

@media print {
  .site-head, .site-foot, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .wcard { border: 1px dashed #777; break-inside: avoid; }
}
