/* ==========================================================================
   RacerNet WCAG 2.1 AA Compliant Stylesheet
   ========================================================================== */

:root {
  --msu-navy: #002144;
  --msu-navy-dark: #00162e;
  --msu-gold: #ecac00;
  --msu-gold-light: #ffd24c;
  --bg-page: #f4f6f8;
  --bg-surface: #ffffff;
  --bg-header: #efefef;
  --text-primary: #1a1a1a;
  --text-muted: #4a5568;
  --link-color: #004488;      /* Contrast > 9.5:1 on white */
  --link-hover: #002144;
  --border-color: #cbd5e1;
  --focus-ring: #005fcc;
  --focus-ring-dark-bg: #ffd24c;
}

/* Base & Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Verdana, Helvetica, Arial, sans-serif;
  font-size: 1rem; /* 16px base for WCAG readability */
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-page);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Screen Reader Utility */
.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;
}

/* WCAG 2.4.1: Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background-color: var(--msu-navy);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  transition: top 0.15s ease-in-out;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--msu-gold);
  outline-offset: 2px;
}

/* WCAG 2.4.7: High-Visibility Keyboard Focus */
a:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Links (WCAG 1.4.1: Not relying on color alone — underlined by default) */
a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header-top {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.header-top-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.utility-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.utility-nav li:not(:last-child)::after {
  content: "|";
  margin-left: 0.75rem;
  color: var(--text-muted);
}

.utility-nav a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--msu-navy);
}

/* Primary Tabs Bar */
.primary-tabs {
  background-color: var(--msu-navy);
  border-bottom: 4px solid var(--msu-gold);
}

.primary-tabs ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.primary-tabs a {
  display: inline-block;
  padding: 0.75rem 1.1rem;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px 4px 0 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.primary-tabs a:hover {
  background-color: var(--msu-gold);
  color: var(--msu-navy);
  text-decoration: underline;
}

.primary-tabs a:focus-visible {
  outline: 3px solid var(--focus-ring-dark-bg);
  outline-offset: -3px;
}

/* ==========================================================================
   Main Three-Column Layout (Holy Grail via CSS Grid)
   ========================================================================== */
.page-layout {
  display: grid;
  grid-template-columns: 230px 1fr 185px;
  gap: 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  align-items: start;
}

/* Left Sidebar */
.sidebar-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.link-group {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.link-group h2 {
  margin: 0;
  padding: 0.65rem 1rem;
  font-size: 1.05rem;
  background-color: var(--msu-navy);
  color: #ffffff;
  border-bottom: 3px solid var(--msu-gold);
}

.link-group ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.link-group li a {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.95rem;
  text-decoration: none;
}

.link-group li a:hover {
  background-color: #eef3f8;
  text-decoration: underline;
}

/* Main Content */
.main-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.75rem;
}

.main-content h1 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.65rem;
  color: var(--msu-navy);
  border-bottom: 2px solid var(--msu-gold);
  padding-bottom: 0.5rem;
}

.support-card {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.support-card:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.support-card h2 {
  margin-top: 0;
  margin-bottom: 0.65rem;
  font-size: 1.2rem;
  color: var(--msu-navy);
}

.support-card p {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.tips-list {
  margin: 0.5rem 0 0 0;
  padding-left: 1.5rem;
}

.tips-list li {
  margin-bottom: 0.45rem;
}

/* Right Sidebar */
.sidebar-right {
  display: flex;
  justify-content: center;
}

.promo-banner a {
  display: inline-block;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-surface);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--msu-navy);
  color: #ffffff;
  border-top: 4px solid var(--msu-gold);
  padding: 2.25rem 0;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-logo {
  margin-bottom: 1rem;
}

.footer-col h2 {
  font-size: 1.1rem;
  color: var(--msu-gold-light); /* Contrast > 10:1 on #002144 */
  margin-top: 0;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.footer-col h2.footer-subheading {
  margin-top: 1.5rem;
}

.footer-address {
  font-style: normal;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.footer-gold-text {
  color: var(--msu-gold-light);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.4rem;
}

.site-footer a {
  color: #ffffff;
  text-decoration: underline;
}

.site-footer a:hover {
  color: var(--msu-gold-light);
}

.site-footer a:focus-visible {
  outline: 3px solid var(--focus-ring-dark-bg);
  outline-offset: 2px;
}

.copyright {
  font-size: 0.85rem;
  color: #e2e8f0;
  margin-top: 1rem;
}

/* ==========================================================================
   Responsive Reflow (WCAG 1.4.10: Supports up to 400% zoom without horizontal scroll)
   ========================================================================== */
@media (max-width: 960px) {
  .page-layout {
    grid-template-columns: 220px 1fr;
  }

  .sidebar-right {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .primary-tabs ul {
    justify-content: flex-start;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}