/* The courses template's one stylesheet. The centre of the design is the
   timetable: a list of courses that reads like a departure board.
   Colours and fonts are CSS variables; the ones named after a setting
   (color_accent, color_dark, font_heading, …) are replaced by what the owner
   picks in Settings. */
:root {
  --color-bg: #f1f2ec;
  --color-ink: #16211c;
  --color-dark: #12261f;
  --color-accent: #d7f04a;
  --color-accent-ink: #12261f;
  --color-surface: #ffffff;
  --color-on-dark: #f1f2ec;
  --color-warn: #c2401c;
  --color-muted: color-mix(in srgb, var(--color-ink) 62%, var(--color-bg));
  --color-line: color-mix(in srgb, var(--color-ink) 16%, var(--color-bg));
  --font-heading: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --width: 72rem;
  --gutter: 1.5rem;

  /* The sign-up button (the shop script draws it) follows the theme. */
  --kp-accent: var(--color-accent);
  --kp-accent-ink: var(--color-accent-ink);
  --kp-surface: var(--color-surface);
  --kp-ink: var(--color-ink);
  --kp-radius: 2px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--color-bg); color: var(--color-ink); font: 1rem/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-heading); font-stretch: condensed; font-weight: 700; line-height: 1.02; text-transform: uppercase; letter-spacing: 0.005em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; line-height: 1.15; }
p { margin: 0 0 1em; }

.eyebrow { font-family: var(--font-heading); font-stretch: condensed; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.85rem; margin: 0 0 1rem; color: var(--color-muted); }
.lead { font-size: 1.15rem; color: var(--color-muted); max-width: 40rem; margin: 0 0 1.5rem; }
.more { font-family: var(--font-heading); font-stretch: condensed; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.95rem; text-decoration: none; white-space: nowrap; border-bottom: 2px solid var(--color-accent); padding-bottom: 0.1rem; }
.more:hover { border-color: currentColor; }
.crumbs { font-size: 0.9rem; margin: 0 0 1.5rem; }
.crumbs a { color: var(--color-muted); text-decoration: none; }
.crumbs a:hover { color: var(--color-ink); }

/* Buttons: ours and the shop script's look the same. */
.button, .kp-button { display: inline-block; font-family: var(--font-heading); font-stretch: condensed; font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.2; text-decoration: none; white-space: nowrap; padding: 0.8em 1.4em; border: 2px solid var(--color-accent); border-radius: 2px; background: var(--color-accent); color: var(--color-accent-ink); cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.button:hover, .kp-button:not([disabled]):hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--color-ink); }
.button-small { font-size: 0.85rem; padding: 0.55em 1em; }
.kp-button[disabled] { background: transparent; border-color: var(--color-line); color: var(--color-muted); opacity: 1; }
.kp-buy { justify-items: stretch; }
.kp-error:empty { display: none; }

.tag { display: inline-block; font-family: var(--font-heading); font-stretch: condensed; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; line-height: 1; padding: 0.4em 0.6em; border: 1.5px solid currentColor; border-radius: 2px; white-space: nowrap; text-decoration: none; }
.tag-quiet { border-color: var(--color-line); color: var(--color-muted); }
a.tag-quiet:hover { border-color: currentColor; color: var(--color-ink); }

