/*DO NOT ERASE! VERSION:&MeetProTemplate_v1.5*/
/*
 * Nittany Track & Field — MeetPro results theme.
 *
 * Colors, type and layout mirror the RaceResult pages (assets/rr-results.css)
 * so both timing systems produce pages that read as one site.
 *
 * Two things to know before editing:
 *
 * 1. MeetPro generates the tables itself and bakes Bootstrap classes into them
 *    (table table-striped table-bordered table-condensed) along with fixed
 *    column classes (td.place, td.athlete, td.team, td.time ...). Those class
 *    names cannot be changed, so much of this file overrides Bootstrap on top
 *    of them rather than replacing the markup.
 * 2. The index page is rebuilt client-side by js/mp-app.js into the tabbed
 *    layout. Classes prefixed mp- are ours; everything else is MeetPro's.
 */

:root {
  --mp-bg: #ffffff;
  --mp-surface: #f7f8fa;
  --mp-border: #dfe3e8;
  --mp-text: #1c2024;
  --mp-muted: #646c76;
  --mp-accent: #16507d;
  --mp-accent-soft: #e8f0f7;
  --mp-win: #12694a;
  --mp-win-soft: #e6f4ee;
  --mp-radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  padding: 0;
  margin: 0;
  background: var(--mp-bg);
  color: var(--mp-text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* MeetPro wraps every page in .container; make it our page frame. */
.container {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

a { text-decoration: none; color: var(--mp-accent); }
a:hover { text-decoration: underline; }

/* Hide the raw MeetPro markup until mp-app.js has rebuilt it, so the page
   never flashes unstyled tables. <noscript> in the template undoes this. */
.mp-preboot #mp-source { display: none; }

/* ============================================================
   Header
   ============================================================ */

.header, .mp-header {
  margin-bottom: 20px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--mp-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
}

.mp-header-main { flex: 1 1 320px; min-width: 0; }

.mp-h1, .header h3.text-muted {
  margin: 0 0 4px;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--mp-text);
  padding: 0;
}

.mp-h1 a, .header h3.text-muted a.home-link-hdr {
  color: inherit;
  font-size: inherit;
}

.mp-meta {
  margin: 0;
  color: var(--mp-muted);
  font-size: 14px;
}

/* MeetPro emits the town and date as inline <span style="font-size:12px">.
   Normalize them and join with a separator dot. */
.mp-meta span, .header span {
  display: inline;
  font-size: 14px !important;
  line-height: 1.4;
  color: var(--mp-muted);
}

.mp-meta span br, .header span br { display: none; }

.mp-meta span + span::before, .header span + span::before {
  content: "·";
  margin: 0 7px;
}

.mp-brand, #logo {
  flex-shrink: 0;
  float: none;
  border: none;
  margin: 0;
  padding: 0;
}

.mp-brand img, #logo img {
  height: 46px;
  width: auto;
  display: block;
}

.home-link, .mp-back {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--mp-accent);
  margin-top: 10px;
}

/* ============================================================
   Tabs
   ============================================================ */

.mp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--mp-border);
}

.mp-tab {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 550;
  color: var(--mp-muted);
  padding: 9px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.mp-tab:hover { color: var(--mp-text); }

.mp-tab-on {
  color: var(--mp-accent);
  border-bottom-color: var(--mp-accent);
}

.mp-tab:focus-visible {
  outline: 2px solid var(--mp-accent);
  outline-offset: 1px;
}

/* ============================================================
   Sections
   ============================================================ */

.mp-section { margin-bottom: 36px; }

.mp-h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.mp-status {
  padding: 14px 16px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface);
  color: var(--mp-muted);
  font-size: 14px;
  margin: 0;
}

.mp-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--mp-win);
  margin-left: auto;
  align-self: center;
  padding-right: 4px;
}

.mp-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================================
   Team scores
   ============================================================ */

.mp-scores {
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface);
  padding: 6px 16px;
  max-width: 480px;
}

.mp-score-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--mp-border);
}

.mp-score-row:last-child { border-bottom: 0; }

