/*
 * Shared site chrome: mega-menu panels + fat footer.
 * Single source consumed by every surface (Astro pages, static homepage/core,
 * generated sport pages, launch page) via:
 *   <link rel="stylesheet" href="/site-chrome.css?v=YYYYMMDD">
 * Loaded after per-surface styles on purpose: it owns header positioning.
 * Markup source: src/lib/siteHeader.mjs and src/lib/siteFooter.mjs.
 */

/* ---------- shared header shell ----------
 * This file is the complete layout contract for the shared header, including
 * static pages that do not load Astro's bundled global.css. Keep these rules
 * aligned with src/styles/global.css. */
.site-header *,
.site-footer-mega * { box-sizing: border-box; }
.site-header a { color: inherit; text-decoration: none; }
.site-header .ic {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  background: rgba(248, 250, 252, .92);
  backdrop-filter: blur(16px);
}
.site-nav {
  display: flex;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 32px;
  align-items: center;
  gap: 20px;
}
.site-logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 9px;
  color: #0b1220;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.site-logo .mk {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #ffffff;
  background: #2563eb;
}
.site-logo .mk .ic {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
  stroke-width: 3;
}
.site-logo b { color: #2563eb; }
.desktop-nav {
  display: flex;
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 4px;
}
.nav-group {
  position: relative;
  flex-shrink: 0;
}
.nav-group::after {
  display: none;
  position: absolute;
  top: 100%;
  right: -18px;
  left: 0;
  height: 12px;
  content: "";
}
.nav-group:hover::after,
.nav-group:focus-within::after { display: block; }
.nav-trigger,
.nav-link {
  display: inline-flex;
  padding: 10px 11px;
  align-items: center;
  gap: 5px;
  border-radius: 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.nav-trigger .ic {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}
.nav-trigger:hover,
.nav-link:hover,
.nav-group:focus-within .nav-trigger,
.nav-group:hover .nav-trigger {
  color: #0b1220;
  background: rgba(15, 23, 42, .05);
}
.site-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-header .btn {
  display: inline-flex;
  padding: 9px 16px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
}
.site-header .btn.royal {
  color: #ffffff;
  background: #2563eb;
}
.site-header .btn.royal:hover { background: #1d4ed8; }
.site-header .btn.outline {
  border: 1px solid rgba(15, 23, 42, .16);
  color: #0b1220;
  background: transparent;
}
.site-header .btn.outline:hover { background: rgba(15, 23, 42, .04); }
.mobile-nav {
  display: none;
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}
.mobile-nav > summary {
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(15, 23, 42, .16);
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
}
.mobile-nav > summary::-webkit-details-marker { display: none; }
.mobile-nav > summary span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #0b1220;
}
.mobile-nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(330px, calc(100vw - 34px));
  max-height: calc(100vh - 88px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
}
.mobile-nav-cta {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}
.mobile-nav-cta .btn { justify-content: center; }
.mobile-demo {
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1120px) {
  .site-nav {
    padding: 12px 24px;
    justify-content: space-between;
  }
  .site-logo { min-width: 0; }
  .desktop-nav,
  .site-actions { display: none !important; }
  .mobile-nav { display: block !important; }
}
@media (max-width: 680px) {
  .site-nav {
    width: 100%;
    max-width: 100%;
    padding: 12px 18px;
  }
  .site-logo { font-size: 14px; }
  .mobile-nav-panel { right: -2px; }
}

/* ---------- anchoring: panels attach to the full header bar ---------- */
.site-header { position: relative !important; }
.site-header .site-nav,
.site-header .desktop-nav,
.site-header .nav-group.mega { position: static !important; }

/* ---------- panel open/close ---------- */
.nav-group.mega .mega-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.nav-group.mega:hover .mega-panel,
.nav-group.mega:focus-within .mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity .18s ease, transform .18s ease, visibility 0s;
}
/* hover bridge so the pointer can travel from trigger to panel */
.nav-group.mega .mega-panel::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .nav-group.mega .mega-panel { transition: none; }
}

/* ---------- panel shell ---------- */
.mega-panel {
  background: #ffffff;
  border: 1px solid #e6ebf2;
  border-radius: 18px;
  box-shadow: 0 34px 90px -32px rgba(8, 15, 35, .4);
  padding: 20px;
  text-align: left;
}
.mega-platform { width: min(720px, calc(100vw - 40px)); }
.mega-sites { width: min(860px, calc(100vw - 40px)); }
.mega-solutions { width: min(440px, calc(100vw - 40px)); }
.mega-resources { width: min(860px, calc(100vw - 40px)); }

.mega-cols { display: grid; gap: 16px; align-items: stretch; }
.mega-platform .mega-cols { grid-template-columns: 1.15fr .85fr; }
.mega-resources .mega-cols { grid-template-columns: 1fr 1fr 1fr; }
.mega-col { display: flex; flex-direction: column; gap: 2px; }

.mega-eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #2563eb;
}

