/* ==========================================================================
   Stoke F.I.T. — site.css
   Single hand-rolled stylesheet for the 2026 redesign.
   Light theme by default; dark mode via prefers-color-scheme.
   Tokens are light/dark pairs so a manual toggle can be added later.
   ========================================================================== */

/* ---- Fonts (self-hosted, moved out of inline <style> in head.njk) ---- */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: fallback;
  src: url("../fonts/manrope/Manrope-VariableFont_wght.woff2") format("woff2");
}
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 300 700;
  font-display: fallback;
  src: url("../fonts/fira-code/FiraCode-VariableFont_wght.woff2") format("woff2");
}

/* ---- Tokens ---- */
:root {
  /* palette — light */
  --bg: #faf7f2;            /* warm off-white page background */
  --surface: #ffffff;       /* cards, header */
  --ink: #211e1a;           /* charcoal headings */
  --text: #3d3931;          /* body text */
  --muted: #6f675b;         /* secondary text */
  --line: #e7dfd3;          /* borders / dividers */
  --accent: #e63329;        /* logo red */
  --accent-ink: #ffffff;    /* text on accent */
  --accent-tint: color-mix(in srgb, var(--accent) 10%, transparent);
  --header-bg: color-mix(in srgb, var(--surface) 86%, transparent);
  --shadow: 0 1px 2px rgba(33, 30, 26, 0.05), 0 8px 24px rgba(33, 30, 26, 0.07);
  --footer-bg: #211e1a;
  --footer-ink: #f5f1ea;

  /* type */
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.35rem, 1.1rem + 1.2vw, 1.6rem);
  --fs-xl: clamp(1.7rem, 1.3rem + 2vw, 2.4rem);
  --fs-hero: clamp(2.4rem, 1.6rem + 3.5vw, 4rem);

  /* layout */
  --measure: 72ch;          /* prose width */
  --gutter: 1.25rem;
  --radius: 14px;
  --header-h: 4.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* palette — dark */
    --bg: #161519;
    --surface: #201f24;
    --ink: #f3efe8;
    --text: #cfc9be;
    --muted: #9a938a;
    --line: #37353c;
    --accent: #ff5b4e;      /* brighter red for dark surfaces */
    --accent-ink: #1c0d0b;
    --accent-tint: color-mix(in srgb, var(--accent) 16%, transparent);
    --header-bg: color-mix(in srgb, var(--bg) 82%, transparent);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --footer-bg: #0e0d10;
    --footer-ink: #f3efe8;

    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  font-weight: 400;
  color: var(--text);
  background-color: var(--bg);
}

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

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.75em;
  font-weight: 800;
  letter-spacing: -0.015em;
}

h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
h5, h6 { font-size: var(--fs-sm); }

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2.5px;
}

a:hover {
  text-decoration-thickness: 2.5px;
}

strong {
  color: var(--ink);
  font-weight: 700;
}

::selection {
  background: var(--accent-tint);
}

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

