/* Athletics Cook Islands - site styles.
   Brand: forest green primary, bright green accent, white ground. */

:root {
  /* ACI green. --brand is sampled from the running singlets in the hero
     photograph (lit fabric reads #08a858). It is the colour that carries the
     brand: borders, rules, tiles, highlights.
     --green-700 is the darker step used wherever white text sits on green,
     because white on --brand does not reach 4.5:1. */
  --green-900: #04291a;
  --green-800: #06462c;
  --green-700: #00713d;
  --green-600: #008a4a;
  --brand: #00a65a;
  --brand-lit: #17c46f;
  --accent: #00a65a;
  --accent-dark: #00713d;
  --ink: #14201a;
  --ink-soft: #4a5a51;
  --line: #dfe6e1;
  --muted-bg: #f3f8f5;
  --wrap: 1200px;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(0, 40, 15, .06), 0 12px 32px rgba(0, 40, 15, .07);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  font-size: 17px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-700); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--green-700); color: #fff; padding: .75rem 1.25rem;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.6rem; border-radius: 999px; font-weight: 700;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-accent { background: var(--brand); color: #fff; }
.btn-accent:hover { background: var(--brand-lit); }
.btn-outline {
  border-color: rgba(255, 255, 255, .85);
  color: #fff;
  background: rgba(0, 0, 0, .28);
  backdrop-filter: blur(2px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.btn-outline:hover { background: rgba(0, 0, 0, .45); border-color: #fff; }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-600); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--green-900);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 78px; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand-text {
  display: flex; flex-direction: column; line-height: 1.05;
  font-size: .95rem; letter-spacing: .04em; text-transform: uppercase;
}
.brand-text strong { font-weight: 800; }
.brand-text span { color: var(--accent); font-weight: 600; }

.primary-nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.nav-list { list-style: none; display: flex; align-items: center; gap: .25rem; margin: 0; padding: 0; }
.nav-list > li { position: relative; }
.nav-list > li > a {
  display: block; padding: .6rem .8rem; color: #fff; text-decoration: none;
  font-weight: 600; font-size: .95rem; border-radius: 8px;
}
.nav-list > li > a:hover,
.nav-list > li > a[aria-current] { background: rgba(255,255,255,.12); color: var(--accent); }
.submenu-toggle { display: none; }

.submenu {
  position: absolute; top: 100%; left: 0; min-width: 250px;
  list-style: none; margin: 0; padding: .5rem;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.has-menu:hover .submenu,
.has-menu:focus-within .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu a {
  display: block; padding: .6rem .75rem; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.submenu a:hover { background: var(--muted-bg); color: var(--green-700); }

.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; display: grid; align-items: center;
  min-height: calc(100svh - 78px);
  color: #fff; text-align: center;
  background: var(--green-900);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero-media::after {
  /* No colour cast over the photograph. The athletes are in Cook Islands green
     and that should read as their green, not as a tint we painted on. Just
     enough darkening at the very top and bottom to hold the sticky header and
     the buttons, and the middle left alone. */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, .38) 0%,
    rgba(0, 0, 0, .10) 18%,
    rgba(0, 0, 0, 0)   42%,
    rgba(0, 0, 0, .12) 72%,
    rgba(0, 0, 0, .45) 100%
  );
}
.hero-inner { position: relative; z-index: 1; padding: 5rem 0; }
.hero h1 {
  /* Layered shadows: a tight dark one for edge definition against a light
     patch of photograph, and a wide soft one so the letterforms still separate
     from a busy background. */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .55),
    0 2px 10px rgba(0, 0, 0, .5),
    0 4px 34px rgba(0, 0, 0, .45);
}
.hero-lede {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem); font-weight: 600;
  max-width: 46ch; margin-inline: auto;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .6),
    0 2px 12px rgba(0, 0, 0, .55);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 2.5rem; }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-muted { background: var(--muted-bg); }
.section-green { background: var(--green-800); color: #fff; }
.section-green a { color: var(--accent); }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto clamp(2rem, 4vw, 3.5rem); }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }
.section-green .section-head p { color: rgba(255,255,255,.8); }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-dark); margin-bottom: .75rem;
}
.section-green .eyebrow { color: var(--accent); }

