/* ==============================================
   ROW 1 — Top bar (light, league + socials)
   ============================================== */
.ch-top-bar {
  background: var(--soft);
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

.ch-top-bar-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 8px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.ch-top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-top-bar-league-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.ch-top-bar-league-link:hover {
  color: var(--ink);
}

.ch-top-bar-league-img {
  display: block;
  height: 18px;
  width: auto;
  opacity: 0.85;
}

.ch-top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.ch-top-bar-right a {
  display: flex;
  align-items: center;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.ch-top-bar-right a:hover {
  color: var(--ink);
}

/* ==============================================
   ROW 2 — Brand bar (navy, logo + wordmark + last-game card)
   ============================================== */
.ch-brand-bar {
  /* background: var(--primary-dark); */
  background: linear-gradient(90deg, var(--primary-dark), var(--tertiary));
  border-bottom: 3px solid var(--tertiary);
  border-top: 3px solid var(--tertiary);
  color: #fff;
  transition: box-shadow 0.25s ease;
}

.ch-brand-bar-stuck {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

.ch-brand-bar-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Brand block (logo + wordmark) */
.ch-logo-block {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}

.ch-logo-img {
  display: block;
  height: 56px;
  width: auto;
  max-width: 64px;
  object-fit: contain;
}

.ch-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.ch-primary-name {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  display: block;
  line-height: 1;
}

.ch-primary-name-accent {
  color: var(--secondary);
}

/* ==============================================
   Game cards — used by the Schedule mega menu (.ch-mega-games)
   ============================================== */
.ch-game-card {
  display: grid;
  grid-template-rows: auto 1fr 1fr;
  gap: 2px;
  background: var(--primary-dark);
  border: 1px solid var(--tertiary);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 150px;
  text-decoration: none;
  color: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ch-game-card:hover {
  background: rgba(16, 42, 33, 0.7);
  border-color: rgba(196, 126, 60, 0.45);
  color: #fff;
}

.ch-gc-header {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

/* "Next" / "Last" tag pill */
.ch-gc-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--secondary);
}

.ch-gc-when {
  color: rgba(255, 255, 255, 0.6);
}

.ch-gc-row {
  display: grid;
  grid-template-columns: 22px auto 1fr 12px;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1;
  padding: 0;
}

/* Next-game card has no scores → simpler 2-col grid */
.ch-game-card--next .ch-gc-row {
  grid-template-columns: 22px auto;
  color: #fff;
}

.ch-gc-row.is-winner {
  color: #fff;
}

.ch-gc-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.ch-gc-logo-placeholder {
  display: block;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.ch-gc-abbr {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: inherit;
}

.ch-gc-score {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: inherit;
  justify-self: end;
}

/* Winner triangle pointer (right side) */
.ch-gc-arrow {
  width: 0;
  height: 0;
  justify-self: end;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid var(--secondary);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ch-gc-row.is-winner .ch-gc-arrow {
  opacity: 1;
}

/* ==============================================
   ROW 3 — Nav bar (white, menu + CTA + search)
   ============================================== */

/* Divi's #page-container can carry overflow:hidden which silently breaks
   position:sticky — override it so the header actually sticks. */
#page-container,
#et-main-area {
  overflow: visible;
}

.ch-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 80;
  transition: box-shadow 0.25s ease;
}

.ch-header-stuck {
  box-shadow: 0 1px 6px rgba(16, 42, 33, 0.12);
}

.ch-header-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: stretch;
  height: 56px;
  gap: 24px;
}

/* ==============================================
   Nav (left/center, full-height links)
   ============================================== */
.ch-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.ch-nav-list {
  list-style: none;
  display: flex;
  align-items: stretch;
  height: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}

.ch-nav-list > li {
  position: relative;
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
}

.ch-nav-list > li > a {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s ease;
  height: 100%;
}

/* Bottom ink underline */
.ch-nav-list > li > a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--secondary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ch-nav-list > li > a:hover {
  color: var(--ink);
}

.ch-nav-list > li > a:hover::before {
  transform: scaleX(1);
}

.ch-nav-list > li.current-menu-item > a,
.ch-nav-list > li.current_page_item > a {
  color: var(--primary);
}

.ch-nav-list > li.current-menu-item > a::before,
.ch-nav-list > li.current_page_item > a::before {
  transform: scaleX(1);
  background: var(--primary);
}

/* External-link arrow (target="_blank" links) */
.ch-nav-list > li > a[target="_blank"]::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 6px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><line x1='7' y1='17' x2='17' y2='7'/><polyline points='7 7 17 7 17 17'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><line x1='7' y1='17' x2='17' y2='7'/><polyline points='7 7 17 7 17 17'/></svg>") no-repeat center / contain;
  flex-shrink: 0;
}

/* Chevron for parent items */
.ch-nav-list > li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 6px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.6;
  background: none;
  -webkit-mask: none;
          mask: none;
}

.ch-nav-list > li.menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
  opacity: 1;
}

/* ==============================================
   Dropdown (sub-menu)
   ============================================== */
.ch-nav-list > li > ul.sub-menu {
  position: absolute;
  inset-block-start: 100%;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 2px solid var(--secondary);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 18px 36px -22px rgba(16, 42, 33, 0.40);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 300;
}

