/* ============================================================
   CCM.CSS — Cuddon Cycling Marlborough shared stylesheet
   ============================================================

   DESIGN SYSTEM
   -------------
   Brand red:  #ED1B24  (matches club logo, close to PMS 185)
   Brand gold: #F5D327  (PMS 109 — accent, used sparingly)
   Background: #ffffff  (white — gold stripe reads cleanly on white)
   Text:       #1a1a1a  (near-black)
   Muted:      #888888
   Border:     #e0e0e0

   Fonts
   -----
   Display: Barlow Condensed — headings, labels, nav
   Body:    Barlow — prose, descriptions
   Mono:    Roboto Mono — times, distances, metadata

   Nav stripe: two × 2px horizontal lines (both gold) beneath nav.
   Change --stripe-top / --stripe-bottom to retheme instantly.
   ============================================================ */

/* ── VARIABLES ── */
:root {
  /* Brand */
  --red:    #ED1B24;
  --gold:   #F5D327;

  /* Backgrounds */
  --bg:       #ffffff;
  --surface:  #f5f5f5;
  --surface2: #fafafa;
  --surface3: #efefef;

  /* Text */
  --text:           #1a1a1a;
  --text-secondary: #555555;
  --muted:          #888888;

  /* Structure */
  --border: #e0e0e0;

  /* Nav stripe — change these two lines to retheme */
  --stripe-top:    var(--gold);
  --stripe-bottom: var(--gold);

  /* Fonts */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;
  --font-mono:    'Roboto Mono', monospace;

  /* Legacy aliases — used by older page-specific code, remove during Chunk 3 */
  --yellow: var(--gold);
  --black:  var(--bg);
  --dark:   var(--surface);
  --dark2:  var(--surface2);
  --dark3:  var(--surface3);
  --white:  var(--text);
  --light:  var(--text-secondary);
}

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px;
  line-height: 1.6; overflow-x: clip;
  padding-top: 68px;
}
body.has-section-nav { padding-top: 120px; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 64px;
}
.nav-logo {
  text-decoration: none; display: flex; align-items: center; height: 64px;
}
.nav-logo img { height: 40px; width: auto; display: block; }
.nav-links { display: flex; gap: 0; list-style: none; height: 64px; align-items: center; }
.nav-links a {
  font-family: var(--font-display); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text);
  text-decoration: none; padding: 0 18px; height: 64px;
  display: flex; align-items: center;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--red); }
.nav-links a.active,
.section-nav a.active,
.nav-active {
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav-join {
  font-family: var(--font-display); font-weight: 700; font-size: 0.75rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--red); color: #ffffff;
  padding: 10px 20px; text-decoration: none;
  transition: background 0.15s;
}
.nav-join:hover { background: #c01018; }

/* ── NAV STRIPE ──
   Two × 2px horizontal lines beneath the nav.
   Colours controlled by --stripe-top and --stripe-bottom in :root.
── */
.nav-stripe {
  position: fixed; top: 64px; left: 0; right: 0; z-index: 199;
  pointer-events: none;
}
body.has-section-nav .nav-stripe { top: 116px; }
.nav-stripe-top    { height: 2px; background: var(--stripe-top); }
.nav-stripe-bottom { height: 2px; background: var(--stripe-bottom); }

/* ── SECTION TAB-BAR ──
   Sits flush under main nav as a second row in the same white bar.
   Right-aligned so it lines up under the primary nav links.
── */
.section-nav {
  position: fixed; top: 64px; left: 0; right: 0; z-index: 198;
  background: var(--bg);
  height: 52px;
}
.section-nav-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 48px;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0; height: 52px; overflow-x: auto;
}
.section-nav a {
  font-family: var(--font-display); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-secondary);
  text-decoration: none; padding: 0 18px; height: 52px;
  display: flex; align-items: center; white-space: nowrap;
  transition: color 0.15s;
}
.section-nav a:hover { color: var(--red); }
.section-nav a.active { }
body.has-section-nav { padding-top: 120px; }
@media (max-width: 760px) {
  .section-nav-inner { padding: 0 16px; justify-content: flex-start; }
}

/* ── NAV AUTH ── */
.nav-auth { display: flex; align-items: center; margin-right: 8px; }