/* --- Header ---------------------------------------------------------------- */
.site-header { background: var(--color-dark); color: var(--color-on-dark); }
.header-inner { max-width: var(--width); margin: 0 auto; padding: 1rem var(--gutter); display: flex; align-items: center; gap: 1rem 2.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-heading); font-stretch: condensed; font-weight: 700; font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none; }
.brand img { height: 2.2rem; }
/* A small peak, drawn with CSS so it takes the accent colour. */
.brand-mark { width: 1.5rem; height: 1.3rem; background: var(--color-accent); clip-path: polygon(0 100%, 38% 0, 58% 52%, 72% 30%, 100% 100%); }
.site-nav { display: flex; gap: 1.6rem; flex: 1; flex-wrap: wrap; }
.site-nav a { text-decoration: none; font-size: 0.95rem; opacity: 0.8; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.current { opacity: 1; border-color: var(--color-accent); }
.site-header .button:hover { box-shadow: 4px 4px 0 var(--color-on-dark); }

/* --- Hero ------------------------------------------------------------------ */
.hero { background: var(--color-dark); color: var(--color-on-dark); overflow: hidden; }
.hero-inner { max-width: var(--width); margin: 0 auto; padding: 3.5rem var(--gutter) 8rem; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 3rem; align-items: center; }
.hero .eyebrow { color: var(--color-accent); }
.hero h1 { font-size: clamp(2.7rem, 7vw, 5.2rem); margin-bottom: 0.35em; }
.hero-lead { font-size: 1.2rem; max-width: 34rem; opacity: 0.85; margin: 0 0 2rem; }
.hero-actions { display: flex; align-items: center; gap: 1rem 1.75rem; flex-wrap: wrap; margin: 0 0 2.5rem; }
.hero .button:hover { box-shadow: 4px 4px 0 var(--color-on-dark); }
.hero-link { font-family: var(--font-heading); font-stretch: condensed; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; text-decoration: none; border-bottom: 2px solid var(--color-accent); }
.hero-facts { list-style: none; margin: 0; padding: 1.5rem 0 0; display: flex; gap: 1.5rem 2.5rem; flex-wrap: wrap; border-top: 1px solid color-mix(in srgb, var(--color-on-dark) 25%, transparent); }
.hero-facts li { display: grid; max-width: 10rem; }
.hero-facts b { font-family: var(--font-heading); font-stretch: condensed; font-size: 2rem; line-height: 1.1; color: var(--color-accent); }
.hero-facts span { font-size: 0.85rem; line-height: 1.35; opacity: 0.75; }
.hero-image { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; border: 1px solid color-mix(in srgb, var(--color-on-dark) 25%, transparent); }

/* --- Sections -------------------------------------------------------------- */
.section { max-width: var(--width); margin: 0 auto; padding: 3.5rem var(--gutter); }
.page-title { padding-top: 0.5rem; margin-bottom: 2rem; }
.page-title h1 { margin-bottom: 0.3em; }

/* --- The timetable ---------------------------------------------------------- */
.board { border-top: 4px solid var(--color-ink); }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--color-ink); }
.board-head h2 { margin: 0; }
/* On the front page the board sits half on the hero, like a notice pinned over it. */
.upcoming { padding-top: 0; }
.board-raised { background: var(--color-surface); margin-top: -5rem; padding: 0.5rem 1.75rem 0.5rem; border-top-color: var(--color-accent); box-shadow: 0 1px 0 var(--color-line), 0 18px 40px -24px color-mix(in srgb, var(--color-ink) 60%, transparent); }
.board-raised .row:last-child { border-bottom: 0; }

.board-cols, .row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 7.5rem 7rem 6rem 8.5rem; column-gap: 1.5rem; align-items: center; }
.board-cols { padding: 0.6rem 0; font-family: var(--font-heading); font-stretch: condensed; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-muted); border-bottom: 1px solid var(--color-ink); }
.board-cols .col-price { text-align: right; }

