/* ==========================================================================
   Oakland Track Club — site styles
   Edit the variables below to change colors/fonts site-wide.
   ========================================================================== */

:root {
  --red: #de170a;
  --red-dark: #b31207;
  --black: #000;
  --white: #fff;
  --text: #111;
  --muted: #555;
  --gray-header: #c7c7c7;
  --gray-card: #ebe9e9;
  --gray-light: #f8f8f8;
  --font-heading: "Rubik", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Karla", "Helvetica Neue", Arial, sans-serif;
  --max: 1100px;
  --gutter: 20px;
  --header-h: 72px;
  --radius: 6px;     /* photos, cards */
  --radius-sm: 4px;  /* buttons */
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

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

a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--white);
  padding: 8px 12px;
  z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  padding: 8px 22px;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn:hover,
.btn:focus-visible { background: var(--red-dark); }
.btn--italic { font-style: italic; letter-spacing: 0.08em; font-family: var(--font-body); font-size: 14px; }
/* Disabled buttons (e.g. "Check back next year"): grayed out, not clickable */
.btn[aria-disabled="true"],
.btn[aria-disabled="true"]:hover {
  background: #767676;
  color: var(--white);
  cursor: default;
}

/* ---------- Header / Nav ---------- */
/* Fixed, frosted-glass bar (Apple-style). Page content starts below it.
   js/main.js adds .is-hidden when scrolling down and removes it when scrolling up. */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: transform 0.35s ease;
}
/* Frosted backdrop. It lives on a pseudo-element because putting
   backdrop-filter on the header itself would trap the fixed mobile drawer
   inside the header's box. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(250, 250, 252, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.site-header.is-hidden { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
/* Content starts below the header so nothing (like the hero photo) is covered */
.site-header ~ main { padding-top: var(--header-h); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}
.site-logo { flex: 0 1 auto; min-width: 0; }
/* Logo scales down on mid-size screens so the menu fits on one line */
.site-logo img { width: min(340px, 34vw); }
.site-nav { flex-shrink: 0; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
}
.site-nav a {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  padding: 4px 0;
  white-space: nowrap;
  transition: color 0.4s ease;
}
@media (max-width: 1024px) {
  .site-nav ul { gap: 20px; }
}
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--red); }

/* "Home" only appears in the mobile drawer, matching Wix */
.site-nav .nav-home { display: none; }