/* ---------- links ---------- */
.mega-link {
  display: block;
  padding: 9px 12px;
  border-radius: 12px;
  text-decoration: none;
  transition: background .12s ease;
}
.mega-link:hover, .mega-link:focus-visible { background: #f1f5f9; }
.mega-link strong { display: block; font-size: 14px; font-weight: 800; color: #0b1220; letter-spacing: -.01em; }
.mega-link span { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: #64748b; }

.mega-mini {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
}
.mega-mini:hover, .mega-mini:focus-visible { background: #f1f5f9; color: #0b1220; }

/* ---------- featured cards ---------- */
.mega-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 16px;
  border-radius: 14px;
  background: radial-gradient(140% 120% at 85% -10%, rgba(37, 99, 235, .5), transparent 55%), #0b1220;
  text-decoration: none;
  overflow: hidden;
  transition: transform .15s ease;
}
.mega-card:hover, .mega-card:focus-visible { transform: translateY(-2px); }
.mega-card img { width: 100%; height: auto; border-radius: 10px; margin-bottom: 10px; display: block; }
.mega-card strong { font-size: 14.5px; font-weight: 800; color: #ffffff; letter-spacing: -.01em; }
.mega-card span { font-size: 12.5px; line-height: 1.5; color: #9fb0c9; }

/* ---------- coach websites grid ---------- */
.mega-sports { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mega-sport {
  display: block;
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  text-decoration: none;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.mega-sport:hover, .mega-sport:focus-visible {
  border-color: rgba(37, 99, 235, .55);
  box-shadow: 0 14px 34px -18px rgba(37, 99, 235, .5);
  transform: translateY(-2px);
}
.mega-sport img { display: block; width: 100%; height: 92px; object-fit: cover; object-position: top center; }
.mega-sport span { display: block; padding: 8px 11px; font-size: 13px; font-weight: 800; color: #0b1220; }
.mega-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #eef2f7;
}
.mega-foot a { font-size: 13px; font-weight: 700; color: #2563eb; text-decoration: none; }
.mega-foot a:hover, .mega-foot a:focus-visible { text-decoration: underline; }

.mega-panel a:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

/* ---------- mobile accordion groups ----------
 * Legacy per-surface CSS styles `.mobile-nav summary` as the circular
 * hamburger button; these overrides rescue the nested accordion summaries
 * from that (width/height/border resets are deliberate). */
.mobile-nav-panel details.mobile-nav-group {
  display: block;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}
.mobile-nav-panel details.mobile-nav-group > summary,
.mobile-nav .mobile-nav-panel details.mobile-nav-group > summary {
  cursor: pointer;
  list-style: none;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: left;
  gap: 10px;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 13px 4px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  white-space: nowrap;
  font-weight: 800;
  font-size: 15.5px;
  color: #0b1220;
}
.mobile-nav-panel details.mobile-nav-group > summary::-webkit-details-marker { display: none; }
.mobile-nav-panel details.mobile-nav-group > summary::before { content: none !important; }
.mobile-nav-panel details.mobile-nav-group > summary span { display: none; }
.mobile-nav-panel details.mobile-nav-group > summary::after {
  content: "+" !important;
  position: static !important;
  font-size: 20px;
  font-weight: 500;
  color: #2563eb;
  line-height: 1;
  transform: none !important;
}
.mobile-nav-panel details.mobile-nav-group[open] > summary::after { content: "\2212" !important; }
.mobile-nav-panel details.mobile-nav-group > a {
  display: block !important;
  padding: 10px 4px 10px 16px !important;
  margin: 0 !important;
  font-size: 14.5px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}
.mobile-nav-panel details.mobile-nav-group > a:last-of-type { padding-bottom: 14px !important; }
.mobile-nav-panel details.mobile-nav-group > a:hover,
.mobile-nav-panel details.mobile-nav-group > a:focus-visible { color: #0b1220; }

/* ---------- fat footer ---------- */
.site-footer-mega {
  background: linear-gradient(180deg, #0b1220, #0a0f1c);
  color: #b6c2d6;
  padding: 56px 0 40px;
  font-size: 13.5px;
}
.site-footer-mega .foot-wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.site-footer-mega .foot-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 22px 18px;
}
.site-footer-mega .foot-col strong {
  display: block;
  margin-bottom: 10px;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #eaf1fb;
}
.site-footer-mega .foot-col a {
  display: block;
  padding: 3px 0;
  color: #9fb0c9;
  text-decoration: none;
  line-height: 1.5;
}
.site-footer-mega .foot-col a:hover, .site-footer-mega .foot-col a:focus-visible { color: #ffffff; }
.site-footer-mega .foot-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.site-footer-mega .foot-cta p { margin: 0; color: #9fb0c9; }
.site-footer-mega .foot-cta strong { color: #ffffff; }
.site-footer-mega .foot-cta .foot-btn {
  display: inline-flex;
  padding: 11px 18px;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 800;
  font-size: 13.5px;
  text-decoration: none;
}
.site-footer-mega .foot-cta .foot-btn:hover { filter: brightness(1.08); }
.site-footer-mega .foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  font-size: 12px;
  color: #6d7f9b;
}
.site-footer-mega .foot-legal a,
.site-footer-mega .foot-legal button { color: #8fa2bd; text-decoration: none; }
.site-footer-mega .foot-legal button { margin: 0; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.site-footer-mega .foot-legal a:hover,
.site-footer-mega .foot-legal button:hover { color: #ffffff; }
.site-footer-mega a:focus-visible,
.site-footer-mega button:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; border-radius: 4px; }

@media (max-width: 960px) {
  .site-footer-mega .foot-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .site-footer-mega .foot-grid { grid-template-columns: repeat(2, 1fr); }
}