.month { display: flex; align-items: baseline; gap: 0.6rem; margin: 0; padding: 2.2rem 0 0.6rem; font-size: 1.15rem; letter-spacing: 0.1em; border-bottom: 1px solid var(--color-ink); }
.board-cols + .month { padding-top: 1.4rem; }
.month span { color: var(--color-muted); font-weight: 500; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { padding: 1.1rem 0; border-bottom: 1px solid var(--color-line); }
.rows-empty { list-style: none; padding: 2rem 0; margin: 0; color: var(--color-muted); }

.row-date { text-decoration: none; }
.date { display: grid; justify-items: start; line-height: 1; font-family: var(--font-heading); font-stretch: condensed; text-transform: uppercase; }
.date-wd, .date-m { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; color: var(--color-muted); }
.date-d { font-size: 2.5rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0.05em 0 0.02em; }
.date-none { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; line-height: 1.3; color: var(--color-muted); }

.row-name { font-family: var(--font-heading); font-stretch: condensed; font-weight: 700; font-size: 1.45rem; line-height: 1.1; text-transform: uppercase; text-decoration: none; }
.row-name:hover { text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 3px; text-underline-offset: 0.2em; }
.row-meta { display: flex; flex-wrap: wrap; gap: 0 0.5rem; margin-top: 0.3rem; font-size: 0.9rem; color: var(--color-muted); }
.row-meta span:not(:last-child)::after { content: "·"; margin-left: 0.5rem; }
.row-place { color: var(--color-ink); }
.row-price { font-family: var(--font-heading); font-stretch: condensed; font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row-action { justify-self: end; min-height: 2.9rem; display: flex; align-items: center; }
.row-action .kp-button { font-size: 0.9rem; padding: 0.7em 1.1em; }

.seats { font-size: 0.9rem; white-space: nowrap; }
.seats::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.45rem; border-radius: 50%; background: #3f9a5c; }
.seats.is-low { color: var(--color-warn); font-weight: 600; }
.seats.is-low::before { background: var(--color-warn); }
.seats.is-full { color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; font-weight: 600; }
.seats.is-full::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--color-muted); }
.row.is-full .row-name, .row.is-full .row-price, .row.is-full .date-d { color: var(--color-muted); }

/* Filters above the timetable: every one is a plain link. */
.filters { display: grid; gap: 0.7rem; margin: 0 0 2rem; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.filter-label { width: 4.5rem; font-family: var(--font-heading); font-stretch: condensed; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-muted); }
.chip { display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.3rem 0.75rem; border: 1.5px solid var(--color-line); border-radius: 2px; background: transparent; text-decoration: none; font-size: 0.9rem; }
.chip small { font-size: 0.75rem; color: var(--color-muted); }
.chip:hover { border-color: var(--color-ink); }
.chip.on { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-bg); }
.chip.on small { color: inherit; opacity: 0.7; }
.chip-check::before { content: ""; width: 0.7rem; height: 0.7rem; border: 1.5px solid currentColor; border-radius: 1px; align-self: center; }
.chip-check.on::before { background: var(--color-accent); border-color: var(--color-accent); }

/* --- Steps ----------------------------------------------------------------- */
.steps-section h2 { margin-bottom: 1.5rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0; border-top: 4px solid var(--color-ink); }
.step { padding: 1.5rem 1.75rem 0.5rem 0; }
.step + .step { padding-left: 1.75rem; border-left: 1px solid var(--color-line); }
.step-no { display: block; font-family: var(--font-heading); font-stretch: condensed; font-weight: 700; font-size: 3.4rem; line-height: 1; margin-bottom: 1rem; color: transparent; -webkit-text-stroke: 1.5px var(--color-ink); }
.step p { color: var(--color-muted); margin: 0; }

/* --- About (front page) ------------------------------------------------------ */
.about { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 2rem 4rem; align-items: start; }
.about h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin: 0; }
.prose { max-width: 40rem; }
.prose p { margin: 0 0 1em; }
.prose h3 { margin: 1.6em 0 0.5em; }
.about .prose { font-size: 1.1rem; }

