/* css styles */

/* ---------------------------------------------------------------------------
   Editorial extensions.

   Passages wrapped in `::: {.elab} ... :::` were written by the notes generator
   and go beyond what is on the source slides or in the class transcript. They
   are marked so they can be reviewed, rewritten, or removed before the text is
   published independently.

   To strip all markers while keeping the prose:
       sed -i '' '/^::: {\.elab}$/d; ' file.qmd   # then remove the matching :::
   Or simply set `div.elab::before { content: none; }` and drop the styling.
   --------------------------------------------------------------------------- */
div.elab {
  border-left: 3px solid #c9b071;
  background: #fdfaf2;
  padding: 0.75em 1.1em 0.15em 1.1em;
  margin: 1.2em 0;
  border-radius: 0 4px 4px 0;
}

div.elab::before {
  content: "editorial extension";
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8a7742;
  margin-bottom: 0.5em;
}

div.elab > p:last-child {
  margin-bottom: 0.6em;
}

/* ---------------------------------------------------------------------------
   Slide images.

   The slides have white backgrounds, so on a white page they bleed into the
   text with no visible edge. Every slide image is named `page-NNN.png`, so the
   attribute selector below picks them all up automatically — no per-image
   markup needed, and new chapters inherit it for free.

   The effect is a "matted photo": a thin border, a light grey mat around the
   image, and a soft shadow to lift it off the page.
   --------------------------------------------------------------------------- */
figure.figure:has(img[src*="page-"]) {
  background: #f4f5f7;
  border: 1px solid #d6d9de;
  border-radius: 6px;
  padding: 0.85rem 0.85rem 0.4rem;
  margin: 1.6rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

/* Fallback for browsers without :has() — border the image itself. */
img[src*="page-"] {
  border: 1px solid #d6d9de;
  border-radius: 3px;
  background: #fff;
}

/* Inside a matted figure the image keeps its own hairline but drops the
   duplicated outer margin. */
figure.figure:has(img[src*="page-"]) img[src*="page-"] {
  display: block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

figure.figure:has(img[src*="page-"]) figcaption {
  margin-top: 0.6rem;
  margin-bottom: 0;
  font-size: 0.86rem;
  color: #5b6270;
  text-align: center;
}