.mp-score-pl {
  width: 1.8em;
  flex-shrink: 0;
  color: var(--mp-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* Every team reads the same: no placing is singled out here. */
.mp-score-team {
  flex: 1;
  min-width: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.mp-score-pts {
  font-size: 19px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ---------- pairwise dual cards ---------- */

.mp-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.mp-card {
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  background: var(--mp-surface);
  padding: 16px;
  /* A two-team meet has a single card. Without a cap it stretches the full
     page width and the two scores end up a screen apart. */
  max-width: 440px;
}

.mp-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mp-side {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.mp-side:last-child { text-align: right; align-items: flex-end; }

.mp-team {
  font-size: 13px;
  font-weight: 550;
  color: var(--mp-muted);
  overflow-wrap: anywhere;
}

.mp-score {
  font-size: 30px;
  font-weight: 680;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mp-win .mp-team, .mp-win .mp-score { color: var(--mp-win); }

.mp-vs { color: var(--mp-muted); font-size: 14px; padding: 14px 4px 0; }

.mp-outcome {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 550;
  color: var(--mp-win);
}

.mp-detail { margin-top: 12px; }

.mp-detail > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--mp-accent);
  font-weight: 550;
  padding: 4px 0;
}

.mp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.mp-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}

.mp-mini th, .mp-mini td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--mp-border);
  text-align: left;
}

.mp-mini th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--mp-muted);
  font-weight: 600;
}

.mp-mini .mp-num { text-align: right; font-variant-numeric: tabular-nums; width: 5.5em; }
.mp-mini .mp-num-lead { font-weight: 700; color: var(--mp-win); }

.mp-mini-total td {
  border-bottom: 0;
  border-top: 2px solid var(--mp-border);
  font-weight: 700;
}

/* ============================================================
   Event list
   ============================================================ */

.mp-events {
  width: 100%;
  border-collapse: collapse;
}

.mp-events td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--mp-border);
  vertical-align: middle;
}

.mp-events tr:hover td { background: var(--mp-surface); }

.mp-ev-num {
  width: 2.6em;
  color: var(--mp-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mp-ev-name {
  font-weight: 550;
  overflow-wrap: anywhere;
}

.mp-ev-links {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.mp-link {
  display: inline-block;
  padding: 5px 12px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  background: var(--mp-surface);
  color: var(--mp-muted);
  border: 1px solid var(--mp-border);
}

.mp-link:hover {
  background: var(--mp-accent-soft);
  color: var(--mp-accent);
  border-color: var(--mp-accent-soft);
  text-decoration: none;
}

/* Results carry the emphasis — that is what people come for. */
.mp-link-results {
  background: var(--mp-accent-soft);
  color: var(--mp-accent);
  border-color: var(--mp-accent-soft);
}

.mp-link-results:hover {
  background: var(--mp-accent);
  color: #fff;
  border-color: var(--mp-accent);
}

.mp-link-none {
  display: inline-block;
  padding: 5px 12px;
  margin-left: 6px;
  font-size: 12.5px;
  color: var(--mp-border);
}

/* ============================================================
   Latest results feed
   ============================================================ */

.mp-feed {
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  overflow: hidden;
}

.mp-feed-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--mp-border);
  background: var(--mp-bg);
  color: var(--mp-accent);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}

.mp-feed-item:last-child { border-bottom: 0; }
.mp-feed-item:hover { background: var(--mp-surface); text-decoration: none; }

.mp-feed-when {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--mp-muted);
  margin-top: 2px;
}

/* ============================================================
   Detail pages: results and start lists
   ============================================================ */

.event-results-hdr, .entries-hdr, .event-start-list-hdr,
.event-performance-list-hdr, .rosters-hdr {
  text-transform: none;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.005em;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--mp-border);
}

.round-results-hdr, .heat-results-hdr, .heat-start-list-hdr {
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mp-muted);
  margin: 26px 0 8px;
}

.event-note {
  color: var(--mp-muted);
  font-size: 13px;
  font-style: italic;
}

/* --- neutralize Bootstrap's table chrome, then restyle --- */

.container table.table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 22px;
  background: transparent;
  font-size: 13.5px;
}

.container .table-bordered,
.container .table-bordered > thead > tr > th,
.container .table-bordered > thead > tr > td,
.container .table-bordered > tbody > tr > th,
.container .table-bordered > tbody > tr > td,
.container .table-bordered > tfoot > tr > th,
.container .table-bordered > tfoot > tr > td {
  border: 0;
}

.container .table-striped > tbody > tr:nth-of-type(odd) > td,
.container .table-striped > tbody > tr:nth-of-type(odd) > th {
  background: transparent;
}

.container table.table > thead > tr > th,
.container table.table > tbody > tr > td,
.container table.table > tbody > tr > th,
.container table.table-condensed > thead > tr > th,
.container table.table-condensed > tbody > tr > td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--mp-border);
  vertical-align: middle;
}

.container table.table > thead > tr > th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mp-muted);
  font-weight: 600;
  background: transparent;
  border-bottom: 2px solid var(--mp-border);
  white-space: nowrap;
}

.container table.table > tbody > tr:hover > td { background: var(--mp-surface); }