/* --- Contact band ---------------------------------------------------------- */
.contact { background: var(--color-accent); color: var(--color-accent-ink); margin-top: 2rem; }
.contact-inner { max-width: var(--width); margin: 0 auto; padding: 2.75rem var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap; }
.contact h2 { margin: 0 0 0.3em; }
.contact p { margin: 0; max-width: 34rem; }
.contact-lines { display: grid; gap: 0.2rem; font-family: var(--font-heading); font-stretch: condensed; font-weight: 700; font-size: 1.5rem; line-height: 1.25; }
.contact-lines a { text-decoration: none; }
.contact-lines a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* --- One course ------------------------------------------------------------ */
.course { max-width: var(--width); margin: 0 auto; padding: 2.5rem var(--gutter) 2rem; display: grid; grid-template-columns: minmax(0, 1fr) 23rem; gap: 2.5rem 4rem; align-items: start; }
.course-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.25rem; }
.course h1 { font-size: clamp(2.3rem, 5.5vw, 3.8rem); margin-bottom: 0.5em; }
.course-text { font-size: 1.1rem; }
.gear { margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 4px solid var(--color-ink); max-width: 40rem; }
.gear h2 { font-size: 1.25rem; letter-spacing: 0.06em; }
.gear p { margin: 0; line-height: 1.9; }
.course-image { margin-top: 2.5rem; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* The sign-up card: date and price on top, the facts, the button. */
.ticket { position: sticky; top: 1.5rem; background: var(--color-surface); border-top: 4px solid var(--color-accent); box-shadow: 0 1px 0 var(--color-line), 0 18px 40px -24px color-mix(in srgb, var(--color-ink) 60%, transparent); }
.ticket-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1.5rem 1.5rem 1.25rem; background: var(--color-dark); color: var(--color-on-dark); }
.ticket-top .date-wd, .ticket-top .date-m, .ticket-top .date-none { color: var(--color-accent); }
.ticket-top .date-d { font-size: 3.6rem; }
.ticket-price { display: grid; justify-items: end; gap: 0.3rem; text-align: right; }
.ticket-price > b { font-family: var(--font-heading); font-stretch: condensed; font-size: 1.9rem; line-height: 1; }
.ticket-top .seats.is-low { color: #ffb59c; }
.ticket-top .seats.is-low::before { background: #ffb59c; }
.ticket-top .seats.is-full { color: inherit; opacity: 0.7; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 0; padding: 0.5rem 1.5rem; }
.facts dt, .facts dd { padding: 0.65rem 0; border-bottom: 1px solid var(--color-line); margin: 0; }
.facts dt { padding-right: 1.5rem; font-family: var(--font-heading); font-stretch: condensed; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-muted); line-height: 2; }
.ticket-buy { padding: 1.25rem 1.5rem 0.5rem; }
.ticket-buy kp-island { display: block; min-height: 3.2rem; }
.ticket-buy .kp-button { width: 100%; font-size: 1.1rem; padding: 0.9em 1em; }
.ticket-note { padding: 0.5rem 1.5rem 1.5rem; margin: 0; font-size: 0.85rem; line-height: 1.5; color: var(--color-muted); }

/* --- About page ------------------------------------------------------------- */
.page-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 2.5rem 4rem; align-items: start; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page-head-image { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.teachers-section .board-head { border-top: 4px solid var(--color-ink); margin-bottom: 1.5rem; }
.teachers { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2.5rem 2rem; }
.teacher img { width: 100%; aspect-ratio: 1; object-fit: cover; margin-bottom: 1rem; }
.teacher h3 { margin: 0 0 0.3rem; font-size: 1.4rem; }
.teacher-role { font-family: var(--font-heading); font-stretch: condensed; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-muted); margin: 0 0 0.75rem; }
.teacher p:last-child { margin: 0; color: var(--color-muted); }

/* --- Questions -------------------------------------------------------------- */
.faq-list { max-width: 48rem; border-top: 4px solid var(--color-ink); }
.faq-item { border-bottom: 1px solid var(--color-line); }
.faq-item summary { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; cursor: pointer; list-style: none; padding: 1.2rem 0; font-family: var(--font-heading); font-stretch: condensed; font-weight: 700; font-size: 1.35rem; line-height: 1.15; text-transform: uppercase; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.6rem; line-height: 0.8; font-weight: 500; }
.faq-item[open] summary::after { content: "–"; }
.faq-item .prose { padding: 0 2.5rem 1.2rem 0; color: var(--color-muted); }

/* --- Footer ----------------------------------------------------------------- */
.site-footer { background: var(--color-dark); color: var(--color-on-dark); }
.contact + .site-footer { margin-top: 0; }
.others + .site-footer, .course + .site-footer { margin-top: 3rem; }
.footer-inner { max-width: var(--width); margin: 0 auto; padding: 3rem var(--gutter) 1.5rem; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem 3rem; }
.footer-inner p { margin: 0 0 0.3rem; opacity: 0.75; max-width: 24rem; }
.footer-inner .footer-name { font-family: var(--font-heading); font-stretch: condensed; font-weight: 700; font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 1; margin-bottom: 0.6rem; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--color-accent); }
.footer-nav { display: grid; gap: 0.3rem; align-content: start; }
.footer-nav a { opacity: 0.75; }
.footer-nav a:hover { opacity: 1; }
.footer-small { max-width: var(--width); margin: 0 auto; padding: 1.25rem var(--gutter) 2rem; font-size: 0.85rem; opacity: 0.55; border-top: 1px solid color-mix(in srgb, var(--color-on-dark) 18%, transparent); }