/* ---- Skip link (visually hidden until keyboard focus) ---- */
.skip-link {
  position: absolute;
  top: -100vh;
  left: 1rem;
  z-index: 100;
  padding: 0.65rem 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.skip-link:focus-visible {
  top: 0;
  outline-offset: 0;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.6rem var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo — dark charcoal artwork needs a light chip in dark mode */
.logo-chip {
  display: inline-flex;
  padding: 0.35rem 0.65rem;
  border-radius: 0.8rem;
  background: transparent;
  transition: background-color 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  .logo-chip {
    background: #faf7f2;
  }
}

.logo-chip img {
  height: 2.6rem;
  width: auto;
}

/* ---- Navigation ---- */
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list {
  display: flex;
  gap: 0.25rem;
}

.nav-list a {
  display: block;
  padding: 0.5rem 0.8rem;
  color: var(--ink);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  border-radius: 0.6rem;
}

.nav-list a:hover {
  background: var(--accent-tint);
  color: var(--accent);
}

/* desktop dropdowns */
.site-nav li {
  position: relative;
}

.site-nav li > ul {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 60;
  min-width: 13rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.site-nav li:hover > ul,
.site-nav li:focus-within > ul {
  display: block;
}

.site-nav li > ul a {
  font-weight: 500;
  white-space: nowrap;
}

/* hamburger button */
.nav-toggle-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.6rem;
  margin-right: -0.4rem;
  color: var(--ink);
  border-radius: 0.6rem;
}

.nav-toggle-btn:hover {
  background: var(--accent-tint);
}

.nav-toggle-lines {
  width: 1.5rem;
  height: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-toggle-lines span {
  display: block;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* hamburger → X */
.nav-toggle-btn[aria-expanded="true"] .nav-toggle-lines span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle-btn[aria-expanded="true"] .nav-toggle-lines span:nth-child(2) {
  opacity: 0;
}
.nav-toggle-btn[aria-expanded="true"] .nav-toggle-lines span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* mobile nav */
@media (max-width: 60rem) {
  .nav-toggle-btn {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }

  .site-header.nav-open .site-nav {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0.75rem var(--gutter) 1rem;
  }

  .nav-list a {
    font-size: var(--fs-base);
    padding: 0.65rem 0.5rem;
  }

  /* submenus are plain indented lists on mobile */
  .site-nav li > ul {
    display: block;
    position: static;
    min-width: 0;
    padding: 0 0 0.25rem 1.25rem;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .site-nav li > ul a {
    font-weight: 500;
    color: var(--muted);
    padding-block: 0.45rem;
  }

  .site-nav li > ul a:hover {
    color: var(--accent);
  }
}

/* ---- Main / page container ---- */
main {
  display: block;
  min-height: 50vh;
}

.container {
  max-width: 72rem;
  margin-inline: auto;
  padding: 2.5rem var(--gutter) 4rem;
}

.prose {
  max-width: var(--measure);
}

.prose h1 {
  font-size: var(--fs-xl);
  margin-bottom: 1.25rem;
}

/* ---- Hero (homepage) ---- */
.hero {
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--accent-tint), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(3rem, 6vw, 5.5rem) var(--gutter);
}

.hero h1 {
  font-size: var(--fs-hero);
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero .lede {
  max-width: 46ch;
  font-size: var(--fs-md);
  color: var(--muted);
  margin-bottom: 0;
}

/* ---- Cards (homepage info blocks) ---- */
.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  padding-bottom: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
}

.card h2,
.card h3 {
  margin-top: 0;
  font-size: var(--fs-md);
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card .card-kicker {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.15rem 0.6rem;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}

/* session times etc. inside cards */
.card ul {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
}

.card ul li {
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--line);
}

.card ul li:last-child {
  border-bottom: none;
}

/* ---- Person layout ---- */
.person-card {
  display: grid;
  gap: 2rem;
  align-items: start;
  max-width: 56rem;
}

@media (min-width: 48rem) {
  .person-card {
    grid-template-columns: 17rem 1fr;
    gap: 3rem;
  }
}

.person-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.role-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: 999px;
}

/* person gallery (coaches / committee landings) */
.person-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

.person-tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.person-tile:hover {
  transform: translateY(-3px);
}

/* non-linked tiles — run leaders without a member page yet */
.person-tile--static {
  cursor: default;
}

.person-tile--static:hover {
  transform: none;
}

.person-tile img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.person-tile .tile-body {
  padding: 0.9rem 1rem 1.1rem;
}

.person-tile .tile-name {
  display: block;
  color: var(--ink);
  font-weight: 700;
  font-size: var(--fs-md);
}

.person-tile .tile-role {
  display: block;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ---- Archive list (news / category indexes) ---- */
.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.archive-item {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.archive-item:first-child {
  padding-top: 0;
}

.archive-item a {
  display: block;
  color: var(--ink);
  font-size: var(--fs-md);
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 0.3rem;
}

.archive-item a:hover {
  color: var(--accent);
}

.archive-item .excerpt {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin: 0;
}

/* ---- Article (news) ---- */
.article-body img {
  border-radius: var(--radius);
}

.article-body figure {
  margin: 1.75rem 0;
}

.article-body figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ---- Page figures (full-width images) ---- */
.page-figure {
  margin: 2rem 0;
}

.page-figure img {
  width: 100%;
  border-radius: var(--radius);
}

/* ---- Social icons + contact list (homepage card) ---- */
.social-icons {
  display: flex;
  gap: 0.75rem;
}

.social-icons a {
  display: inline-flex;
  padding: 0.4rem;
  color: var(--muted);
  border-radius: 0.6rem;
}

.social-icons a:hover {
  color: var(--accent);
  background: var(--accent-tint);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--line);
}

.contact-list li:last-child {
  border-bottom: none;
}

/* ---- Simple link list (people landing) ---- */
.link-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.link-list a {
  display: inline-block;
  width: fit-content;
  padding: 0.55rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.link-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Prose details ---- */
.prose hr,
.article-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.prose ul,
.prose ol,
.article-body ul,
.article-body ol {
  padding-left: 1.4rem;
  margin: 0 0 1.25rem;
}

.prose li,
.article-body li {
  margin-bottom: 0.35rem;
}

.prose blockquote,
.article-body blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 4px solid var(--accent);
  color: var(--ink);
  font-weight: 500;
}

.prose figure,
.article-body figure {
  margin: 1.75rem 0;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-ink);
  margin-top: 2rem;
}

.footer-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 3rem var(--gutter) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand {
  color: var(--footer-ink);
  font-size: var(--fs-lg);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.015em;
}

.footer-tagline {
  margin: 0;
  font-family: "Fira Code", monospace;
  font-size: var(--fs-sm);
  color: color-mix(in srgb, var(--footer-ink) 62%, transparent);
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
