/* ==========================================================================
   Martial Arms: one stylesheet, ordered tokens > base > layout > components > pages
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink: #1f262d;
  --slate: #263039;      /* header, footer, hero */
  --red: #cb2027;        /* buttons, accents; white on red is 5.56:1 */
  --red-dark: #ab1f23;   /* hover */
  --paper: #f7f6f3;      /* page background */
  --card: #ffffff;
  --line: #e2e0db;
  --muted: #5b6670;      /* 5.43:1 on paper */
  --on-slate: #c9d0d6;   /* secondary text on slate, 8.62:1 */
  --focus: var(--ink);   /* switched to white inside dark sections */

  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 72rem;
  --gutter: 1rem;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(31 38 45 / 0.06), 0 6px 16px rgb(31 38 45 / 0.05);
}

@media (min-width: 40em) {
  :root { --gutter: 1.5rem; }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  /* keeps the footer at the bottom of short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }

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

h1, h2, h3 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h3 { font-weight: 600; }
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem); }
h3 { font-size: 1.375rem; }

p, ul, ol { margin: 0 0 1em; }
p { text-wrap: pretty; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: 0.25em; }

a {
  color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover { color: var(--red-dark); text-decoration-thickness: 2px; }

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

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  border-radius: 4px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Header: logo left, nav right; on narrow screens the nav wraps under the logo. */
.site-header {
  --focus: #fff;
  background: var(--slate);
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
}
.site-header__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding-block: 1rem 0.5rem;
}
.brand { display: inline-block; padding-block: 0.25rem; }
.site-header .brand img { width: 11.5rem; }
.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 0.25rem;
  margin: 0 0 0 -0.5rem;
  padding: 0;
  list-style: none;
}
.site-header nav li { margin: 0; }
.site-header nav a {
  display: block;
  padding: 0.5rem;
  border-radius: 4px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
.site-header nav a:hover { background: rgb(255 255 255 / 0.1); color: #fff; }
.site-header nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--red); }

@media (min-width: 64em) {
  .site-header__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.875rem;
  }
  .site-header nav ul { margin: 0 -0.75rem 0 0; }
  .site-header nav a { padding-inline: 0.75rem; }
}

/* Footer */
.site-footer {
  --focus: #fff;
  background: var(--slate);
  color: var(--on-slate);
}
.site-footer__inner {
  display: grid;
  gap: 2.5rem;
  padding-block: 3.5rem 2.5rem;
}
.site-footer a {
  color: #fff;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}
.site-footer a:hover { color: #fff; text-decoration-color: #fff; }
.site-footer .brand img { width: 12rem; margin-bottom: 1.25rem; }
.site-footer .contact-cta { max-width: 40ch; }
.footer-contact {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.footer-contact li { margin: 0; }
.footer-contact a { font-weight: 600; overflow-wrap: anywhere; }
.site-footer__legal { font-size: 0.9375rem; }
.site-footer__legal p {
  margin: 0;
  padding-block: 1.25rem 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.14);
}

/* Inner pages: a centred reading column; courses and schedule get the full width. */
.page {
  max-width: calc(70ch + 2 * var(--gutter));
  margin-inline: auto;
  padding: 2.5rem var(--gutter) 4rem;
}
.page--wide { max-width: var(--wrap); }
.page > h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: 0.75rem;
  border-radius: 2px;
  background: var(--red);
}
.lede {
  max-width: 60ch;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.5;
}
.page > h2 { margin-top: 2.5rem; }
.page > h3 { margin-top: 2rem; }

/* ---------- Components ---------- */
.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--red);
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
  color: #fff;
}
.button--outline { border-color: var(--ink); background: transparent; color: var(--ink); }
.button--outline:hover { border-color: var(--slate); background: var(--slate); }
.button--light { border-color: #fff; background: #fff; color: var(--red); }
.button--light:hover { border-color: var(--slate); background: var(--slate); }

/* Small-caps section label */
.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--red);
  font-size: 1.125rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
}

/* ---------- Pages ---------- */

/* Home: hero */
.hero {
  --focus: #fff;
  background:
    linear-gradient(rgb(38 48 57 / 0.86), rgb(38 48 57 / 0.92)),
    url("/assets/images/banner.jpg") center / cover no-repeat,
    var(--slate);
  color: #fff;
}
.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-block: 3.5rem 4rem;
}
.hero h1 {
  max-width: 15ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2.375rem, 1.5rem + 3.6vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.hero h1 span {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.12em;
}
.hero img { width: min(100%, 24rem); }

@media (min-width: 48em) {
  .hero {
    background:
      linear-gradient(90deg, rgb(38 48 57 / 0.95) 0%, rgb(38 48 57 / 0.88) 50%, rgb(38 48 57 / 0.6) 100%),
      url("/assets/images/banner.jpg") center / cover no-repeat,
      var(--slate);
  }
  .hero__inner { padding-block: 5.5rem 6rem; }
}

/* Home: mission */
.mission { padding-block: 4rem; }
.mission__inner { display: grid; gap: 2.25rem; align-items: center; }
.mission__text h3 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); font-weight: 700; }
.mission__text p { max-width: 58ch; margin-bottom: 1.5rem; }
.mission__photo { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }

@media (min-width: 50em) {
  .mission { padding-block: 5.5rem; }
  .mission__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); gap: 4rem; }
}

/* Home: features, image side alternates from 800px */
.features {
  padding-block: 4rem;
  background: var(--card);
  border-block: 1px solid var(--line);
}
.features .container { max-width: calc(58rem + 2 * var(--gutter)); }
.feature { display: grid; gap: 1.25rem; margin-top: 2.5rem; }
.feature img { width: 100%; max-width: 26rem; border-radius: var(--radius); }
.feature h3 { margin-bottom: 0.375rem; font-size: 1.5rem; font-weight: 700; }
.feature p { margin: 0; }

@media (min-width: 50em) {
  .features { padding-block: 5.5rem; }
  .feature {
    grid-template-columns: minmax(0, 18.375rem) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
    margin-top: 3.5rem;
  }
  .feature:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 18.375rem); }
  .feature:nth-of-type(even) img { order: 2; }
}

/* Home: call to action */
.cta-band {
  --focus: #fff;
  background: var(--red);
  color: #fff;
}
.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding-block: 2.75rem;
}
.cta-band p {
  margin: 0;
  font-size: clamp(1.625rem, 1.3rem + 1.3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
}

/* Instructors */
.affiliations li { break-inside: avoid; }
@media (min-width: 43.75em) {
  .affiliations { columns: 2; column-gap: 2.5rem; }
}

/* Testimonials */
.quote {
  margin: 0 0 1.5rem;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.quote blockquote { margin: 0; }
.quote blockquote > :last-child { margin-bottom: 0; }
.quote figcaption { margin-top: 0.875rem; color: var(--muted); font-weight: 600; }

/* Courses */
.course-grid { display: grid; gap: 1.25rem; }
.course {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 1rem;
}
.course h2 { margin: 0 0 0.75rem; font-size: 1.375rem; }
.course p { margin: 0 0 0.75rem; }
.course ul { margin: 0 0 0.75rem; }
.course .course-cost {
  margin: auto 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
}
.course details { margin-top: 0.75rem; }
.course summary {
  padding-block: 0.25rem;
  color: var(--red);
  font-weight: 600;
  cursor: pointer;
}
.course summary:hover { color: var(--red-dark); text-decoration: underline; }
.course details ul { margin: 0.5rem 0 0; }
.course-notes {
  max-width: 70ch;
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border-left: 4px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.course-notes ul { padding: 0; list-style: none; color: var(--muted); }
.course-notes p { margin: 0; font-weight: 600; }

@media (min-width: 56.25em) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
}

/* Schedule: month blocks; price card beside the list from 900px, below it on phones */
.schedule-layout { display: grid; gap: 2.5rem; }
.month + .month { margin-top: 2rem; }
.month h2 { margin: 0 0 0.75rem; font-size: 1.375rem; }
.sessions {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.sessions li {
  display: grid;
  grid-template-columns: 7.75rem minmax(0, 1fr);
  column-gap: 1rem;
  row-gap: 0.25rem;
  margin: 0;
  padding: 0.75rem 1rem;
}
.sessions li + li { border-top: 1px solid var(--line); }
.sessions__when { font-weight: 600; font-variant-numeric: tabular-nums; }
.sessions__where {
  grid-column: 2;
  justify-self: start;
  align-self: center;
  padding: 0 0.625rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.9375rem;
}
.sessions__sep {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.price-card {
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.price-card h2 { margin: 0 0 0.5rem; font-size: 1.375rem; }
.price-card h2:not(:first-child) { margin-top: 2rem; }
.price-list { margin: 0; padding: 0; list-style: none; }
.price-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.price-list__price { font-weight: 700; text-align: right; white-space: nowrap; }
.price-card__footnote { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.9375rem; }
.price-card__notes { margin: 0; }

@media (min-width: 37.5em) {
  .sessions li { grid-template-columns: 8.5rem minmax(0, 1fr) auto; }
  .sessions__where { grid-column: 3; }
}

@media (min-width: 56.25em) {
  .schedule-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
    align-items: start;
    gap: 3rem;
  }
}

/* Only stick the price card where the whole card fits in the viewport. */
@media (min-width: 56.25em) and (min-height: 52em) {
  .price-card { position: sticky; top: 1.5rem; }
}