/* ---------- Mobile menu ----------
   Below 860px the nav becomes a white drawer that slides in from the right,
   with a dark overlay behind it. js/main.js toggles .is-open / .menu-open. */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 3;
  width: 30px;
  height: 28px;
  padding: 0;
  margin-right: -2px;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-toggle__line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out;
}
.nav-toggle__line:nth-child(1) { top: 3px; }
.nav-toggle__line:nth-child(2) { top: 50%; margin-top: -1px; }
.nav-toggle__line:nth-child(3) { bottom: 3px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

.nav-overlay { display: none; }

@media (max-width: 860px) {
  .site-logo img { width: min(300px, 62vw); }
  .nav-toggle { display: block; }

  .site-nav {
    position: fixed;
    z-index: 2;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    padding: 22px 32px 40px;
    background: var(--white);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.45s;
  }
  .site-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
  }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav .nav-home { display: block; }
  .site-nav li {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .site-nav.is-open li {
    opacity: 1;
    transform: none;
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .site-nav.is-open li:nth-child(1) { transition-delay: 0.10s; }
  .site-nav.is-open li:nth-child(2) { transition-delay: 0.15s; }
  .site-nav.is-open li:nth-child(3) { transition-delay: 0.20s; }
  .site-nav.is-open li:nth-child(4) { transition-delay: 0.25s; }
  .site-nav.is-open li:nth-child(5) { transition-delay: 0.30s; }
  .site-nav a {
    display: block;
    padding: 18px 0;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 22px;
    line-height: 1.4;
    white-space: normal;
    color: var(--black);
  }
  .site-nav a[aria-current="page"] { color: var(--red); }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0s linear 0.45s;
  }
  .menu-open .nav-overlay {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s ease, visibility 0s;
  }
  html.menu-open { overflow: hidden; }
}

@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .site-nav,
  .site-nav.is-open,
  .site-nav li,
  .site-nav.is-open li,
  .nav-overlay,
  .menu-open .nav-overlay,
  .nav-toggle__line { transition: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 560px;
  height: 70vh;
  max-height: 760px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
  overflow: hidden;
  background: #333;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Full-screen hero (home page): fills the viewport below the header */
.hero--full {
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 420px;
  max-height: none;
}
/* Light dim so a hero title stays readable (pages without a title get none) */
.hero:has(.hero__title)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
}
.hero__title {
  position: relative;
  z-index: 1;
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ---------- Generic sections ---------- */
.section { padding: 80px 0; }
.section--light { background: var(--gray-light); }
.section--black { background: var(--black); color: var(--white); }
.section--tight { padding: 48px 0; }
.text-center { text-align: center; }
.small { font-size: 14px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; gap: 36px; }
  .section { padding: 56px 0; }
}

/* Overlapping two-photo collage */
.collage { position: relative; padding-bottom: 28%; }
.collage img { box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.collage__a { width: 78%; }
.collage__b {
  position: absolute;
  width: 62%;
  right: 0;
  bottom: 0;
  border: 0;
}
.collage--right .collage__a { margin-left: auto; }
.collage--right .collage__b { right: auto; left: 0; }

.cta-band { text-align: center; }
.cta-band h2 { font-size: 28px; margin-bottom: 16px; }

/* ---------- Home ---------- */
.intro p { font-size: 18px; max-width: 420px; }

.join h2 { font-size: 32px; font-weight: 700; }
.join p { max-width: 380px; font-size: 15px; }
.join .btn-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.gallery button {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  aspect-ratio: 1 / 1.05;
  overflow: hidden;
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery button:hover img { transform: scale(1.04); }
@media (max-width: 500px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 92vw;
  max-height: 92vh;
}
.lightbox::backdrop { background: rgba(0,0,0,0.88); }
.lightbox img { max-width: 92vw; max-height: 86vh; width: auto; margin: 0 auto; }
.lightbox__close {
  position: fixed;
  top: 16px; right: 20px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: 0;
  color: #fff;
  font-size: 32px;
  width: 48px; height: 64px;
  cursor: pointer;
}
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }

.quote {
  position: relative;
  color: var(--white);
  text-align: center;
  padding: 110px 0;
  background: #222;
  overflow: hidden;
}
.quote > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}
.quote blockquote {
  position: relative;
  margin: 0 auto;
  max-width: 540px;
  font-size: 17px;
}
.quote blockquote::before,
.quote blockquote::after {
  display: block;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 110px;
  line-height: 0.6;
  height: 52px;
}
.quote blockquote::before { content: "\201C"; margin-bottom: 24px; }
.quote blockquote::after { content: "\201D"; margin-top: 40px; }
.quote cite { display: block; font-style: normal; margin-top: 8px; }

.partners {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
}
.partners > * {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  min-height: 200px;
}
.partners > * + * { border-left: 2px solid var(--black); }
.partners h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(transparent 62%, var(--red) 62%, var(--red) 88%, transparent 88%);
  padding-right: 40px;
}
.partners img { max-height: 140px; width: auto; }
@media (max-width: 700px) {
  .partners { grid-template-columns: 1fr; }
  .partners > * + * { border-left: 0; border-top: 2px solid var(--black); }
  .partners > * { min-height: 0; }
}

/* ---------- Weekly runs ---------- */
.runs-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 40px;
}
.runs-layout > h1 { font-size: clamp(40px, 5vw, 56px); font-weight: 600; }
.run { margin-bottom: 64px; }
.run:last-child { margin-bottom: 0; }
.run h2 {
  color: var(--red);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 18px;
}
.run h2 span { display: block; }
.run p { font-size: 15px; line-height: 2; margin: 0; }
.run .note { font-weight: 700; }
@media (max-width: 760px) {
  .runs-layout { grid-template-columns: 1fr; }
}

