/* ==========================================================================
   NESSIS — New England Symposium on Statistics in Sports
   Site-wide stylesheet
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f6f8;
  --color-text: #1b1f27;
  --color-text-muted: #565f6d;
  --color-border: #e0e3e8;
  --color-navy: #16213a;
  --color-navy-dark: #0e1526;
  --color-accent: #a72d33;
  --color-accent-dark: #832127;
  --color-focus: #2f6fed;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 20, 30, 0.08);
  --shadow-md: 0 6px 20px rgba(15, 20, 30, 0.10);
  --max-width: 1120px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #12161f;
    --color-bg-alt: #191f2b;
    --color-text: #e7e9ee;
    --color-text-muted: #a8b0bd;
    --color-border: #2a3141;
    --color-navy: #0b0f18;
    --color-navy-dark: #05070c;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

img { max-width: 100%; height: auto; border: 0; }

a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--color-accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--color-text); }
h2 { font-size: 1.7rem; margin: 0 0 1rem; }
h3 { font-size: 1.35rem; margin: 1.5rem 0 0.75rem; }
h4 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

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

.site-header {
  /* The banner artwork has a white backdrop baked into the JPEG, so this strip
     stays light in both color schemes rather than switching to the dark navy
     used elsewhere — otherwise the image would sit in a mismatched box. */
  background: #ffffff;
  border-bottom: 3px solid var(--color-accent);
}

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

.brand {
  display: block;
  line-height: 0;
}
.brand img {
  display: block;
  height: auto;
  width: auto;
  max-width: 100%;
  /* Above the source image's native height (195px) so it renders at full
     native resolution on any viewport wide enough to fit it, instead of
     being shrunk down — max-width: 100% still handles narrow screens. */
  max-height: 220px;
}

/* ---------------- Navigation ---------------- */

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-navy);
  color: var(--color-navy);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.95rem;
}

nav.site-nav {
  background: var(--color-navy-dark);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.nav-inner > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

.nav-inner > ul > li { position: relative; margin: 0; }

.nav-inner a {
  display: block;
  color: #e7e9ee;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 16px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.nav-inner > ul > li > a:hover,
.nav-inner > ul > li > a[aria-current="page"] {
  background: var(--color-accent);
  color: #fff;
}

.nav-inner li ul {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 200px;
  background: var(--color-navy-dark);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 20;
  border-top: 2px solid var(--color-accent);
}

.nav-inner li:hover > ul,
.nav-inner li:focus-within > ul {
  display: block;
}

.nav-inner li ul a { padding: 10px 16px; font-weight: 500; }
.nav-inner li ul a:hover { background: var(--color-accent); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  nav.site-nav { display: none; }
  nav.site-nav.open { display: block; }
  .nav-inner > ul { flex-direction: column; }
  .nav-inner li ul { position: static; box-shadow: none; }
  .nav-inner li:hover > ul, .nav-inner li:focus-within > ul { display: none; }
  .nav-inner li.submenu-open > ul { display: block; }
}

/* ---------------- Layout ---------------- */

main { display: block; }

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 56px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; }
}

.content { min-width: 0; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.lede {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.notice {
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg-alt);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 24px;
}

.button, button[type="submit"], input[type="submit"] {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button[type="submit"]:hover, input[type="submit"]:hover { background: var(--color-accent-dark); color: #fff; }
.button[hidden], button[hidden] { display: none !important; }

/* ---------------- Sidebar ---------------- */

.sidebar { min-width: 0; }

.sidebar-box {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}

.sidebar-box h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.sidebar-box ul { list-style: none; margin: 0; padding: 0; }
.sidebar-box li { margin-bottom: 8px; }
.sidebar-box a { text-decoration: none; font-weight: 600; }
.sidebar-box a:hover { text-decoration: underline; }

.news-list { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.news-list li {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}
.news-list li:last-child { border-bottom: 0; }

/* ---------------- Sponsors grid ---------------- */

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin: 20px 0 28px;
}

.sponsor-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  background: var(--color-bg-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.sponsor-card img { max-height: 70px; width: auto; }
.sponsor-card span { font-weight: 600; color: var(--color-text); font-size: 0.95rem; }

/* ---------------- Forms ---------------- */

form { max-width: 600px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

input[type="text"], input[type="email"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
}

textarea { min-height: 160px; resize: vertical; }

.g-recaptcha { margin: 8px 0 16px; }

/* ---------------- Tables ---------------- */

table { border-collapse: collapse; width: 100%; margin: 16px 0; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--color-border); }

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

.site-footer {
  background: var(--color-navy);
  color: #c7cede;
  text-align: center;
  padding: 24px 20px;
  font-size: 0.9rem;
}
.site-footer a { color: #fff; }

/* ---------------- Utilities ---------------- */

.center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