/* --- Narrow screens --------------------------------------------------------- */
@media (max-width: 62rem) {
  .course { grid-template-columns: 1fr; }
  .ticket { position: static; max-width: 30rem; }
  /* Level moves under the name; the board keeps date, course, seats, price, button. */
  .board-cols, .row { grid-template-columns: 4.5rem minmax(0, 1fr) 6.5rem 5.5rem 8rem; }
  .board-cols span:nth-child(3) { display: none; }
  .row { grid-template-areas: "date main seats price action" "date level seats price action"; row-gap: 0.5rem; }
  .row-date { grid-area: date; align-self: start; }
  .row-main { grid-area: main; }
  .row-level { grid-area: level; }
  .row-seats { grid-area: seats; }
  .row-price { grid-area: price; }
  .row-action { grid-area: action; }
}

@media (max-width: 46rem) {
  :root { --gutter: 1.1rem; }
  .site-nav { order: 3; flex-basis: 100%; gap: 1.25rem; }
  /* The first nav link already goes to the courses. */
  .header-cta { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.25rem; padding-bottom: 6.5rem; }
  .hero-image { aspect-ratio: 16 / 9; }
  .hero-facts { gap: 1rem 1.5rem; }
  .hero-facts li { max-width: 8.5rem; }
  .section { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .upcoming { padding-top: 0; }
  .about, .page-head { grid-template-columns: 1fr; }
  .board-raised { padding: 0.25rem 1rem; margin-top: -4.5rem; }
  .step, .step + .step { padding: 1.25rem 0 1.5rem; border-left: 0; }
  .step + .step { border-top: 1px solid var(--color-line); }
  .step-no { font-size: 2.6rem; margin-bottom: 0.6rem; }
  .footer-inner { grid-template-columns: 1fr; }

  /* A timetable row becomes a small card: date beside name, then one line
     with level and seats, then price and the button. */
  .board-cols { display: none; }
  .board-cols + .month { padding-top: 1.2rem; }
  .row { grid-template-columns: 3.6rem minmax(0, 1fr) auto; grid-template-areas: "date main main" "date level seats" "date price action"; column-gap: 1rem; row-gap: 0.7rem; padding: 1.1rem 0 1.2rem; }
  .date-d { font-size: 2.1rem; }
  .row-name { font-size: 1.3rem; }
  .row-seats { justify-self: end; }
  .row-price { text-align: left; align-self: center; font-size: 1.25rem; }
  .filter-label { width: 100%; }
  .contact-lines { font-size: 1.3rem; }
  .faq-item summary { font-size: 1.15rem; }
}
