:root {
  color-scheme: light;
  --paper: #f3ead7;
  --ink: #161616;
  --muted: #5c5348;
  --rule: #161616;
  --red: #b11226;
  --navy: #16324f;
  --panel: #fffaf1;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Newsreader, Georgia, serif;
  background:
    linear-gradient(90deg, rgba(22, 22, 22, 0.04) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

.masthead,
.sport {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 8px;
  text-align: center;
}

.edition {
  margin: 0 0 6px;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--red);
}

.wordmark {
  margin: 0;
  font-family: Anton, Impact, sans-serif;
  font-size: clamp(3.4rem, 9vw, 6.4rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 0.9;
  text-transform: uppercase;
}

.wordmark a {
  color: inherit;
  text-decoration: none;
}

.masthead {
  border-bottom: 4px solid var(--rule);
  box-shadow: 0 8px 0 var(--red);
  padding-bottom: 28px;
  margin-bottom: 8px;
}

.site-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 18px 0 28px;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-nav-sports {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.site-nav a,
.site-nav button {
  display: inline-block;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--ink);
  text-decoration: none;
}

.site-nav button {
  font: inherit;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav button:hover {
  border-bottom-color: var(--red);
  color: var(--red);
}

h1,
.sport h2,
.history h2,
.history-modal h2,
.caption h3,
#detail-title,
.table-block h3 {
  font-family: Anton, Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.8rem, 6vw, 4.6rem);
}

.sport h2,
.history h2,
.history-modal h2 {
  margin: 0 auto 18px;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.sport h2 {
  display: block;
  padding: 10px 16px;
  color: #f6f1e7;
}

#field-hockey h2 {
  background: var(--red);
}

#lacrosse h2 {
  background: var(--navy);
}

.history {
  max-width: 1120px;
  margin: 8px auto 0;
  padding: 36px 24px 96px;
  text-align: center;
  border-top: 4px solid var(--rule);
  box-shadow: 0 -8px 0 var(--red);
}

.history h2 {
  display: block;
  padding: 10px 16px;
  background: var(--ink);
  color: #f6f1e7;
}

.history-open {
  margin-top: 22px;
  font-family: Anton, Impact, sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--red);
  border: 0;
  padding: 12px 22px;
  cursor: pointer;
}

.history-open:hover {
  background: var(--ink);
}

.history-open:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.lede,
.history-status,
#detail-meta {
  max-width: 38rem;
  margin: 0 auto;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 0 36px;
  text-align: center;
}

.sport .grid {
  max-width: none;
  padding-bottom: 48px;
}

.tile {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  z-index: 1;
}

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  box-shadow: 6px 6px 0 rgba(22, 22, 22, 0.12);
  transform: translateY(0);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
  border-bottom: 1px solid var(--rule);
}

.caption {
  padding: 16px 18px 18px;
  text-align: center;
}

.caption h3 {
  margin: 0 0 6px;
  font-size: 1.55rem;
}

.caption p {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: var(--muted);
}

.host {
  display: inline-block;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

#lacrosse .host {
  color: var(--navy);
}

.tile:hover,
.tile:focus-visible {
  z-index: 2;
}

.tile:hover .card,
.tile:focus-visible .card {
  transform: translateY(-6px);
  box-shadow: 10px 12px 0 rgba(22, 22, 22, 0.16);
}

.tile:focus-visible {
  outline: none;
}

.tile:focus-visible .card {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.history-modal {
  width: min(1080px, calc(100% - 32px));
  max-height: min(860px, calc(100% - 48px));
  margin: auto;
  padding: 28px 28px 32px;
  overflow: auto;
  border: 3px solid var(--rule);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 12px 12px 0 rgba(22, 22, 22, 0.2);
}

.history-modal::backdrop {
  background: rgba(22, 22, 22, 0.55);
}

.history-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--rule);
}

.history-toolbar .text-button {
  justify-self: end;
}

.text-button,
.pager button,
.history-form button {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--rule);
  border-radius: 0;
  padding: 8px 14px;
  cursor: pointer;
}

.text-button:hover,
.pager button:hover,
.history-form button:hover {
  background: var(--ink);
  color: var(--paper);
}

[hidden] {
  display: none !important;
}

.history-form {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 0.7fr)) auto;
  gap: 12px;
  margin-top: 22px;
  align-items: end;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field span {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-form input,
.history-form select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--rule);
  border-radius: 0;
}

.history-form input:focus,
.history-form select:focus,
.history-form button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.history-status {
  min-height: 1.4em;
  margin-top: 14px;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

.table-scroll {
  overflow: auto;
  max-height: 46vh;
  margin-top: 16px;
  border: 2px solid var(--rule);
  background: var(--panel);
  text-align: left;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(22, 22, 22, 0.15);
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--ink);
  color: #f6f1e7;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(22, 22, 22, 0.04);
}

.data-table tbody tr:hover {
  background: rgba(177, 18, 38, 0.08);
}

.row-open {
  font-family: Anton, Impact, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.row-open:hover {
  color: var(--red);
}

.table-block {
  margin-top: 22px;
}

#detail-title {
  margin: 18px 0 6px;
  font-size: 2rem;
}

#history-detail {
  text-align: center;
}

#history-back {
  margin-top: 16px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 900px) {
  .masthead {
    padding-top: 28px;
  }

  .grid,
  .sport .grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .history-form,
  .history-toolbar {
    grid-template-columns: 1fr;
  }

  .history-toolbar .text-button {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }

  .tile:hover .card,
  .tile:focus-visible .card {
    transform: none;
  }
}
