/* The Sports Guru shared header: one sticky masthead for every page type.
 * Self-contained: it carries its own tokens (the Stat Man palette from statman.css) and resets,
 * so it can sit on style.css, gameweek.css, matchreport.css, pundit.css and statman.css pages alike. */
.tsg-head {
  --th-paper: #f7f6ef; --th-paper-2: #eef0e6; --th-ink: #142c25; --th-green: #236242; --th-muted: #536258;
  --th-line: #d3dacf; --th-lime: #ccdc66; --th-focus: #a75a0b;
  --th-ui: Arial, Helvetica, sans-serif;
  position: sticky; top: 0; z-index: 300;
  background: var(--th-paper); color: var(--th-ink);
  border-bottom: 3px double var(--th-ink);
  font: 400 15px/1.3 var(--th-ui);
  letter-spacing: 0; text-transform: none;
}
.tsg-head *, .tsg-head *::before, .tsg-head *::after { box-sizing: border-box; }
.tsg-head [hidden] { display: none !important; }
.tsg-head ul { list-style: none; margin: 0; padding: 0; }
.tsg-head p { margin: 0; }
.tsg-head a { color: var(--th-ink); text-decoration: none; }
.tsg-head a:focus-visible, .tsg-head button:focus-visible { outline: 2px solid var(--th-focus); outline-offset: 3px; border-radius: 2px; }
.tsg-head.is-stuck { box-shadow: 0 6px 18px -12px rgba(20, 44, 37, .45); }

.tsg-head__inner {
  max-width: 1440px; margin: 0 auto;
  padding: 10px clamp(16px, 4.4vw, 64px);
  display: flex; align-items: center; gap: 28px; min-height: 68px;
}

/* the wordmark, as on the Stat Man, round-up and match report mastheads */
.tsg-mark { display: inline-flex; flex-direction: column; line-height: 1; flex: none; font-family: var(--th-ui); font-weight: 800; color: var(--th-ink); }
.tsg-mark__top { font-size: 11px; letter-spacing: .12em; }
.tsg-mark__main { font-size: 31px; letter-spacing: -.06em; margin-top: 1px; }
.tsg-mark__dot { color: var(--th-green); }

.tsg-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; min-width: 0; }
.tsg-nav__group { display: flex; align-items: center; gap: 4px 20px; }
.tsg-nav__group--sports { padding-left: 22px; border-left: 1px solid var(--th-line); }
.tsg-head .tsg-nav a, .tsg-head .tsg-more__btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font: inherit; color: var(--th-ink); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color 120ms ease, border-color 120ms ease;
}
.tsg-head .tsg-nav .tsg-nav__group--formats a { font-weight: 700; }
/* More is a button that opens the panel. The plain link to /blog/ is the fallback for visitors without
 * JavaScript: hidden here, shown by the <noscript> style in site_header.HEAD_TAGS. */
.tsg-head .tsg-nav .tsg-more__link { display: none; }
.tsg-head .tsg-nav a:hover, .tsg-head .tsg-more__btn:hover { color: var(--th-green); border-bottom-color: var(--th-green); }
.tsg-nav a[aria-current="page"] { color: var(--th-green); border-bottom-color: var(--th-green); }
.tsg-nav__statman { background: linear-gradient(transparent 62%, var(--th-lime) 62%, var(--th-lime) 92%, transparent 92%); }

.tsg-more { position: relative; }
.tsg-head .tsg-more__btn { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 0; min-height: 44px; cursor: pointer; }
.tsg-more__btn svg { transition: transform 120ms ease; }
.tsg-more.is-open .tsg-more__btn { color: var(--th-green); border-bottom-color: var(--th-green); }
.tsg-more.is-open .tsg-more__btn svg { transform: rotate(180deg); }
.tsg-more__panel {
  display: none; position: absolute; right: 0; top: calc(100% + 14px);
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px;
  width: max-content; max-width: min(600px, 92vw);
  padding: 22px 26px; background: var(--th-paper);
  border: 1px solid var(--th-line); border-top: 3px solid var(--th-green);
  box-shadow: 0 18px 40px -20px rgba(20, 44, 37, .45);
}
.tsg-more.is-open .tsg-more__panel { display: grid; }
.tsg-more__head { font-weight: 700; font-size: 13px; color: var(--th-muted); padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--th-line); }
.tsg-head .tsg-more__panel a { min-height: 36px; font-size: 15px; }
.tsg-more__col:first-child ul { columns: 2; column-gap: 28px; }
.tsg-more__col li { break-inside: avoid; }

.tsg-head .tsg-head__menu {
  display: none; align-items: center; margin-left: auto; min-height: 44px; padding: 0 16px; cursor: pointer;
  font: 700 15px/1 var(--th-ui); color: var(--th-ink); background: var(--th-paper);
  border: 1px solid var(--th-ink); border-radius: 3px;
}
.tsg-head .tsg-head__menu[aria-expanded="true"] { background: var(--th-ink); color: var(--th-paper); }

.tsg-skip { position: absolute; left: 12px; top: -100px; z-index: 400; background: #fff; color: #142c25; padding: 12px 16px; font: 700 15px Arial, sans-serif; }
.tsg-skip:focus { top: 8px; }

/* narrower screens: the nav folds behind Menu. This is the state of the first paint, not something the script
 * switches on afterwards (that switch moved the page by about 0.058 CLS on phones). Without JavaScript the
 * <noscript> style in site_header.HEAD_TAGS puts back the nav as a scrolling row and hides the two buttons. */
@media (max-width: 1180px) {
  .tsg-head__inner { flex-wrap: wrap; gap: 10px 20px; }
  .tsg-head .tsg-head__menu { display: inline-flex; }
  .tsg-head .tsg-nav { display: none; }
  .tsg-head.is-menu-open .tsg-nav {
    display: grid; gap: 18px; width: 100%; margin: 4px 0 10px;
    padding-top: 16px; border-top: 1px solid var(--th-line);
    max-height: calc(100vh - 90px); overflow-y: auto;
  }
  .tsg-head.is-menu-open .tsg-nav__group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; }
  .tsg-head.is-menu-open .tsg-nav__group--sports { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--th-line); }
  .tsg-head.is-menu-open .tsg-more { grid-column: 1 / -1; }
  .tsg-head.is-menu-open .tsg-more__btn { display: none; }
  .tsg-head.is-menu-open .tsg-more__panel { display: grid; position: static; width: auto; max-width: none; padding: 12px 0 0; border: 0; box-shadow: none; gap: 18px 20px; }
  .tsg-head.is-menu-open .tsg-more__panel { grid-template-columns: minmax(0, 1fr); }
  .tsg-head.is-menu-open .tsg-more__col:first-child ul { columns: 2; }
}
@media (max-width: 560px) {
  .tsg-mark__main { font-size: 27px; }
  .tsg-head__inner { min-height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .tsg-head *, .tsg-head *::before, .tsg-head *::after { transition: none !important; }
}

/* Page integration. The header is sticky, so an in-page jump (a match report's section nav, a Stat Man fixture
 * card, an FAQ link) and the match report's own sticky section nav must clear it. tsg-header.js measures the
 * closed header into --tsg-head-h; 71px is the closed desktop height, for the moment before it runs. */
html { scroll-padding-top: var(--tsg-head-h, 71px); }
.gw-page .gw-mr-nav { top: var(--tsg-head-h, 71px); }
/* the Stat Man hub's sticky notes column (style.css gives it top: 24px) */
.statman-notes { top: calc(var(--tsg-head-h, 71px) + 24px); }