/* Times and marks read as numbers: tabular figures keep the digits aligned. */
td.time, td.seed, td.mark, td.english, td.place, td.hplace, td.lane,
td.points, td.score, td.jd, td.wind {
  font-variant-numeric: tabular-nums;
}

td.athlete { font-weight: 550; }
td.team { color: var(--mp-muted); }

/* A scratched athlete: say so with type, not a background image. */
tr.scratched td {
  background-image: none;
  color: var(--mp-muted);
  font-style: italic;
}

tr.scratched td.multiple { background: none; }

/* --- field-event and split sub-tables inside a result row --- */

.vertical-table { border: none; }

.vertical-table th {
  height: 23px;
  font-size: 10px;
  background: var(--mp-surface);
  color: var(--mp-muted);
  padding: 2px 4px;
  text-align: center;
}

.vertical-table td {
  font-size: 11px;
  height: 23px;
  padding: 2px 4px;
  text-align: center;
}

.horizontal-table { width: 100%; }
.horizontal-table td { font-size: 11px; height: 12px; }

.splits-table { width: 100%; border: none; text-align: center; }
.splits-table .split { padding: 2px 0; }

.splits-table .cumulative .split {
  font-size: 10px;
  font-style: italic;
  color: var(--mp-muted);
}

.relay-split-table { width: 100%; text-align: center; }
.relay-split-table em { font-size: 11px; font-style: italic; }

.records-table td { padding: 2px 4px; }

p.multi-athlete, .sub-event p { margin: 0; }

.sub-event-points, .sub-event-wind { font-size: 12px; font-style: italic; }

td.splits { font-size: 11px !important; }

img.teamlogo { height: 20px; padding-right: 5px; }

/* --- column alignment and widths (MeetPro's own class names) --- */

th.lane, th.place, th.hplace, th.jd, th.comp, th.squad, th.year, th.gender,
th.time, th.seed, th.mark, th.english, th.wind, th.code, th.points, th.score,
th.entries, th.start-list, th.performance-list, th.results {
  text-align: center;
}

td.lane, td.row-num, td.event-num, td.place, td.hplace, td.jd, td.comp,
td.squad, td.year, td.gender, td.code, td.points, td.score, td.entries,
td.start-list, td.performance-list, td.results {
  text-align: center;
}

td.seed, td.mark, td.time, td.wind, td.english, td.sub-event { text-align: right; }

th.row-num, td.row-num, th.event-num, td.event-num { width: 60px; }
th.place, td.place, th.jd, td.jd, th.points, td.points { width: 40px; }
th.lane, td.lane, th.year, td.year, th.comp, td.comp { width: 44px; }
th.hplace, td.hplace { width: 50px; }
th.squad, td.squad, th.wind, td.wind { width: 54px; }
th.gender, td.gender, th.code, td.code, th.heat-lane, td.heat-lane { width: 60px; }
th.entries, td.entries, th.results, td.results { width: 70px; }
th.time, td.time, th.seed, td.seed, th.mark, td.mark, th.english, td.english,
th.start-list, td.start-list { width: 84px; }
th.performance-list, td.performance-list { width: 135px; }

.entries-list-table tr.athlete-odd > td,
.entries-list-table tr.athlete-even > td { background-color: transparent !important; }

.results-table tr.record-break > td { background-color: transparent !important; }

/* ============================================================
   Footer
   ============================================================ */

.footer, .mp-footer {
  margin-top: 32px;
  padding: 16px 0 0;
  border-top: 1px solid var(--mp-border);
  color: var(--mp-muted);
  font-size: 13px;
}

.footer img { display: none; }

.mp-stamp { margin: 0; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 767px) {
  .container { padding: 16px 14px 40px; }
  .mp-h1, .header h3.text-muted { font-size: 21px; }
  .mp-brand img, #logo img { height: 38px; }
  .mp-tab { padding: 9px 12px; }
  .mp-scores { max-width: none; }
}

@media (max-width: 560px) {
  .container table.table { font-size: 12.5px; }
  .container table.table > thead > tr > th,
  .container table.table > tbody > tr > td { padding: 7px 6px; }
  .mp-events td { padding: 10px 4px; }
  .mp-link, .mp-link-none { padding: 5px 9px; font-size: 11.5px; margin-left: 4px; }
  /* The event number is the least useful column when space is tight. */
  .mp-ev-num { display: none; }
  td.year, td.comp, th.year, th.comp { display: none; }
}

@media print {
  a[href]:after { content: none !important; }
  .mp-tabs, .mp-feed, .home-link, .mp-back { display: none; }
  .container { max-width: none; }
}
