/* Stowe Athletics — site styles */
:root {
  --cream: #fdfbf5;
  --cream-deep: #f6f1e6;
  --brown: #4d3022;
  --brown-soft: #6a4634;
  --rust: #a83f2a;
  --blue: #82a0ab;
  --blue-soft: #c5d5db;
  --header-h: 4.85rem;
  --subnav-h: 3.4rem;
  --page-gutter: 1.5rem;
  --shadow: 0 1px 0 rgba(77, 48, 34, 0.08), 0 8px 24px rgba(77, 48, 34, 0.06);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Oswald", "Outfit", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 200;
  background: var(--brown);
  color: var(--cream);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(253, 251, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.header-inner {
  height: calc(var(--header-h) - 6px);
  max-width: 100%;
  padding: 0 var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}

.logo img {
  height: 3.15rem;
  width: auto;
}

.header-stripe {
  height: 6px;
  background: linear-gradient(
    to bottom,
    var(--rust) 0 50%,
    var(--blue) 50% 100%
  );
}

/* Sport pages: only the submenu ribbon — no second stripe under the main header */
body.has-subnav .header-stripe {
  display: none;
}

body.has-subnav .header-inner {
  height: 100%;
}

/* ——— Main nav ——— */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hamburger {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 auto;
}

.hamburger span {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--brown);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle:focus-visible + .hamburger {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

.nav-toggle:checked + .hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle:checked + .hamburger span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked + .hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.75rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--brown);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0;
  position: relative;
  white-space: nowrap;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--rust);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--rust);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after,
.main-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.main-nav a[aria-current="page"] {
  color: var(--rust);
  font-weight: 600;
}

/* ——— Sport submenu (sliding pill track) ——— */
.sport-chrome {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
}

.subnav {
  height: var(--subnav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(246, 241, 230, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pills {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(77, 48, 34, 0.1);
  box-shadow: 0 0 0 1px rgba(77, 48, 34, 0.08);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.pills a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: transparent;
  color: rgba(77, 48, 34, 0.72);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  -webkit-user-drag: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.pills a[aria-current="page"] {
  background: var(--brown);
  color: var(--cream);
}

.pills a:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

@media (hover: hover) {
  .pills a:hover {
    color: var(--brown);
  }

  .pills a[aria-current="page"]:hover {
    color: var(--cream);
  }
}

.pills .pthumb {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--brown);
  opacity: 0;
  pointer-events: none;
}

.pills:not(.live) .pthumb {
  visibility: hidden;
}

.pills.live a[aria-current="page"] {
  background: transparent;
  color: rgba(77, 48, 34, 0.72);
}

.pills.live a.over,
.pills.live a.over:hover {
  color: var(--cream);
}

.pills.slide a {
  transition: color 0.15s ease;
}

.pills.sliding a {
  transition: color 0.14s ease;
}

.pills.dragging,
.pills.dragging a {
  cursor: grabbing;
}

@media (prefers-reduced-motion: reduce) {
  .pills.slide a {
    transition: none;
  }
}

/* Logo ribbon under the sport submenu — sticky with it */
.sport-ribbon {
  height: 8px;
  background: linear-gradient(
    to bottom,
    var(--rust) 0 50%,
    var(--blue) 50% 100%
  );
}

/* ——— Page content ——— */
main {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

/* ——— Footer ——— */
.site-footer {
  flex: 0 0 auto;
  padding: 1rem var(--page-gutter) calc(1.15rem + env(safe-area-inset-bottom, 0px));
  text-align: left;
  color: var(--brown-soft);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-top: 1px solid rgba(77, 48, 34, 0.08);
  background: var(--cream);
}

.site-footer p {
  margin: 0;
}

main h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--brown);
  line-height: 1.15;
}

/* ——— 404 extras ——— */
.page-note {
  margin-top: 1rem;
  text-align: center;
  color: var(--brown-soft);
}

.page-note a {
  color: var(--rust);
  font-weight: 600;
  text-decoration: none;
}

.page-note a:hover {
  text-decoration: underline;
}

/* ——— Mobile ——— */
@media (max-width: 720px) {
  :root {
    --header-h: 4.15rem;
    --subnav-h: 3.2rem;
    --page-gutter: 1rem;
  }

  .logo img {
    height: 2.55rem;
  }

  .hamburger {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 110;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 0.75rem;
    background: var(--cream);
    box-shadow: var(--shadow);
    border-bottom: 1px solid rgba(77, 48, 34, 0.08);
  }

  .nav-toggle:checked ~ .main-nav {
    display: flex;
  }

  .main-nav a {
    padding: 0.85rem 1.25rem;
    letter-spacing: 0.1em;
  }

  .main-nav a::after {
    display: none;
  }

  .main-nav a[aria-current="page"] {
    background: #f4e8e4;
  }

  /* Keep subnav below the open menu visually; menu overlays it */
}

@media (max-width: 400px) {
  .logo img {
    height: 2.2rem;
  }

  .pills a {
    padding: 10px 14px;
    font-size: 0.8rem;
  }
}
