/* Course homepage and About page, after ai-design-27:
   Newsreader on white, a light sepia band for the menu and title,
   sections with the heading on the left and the content 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 title band */
  --on-band: #000000;
  --accent: #A58458;    /* session numbers, link underlines */
  --paper: #FFFFFF;
  --black: #000000;
  --text: #222222;
  --muted: #5E5E5E;
  --hairline: #D8CFBF;  /* rules between rows */
  --aside: #FBF8F2;     /* very light tint for the optional deep dives */
  --font: "Newsreader", Georgia, serif;
  --body-size: 1.125rem;
  --body-leading: 1.65;
  --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: menu, title, subtitle and course line paint the band colour to both window edges */
#site-menu, h1, .subtitle {
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(-1px -100vmax);
}

#site-menu {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  font-size: 0.9375rem;
}
#site-menu ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
#site-menu a { color: var(--on-band); text-decoration: none; }
#site-menu a:hover { text-decoration: underline 1px; }
#site-menu 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: 500;
  line-height: 0.95;
  letter-spacing: -0.025em;
}
.subtitle {
  margin: 0 0 3rem;
  padding: 0.75rem 0 1.75rem;
  max-width: 44rem;
  color: var(--on-band);
  font-size: 1.25rem;
  line-height: 1.45;
}
/* Pages without a subtitle close the band on the title */
h1:not(:has(+ .subtitle)) { padding-bottom: 1.5rem; margin-bottom: 2.5rem; }

/* Sections: heading left, content 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; grid-row: 1 / span 2; }
h2 { margin: 0; color: var(--black); font-size: 1.3125rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; max-width: 40rem; }

/* Parts of the session list: span the full width, like a sub-section */
section > .part, section > .part-note, section > .rows { grid-column: 1 / -1; }
.part { margin: 2.25rem 0 0.25rem; color: var(--black); font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.part-note { margin: 0 0 0.5rem; color: var(--muted); font-style: italic; max-width: 48rem; }

/* Session rows: each in its own hairline frame, with a gap between frames.
   Inside: number, title and description, then videos, points and playgrounds */
.rows { display: grid; gap: 0.9rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 16rem) minmax(0, 1fr);
  column-gap: 2rem;
  padding: 1.35rem 1.5rem 1.5rem;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--paper);
}
.row-number { grid-column: 1; color: var(--accent); font-size: 2rem; line-height: 1; letter-spacing: -0.02em; }
.row-head { grid-column: 2; }
.row-body { grid-column: 3; }
.row h4 { margin: 0; color: var(--black); font-size: 1.1875rem; font-weight: 600; line-height: 1.25; }
.row-desc { margin: 0.5rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }

/* Upcoming sessions: one quiet line, frames stacked a little closer */
.row.upcoming { padding: 0.8rem 1.5rem; }
.row.upcoming + .row.upcoming { margin-top: -0.4rem; }
.row.upcoming .row-number { font-size: 1.5rem; color: var(--hairline); }
.row.upcoming h4 { font-weight: 500; color: var(--muted); }
.status { margin: 0; color: var(--muted); font-style: italic; font-size: 1rem; }
.dive .status { margin-top: 0.6rem; }

/* Optional deep dives: a separate, lightly tinted band across the full width */
#deep-dives {
  margin: 3rem 0 0;
  padding: 2rem 0 2.25rem;
  border-top: none;
  background: var(--aside);
  box-shadow: 0 0 0 100vmax var(--aside);
  clip-path: inset(0 -100vmax);
}
#deep-dives .rows { margin-top: 0.5rem; }

/* Deep dives are not a sequence: no number column */
.row.dive { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); }
.row.dive .row-head { grid-column: 1; }
.row.dive .row-body { grid-column: 2; }

/* Video thumbnails: links to YouTube, in a strip that wraps */
.videos { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; list-style: none; margin: 0 0 1.1rem; padding: 0; }
.videos li { width: 13.5rem; max-width: 100%; }
a.video { display: block; color: var(--text); text-decoration: none; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--band); outline: 1px solid var(--hairline); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; left: 0.6rem; bottom: 0.6rem;
  width: 2.25rem; height: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--black); color: var(--paper); font-size: 0.75rem;
}
.video-caption { display: block; margin-top: 0.45rem; font-size: 0.9375rem; line-height: 1.35; }
a.video:hover .video-caption { text-decoration: underline 0.1em var(--accent); text-underline-offset: 0.2em; }
a.video:hover .play { background: var(--accent); }
a.video:focus-visible { outline: 3px solid var(--black); outline-offset: 3px; }

.points { margin: 0 0 1rem; padding-left: 1.1rem; font-size: 1rem; line-height: 1.5; max-width: 42rem; }
.points li + li { margin-top: 0.3rem; }
.playgrounds, .open-page { margin: 0; font-size: 1rem; }
.playgrounds + .open-page, .open-page + .playgrounds { margin-top: 0.4rem; }

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: 900px) {
  .row { grid-template-columns: 3.25rem minmax(0, 1fr); column-gap: 1rem; }
  .row-body { grid-column: 2; margin-top: 0.9rem; }
  .row.upcoming .row-body { margin-top: 0.25rem; }
  .row.dive { grid-template-columns: minmax(0, 1fr); }
  .row.dive .row-body { grid-column: 1; }
}

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