/* Mobile-first, no framework. Colours are tokens so the dark theme only swaps values. */

:root {
  --bg: #ffffff;
  --surface: #f5f7f9;
  --text: #16181d;
  --muted: #5b6470;
  --border: #dde1e6;
  --accent: #0b5cad;
  --accent-text: #ffffff;
  --label-bg: #e8eef5;
  --radius: 10px;
  --wrap: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #171d24;
    --text: #e6e8eb;
    --muted: #9aa4b0;
    --border: #2a313a;
    --accent: #6cb4ff;
    --accent-text: #0f1419;
    --label-bg: #1f2a36;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 var(--font);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
}

a:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  /* Inline only, so elements with .wrap keep their own top and bottom padding. */
  padding-inline: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 0.5rem;
}

/* Header and navigation */

.site-header {
  border-bottom: 1px solid var(--border);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.site-name {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.header-search input,
.search-form input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.header-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 14rem;
}

.header-search input {
  min-width: 0;
}

.league-nav ul {
  display: flex;
  gap: 0.25rem;
  margin: 0 auto;
  padding-top: 0;
  padding-bottom: 0.5rem;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.league-nav a {
  display: block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.league-nav a:hover {
  background: var(--surface);
}

.league-nav a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-text);
}

/* Page structure */

main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.page-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.9rem;
}

.page-intro {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.section {
  margin-bottom: 2.5rem;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.3rem;
}

.section-title a {
  color: var(--text);
  text-decoration: none;
}

.section-title a:hover {
  text-decoration: underline;
}

.more {
  margin: 0.75rem 0 0;
  font-weight: 600;
}

.empty {
  color: var(--muted);
}

/* Article cards */

.grid,
.list {
  display: grid;
  gap: 1rem;
}

.card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card-title {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.1rem;
}

.card--large .card-title {
  font-size: 1.4rem;
}

.card-title a {
  color: var(--text);
  text-decoration: none;
}

.card-title a:hover {
  text-decoration: underline;
}

.card-teaser {
  margin: 0;
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.league-tag {
  font-weight: 700;
  text-decoration: none;
}

.label {
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--label-bg);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Article page */

.article {
  max-width: 42rem;
}

.article h1 {
  margin: 0.5rem 0;
  font-size: 2rem;
}

.article-teaser {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.source {
  margin: 0 0 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

.source p {
  margin: 0 0 0.75rem;
}

.article-body {
  font-size: 1.075rem;
}

.teams h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1rem;
}

.article + .section {
  margin-top: 2.5rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list a {
  display: block;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.button {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* Search and pagination */

.search-form {
  margin-bottom: 1.5rem;
}

.search-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.search-row {
  display: flex;
  gap: 0.5rem;
}

.result-count {
  color: var(--muted);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  font-weight: 600;
}

.pagination span {
  color: var(--muted);
  font-weight: 400;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Wider screens */

@media (min-width: 40rem) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid--featured {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .grid--featured .card--large {
    grid-row: span 2;
  }

  .list {
    max-width: 48rem;
  }
}
