/* Mawqif Sports — header & footer chrome */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--chalk);
  border-bottom: none;
  transition: height var(--t-base) var(--ease), background var(--t-base), box-shadow var(--t-base);
}

.site-header.is-scrolled {
  height: var(--header-h-scrolled);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(11, 32, 25, 0.06);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
}

/* Permanent 3px brand bar on header bottom edge */
.site-header__brand-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--surface-brand);
  pointer-events: none;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.site-logo img {
  display: block;
  height: 40px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
  transition: height var(--t-base) var(--ease);
}

.site-logo--header img {
  aspect-ratio: 915 / 344;
}

.site-header.is-scrolled .site-logo--header img {
  height: 32px;
  width: auto;
}

.site-logo--footer img {
  height: 44px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s6);
}

.site-nav__link {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mawqif-text);
  position: relative;
  padding-block: var(--s2);
  transition: color var(--t-fast);
}

.site-nav__link:hover {
  color: var(--mawqif-green);
}

.site-nav__link.is-active {
  color: var(--mawqif-green);
}

.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--mawqif-green);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.menu-toggle {
  display: none;
}

/* Mega menu — centered modal overlay */
.mega-wrap {
  position: relative;
}

.mega-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5);
  background: rgba(11, 32, 25, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease-out, visibility 180ms ease-out;
}

.mega-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mega-menu.is-closing {
  transition-timing-function: ease-in;
}

.mega-menu__panel {
  width: min(920px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: var(--s6);
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform 180ms ease-out, opacity 180ms ease-out;
}

.mega-menu.is-open .mega-menu__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.mega-menu.is-closing .mega-menu__panel {
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition-timing-function: ease-in;
}

.mega-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s5);
}

.mega-menu__title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mega-menu__close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
}

.mega-menu__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
}

@media (min-width: 900px) {
  .mega-menu__grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 640px) {
  .mega-menu__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mega-tile {
  display: block;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--surface-dark);
}

.mega-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-base);
}

.mega-tile:hover img {
  transform: scale(1.03);
}

.mega-tile__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--pitch-800), var(--pitch-600));
}

.mega-tile__label {
  position: absolute;
  left: var(--s2);
  bottom: var(--s2);
  right: var(--s2);
  color: var(--on-brand);
  z-index: 1;
}

.mega-tile__name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}

.mega-tile__count {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-brand-faint);
  margin-top: 2px;
}

.mega-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 37, 23, 0.90), rgba(12, 37, 23, 0.55) 30%, transparent 58%);
}

@media (prefers-reduced-motion: reduce) {
  .mega-menu,
  .mega-menu__panel {
    transition: none;
  }
}

/* Progress bar (articles) — overlays brand bar */
.reading-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: transparent;
  pointer-events: none;
  z-index: 1;
}

.reading-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--surface-brand-deep);
}

/* Mobile drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 37, 23, 0.4);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base), visibility var(--t-base);
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 400px);
  background: var(--surface-brand-deep);
  z-index: 160;
  transform: translateX(100%);
  transition: transform var(--t-base) var(--ease);
  padding: var(--s7) var(--s5);
  overflow-y: auto;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__close {
  position: absolute;
  top: var(--s4);
  right: var(--s4);
  color: var(--on-brand);
  min-width: 44px;
  min-height: 44px;
  font-size: 1.5rem;
}

.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  margin-top: var(--s8);
}

.drawer__link {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-brand);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--brand-rule);
}

.drawer__sports {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding-top: var(--s2);
}

.drawer__sports a {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--on-brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.drawer__sports a:hover {
  color: var(--on-brand);
}

@media (max-width: 1023px) {
  .site-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mega-menu {
    display: none !important;
  }
}

/* ── Footer ── */

.site-footer {
  background: var(--mawqif-green);
  color: var(--on-brand);
  padding-top: var(--s9);
  padding-bottom: var(--s6);
  margin-top: var(--s9);
}

/* Join band already greens the page bottom — don't insert a chalk gap */
main:has(.join-band) + .site-footer,
main:has(.error-page) + .site-footer {
  margin-top: 0;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(16rem, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: var(--s7) var(--s6);
  align-items: start;
}

.site-footer__brand .site-logo {
  margin-bottom: var(--s4);
}

.site-footer__charter {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--on-brand-muted);
  max-width: 34ch;
}

.site-footer__social {
  display: inline-block;
  margin-top: var(--s4);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--on-brand-muted);
  transition: color var(--t-fast), opacity var(--t-fast);
}

.site-footer__social:hover {
  color: var(--on-brand);
}

.site-footer__col-title {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-brand-faint);
  margin-bottom: var(--s4);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.site-footer__links a {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--on-brand-muted);
  width: fit-content;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: color var(--t-fast), opacity var(--t-fast), background-size var(--t-base) var(--ease);
}

.site-footer__links a:hover {
  color: var(--on-brand);
  background-size: 100% 1px;
}

.site-footer__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em 0.5em;
  margin-top: var(--s5);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-brand-muted);
}

.site-footer__stats span {
  white-space: nowrap;
}

.site-footer__stats-sep {
  opacity: 0.55;
}

.site-footer__season {
  white-space: nowrap;
}

.site-footer__bottom {
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--brand-rule);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--on-brand-faint);
}

@media (max-width: 1023px) {
  .site-footer {
    padding-top: var(--s8);
    padding-bottom: var(--s6);
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s7) var(--s6);
  }

  .site-footer__brand {
    grid-column: 1 / -1;
    max-width: 36rem;
  }
}

@media (max-width: 767px) {
  .site-footer {
    padding-top: var(--s8);
    padding-bottom: var(--s6);
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--s6);
  }

  .site-footer__brand {
    grid-column: auto;
  }

  .site-footer__links a {
    min-height: 44px;
  }

  .site-logo--header img {
    height: 36px;
  }
}