.nav-auth-login {
  font-family: var(--font-display); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text);
  text-decoration: none; padding: 0 18px; height: 64px;
  display: flex; align-items: center;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.nav-auth-login:hover { color: var(--red); }

.nav-user { position: relative; cursor: pointer; }
.nav-user-btn {
  font-family: var(--font-display); font-weight: 700; font-size: 0.75rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary);
  padding: 0 18px; height: 64px; display: flex; align-items: center; gap: 6px;
  border-bottom: 2px solid transparent; transition: color 0.15s;
  background: none; border-top: none; border-left: none; border-right: none;
  cursor: pointer;
}
.nav-user-btn:hover { color: var(--text); }
.nav-user-btn .nav-user-caret { font-size: 0.5rem; opacity: 0.6; }

.nav-user-dropdown {
  display: none; position: absolute; top: 68px; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-top: 2px solid var(--red); min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08); z-index: 300;
}
.nav-user-dropdown.open { display: block; }
.nav-user-dropdown a {
  display: block; padding: 11px 20px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-secondary); text-decoration: none; transition: color 0.12s, background 0.12s;
}
.nav-user-dropdown a:hover { color: var(--red); background: var(--surface); }
.nav-user-dropdown a.nav-signout { color: var(--muted); border-top: 1px solid var(--border); }
.nav-user-dropdown a.nav-signout:hover { color: var(--red); }

/* ── NAV DROPDOWNS ── */
.nav-link {
  font-family: var(--font-display); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text);
  text-decoration: none; padding: 0 18px; height: 64px;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: var(--red); }

.nav-dropdown {
  position: relative; display: flex; align-items: stretch; height: 64px;
}
.nav-dropdown-btn {
  font-family: var(--font-display); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text);
  background: none; border: none; cursor: pointer;
  padding: 0 18px; display: flex; align-items: center; gap: 6px;
  transition: color 0.15s; height: 100%;
}
.nav-dropdown-btn:hover { color: var(--red); }
.nav-dropdown-btn .nav-caret { font-size: 0.5rem; opacity: 0.6; }

.nav-dropdown-menu {
  display: none; position: absolute; top: 68px; left: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-top: 2px solid var(--red); min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08); z-index: 300;
  list-style: none; margin: 0; padding: 0;
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu li a {
  display: block; padding: 11px 20px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-secondary); text-decoration: none;
  transition: color 0.12s, background 0.12s;
}
.nav-dropdown-menu li a:hover { color: var(--red); background: var(--surface); }
.nav-dropdown-menu li a.nav-signout { color: var(--muted); border-top: 1px solid var(--border); }
.nav-dropdown-menu li a.nav-signout:hover { color: var(--red); }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; pointer-events: none; }

/* ── DIVIDER ── */
.divider { height: 3px; background: var(--red); }

/* ── SECTION SHARED ── */
.section { padding: 96px 0; }
.section-inner { max-width: 1400px; margin: 0 auto; padding: 0 48px; }
.section-header { margin-bottom: 56px; }
.section-eyebrow {
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--red); margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.section-eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--red); display: block; }
.section-title {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(36px, 5vw, 60px);
  text-transform: uppercase; line-height: 0.95; letter-spacing: -0.01em;
}
.section-title em { font-style: italic; color: var(--red); }
.section-link {
  font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--red); text-decoration: none;
  display: flex; align-items: center; gap: 8px; transition: gap 0.2s;
}
.section-link:hover { gap: 14px; }
.section-link::after { content: '→'; }

