/* Husker MBB archive — scoped styles for fragments injected into the IPS theme.
   Mirrors the live vankat/nebrasketball theme: white widget cards with a red
   header bar, system UI font, 14px body text, gray-50 table headers and
   10px/6px cells split by gray-200 rules. */

.hkc-archive {
  --scarlet: #ec1313;
  --scarlet-dark: #c01010;
  --ink: #1c1f26;
  --muted: #4b5563;
  --line: #e5e7eb;
  --line-soft: #f1f2f4;
  --card: #ffffff;
  --thead: #f9fafb;
  color: var(--ink);
  font-family: system-ui, system-ui, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  max-width: 100%;
  padding-bottom: 4px;
  overflow-wrap: anywhere;
}

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

.hkc-archive h1,
.hkc-archive h2,
.hkc-archive h3,
.hkc-archive h4 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
}

.hkc-archive h1 { font-size: 28px; margin: 0 0 12px; }
.hkc-archive h2 { font-size: 18px; margin: 0 0 12px; }
.hkc-archive h3 { font-size: 15px; margin: 0 0 8px; }
.hkc-archive h4 { font-size: 14px; margin: 0 0 6px; }

.hkc-archive p { margin: 0 0 10px; }
.hkc-archive ul,
.hkc-archive ol { margin: 0 0 10px; padding-left: 22px; }
.hkc-archive li { margin: 2px 0; }
.hkc-archive small,
.hkc-archive .small { font-size: 12.5px; }

.hkc-archive a { color: var(--scarlet-dark); text-decoration: none; }
.hkc-archive a:hover { color: var(--scarlet); text-decoration: underline; }

/* Screen-reader-only helper (kept for any page that still uses it). */
.hkc-archive .hkc-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hkc-archive .muted { color: var(--muted); }

/* ------------------------------------------------------------------ page */

/* One native-looking widget per archive page: red header bar + white body. */
.hkc-archive .hkc-page-widget {
  background: var(--card);
  border: 1px solid #e2e4e9;
  border-radius: 9px;
  box-shadow: 0 6.2px 7px -3px rgba(10, 12, 20, .05);
  overflow: hidden;
  margin: 0 0 21px;
}

.hkc-archive .hkc-page-title,
.hkc-archive .ipsWidget__header.hkc-page-title {
  margin: 0;
  padding: 15.4px 18.48px;
  background: var(--scarlet);
  color: #fff;
  font-size: 15.4px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 8px 8px 0 0;
}

.hkc-archive .hkc-page-content { padding: 21px; }

/* Inside the page widget, cards become plain sections separated by a rule. */
.hkc-archive .card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 18px;
}

.hkc-archive .hkc-page-content > .card + .card:not(.hkc-table-card) {
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
}

.hkc-archive .hkc-page-content > .card:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- tables */

.hkc-archive table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.hkc-archive table.data th,
.hkc-archive table.data td {
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.hkc-archive table.data th {
  background: var(--thead);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.hkc-archive table.data tbody td { color: var(--muted); }
.hkc-archive table.data tbody tr:hover td { background: var(--thead); }
.hkc-archive table.data tbody tr:last-child td { border-bottom: 0; }
.hkc-archive table.data a { color: var(--ink); font-weight: 600; }
.hkc-archive table.data a:hover { color: var(--scarlet-dark); }
.hkc-archive .score { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

/* Schedule table sits in a rounded, shadowed panel like the native page. */
.hkc-archive .hkc-table-card {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);
  overflow: hidden;
}

.hkc-archive .hkc-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.hkc-archive .hkc-table-card table.data thead th:first-child,
.hkc-archive .hkc-table-card table.data tbody td:first-child { padding-left: 14px; }
.hkc-archive .hkc-table-card table.data thead th:last-child,
.hkc-archive .hkc-table-card table.data tbody td:last-child { padding-right: 14px; }

.hkc-archive .hkc-nowrap { white-space: nowrap; }
.hkc-archive .hkc-box-link { font-weight: 400; color: var(--muted); }
.hkc-archive .hkc-box-link:hover { color: var(--scarlet); }

/* Wide historical tables scroll inside their card instead of stretching the page. */
.hkc-archive .card[style*="overflow:auto"],
.hkc-archive .card[style*="overflow: auto"] { -webkit-overflow-scrolling: touch; }

/* -------------------------------------------------------------- toolbar */

.hkc-archive .hkc-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hkc-archive form.inline,
.hkc-archive .hkc-season-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
}

.hkc-archive .hkc-season-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  color: var(--muted);
}

.hkc-archive .hkc-season-meta strong { color: var(--ink); }

