/* F.A.T.T. – First Adult Triathlon Team
   Colours sampled from the team logo. Slant angle matches the logo's panels. */

:root {
  --navy: #062b4d;
  --navy-2: #0d3a63;
  --swim: #0773b7;
  --bike: #539334;
  --bike-text: #3c7322;   /* darker green for text on light backgrounds */
  --run: #f17310;
  --run-text: #b8520a;    /* darker orange for text on light backgrounds */
  --paper: #f3f6f9;
  --white: #ffffff;
  --ink: #1b2733;
  --muted: #4a5a6a;
  --line: #d5dde5;

  --slant: -16deg;
  --font-display: "Saira", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 66ch;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem); /* 18–20px: comfortable for every reader */
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
}

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

a { color: var(--swim); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--navy); }

:focus-visible {
  outline: 3px solid var(--run);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: var(--white); padding: 0.75rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

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

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 1.2rem + 0.5vw, 1.6rem); font-weight: 700; }

p, ul, ol, dl { margin: 0 0 1em; max-width: var(--measure); }
.lead { font-size: 1.2em; color: var(--muted); }

/* Placeholder text you still need to fill in. Search the files for class="fill". */
.fill {
  background: #fff3c4;
  outline: 2px dashed #e0b400;
  outline-offset: 1px;
  padding: 0 0.2em;
  border-radius: 2px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 5rem;
}
.brand img { width: 8.75rem; }

.nav-toggle {
  display: none;
  font: 700 1rem var(--font-body);
  color: var(--navy);
  background: none;
  border: 2px solid var(--navy);
  border-radius: 6px;
  padding: 0.55rem 0.9rem;
  min-height: 48px;
  cursor: pointer;
}

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem;
}
.site-nav a {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  text-decoration: none;
  padding: 0.6rem 0 0.4rem;
  position: relative;
}
/* Current page: a slanted bar in that page's leg colour */
.site-nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0.1rem;
  height: 5px;
  background: var(--leg, var(--navy));
  transform: skewX(var(--slant)) scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: skewX(var(--slant)) scaleX(1); }
.site-nav a.cta-link {
  background: var(--run);
  color: var(--navy);
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
}
.site-nav a.cta-link::after { display: none; }
.site-nav a.cta-link:hover { background: #ff8a2e; }

@media (max-width: 66rem) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-header .wrap { flex-wrap: wrap; }
  .site-nav ul { flex-direction: column; gap: 0; padding-bottom: 1rem; }
  .site-nav a { font-size: 1.25rem; padding: 0.7rem 0; }
  .site-nav a.cta-link { margin-top: 0.5rem; }
}
@media (min-width: 66.01rem) {
  .site-nav { display: block !important; }
}

/* ---------- Leg colours ---------- */

.leg-swim { --leg: var(--swim); --leg-text: var(--swim); }
.leg-bike { --leg: var(--bike); --leg-text: var(--bike-text); }
.leg-run  { --leg: var(--run);  --leg-text: var(--run-text); }

/* ---------- Hero (home) ---------- */

.hero {
  background: var(--navy);
  color: var(--white);
  padding: clamp(3rem, 7vw, 6rem) 0 0;
  overflow: hidden;
}
.hero h1 { color: var(--white); max-width: 15ch; }
.hero .lead { color: #c9d6e3; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 0; }

/* The signature: three slanted panels, one per leg, showing a sprint race */
.legs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: clamp(3rem, 6vw, 4.5rem) calc(var(--gutter) * -0.5) 0;
  padding: 0 0 0 1.5rem;
  list-style: none;
  max-width: none;
}
.legs li {
  background: var(--leg);
  transform: skewX(var(--slant));
  padding: 1.4rem 1.6rem 1.6rem;
  color: var(--white);
}
.legs li > * { transform: skewX(calc(var(--slant) * -1)); }
.legs .leg-name {
  font-family: var(--font-display); font-style: italic; font-weight: 700;
  font-size: 1.15rem; display: block; opacity: 0.92;
}
.legs .leg-dist {
  font-family: var(--font-display); font-style: italic; font-weight: 800;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem); line-height: 1; display: block;
}
.legs .leg-run { color: var(--navy); }
.legs-caption {
  color: #c9d6e3; font-size: 1rem; padding: 1rem 0 2.5rem; margin: 0;
}

@media (max-width: 40rem) {
  .legs { grid-template-columns: 1fr; padding-left: 0.75rem; margin-left: 0; margin-right: 0; }
  .legs li { padding: 1rem 1.4rem; display: flex; justify-content: space-between; align-items: baseline; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  min-height: 48px;
  border-radius: 4px;
  border: 2px solid transparent;
}
.btn-primary { background: var(--run); color: var(--navy); }
.btn-primary:hover { background: #ff8a2e; color: var(--navy); }
.btn-ghost { border-color: currentColor; color: var(--white); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: var(--navy-2); color: var(--white); }

/* ---------- Page header (inner pages) ---------- */

.page-head {
  background: var(--paper);
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 6px solid var(--leg, var(--navy));
}
.page-head h1 { margin-bottom: 0.3em; }
.page-head .lead { margin: 0; }

/* ---------- Sections ---------- */

.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-alt { background: var(--paper); }
.section > .wrap > h2:first-child { margin-top: 0; }

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.split-top { align-items: start; }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }

.figure { margin: 0; }
.figure img { border-radius: 6px; }
.figure figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.6rem; }

