/* km-27 — Newsreader on white, with a light sepia title band.
   A full-bleed band carries the menu and the title.
   Below it, a two-column grid puts each section heading on the left
   and its text on the right. Change the look through the tokens in :root. */
@import url("https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&display=swap");

:root {
  --band: #F3EBDD;     /* light sepia; set to #FFFFFF for an all-white page */
  --on-band: #000000;     /* text on the band */
  --accent: #A58458;      /* link underlines on white */
  --paper: #FFFFFF;
  --black: #000000;
  --text: #222222;
  --muted: #5E5E5E;
  --hairline: #D8CFBF;  /* rules between session rows */
  --font: "Newsreader", Georgia, serif;
  --body-size: 1.125rem;
  --body-leading: 1.65;
  --title-weight: 500;
  --title-stretch: 100%;
  --title-tracking: -0.025em;
  --title-leading: 0.95;
  --heading-weight: 600;
  --heading-stretch: 100%;
  --placeholder-style: italic;
  --wide: 72rem;
  --heading-column: 12rem;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: var(--body-size);
  line-height: var(--body-leading);
}

a {
  color: var(--black);
  text-decoration: underline 0.1em var(--accent);
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }

/* The band: nav, h1, subtitle and course info each paint the band colour out
   to both edges of the window, so together they form one full-width block. */
#site-menu, h1, .subtitle, .course-info {
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(-1px -100vmax);  /* 1px overlap hides seams between them */
}

/* Menu */
#site-menu {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  font-size: 0.9375rem;
}
#site-menu a { color: var(--on-band); text-decoration: none; }
#site-menu a:hover { text-decoration: underline 1px; }
#site-menu a:focus-visible { outline-color: var(--on-band); }
#site-menu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
#site-menu li a[aria-current="page"] { text-decoration: underline 3px; text-underline-offset: 0.3em; }

main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

h1 {
  margin: 0;
  padding: 1.75rem 0 0.5rem;
  color: var(--on-band);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: var(--title-weight);
  font-stretch: var(--title-stretch);
  line-height: var(--title-leading);
  letter-spacing: var(--title-tracking);
}
/* Pages without a subtitle close the band on the h1 itself */
h1:not(:has(+ .subtitle)) { padding-bottom: 1.5rem; margin-bottom: 2.5rem; }

.subtitle {
  margin: 0;
  padding: 0.5rem 0 0;
  max-width: 44rem;
  color: var(--on-band);
  font-size: 1.25rem;
  line-height: 1.45;
}
/* Last line of the band on the home page */
.course-info {
  margin: 0 0 3rem;
  padding: 1rem 0 1.5rem;
  color: var(--on-band);
  font-size: 1rem;
}

/* Sections: heading left, text right */
section {
  display: grid;
  grid-template-columns: var(--heading-column) minmax(0, 1fr);
  column-gap: 2.5rem;
  padding: 1.5rem 0 2rem;
  border-top: 2px solid var(--black);
}
section > * { grid-column: 2; }
section > h2 { grid-column: 1; }

h2 {
  margin: 0;
  color: var(--black);
  font-size: 1.3125rem;
  font-weight: var(--heading-weight);
  font-stretch: var(--heading-stretch);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1rem; max-width: 36rem; }
main > ul, section > ul { margin: 0 0 1rem; max-width: 38rem; padding-left: 1.25rem; }
main > ul li + li, section > ul li + li { margin-top: 0.3rem; }

.placeholder { color: var(--muted); font-style: var(--placeholder-style); }

footer {
  width: min(calc(var(--wide) - 3rem), calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
  border-top: 2px solid var(--black);
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 720px) {
  section { grid-template-columns: minmax(0, 1fr); row-gap: 0.5rem; }
  section > *, section > h2 { grid-column: 1; }
  h1 { padding-top: 1.5rem; }
  #site-menu, main { padding-left: 1rem; padding-right: 1rem; }
  footer { width: calc(100% - 2rem); }
}

/* Sessions: one row per tile — number, title and label, then the three points.
   Numbers come from the list order (CSS counter). */
.tiles {
  grid-column: 1 / -1;
  counter-reset: tile;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.tile {
  counter-increment: tile;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 17rem) minmax(0, 1fr);
  column-gap: 2rem;
  padding: 1.25rem 0 1.4rem;
  border-top: 1px solid var(--hairline);
}
.tile:last-child { border-bottom: 1px solid var(--hairline); }
.tile::before {
  content: counter(tile);
  grid-column: 1;
  grid-row: 1 / span 2;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1;
}
.tile h3 {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--black);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.2;
}
.tile ul {
  grid-column: 3;
  grid-row: 1 / span 3;
  margin: 0;
  padding-left: 1.1rem;
  font-size: 1rem;
  line-height: 1.5;
}
.tile ul li + li { margin-top: 0.3rem; }

@media (max-width: 720px) {
  .tile { grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 0.75rem; }
  .tile ul { grid-column: 2; grid-row: 3; margin-top: 0.6rem; }
}
