/* running.gi - one stylesheet for the whole site. Design notes live in NOTES.md. */

@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/fonts/barlow-condensed-latin-600-italic.woff2") format("woff2");
  font-weight: 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/fonts/barlow-condensed-latin-700-italic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}

:root {
  --red: #DE0B13;        /* brand red, from the logos */
  --red-dark: #B3080F;   /* hover, and red text on grey */
  --ink: #14233A;        /* Strait navy: text and headings */
  --muted: #4B5868;
  --rock: #ECEEF1;       /* limestone grey bands */
  --line: #CDD3DB;
  --paper: #FFFFFF;

  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  --wrap: 68rem;
  --gutter: clamp(0.75rem, 4vw, 2rem);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

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

a { color: var(--red); text-underline-offset: 0.15em; }
a:hover { color: var(--red-dark); }

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

h1, h2, h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.005em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.6rem, 8vw, 4.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-top: 1.6em; }
h3 { font-size: 1.4rem; font-weight: 600; margin-top: 1.4em; }

p, ul, ol, dl { margin: 0 0 1em; }

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
/* Text column, left-aligned with the logo */
.narrow > * { max-width: 42rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.75rem 1.5rem;
  padding-top: 1rem; padding-bottom: 1rem;
}
.brand img { width: clamp(9rem, 30vw, 12rem); }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem;
}
.site-nav a {
  font-family: var(--display); font-style: italic; font-weight: 600;
  font-size: 1.3rem; color: var(--ink); text-decoration: none;
  padding: 0.25rem 0; border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--red); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red); }

/* Bands */
.hero { background: var(--rock); padding: clamp(2rem, 6vw, 4.5rem) 0; }
.band { padding: clamp(2rem, 6vw, 4rem) 0; }
.band h2:first-child, .hero h2:first-child { margin-top: 0; }

.hero-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "text" "bib" "more";
}
.hero-text { grid-area: text; }
.hero-more { grid-area: more; }
.hero-grid > .bib { grid-area: bib; }

@media (min-width: 56rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 23rem;
    grid-template-areas: "text bib" "more bib";
    column-gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
  }
  .hero-more { margin-top: -1rem; }
}

.hero a { color: var(--red-dark); }
.lede { font-size: 1.3rem; line-height: 1.5; }
.hero-text > :last-child, .hero-more > :last-child { margin-bottom: 0; }

/* Page body */
.page { padding: clamp(2rem, 6vw, 4rem) 0; }

/* Photos */
.photo { margin: 0 0 1.75rem; }
.photo img { width: 100%; border-radius: 6px; }
.photo figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.5rem; }

/* Lists with a slanted brand tick, echoing the logo's italic stroke */
.ticks { list-style: none; padding: 0; }
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: 0.6em; }
.ticks li::before {
  content: ""; position: absolute; left: 0.2rem; top: 0.35em;
  width: 0.4rem; height: 0.95em; background: var(--red);
  transform: skewX(-14deg); border-radius: 1px;
}

/* "In every issue" */
.issue-sections { margin: 0; }
.issue-sections dt { font-weight: 600; margin-top: 0.9em; }
.issue-sections dt:first-child { margin-top: 0; }
.issue-sections dd { margin: 0.1em 0 0; color: var(--muted); }

/* Buttons */
.button, .bib button {
  display: inline-block;
  font-family: var(--display); font-style: italic; font-weight: 700;
  font-size: 1.4rem; line-height: 1;
  color: var(--paper); background: var(--red);
  border: 0; border-radius: 4px;
  padding: 0.75rem 1.4rem 0.8rem;
  text-decoration: none; cursor: pointer;
}
.button:hover, .bib button:hover { background: var(--red-dark); color: var(--paper); }

/* The race bib: the signup form */
.bib {
  position: relative;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line);
  overflow: hidden;
  max-width: 24rem;
  width: 100%;
  justify-self: start;
}
/* Safety-pin holes in the four corners */
.bib::before, .bib::after {
  content: ""; position: absolute; left: 10px; right: 10px; height: 12px; z-index: 2;
  background:
    radial-gradient(circle, var(--rock) 0 3.5px, rgba(20, 35, 58, 0.35) 4px, transparent 5px) left center / 12px 12px no-repeat,
    radial-gradient(circle, var(--rock) 0 3.5px, rgba(20, 35, 58, 0.35) 4px, transparent 5px) right center / 12px 12px no-repeat;
  pointer-events: none;
}
.bib::before { top: 10px; }
.bib::after { bottom: 10px; }

.bib-band {
  background: var(--red);
  padding: 1.6rem 1.75rem 1.3rem;
}
.bib-band img {
  width: 100%; max-width: 17rem; margin: 0 auto;
  filter: brightness(0) invert(1);
}
.bib-band p {
  margin: 0.6rem 0 0; text-align: center; color: var(--paper);
  font-weight: 600; font-size: 1rem; line-height: 1.35;
}

.bib form {
  padding: 1.25rem 1rem 1.75rem;
  border-bottom: 6px solid var(--red);
}
@media (min-width: 24rem) { .bib form { padding-left: 1.5rem; padding-right: 1.5rem; } }

.field { margin-bottom: 0.9rem; }
.field label { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.field input {
  width: 100%;
  font: inherit; font-size: 1.1rem;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--muted); border-radius: 4px;
  padding: 0.55rem 0.7rem;
}
.field input:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }

.h-captcha { min-height: 78px; margin: 1.1rem 0 1rem; }

.fineprint { font-size: 0.9rem; color: var(--muted); margin: 0.9rem 0 0; }
.fineprint a { color: var(--muted); }

/* Footer */
.site-footer {
  background: var(--ink); color: var(--paper);
  padding: 2rem 0 2.5rem; font-size: 1rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: baseline; }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--rock); }

.updated { color: var(--muted); font-size: 0.95rem; margin-top: 2.5rem; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
