/* ============================================
   SILVER & BLACK HQ — CSS
   Raiders: Black, Silver, White
   WCAG 2.2 AA+ Accessible
   ============================================ */

/* --- RESET --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- CUSTOM PROPERTIES --- */
:root {
  /* Base palette */
  --black: #0b0b0b;
  --gray-950: #141414;
  --gray-900: #1a1a1a;
  --gray-800: #2a2a2a;
  --gray-700: #3a3a3a;
  --gray-600: #555;
  --gray-500: #717171;
  --gray-400: #999;
  --gray-300: #b5b5b5;
  --gray-200: #d4d4d4;
  --gray-100: #e8e8e8;
  --gray-50: #f3f3f3;
  --white: #fafafa;
  --silver: #a5acaf;
  --focus-ring: #4a90d9;

  /* Typography */
  --font-heading: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-body: Georgia, 'Times New Roman', serif;
  --font-mono: 'Courier New', Courier, monospace;
  --line-height-body: 1.7;
  --line-height-heading: 1.2;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Layout */
  --max-width: 72rem;
  --content-width: 48rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* --- DARK THEME (default) --- */
[data-theme="dark"] {
  --bg-primary: var(--black);
  --bg-secondary: var(--gray-900);
  --bg-card: var(--gray-800);
  --bg-card-hover: var(--gray-700);
  --text-primary: var(--gray-100);
  --text-secondary: var(--gray-400);
  --text-heading: var(--white);
  --border-color: var(--gray-700);
  --border-subtle: var(--gray-800);
  --link-color: var(--silver);
  --link-hover: var(--white);
  --accent: var(--silver);
  --accent-text: var(--black);
  --watermark-opacity: 0.02;
}

/* --- LIGHT THEME (Away) --- */
[data-theme="light"] {
  --bg-primary: var(--white);
  --bg-secondary: var(--gray-50);
  --bg-card: var(--gray-100);
  --bg-card-hover: var(--gray-200);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-heading: var(--black);
  --border-color: var(--gray-300);
  --border-subtle: var(--gray-200);
  --link-color: var(--gray-700);
  --link-hover: var(--black);
  --accent: var(--gray-700);
  --accent-text: var(--white);
  --watermark-opacity: 0.06;
}

/* --- SKIP LINK --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 1000;
  padding: var(--space-sm) var(--space-md);
  background: var(--focus-ring);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

/* --- SCREEN READER ONLY --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- FOCUS STYLES (WCAG 2.4.7 & 2.4.11) --- */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* --- BASE STYLES --- */
html {
  font-size: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: var(--line-height-body);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- WATERMARK LOGO --- */
body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(70vw, 1200px);
  height: min(70vw, 1200px);
  background-image: url('../images/oakland-raiders-logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: var(--watermark-opacity);
  pointer-events: none;
  z-index: 0;
  transition: opacity var(--transition-base);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  line-height: var(--line-height-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border-color);
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-md);
  max-width: 68ch;
}

strong {
  font-weight: 700;
  color: var(--text-heading);
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* --- LINKS --- */
a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link-hover);
}

/* --- HEADER --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) var(--space-lg);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.logo-silver { color: var(--silver); }
.logo-amp { color: var(--text-secondary); margin: 0 0.15em; }
.logo-black { color: var(--text-heading); }
.logo-hq { color: var(--text-secondary); font-weight: 400; }

/* --- NAVIGATION --- */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  padding: var(--space-sm);
  cursor: pointer;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-xs);
}

.nav-list a {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  /* Minimum touch target 44x44 via padding */
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--text-heading);
  background-color: var(--bg-card);
}

.nav-list a[aria-current="page"] {
  border-bottom: 2px solid var(--accent);
}

/* --- THEME SWITCH --- */
.theme-switch-wrapper {
  flex-shrink: 0;
}

.theme-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
}

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

.slider {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 56px;
  height: 30px;
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 30px;
  transition: background-color var(--transition-base);
  /* 44px touch target */
  min-height: 44px;
  min-width: 56px;
  justify-content: center;
}

.slider::before {
  content: '';
  position: absolute;
  left: 3px;
  width: 22px;
  height: 22px;
  background-color: var(--text-heading);
  border-radius: 50%;
  transition: transform var(--transition-base);
}

.theme-switch input:checked + .slider::before {
  transform: translateX(24px);
}

.theme-switch input:focus-visible + .slider {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.slider-icon {
  position: absolute;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.slider-icon--light {
  left: 6px;
}

.slider-icon--dark {
  right: 6px;
}

/* --- MAIN CONTENT --- */
main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
}

main:focus {
  outline: none;
}

/* --- PAGE HERO --- */
.page-hero {
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 3px solid var(--border-color);
}

.page-hero h1 {
  margin-bottom: var(--space-sm);
}

.page-hero .hero-subtitle {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* --- CONTENT SECTION --- */
.content-section {
  margin-bottom: var(--space-3xl);
}

/* --- CARDS --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: var(--space-lg);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.card h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

.card .card-meta {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

.card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* --- ROSTER TABLE --- */
.table-wrapper {
  overflow-x: auto;
  margin: var(--space-lg) 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

caption {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: left;
  padding: var(--space-md);
  color: var(--text-heading);
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-color);
}

thead th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

tbody td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

tbody tr:hover {
  background: var(--bg-card);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Scope column for screen readers */
th[scope="row"] {
  font-weight: 700;
  color: var(--text-heading);
}

/* --- DEFINITION LIST (football terms) --- */
.terms-list {
  margin: var(--space-lg) 0;
}

.terms-list dt {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-heading);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.terms-list dt:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.terms-list dd {
  margin-left: 0;
  margin-top: var(--space-xs);
  color: var(--text-secondary);
  padding-left: var(--space-lg);
  border-left: 3px solid var(--border-color);
}

/* --- COACH PROFILE --- */
.coach-feature {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
}

.coach-feature h3 {
  margin-top: 0;
}

.coach-feature .coach-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* --- INFO CALLOUT --- */
.callout {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  border-radius: 0 6px 6px 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* --- HOME PAGE NAV CARDS --- */
.home-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-lg);
  margin: var(--space-2xl) 0;
}

.home-nav-card {
  display: block;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: var(--space-xl);
  text-decoration: none;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.home-nav-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .home-nav-card:hover {
    transform: none;
  }
}

.home-nav-card .card-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.home-nav-card .card-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
}

.home-nav-card .card-desc {
  display: block;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* --- FOOTER --- */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-2xl) var(--space-lg);
  margin-top: var(--space-3xl);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-tagline {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
}

.footer-legal,
.footer-a11y,
.footer-copy {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.footer-a11y {
  font-style: italic;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list a {
    padding: var(--space-md);
    font-size: 1rem;
  }

  .site-header {
    padding: var(--space-sm) var(--space-md);
  }

  main {
    padding: var(--space-lg) var(--space-md) var(--space-2xl);
  }
}

/* --- HIGH CONTRAST MODE (beyond WCAG) --- */
@media (forced-colors: active) {
  .skip-link {
    border: 2px solid;
  }

  .card,
  .coach-feature,
  .callout {
    border: 2px solid;
  }

  .slider {
    border: 2px solid;
  }

  .nav-list a[aria-current="page"] {
    border: 2px solid;
  }
}

/* --- PRINT STYLES --- */
@media print {
  .site-header,
  .theme-switch-wrapper,
  .skip-link,
  .nav-toggle {
    display: none;
  }

  body::before {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  main {
    max-width: 100%;
    padding: 0;
  }
}