.grid { display: grid; gap: 1.75rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------- cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,40,15,.08), 0 20px 44px rgba(0,40,15,.1); }
.card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--ink-soft); font-size: .97rem; }
.card-meta {
  font-size: .82rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-dark); margin-bottom: .6rem;
}
.card-link { margin-top: auto; padding-top: 1rem; font-weight: 700; text-decoration: none; }

.event-card { border-left: 5px solid var(--accent); }
.event-date { font-size: .95rem; font-weight: 700; color: var(--green-700); }

/* ---------- tiles ---------- */
.tile {
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 190px; padding: 1.5rem; border-radius: var(--radius);
  background: var(--green-800); color: #fff; text-decoration: none;
  border: 1px solid rgba(255,255,255,.12);
  transition: transform .18s ease, background-color .18s ease;
}
.tile:hover { transform: translateY(-3px); background: var(--green-700); }
.tile strong { font-size: 1.35rem; letter-spacing: .04em; text-transform: uppercase; }
.tile span { color: rgba(255,255,255,.75); font-size: .95rem; }

/* ---------- partners ---------- */
.partner-group { margin-bottom: 3rem; }
.partner-group h3 {
  text-align: center; font-size: .85rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 1.5rem;
}
.partner-row { display: flex; flex-wrap: wrap; gap: 2rem 3rem; align-items: center; justify-content: center; }
.partner-row img { max-height: 64px; width: auto; object-fit: contain; }
.partner-pending {
  display: flex; align-items: center; justify-content: center;
  min-width: 150px; min-height: 64px; padding: 0 1rem;
  border: 1px dashed var(--line); border-radius: 10px;
  color: var(--ink-soft); font-size: .85rem; text-align: center;
}

/* ---------- footer ---------- */
.site-footer { background: var(--green-900); color: rgba(255,255,255,.78); padding: 4rem 0 0; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer-logo { width: 72px; height: auto; }
.footer-tagline { max-width: 30ch; margin-top: 1rem; }
.footer-social a { margin-right: 1rem; }
.site-footer h2 { color: #fff; font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.site-footer a { color: rgba(255,255,255,.78); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-base {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  margin-top: 3rem; padding: 1.5rem 0; border-top: 1px solid rgba(255,255,255,.12);
  font-size: .88rem;
}
.footer-base p { margin: 0; }

/* ---------- mobile ---------- */
@media (max-width: 1080px) {
  .nav-toggle {
    display: block; margin-left: auto; width: 46px; height: 46px;
    background: transparent; border: 1px solid rgba(255,255,255,.3);
    border-radius: 10px; cursor: pointer; position: relative;
  }
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    position: absolute; left: 50%; width: 22px; height: 2px;
    background: #fff; transform: translateX(-50%);
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav-toggle-bars { top: 50%; margin-top: -1px; }
  .nav-toggle-bars::before { content: ""; top: -7px; }
  .nav-toggle-bars::after { content: ""; top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateX(-50%) translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateX(-50%) translateY(-7px) rotate(-45deg); }

  .primary-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--green-900); padding: 1rem 1.25rem 2rem;
    max-height: calc(100vh - 78px); overflow-y: auto;
    border-bottom: 3px solid var(--accent);
  }
  .primary-nav.is-open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav-list > li > a { padding: .9rem .25rem; font-size: 1.05rem; }

  .submenu-toggle {
    display: block; position: absolute; right: 0; top: .5rem;
    width: 44px; height: 44px; background: transparent; border: 0; cursor: pointer;
  }
  .submenu-toggle::after {
    content: ""; position: absolute; left: 15px; top: 17px;
    width: 9px; height: 9px;
    border-right: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(45deg); transition: transform .2s ease;
  }
  .submenu-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); }

  .submenu {
    position: static; opacity: 1; visibility: visible; transform: none;
    display: none; background: transparent; border: 0; box-shadow: none;
    padding: 0 0 .75rem .75rem;
  }
  .submenu.is-open { display: block; }
  .has-menu:hover .submenu:not(.is-open) { display: none; }
  .submenu a { color: rgba(255,255,255,.8); padding: .55rem .25rem; }
  .submenu a:hover { background: transparent; color: var(--accent); }
  .nav-cta { margin-top: 1.25rem; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
