/* ==========================================================================
   SportNews, fast, accessible, SEO-first stylesheet
   No frameworks, no external fonts, no external requests.
   ========================================================================== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #edeff3;
  --text: #10141f;
  --muted: #5c6473;
  --border: #e2e5eb;
  --accent: #e11d2e;
  --accent-hover: #c11424;
  --accent-contrast: #ffffff;
  --chip-bg: #10141f;
  --chip-text: #ffffff;
  --shadow: 0 1px 2px rgba(16, 20, 31, 0.05), 0 10px 30px rgba(16, 20, 31, 0.07);
  --shadow-lift: 0 2px 4px rgba(16, 20, 31, 0.06), 0 18px 44px rgba(16, 20, 31, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --header-bg: rgba(245, 246, 248, 0.85);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17;
    --surface: #121826;
    --surface-2: #1a2234;
    --text: #e8ebf1;
    --muted: #99a1b3;
    --border: #232c40;
    --accent: #f43f4f;
    --accent-hover: #ff5d6c;
    --chip-bg: #e8ebf1;
    --chip-text: #0b0f17;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.45), 0 18px 44px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(11, 15, 23, 0.85);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #1a2234;
  --text: #e8ebf1;
  --muted: #99a1b3;
  --border: #232c40;
  --accent: #f43f4f;
  --accent-hover: #ff5d6c;
  --chip-bg: #e8ebf1;
  --chip-text: #0b0f17;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.45), 0 18px 44px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(11, 15, 23, 0.85);
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .brand-accent { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  overflow-x: auto;
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--accent); }

.theme-toggle {
  flex: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* --------------------------------------------------------------------------
   Section titles & chips
   -------------------------------------------------------------------------- */

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 2.5rem 0 1.25rem;
}
.section-title::before {
  content: "";
  width: 6px;
  height: 1.35em;
  border-radius: 3px;
  background: var(--accent);
  flex: none;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
}

.chip {
  display: inline-block;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.category-chip {
  display: inline-block;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
}
.category-chip:hover { background: var(--accent-hover); }

/* --------------------------------------------------------------------------
   Hero (featured article)
   -------------------------------------------------------------------------- */

.hero { margin-top: 2rem; }

.hero-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.hero-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }

.hero-card .hero-media { position: relative; min-height: 320px; }
.hero-card .hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card .hero-body {
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
}

.hero-card h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.hero-card h2 a { text-decoration: none; }
.hero-card h2 a:hover { color: var(--accent); }

.hero-card .hero-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

@media (max-width: 780px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-card .hero-media { min-height: 220px; }
  .hero-card .hero-body { padding: 1.5rem; }
}

/* --------------------------------------------------------------------------
   Article cards
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }

.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.card h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 800;
}
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }

.card .card-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.83rem;
  margin-top: auto;
}
.meta .dot { opacity: 0.5; }

/* --------------------------------------------------------------------------
   Article page
   -------------------------------------------------------------------------- */

.breadcrumbs {
  margin: 1.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.breadcrumbs li + li::before { content: "›"; margin-right: 0.4rem; opacity: 0.6; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

.article-header { max-width: 780px; margin: 1.5rem auto 0; }

.article-header h1 {
  margin: 0.75rem 0 0.75rem;
  font-size: clamp(1.8rem, 4.5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
}

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

.article-header .meta { margin-top: 1rem; font-size: 0.9rem; }

.article-hero-img {
  max-width: 980px;
  margin: 1.75rem auto 0;
}
.article-hero-img img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.article-hero-img figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
  text-align: center;
}

.prose {
  max-width: 780px;
  margin: 1.5rem auto 0;
  font-size: 1.06rem;
  line-height: 1.75;
}
.prose p { margin: 1.2rem 0; }
.prose h2 {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2.4rem 0 0.8rem;
  font-weight: 800;
}
.prose h3 {
  font-size: 1.2rem;
  margin: 1.8rem 0 0.6rem;
  font-weight: 800;
}
.prose a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent-hover); }
.prose ul, .prose ol { margin: 1.2rem 0; padding-left: 1.4rem; }
.prose li { margin: 0.45rem 0; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose blockquote {
  margin: 1.8rem 0;
  padding: 0.9rem 1.4rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.prose blockquote p { margin: 0; }
.prose img { border-radius: var(--radius-sm); margin: 1.5rem 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.prose code {
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  font-size: 0.92em;
}

/* Tags + share */

.article-footer {
  max-width: 780px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.share-row { display: flex; align-items: center; gap: 0.5rem; }
.share-row a, .share-row button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.share-row a:hover, .share-row button:hover { border-color: var(--accent); color: var(--accent); }

/* Related */

.related { margin-top: 3rem; }

/* --------------------------------------------------------------------------
   Category / listing pages
   -------------------------------------------------------------------------- */

.page-header { margin: 2.5rem 0 1.5rem; max-width: 780px; }
.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  font-weight: 800;
}
.page-header p { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
}
@media (max-width: 700px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

.site-footer h2 {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  color: var(--muted);
}
.site-footer p { margin: 0; color: var(--muted); font-size: 0.93rem; max-width: 42ch; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.35rem 0; }
.site-footer a { color: var(--text); text-decoration: none; font-size: 0.93rem; }
.site-footer a:hover { color: var(--accent); }

.site-footer .footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.1rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.error-page {
  text-align: center;
  padding: 5rem 1rem;
}
.error-page .error-code {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  margin: 0;
}
.error-page h1 { margin: 0.75rem 0; letter-spacing: -0.02em; }
.error-page p { color: var(--muted); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  text-decoration: none;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