.hkc-archive .hkc-toolbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-size: 13px;
}

.hkc-archive .hkc-season-notes { margin: 0; }

/* --------------------------------------------------------------- forms */

.hkc-archive select,
.hkc-archive input[type="search"],
.hkc-archive input[type="text"] {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  max-width: 100%;
}

.hkc-archive select:focus,
.hkc-archive input[type="search"]:focus,
.hkc-archive input[type="text"]:focus {
  outline: 2px solid rgba(236, 19, 19, .22);
  outline-offset: 1px;
  border-color: var(--scarlet);
}

.hkc-archive button,
.hkc-archive .btn,
.hkc-archive a.btn {
  background: var(--scarlet);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
}

.hkc-archive button:hover,
.hkc-archive .btn:hover,
.hkc-archive a.btn:hover {
  background: var(--scarlet-dark);
  color: #fff;
  text-decoration: none;
}

/* --------------------------------------------------------------- badges */

.hkc-archive .badge {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #fff;
}

.hkc-archive .badge.W { background: #dcfce7; color: #166534; }
.hkc-archive .badge.L { background: #f3f4f6; color: #4b5563; }
.hkc-archive .badge.sched { background: #fee2e2; color: #991b1b; }

/* --------------------------------------------------------------- extras */

.hkc-archive img.opp-logo {
  height: 22px;
  width: auto;
  max-width: 34px;
  object-fit: contain;
  vertical-align: -5px;
  margin-right: 6px;
  display: inline-block;
}

.hkc-archive img.opp-logo.opp-logo-lg {
  height: 64px;
  max-width: 96px;
  vertical-align: middle;
  margin: 0 0 6px;
}

.hkc-archive .grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.hkc-archive .player-head {
  display: flex;
  gap: 18px;
  align-items: baseline;
  flex-wrap: wrap;
}

.hkc-archive code {
  background: #f1f2f5;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .92em;
}

.hkc-archive hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.hkc-archive img { max-width: 100%; height: auto; }

@media (max-width: 800px) {
  .hkc-archive .grid2 { grid-template-columns: 1fr; }
  .hkc-archive .hkc-page-title,
  .hkc-archive .ipsWidget__header.hkc-page-title { padding: 12px 14px; }
  .hkc-archive .hkc-page-content { padding: 14px; }
  .hkc-archive table.data { font-size: 13px; }
  .hkc-archive table.data th,
  .hkc-archive table.data td { padding: 8px 6px; }
  .hkc-archive .hkc-table-card table.data thead th:first-child,
  .hkc-archive .hkc-table-card table.data tbody td:first-child { padding-left: 10px; }
  .hkc-archive .hkc-table-card table.data thead th:last-child,
  .hkc-archive .hkc-table-card table.data tbody td:last-child { padding-right: 10px; }
  .hkc-archive h1 { font-size: 24px; }
  .hkc-archive h2 { font-size: 17px; }
}

/* Archive pages keep the IPS header/nav but use a single full-width column
   (the dynamic sidebar is removed by the Worker). */
body.hkc-route .ipsLayout__columns { display: block !important; }
body.hkc-route .ipsLayout__primary-column { width: 100%; max-width: 100%; }

/* The Worker adds hkc-section-* to <body>. Repaint the matching menu item
   using the theme's own active-link treatment (it renders the shell from the
   home page, which has no knowledge of the archive route). */
body.hkc-section-schedule :is(ul.ipsNavBar, .ipsOffCanvas__nav--navigation) a[href$="/schedule/"],
body.hkc-section-seasons :is(ul.ipsNavBar, .ipsOffCanvas__nav--navigation) a[href$="/seasons/"],
body.hkc-section-opponents :is(ul.ipsNavBar, .ipsOffCanvas__nav--navigation) a[href$="/opponents/"],
body.hkc-section-exhibitions :is(ul.ipsNavBar, .ipsOffCanvas__nav--navigation) a[href$="/exhibitions/"],
body.hkc-section-roster :is(ul.ipsNavBar, .ipsOffCanvas__nav--navigation) a[href$="/roster/"],
body.hkc-section-coaches :is(ul.ipsNavBar, .ipsOffCanvas__nav--navigation) a[href$="/coaches/"],
body.hkc-section-players :is(ul.ipsNavBar, .ipsOffCanvas__nav--navigation) a[href$="/players/"],
body.hkc-section-stats :is(ul.ipsNavBar, .ipsOffCanvas__nav--navigation) a[href$="/stats/"] {
  background-color: rgba(2, 3, 5, .14);
  border-radius: 5px;
}
