/* NIRA regional results — style.css. Base copied verbatim from the CNFR results site (cnfr/static/style.css @ 2cd953b)
   so both sites share fonts, colours, header/footer, nav, year bar, breadcrumbs, tables and responsive rules.
   NIRA-only additions are at the end.
   THEME (Oct 26): colours, fonts, wood background and header look are overridden in shared.css (last section), matching collegerodeo.com. */

/* ── Variables ── */
:root {
  --green-dark:   #1a2e1a;
  --green-mid:    #2a4a2a;
  --green-light:  #3d6e3d;
  --gold:         #c9a227;
  --gold-light:   #e6bc4a;
  --gold-pale:    #f5e9c0;
  --tan:          #f4efe4;
  --tan-dark:     #e8dfc8;
  --white:        #ffffff;
  --text-dark:    #1c1c1c;
  --text-mid:     #444;
  --text-light:   #777;
  --border:       #d4c9aa;
  --shadow:       0 2px 12px rgba(0,0,0,.13);

  --font-display: 'Oswald', 'Impact', sans-serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'Inconsolata', 'Courier New', monospace;

  --max-width: 1160px;
  --header-h: 68px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--tan);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Header ── */
.site-header {
  background: var(--green-dark);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 16px rgba(0,0,0,.4);
  border-bottom: 3px solid var(--gold);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.site-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-rodeo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--gold);
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}
.logo-year {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--white);
  opacity: .75;
  font-weight: 400;
}
.logo-tag {
  font-family: var(--font-body);
  font-size: .7rem;
  color: var(--gold-pale);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .8;
}
.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.main-nav a {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--white);
  padding: 6px 14px;
  border-radius: 4px;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.main-nav a:hover {
  background: var(--gold);
  color: var(--green-dark);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 1.4rem;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
  margin-left: auto;
}

/* ── Page wrap ── */
.page-wrap {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 32px 24px 48px;
}

/* ── Footer ── */
.site-footer {
  background: var(--green-dark);
  border-top: 3px solid var(--gold);
  padding: 18px 24px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--gold-pale);
  opacity: .8;
  font-family: var(--font-display);
  letter-spacing: .05em;
}

/* ══ INDEX PAGE ══════════════════════════════════════════════════════ */
.index-hero {
  text-align: center;
  padding: 40px 0 32px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 32px;
}
.index-hero h1 {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.index-subtitle {
  margin-top: 8px;
  font-size: 1.05rem;
  color: var(--text-mid);
  font-style: italic;
}

.index-section {
  margin-bottom: 40px;
}
.index-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-dark);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
  margin-bottom: 16px;
}
.index-section.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

/* Index events table */
.index-events-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.index-events-table th {
  background: var(--green-dark);
  color: var(--gold-pale);
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 10px 16px;
  text-align: left;
}
.index-events-table tr {
  border-bottom: 1px solid var(--border);
}
.index-events-table tr:last-child { border-bottom: none; }
.index-events-table tr:nth-child(even) { background: var(--tan); }
.index-events-table td {
  padding: 10px 16px;
  vertical-align: middle;
}
.event-name-cell a {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--green-mid);
}
.event-name-cell a:hover { color: var(--gold); }
.go-links-cell { display: flex; flex-wrap: wrap; gap: 6px; }
.go-link {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 3px 10px;
  border: 1px solid var(--green-light);
  border-radius: 20px;
  color: var(--green-mid);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.go-link:hover {
  background: var(--green-dark);
  color: var(--gold);
  border-color: var(--green-dark);
  text-decoration: none;
}

/* Index link lists */
.index-links {
  list-style: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.index-links li {
  border-bottom: 1px solid var(--border);
}
.index-links li:last-child { border-bottom: none; }
.index-links a {
  display: block;
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-mid);
  letter-spacing: .04em;
  transition: background .15s, color .15s;
}
.index-links a:hover {
  background: var(--green-dark);
  color: var(--gold);
  text-decoration: none;
}
.index-links.large a { font-size: 1.15rem; padding: 14px 20px; }

/* ══ EVENT PAGES ═════════════════════════════════════════════════════ */
.event-page { max-width: 960px; }

.event-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.event-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.15;
}
.as-of {
  margin-top: 6px;
  font-size: .9rem;
  color: var(--text-light);
  font-style: italic;
}
.breadcrumb {
  margin-bottom: 10px;
}
.breadcrumb a {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green-light);
}
.breadcrumb a:hover { color: var(--gold); }