/* ── FOOTER ── */
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 64px 0 40px;
}
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 0 48px; }
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 64px;
  margin-bottom: 64px;
}
.footer-logo {
  font-family: var(--font-display); font-weight: 900; font-size: 1.2rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text);
  margin-bottom: 16px; display: block;
}
.footer-logo em { font-style: normal; color: var(--red); }
.footer-desc {
  font-size: 0.85rem; font-weight: 300; color: var(--muted); line-height: 1.8;
  max-width: 280px; margin-bottom: 24px;
}
.footer-founding {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.footer-col h4 {
  font-family: var(--font-display); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 20px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: 0.85rem; font-weight: 300; color: var(--muted); text-decoration: none;
  transition: color 0.15s;
}
.footer-col ul li a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border); padding-top: 32px;
}
.footer-copy {
  font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.footer-contact {
  font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.1em; color: var(--muted);
}
.footer-contact a { color: var(--muted); text-decoration: none; }
.footer-contact a:hover { color: var(--red); }

/* ── SPONSOR STRIP ── */
.sponsors-strip { background: var(--surface2); border-top: 1px solid var(--border); }
.sponsors-strip .section-inner { display: flex; flex-direction: column; align-items: center; }
.sponsors-head {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 36px; text-align: center;
}
.sponsors-naming { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 760px; padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--border); }
.sponsors-naming:empty { display: none; }
.sponsors-powered { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.ss-naming { display: inline-flex; align-items: center; justify-content: center; opacity: 0.95; transition: opacity 0.15s; }
.ss-naming:hover { opacity: 1; }
.ss-naming-img { max-height: 84px; max-width: 300px; object-fit: contain; }
.sponsors-tier { width: 100%; display: flex; flex-direction: column; align-items: center; margin-bottom: 44px; }
.sponsors-tier:last-of-type { margin-bottom: 36px; }
.sponsors-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 40px 56px; }
.sponsors-row-small { gap: 30px 44px; }
.sponsors-row-small .ss-item { height: 40px; opacity: 0.65; }
.sponsors-row-small .ss-logo-img { max-height: 40px; max-width: 130px; }
.ss-item { display: flex; align-items: center; justify-content: center; height: 52px; text-decoration: none; opacity: 0.75; transition: opacity 0.15s; }
.ss-item:hover { opacity: 1; }
.ss-logo-img { max-height: 52px; max-width: 160px; object-fit: contain; }
.ss-logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── HAMBURGER ── */
.nav-burger {
  display: none; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px; width: 36px; height: 36px;
  background: none; border: none; cursor: pointer; padding: 4px;
  z-index: 300; flex-shrink: 0;
}
.nav-burger span {
  display: block; width: 24px; height: 2px;
  background: var(--text); transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.nav-mobile-menu {
  display: none; position: fixed;
  top: 68px; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 190;
  flex-direction: column; padding: 32px 24px; overflow-y: auto;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu li { list-style: none; border-bottom: 1px solid var(--border); }
.nav-mobile-menu li a {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.6rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-secondary); text-decoration: none;
  display: block; padding: 16px 0; transition: color 0.15s;
}
.nav-mobile-menu li a:hover,
.nav-mobile-menu li a.active { color: var(--red); }
.nav-mobile-join {
  margin-top: 32px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--red); color: #ffffff;
  padding: 16px 24px; text-decoration: none;
  display: inline-block; text-align: center; transition: background 0.15s;
}
.nav-mobile-join:hover { background: #c01018; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  nav { padding: 0 16px; }
  .nav-links { display: none; }
  .nav-join { display: none; }
  .nav-burger { display: flex; }
  .section { padding: 60px 0; }
  .section-inner { padding: 0 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-inner { padding: 0 20px; }
  .footer-bottom { flex-direction: column; gap: 12px; }

  .nav-mobile-menu .nav-dropdown { display: block; flex: none; height: auto; align-items: unset; }
  .nav-mobile-menu .nav-dropdown-btn {
    display: block; height: auto; padding: 12px 0 !important;
    font-size: 1.4rem; width: 100%; border-bottom: none;
  }
  .nav-mobile-menu .nav-dropdown-menu {
    position: static; display: none; background: none;
    border: none; border-top: none; box-shadow: none;
    padding: 8px 0 0 16px; margin: 0; min-width: unset; z-index: auto;
  }
  .nav-mobile-menu .nav-dropdown-menu.open { display: block; }
  .nav-mobile-menu .nav-dropdown-menu li { border-bottom: none; margin-bottom: 8px; }
  .nav-mobile-menu .nav-dropdown-menu li a { font-size: 1.2rem; padding: 8px 0; color: var(--text-secondary); }
  .nav-mobile-menu .nav-dropdown-menu li a:hover,
  .nav-mobile-menu .nav-dropdown-menu li a.active { color: var(--red); }
}