.ch-nav-list > li:hover > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ch-nav-list > li > ul.sub-menu > li {
  list-style: none;
  margin: 0;
  padding: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ch-nav-list > li:hover > ul.sub-menu > li {
  opacity: 1;
  transform: translateY(0);
}

.ch-nav-list > li:hover > ul.sub-menu > li:nth-child(2) { transition-delay: 0.04s; }
.ch-nav-list > li:hover > ul.sub-menu > li:nth-child(3) { transition-delay: 0.08s; }
.ch-nav-list > li:hover > ul.sub-menu > li:nth-child(4) { transition-delay: 0.12s; }
.ch-nav-list > li:hover > ul.sub-menu > li:nth-child(5) { transition-delay: 0.16s; }
.ch-nav-list > li:hover > ul.sub-menu > li:nth-child(6) { transition-delay: 0.20s; }

.ch-nav-list > li > ul.sub-menu > li > a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.ch-nav-list > li > ul.sub-menu > li > a:hover {
  color: var(--ink);
  background: var(--soft);
  border-left-color: var(--secondary);
}

.ch-nav-list > li > ul.sub-menu > li > a::before {
  display: none;
}

/* ==============================================
   Header actions (CTA + search)
   ============================================== */
.ch-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ch-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 9px 16px;
  background: var(--primary-dark);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.ch-header-cta:hover {
  background: var(--primary);
  color: #fff;
}

/* ==============================================
   Hamburger toggle
   ============================================== */
.ch-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.ch-hamburger,
.ch-hamburger::before,
.ch-hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
  position: relative;
}

.ch-hamburger::before,
.ch-hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.ch-hamburger::before { top: -7px; }
.ch-hamburger::after  { top: 7px; }

.ch-menu-toggle[aria-expanded="true"] .ch-hamburger {
  background: transparent;
}

.ch-menu-toggle[aria-expanded="true"] .ch-hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.ch-menu-toggle[aria-expanded="true"] .ch-hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ==================================================================
   MONTANA TECH — unique masthead
   A cohesive deep-green + copper header that replaces the default
   light top bar / washed gradient / white nav strip. Signature
   touches: copper top hairline, copper "ore-vein" texture on the
   brand bar, a copper divider between the logo and wordmark, a
   unified dark nav, and a solid copper CTA pill.
   ================================================================== */

/* Row 1 — top bar: deep green with a copper hairline above it */
.ch-top-bar {
  background: var(--bg-drop);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 3px 0 var(--secondary); /* copper top line */
}
.ch-top-bar-inner { padding-top: 9px; padding-bottom: 9px; }
.ch-top-bar-left {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(238, 240, 230, 0.7);
}
.ch-top-bar-left a,
.ch-top-bar-right a { color: rgba(238, 240, 230, 0.7); }
.ch-top-bar-left a:hover,
.ch-top-bar-right a:hover { color: var(--secondary); }
.ch-top-bar-right { gap: 18px; }

/* Row 2 — brand bar: solid deep green + faint copper ore-vein texture */
.ch-brand-bar {
  background:
    repeating-linear-gradient(122deg, rgba(196, 126, 60, 0.10) 0 1px, transparent 1px 11px),
    linear-gradient(180deg, #1d4d2d 0%, #143521 100%);
  border-top: none;
  border-bottom: 3px solid var(--secondary);
}
.ch-brand-bar-inner { padding-top: 16px; padding-bottom: 16px; }
.ch-logo-block { gap: 20px; }
.ch-logo-img {
  height: 62px;
  max-width: 72px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}
/* copper divider between the M crest and the wordmark */
.ch-logo-text {
  padding-left: 20px;
  border-left: 2px solid rgba(196, 126, 60, 0.55);
}
.ch-primary-name {
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
/* small mono tagline under the wordmark */
.ch-logo-text::after {
  content: "Montana Tech · Butte, Montana";
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--secondary);
  opacity: 0.95;
}

/* Row 3 — nav bar: dark masthead continuation (not white) */
.ch-header {
  background: linear-gradient(180deg, #143521 0%, #102f1c 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ch-header-inner { height: 60px; }
.ch-nav-list > li > a {
  color: rgba(238, 240, 230, 0.84);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.ch-nav-list > li > a:hover { color: #fff; }
.ch-nav-list > li > a::before { background: var(--secondary); }
.ch-nav-list > li.current-menu-item > a,
.ch-nav-list > li.current_page_item > a { color: var(--secondary); }
.ch-nav-list > li.current-menu-item > a::before,
.ch-nav-list > li.current_page_item > a::before { background: var(--secondary); }
.ch-nav-list > li.menu-item-has-children > a::after { border-top-color: var(--secondary); opacity: 0.9; }

/* Dropdowns → dark theme to match */
.ch-nav-list > li > ul.sub-menu {
  background: #143521;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 2px solid var(--secondary);
  box-shadow: 0 24px 46px -22px rgba(0, 0, 0, 0.65);
}
.ch-nav-list > li > ul.sub-menu > li > a { color: rgba(238, 240, 230, 0.82); }
.ch-nav-list > li > ul.sub-menu > li > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-left-color: var(--secondary);
}

/* CTA — solid copper pill */
.ch-header-cta {
  background: var(--secondary);
  color: #15241b;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 10px 20px;
  box-shadow: 0 6px 16px -6px rgba(196, 126, 60, 0.6);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.ch-header-cta:hover {
  background: var(--secondary-light);
  color: #15241b;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(196, 126, 60, 0.7);
}

/* Stronger shadow when the nav sticks */
.ch-header-stuck { box-shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.55); }