/* Go round tabs */
.go-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.go-tab {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 5px 14px;
  border: 2px solid var(--green-light);
  border-radius: 4px;
  color: var(--green-mid);
  transition: all .15s;
}
.go-tab:hover, .go-tab.active {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--gold);
  text-decoration: none;
}

/* ══ RESULTS TABLE ═══════════════════════════════════════════════════ */
.results-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-family: var(--font-mono);
  font-size: .9rem;
}
.results-table thead tr {
  background: var(--green-dark);
}
.results-table thead th {
  color: var(--gold-pale);
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--gold);
}
.results-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.results-table tbody tr:last-child { border-bottom: none; }
.results-table tbody tr:nth-child(even) { background: var(--tan); }
.results-table tbody tr:hover { background: var(--gold-pale); }
.results-table tbody td {
  padding: 8px 12px;
  color: var(--text-dark);
  vertical-align: middle;
}
/* First column (rank/place) */
.results-table tbody td:first-child {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--green-mid);
  text-align: right;
  width: 3em;
}
/* NS cells */
.results-table td:has(+ td) {
  /* no special rule needed, handled by JS */
}

/* Top-3 highlight */
/* Place highlights: gold → silver → bronze → 4th → 5th → 6th */
.results-table tbody tr.rank-1 { background: #fdf0b0 !important; }
.results-table tbody tr.rank-2 { background: #efefef !important; }
.results-table tbody tr.rank-3 { background: #fce8d8 !important; }
.results-table tbody tr.rank-4 { background: #edf5e8 !important; }
.results-table tbody tr.rank-5 { background: #e8f0fa !important; }
.results-table tbody tr.rank-6 { background: #f3edf8 !important; }

/* Left-edge accent bar per place */
.results-table tbody tr.rank-1 td:first-child { border-left: 4px solid #c9a227; }
.results-table tbody tr.rank-2 td:first-child { border-left: 4px solid #9e9e9e; }
.results-table tbody tr.rank-3 td:first-child { border-left: 4px solid #c87941; }
.results-table tbody tr.rank-4 td:first-child { border-left: 4px solid #5a9e5a; }
.results-table tbody tr.rank-5 td:first-child { border-left: 4px solid #4a7ec8; }
.results-table tbody tr.rank-6 td:first-child { border-left: 4px solid #9a5ec8; }

.no-data {
  padding: 24px;
  text-align: center;
  color: var(--text-light);
  font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .header-inner { gap: 12px; }
  .logo-tag { display: none; }
  .main-nav { display: none; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--green-dark); padding: 12px 0; border-top: 2px solid var(--gold); z-index: 200; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 24px; border-radius: 0; }
  .nav-toggle { display: block; }
  .index-section.two-col { grid-template-columns: 1fr; }
  .index-hero h1 { font-size: 2.2rem; }
  .event-title { font-size: 1.6rem; }
  .results-table { font-size: .8rem; }
  .results-table thead th, .results-table tbody td { padding: 6px 8px; }
  .page-wrap { padding: 16px 12px 32px; }
}

/* ══ GLOBAL LANDING (multi-year) ════════════════════════════════════ */
.global-hero h1 { font-size: 2.8rem; }

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.year-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 22px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  gap: 6px;
}
.year-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  text-decoration: none;
}
.year-card-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1;
}
.year-card:hover .year-card-num { color: var(--gold); }
.year-card-label {
  font-family: var(--font-display);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
}

/* ══ YEAR BAR — sticky back button strip ════════════════════════════ */
.year-bar {
  background: var(--green-mid);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: var(--header-h);
  z-index: 90;
}
.year-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.year-bar-back {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gold-pale);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px 4px 10px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 4px;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.year-bar-back:hover {
  background: var(--gold);
  color: var(--green-dark);
  border-color: var(--gold);
  text-decoration: none;
}
.year-bar-crumb {
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .06em;
  color: rgba(255,255,255,.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.year-bar-crumb::before {
  content: "/ ";
  opacity: .5;
}
.year-bar-crumb:empty { display: none; }

/* Offset page-wrap so sticky year-bar doesn't overlap content */
.page-wrap { padding-top: 24px; }

@media (max-width: 760px) {
  .year-bar-inner { padding: 0 12px; }
  .year-bar-back  { font-size: .78rem; padding: 4px 10px 4px 8px; }
}

/* ===================== ADDITIONS (new build; existing rules above are unchanged from prod) ===================== */
/* status / On Team legend - only emitted when CNFR_LEGEND=1 */
.results-legend {
  margin-top: 12px;
  font-size: .82rem;
  color: var(--text-mid);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.results-legend b { font-family: var(--font-mono); color: var(--green-mid); }
/* contestant-name links inside result tables: look like plain text with a dotted underline */
.results-table td a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--border); }
.results-table td a:hover { color: var(--green-light); border-bottom-color: var(--gold); }
/* 2005 'Results unavailable' card on the home page */
.year-card-unavailable { opacity: .6; cursor: default; border-style: dashed; }
.year-card-unavailable:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow); }
.year-card-unavailable:hover .year-card-num { color: var(--green-dark); }
/* contestant pages */
.event-page .index-section { margin-top: 28px; }
.event-page .index-section h2 a { color: inherit; text-decoration: none; }
.event-header .as-of a { color: inherit; }

/* ===================== NIRA ADDITIONS (same palette and type as above) ===================== */
.event-page { max-width: 960px; }
.event-page h2 {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--green-dark); border-bottom: 2px solid var(--gold); padding-bottom: 6px; margin: 28px 0 14px;
}
.event-page h2 a { color: inherit; }
.event-page h3 {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; letter-spacing: .04em; color: var(--green-mid);
  margin: 26px 0 8px; padding-top: 6px; border-top: 1px solid var(--border);
}
.event-page > p, .event-page > ul:not(.toc):not(.clist):not(.index-links) { margin: 0 0 14px; line-height: 1.5; }
.event-header .as-of + .as-of { margin-top: 2px; }
.pending { color: var(--text-light); font-style: italic; font-size: .9em; }
/* in-page section links: CNFR go-link pills */
.toc { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 20px; }
.toc a {
  display: inline-block; font-family: var(--font-display); font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  padding: 3px 10px; border: 1px solid var(--green-light); border-radius: 20px; color: var(--green-mid); text-decoration: none;
  transition: background .15s, color .15s;
}
.toc a:hover { background: var(--green-dark); color: var(--gold); border-color: var(--green-dark); text-decoration: none; }
/* plain lists of pages (standings index, membership index, season list): CNFR index-links card */
.event-page > ul:not(.toc):not(.clist):not(.index-links) {
  list-style: none; background: var(--white); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow);
}
.event-page > ul:not(.toc):not(.clist):not(.index-links) > li { border-bottom: 1px solid var(--border); padding: 10px 16px; }
.event-page > ul:not(.toc):not(.clist):not(.index-links) > li:last-child { border-bottom: none; }
.event-page > ul:not(.toc):not(.clist):not(.index-links) > li > a {
  font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: .04em; color: var(--green-mid);
}
.event-page > ul ul { list-style: none; margin-top: 4px; }
/* tables whose first column is text, not a place (schedule, contestant history, region status, team results) */
.results-table.text-first tbody td:first-child {
  font-family: var(--font-body); font-weight: 400; color: var(--text-dark); text-align: left; width: auto;
}
.results-table td.n, .results-table th.n { text-align: right; white-space: nowrap; }
.results-table tbody td:first-child.n { text-align: right; }
.results-table { margin: 0; }
.results-table-wrap { margin-bottom: 18px; }
/* contestant index: A-Z pills, CNFR-styled search box, name columns */
#csearch {
  width: 100%; max-width: 420px; padding: 8px 12px; font-family: var(--font-body); font-size: 1rem;
  border: 2px solid var(--border); border-radius: 6px; background: var(--white); color: var(--text-dark);
}
#csearch:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-pale); }
.clist {
  list-style: none; columns: 2 380px; column-gap: 24px; background: var(--white); border: 1px solid var(--border);
  border-radius: 6px; box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 8px;
}
.clist li { padding: 3px 0; break-inside: avoid; }
.clist li a { font-family: var(--font-display); font-weight: 600; letter-spacing: .03em; color: var(--green-mid); }
.event-page h2.letter { margin-top: 22px; }
.csearch-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 14px; }
#ckind {
  padding: 8px 10px; font-family: var(--font-body); font-size: 1rem; border: 2px solid var(--border);
  border-radius: 6px; background: var(--white); color: var(--text-dark);
}
#ckind:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-pale); }
.cwhere { white-space: nowrap; }
.clist li a.ctag {
  display: inline-block; font-family: var(--font-body); font-weight: 600; font-size: .72rem; letter-spacing: .02em;
  padding: 1px 7px; border-radius: 10px; margin-left: 2px; text-decoration: none; vertical-align: 1px;
}
.clist li a.ctag-reg { background: var(--gold-pale); color: var(--text-dark); border: 1px solid var(--gold); }
.clist li a.ctag-cnfr { background: var(--green-mid); color: var(--white); border: 1px solid var(--green-mid); }
/* membership: staff entries as cards */
.person {
  background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--green-light); border-radius: 6px;
  padding: 8px 14px; margin: 8px 0; line-height: 1.45; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.person .role {
  font-family: var(--font-display); font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); margin-right: 6px;
}
/* NIRA <-> CNFR cross-links */
.cnfr-cta { margin-top: 36px; }
@media (max-width: 760px) { .clist { columns: 1; } }
/* membership: a school's team results (season to date first, then rodeos by date) */
.team-results .group-row th {
  background: var(--gold-pale); color: var(--green-dark); text-align: left; font-family: var(--font-display);
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px;
}
.team-results tbody.season-total td { font-weight: 600; background: #fbf6e6; }
.team-results tbody.season-total tr:last-child td { border-bottom: 3px solid var(--gold); }
/* header, nav, year bar and cross-links: assets/shared.css (also used by the mounted CNFR pages) */

/* Season picker (year bar, right): the same page in another season */
.season-pick { margin-left: auto; position: relative; font-family: var(--font-display); }
.season-pick summary {
  list-style: none; cursor: pointer; font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--gold-pale); padding: 4px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; white-space: nowrap;
}
.season-pick summary::-webkit-details-marker { display: none; }
.season-pick summary::after { content: " \25BE"; }
.season-pick[open] summary, .season-pick summary:hover { background: var(--gold); color: var(--green-dark); border-color: var(--gold); }
.season-pick ul {
  position: absolute; right: 0; top: 100%; margin: 4px 0 0; padding: 6px 0; list-style: none; background: #fff;
  border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.18); max-height: 60vh;
  overflow-y: auto; min-width: 9rem; z-index: 95;
}
.season-pick li a { display: block; padding: 4px 14px; color: var(--green-dark); text-decoration: none; font-size: .9rem; }
.season-pick li a:hover { background: var(--gold-pale); }
.season-pick li a[aria-current] { font-weight: 700; background: var(--green-dark); color: var(--gold); }
