/* ==========================================================
   Image size classes — fig-sm / fig-md / fig-lg
   Applied per-image via Quarto attributes, e.g.
     ![Alt](path.webp){#fig-id .fig-sm}
   ========================================================== */

/* Small: persona cards, quotes, formulas, simple concept cards */
.fig-sm .figure-img {
  max-width: 62%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Medium (default for most concept diagrams, workflows, architecture) */
.fig-md .figure-img {
  max-width: 78%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Large: detailed data plots, model outputs, time series, matrices */
.fig-lg .figure-img {
  max-width: 92%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================
   Tables — keep wide tables readable on the web.
   Wide markdown pipe tables and pandas DataFrame outputs
   become their own horizontal-scroll region instead of
   squishing the page or overflowing off-screen.
   ========================================================== */
main table,
.cell-output-display table {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  font-size: 0.9rem;
}

main table th,
main table td,
.cell-output-display table th,
.cell-output-display table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

/* ==========================================================
   Part-opener header images — full width, fixed-height crop,
   with the Unsplash credit as small grey text below.
   Applied via ::: {.part-header-image} and ::: {.image-credit}
   fenced divs in partN/_partN.qmd (no #fig- id, no figcaption).
   ========================================================== */
.part-header-image img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
}

.image-credit {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.3rem;
  margin-bottom: 1.5rem;
}