/* ---------- Events ---------- */
.page-title {
  text-align: center;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  margin-bottom: 8px;
}
.page-title::after {
  content: "";
  display: block;
  width: 30px;
  height: 2px;
  background: var(--black);
  margin: 18px auto 0;
}
/* Event cards: one row of three on desktop, equal heights, buttons aligned at the bottom */
.events {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
  margin-top: 48px;
}
.event {
  display: flex;
  flex-direction: column;
  background: var(--gray-card);
  padding: 28px;
}
.event__img {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;  /* keep every image box the same height, even for tall logos */
  margin-bottom: 24px;
}
.event__img img { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.event__date { margin: 0 0 2px; }
.event h2 { font-size: 20px; margin-bottom: 12px; }
.event p { font-size: 15px; }
.event .btn { display: table; margin: auto auto 0; }
.event p:last-of-type { margin-bottom: 24px; }
@media (max-width: 1000px) {
  .events { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .events { grid-template-columns: 1fr; gap: 24px; }
  .event { padding: 22px; }
}

/* ---------- Membership ---------- */
.keep-in-touch h1 { font-size: 34px; font-weight: 700; }
.keep-in-touch p { font-size: 17px; }

.dues h2 { text-align: center; font-size: 28px; font-weight: 700; margin-bottom: 36px; }
/* Each benefit is a card: full-color photo on top, text below */
.benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.benefit {
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--text);
  overflow: hidden;
}
.benefit > img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.benefit:hover > img { transform: scale(1.03); }
.benefit__card { padding: 22px 22px 26px; }
.benefit__card h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.benefit__card p { font-size: 15px; line-height: 1.55; margin: 0; color: #333; }
.dues__footnote { max-width: 520px; margin: 28px auto 0; text-align: center; font-size: 14px; }
@media (max-width: 900px) { .benefits { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .benefits { grid-template-columns: 1fr; }
}

.sliding-scale { text-align: center; max-width: 620px; margin: 0 auto; font-size: 18px; }
.sliding-scale h2 { font-size: 28px; font-weight: 600; }

/* ---------- Contact ---------- */
.contact h1 { font-size: 40px; font-weight: 700; }
.contact p { font-size: 18px; }

/* ---------- Footer ---------- */
.ig-feed {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 56px;
}
.ig-feed[hidden] { display: none; }
.ig-feed__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 4 * 12px) / 5);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.ig-feed__track::-webkit-scrollbar { display: none; }
.ig-feed__item {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--gray-card);
}
.ig-feed__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.ig-feed__item:hover img { transform: scale(1.04); }
.ig-feed__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}
.ig-feed__arrow--prev { left: 8px; }
.ig-feed__arrow--next { right: 8px; }
.ig-feed__follow {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 14px;
  margin: 16px 0 0;
}
.ig-feed__follow a { text-decoration: none; }
.ig-feed__follow a:hover { color: var(--red); }
@media (max-width: 700px) {
  .ig-feed { padding: 32px var(--gutter); }
  .ig-feed__track { grid-auto-columns: calc((100% - 2 * 8px) / 2.5); gap: 8px; }
  .ig-feed__arrow { display: none; }
}

.site-footer__bar {
  background: var(--gray-header);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 28px var(--gutter);
}
.site-footer__bar p { margin: 0 0 4px; }
.social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}
.social img { width: 26px; height: 26px; }

/* ---------- Rounded corners ----------
   Subtle rounding for a softer look. Adjust --radius / --radius-sm at the top.
   Full-bleed sections (hero, quote, partners) stay square. */
.btn,
.skip-link { border-radius: var(--radius-sm); }

.collage img,
.two-col > img,
.gallery button,
.lightbox img,
.event,
.event__img img,
.benefit,
.ig-feed__item { border-radius: var(--radius); }