/* Three short columns, used for "who it's for" and similar */
.trio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem 2.5rem;
  margin-top: 2rem;
}
.trio > div { border-top: 5px solid var(--leg, var(--navy)); padding-top: 1rem; }
.trio p { margin: 0; }

/* Real sequences only: steps you do in order */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 2rem 0 0; max-width: 48rem; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.75rem 4.25rem;
  min-height: 3rem;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -0.2rem;
  width: 3rem; height: 2.6rem;
  display: grid; place-items: center;
  font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 1.4rem;
  color: var(--white);
  background: var(--leg, var(--navy));
  transform: skewX(var(--slant));
}
.steps li:nth-child(3n+1) { --leg: var(--swim); }
.steps li:nth-child(3n+2) { --leg: var(--bike); }
.steps li:nth-child(3n+3) { --leg: var(--run); }
.steps li:nth-child(3n+3)::before { color: var(--navy); }
.steps h3 { margin-bottom: 0.25em; }
.steps p { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0 2rem; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 1rem; }
th, td { text-align: left; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: var(--navy); border-bottom: 3px solid var(--navy);
}
tbody th { font-weight: 700; color: var(--navy); }
tr.highlight { background: #e8f2fa; }

/* Checklists */
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 2rem; margin-bottom: 0.6rem; }
.checklist li::before {
  content: "";
  position: absolute; left: 0.2rem; top: 0.55em;
  width: 0.9rem; height: 0.55rem;
  background: var(--leg, var(--bike));
  transform: skewX(var(--slant));
}

/* Note box */
.note {
  border-left: 6px solid var(--run);
  background: #fff4ea;
  padding: 1.1rem 1.4rem;
  margin: 2rem 0;
  max-width: var(--measure);
}
.note p:last-child { margin-bottom: 0; }

/* FAQ */
.faq { max-width: 52rem; margin-top: 1rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  color: var(--navy);
  padding: 1.1rem 3rem 1.1rem 0;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 0.5rem; top: 0.8rem;
  font-size: 1.8rem; font-weight: 400; color: var(--swim);
}
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 1.25rem; }
.faq details > div p:last-child { margin-bottom: 0; }

/* Contact card */
.contact {
  background: var(--navy); color: var(--white);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 6px;
}
.contact h2, .contact h3 { color: var(--white); }
.contact a { color: var(--white); }
.contact .email { font-family: var(--font-display); font-weight: 700; font-style: italic; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }

/* Call-to-action band */
.cta-band { background: var(--navy); color: var(--white); padding: clamp(3rem, 6vw, 4.5rem) 0; }
.cta-band h2 { color: var(--white); }
.cta-band p { color: #c9d6e3; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy);
  color: #c9d6e3;
  padding: 3rem 0 2rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 1rem;
}
.site-footer .wrap { display: grid; grid-template-columns: auto 1fr; gap: 2rem 3rem; align-items: start; }
.site-footer img { width: 9rem; }
.site-footer a { color: var(--white); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer .small { grid-column: 1 / -1; margin: 0; font-size: 0.9rem; }
@media (max-width: 40rem) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* The three-colour stripe under the footer, as on the logo */
.tri-stripe { display: flex; gap: 6px; height: 8px; margin: 0; overflow: hidden; }
.tri-stripe span { flex: 1; transform: skewX(var(--slant)); }
.tri-stripe span:nth-child(1) { background: var(--swim); }
.tri-stripe span:nth-child(2) { background: var(--bike); }
.tri-stripe span:nth-child(3) { background: var(--run); }

/* ---------- Motion ---------- */

/* One moment only: the three legs arrive in race order on the home page */
@media (prefers-reduced-motion: no-preference) {
  .legs li { animation: leg-in 0.6s cubic-bezier(.2,.7,.2,1) both; }
  .legs li:nth-child(2) { animation-delay: 0.15s; }
  .legs li:nth-child(3) { animation-delay: 0.3s; }
  @keyframes leg-in {
    from { opacity: 0; transform: skewX(var(--slant)) translateX(-2rem); }
    to   { opacity: 1; transform: skewX(var(--slant)) translateX(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =========================================================
   Members area
   ========================================================= */

.members-bar {
  background: var(--navy-2);
  color: var(--white);
}
.members-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.75rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.members-bar .label { font-family: var(--font-display); font-style: italic; font-weight: 700; color: #c9d6e3; margin: 0; }
.members-bar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.members-bar a { color: var(--white); text-decoration: none; display: inline-block; padding: 0.4rem 0; border-bottom: 3px solid transparent; }
.members-bar a:hover { border-bottom-color: rgba(255,255,255,0.5); }
.members-bar a[aria-current="page"] { border-bottom-color: var(--run); font-weight: 700; }

/* Big links to the three member tools */
.tool-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.tool-link {
  display: block; text-decoration: none; color: var(--ink);
  border: 2px solid var(--line); border-top: 8px solid var(--leg, var(--navy));
  padding: 1.4rem 1.5rem 1.5rem; border-radius: 4px; background: var(--white);
}
.tool-link:hover { border-color: var(--leg, var(--navy)); color: var(--ink); }
.tool-link h3 { color: var(--leg-text, var(--navy)); margin-bottom: 0.3em; }
.tool-link p { margin: 0; }

/* Calendar */
.calendar-frame {
  border: 2px solid var(--line); border-radius: 4px; background: var(--white);
  aspect-ratio: 4 / 3; width: 100%; min-height: 32rem;
}
.calendar-frame iframe { width: 100%; height: 100%; border: 0; }
.calendar-empty { height: 100%; display: grid; place-items: center; padding: 2rem; text-align: center; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }

/* Newsletter */
.issue-list { list-style: none; padding: 0; max-width: 52rem; }
.issue-list li { border-bottom: 1px solid var(--line); }
.issue-list a { display: grid; grid-template-columns: 9rem 1fr; gap: 0.25rem 1.5rem; padding: 1.1rem 0; text-decoration: none; color: var(--ink); }
.issue-list a:hover .issue-title { text-decoration: underline; }
.issue-date { color: var(--muted); }
.issue-title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--navy); }
.issue-sum { grid-column: 2; color: var(--muted); font-size: 1rem; }
@media (max-width: 40rem) { .issue-list a { grid-template-columns: 1fr; } .issue-sum { grid-column: 1; } }

.issue { max-width: 46rem; }
.issue h2 { margin-top: 2.2rem; padding-top: 1.2rem; border-top: 5px solid var(--leg, var(--navy)); }
.issue .meta { color: var(--muted); }

/* Shop */
.products { display: grid; gap: 1.25rem; margin: 1.5rem 0 2.5rem; }
.product {
  display: grid; grid-template-columns: 7rem 1fr auto; gap: 1rem 1.5rem; align-items: center;
  border: 2px solid var(--line); border-radius: 4px; padding: 1rem 1.25rem; background: var(--white);
}
.product .swatch { width: 7rem; aspect-ratio: 1; border-radius: 3px; background: var(--navy); overflow: hidden; display: grid; place-items: center; }
.product .swatch img { width: 100%; height: 100%; object-fit: cover; }
.product .swatch span { display: block; width: 60%; height: 18%; background: linear-gradient(90deg, var(--swim) 0 32%, transparent 32% 34%, var(--bike) 34% 66%, transparent 66% 68%, var(--run) 68%); transform: skewX(var(--slant)); }
.product h3 { margin: 0 0 0.2em; }
.product p { margin: 0; font-size: 1rem; color: var(--muted); }
.product .price { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--navy); white-space: nowrap; }
.product .choose { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; }
@media (max-width: 40rem) {
  .product { grid-template-columns: 5rem 1fr; }
  .product .swatch { width: 5rem; }
  .product .price { grid-column: 2; }
  .product .choose { grid-column: 1 / -1; }
}

/* Forms */
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1.1rem; max-width: 34rem; }
.choose .field { margin: 0; min-width: 7rem; }
label, .label-text { font-weight: 700; font-size: 1rem; color: var(--navy); }
input[type=text], input[type=email], select, textarea {
  font: inherit; font-size: 1.05rem; color: var(--ink);
  border: 2px solid #9aabbc; border-radius: 4px; padding: 0.6rem 0.75rem; min-height: 48px; background: var(--white);
}
textarea { min-height: 7rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--swim); outline: 3px solid var(--run); outline-offset: 1px; }
.hint { font-size: 0.95rem; color: var(--muted); font-weight: 400; }
.check { display: flex; gap: 0.75rem; align-items: flex-start; max-width: 40rem; margin: 1rem 0 1.5rem; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: 0.2rem; accent-color: var(--swim); flex: none; }
.check label { font-weight: 400; color: var(--ink); }
.hp { position: absolute; left: -9999px; }
fieldset { border: 0; padding: 0; margin: 0 0 2rem; }
legend { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem); color: var(--navy); margin-bottom: 0.5rem; padding: 0; }
button.btn { cursor: pointer; font-family: var(--font-display); }
.order-total { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--navy); margin: 0 0 1rem; }
.btn-outline { border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--paper); color: var(--navy); }
.form-error:not(:empty) { color: #a3200f; font-weight: 700; border-left: 6px solid #a3200f; padding: 0.5rem 1rem; background: #fdeceb; max-width: 40rem; }
.kit-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.kit-pair img { border-radius: 6px; }
.legs .leg-dist small { display: block; font-size: 0.4em; font-weight: 700; opacity: 0.9; margin-top: 0.35rem; letter-spacing: 0; }
@media (max-width: 40rem) { .legs .leg-dist small { display: inline; margin: 0 0 0 0.4rem; font-size: 0.45em; } }
