/* ML decks inherit the same Clean theme and Lecture 9 layouts as DANL 399.
   Keep the source teaching content readable at the existing 32px body size. */
.reveal .slides section.slide.level2 li + li { margin-top: .25em; }

/* Raw source diagrams receive the same white image plates as Lecture 9. */
.reveal .slides section.slide.level2 img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  box-sizing: border-box;
}

/* Fit tall source illustrations while keeping the text at its usual size. */
.reveal #intuition-on-different-penalties img {
  max-height: 450px;
  width: auto !important;
}
.reveal #elastic-net-regression-with-cross-validation-in-r img {
  max-height: 570px;
  width: auto !important;
}
.reveal #tune-the-maximum-tree-depth-or-minimum-node-size div > p { margin: 0; }

/* Match the wide-figure treatment used in earlier DANL 399 slides. */
.reveal .slides section.slide.level2 .fig.wide img { max-height: 440px; }
.reveal #decision-tree-terminologies img {
  max-height: 480px;
  width: auto !important;
}
.reveal #tree-logic img {
  max-height: 440px;
  width: auto !important;
}
.reveal #tune-the-maximum-tree-depth-or-minimum-node-size img {
  max-height: 570px;
  width: auto !important;
}
.reveal #prune-the-tree-by-tuning-cost-complexity img {
  max-height: 380px;
  width: auto !important;
}

/* Space-aware font sizes. */
/* Larger text is applied only on slides with enough room. */
body.ml-lecture-10 .reveal .slides section:is(
  [id="title-slide"],
  [id="training-and-test-data"],
  [id="training-vs.-test-data"],
  [id="overfitting"],
  [id="model-construction-and-evaluation"],
  [id="randomization-in-the-sampling-process"],
  [id="dummy-variables-in-linear-regression"],
  [id="what-are-dummy-variables"],
  [id="dummy-variables-in-regression-models"],
  [id="dummy-variable-regression-in-r"],
  [id="residual-plots"],
  [id="residuals"],
  [id="residuals-1"],
  [id="residual-plots-1"],
  [id="residual-plots-2"],
  [id="examples"],
  [id="unbiasedness-and-homoskedasticity"],
  [id="what-happens-if-biased"],
  [id="what-happens-if-heteroscedasticity-is-present"],
  [id="residual-plot-in-r"]
) { font-size: 40px; }
body.ml-lecture-10 .reveal .slides section:is(
  [id="title-slide"],
  [id="training-and-test-data"],
  [id="training-vs.-test-data"],
  [id="overfitting"],
  [id="model-construction-and-evaluation"],
  [id="randomization-in-the-sampling-process"],
  [id="dummy-variables-in-linear-regression"],
  [id="what-are-dummy-variables"],
  [id="dummy-variables-in-regression-models"],
  [id="dummy-variable-regression-in-r"],
  [id="residual-plots"],
  [id="residuals"],
  [id="residuals-1"],
  [id="residual-plots-1"],
  [id="residual-plots-2"],
  [id="examples"],
  [id="unbiasedness-and-homoskedasticity"],
  [id="what-happens-if-biased"],
  [id="what-happens-if-heteroscedasticity-is-present"],
  [id="residual-plot-in-r"]
) pre code { font-size: 24px !important; line-height: 1.25; }

body.ml-lecture-10 .reveal .slides section:is(
  [id="goals-of-linear-regression"],
  [id="a-little-bit-of-statistics-for-the-uniform-distribution"],
  [id="motivation-treating-categorical-variables-in-linear-regression"],
  [id="avoiding-the-dummy-variable-trap"]
) { font-size: 36px; }
body.ml-lecture-10 .reveal .slides section:is(
  [id="goals-of-linear-regression"],
  [id="a-little-bit-of-statistics-for-the-uniform-distribution"],
  [id="motivation-treating-categorical-variables-in-linear-regression"],
  [id="avoiding-the-dummy-variable-trap"]
) pre code { font-size: 22px !important; line-height: 1.25; }

body.ml-lecture-10 .reveal .slides section:is(
  [id="the-dummy-variable-trap"]
) { font-size: 32px; }
body.ml-lecture-10 .reveal .slides section:is(
  [id="the-dummy-variable-trap"]
) pre code { font-size: 20px !important; line-height: 1.25; }

body.ml-lecture-11 .reveal .slides section:is(
  [id="title-slide"],
  [id="k-fold-cross-validation"],
  [id="bias-variance-trade-off"],
  [id="why-we-care"],
  [id="a-useful-decomposition-for-squared-error"],
  [id="where-cross-validation-fits"],
  [id="regularization"],
  [id="what-is-linear-regression-doing"],
  [id="what-is-lasso-regression-doing"],
  [id="what-is-lasso-regression-doing-1"],
  [id="what-is-ridge-regression-doing"],
  [id="what-is-ridge-regression-doing-1"],
  [id="choosing-between-lasso-ridge-and-elastic-net"],
  [id="intuition-on-different-penalties"],
  [id="regularization-affects-the-interpretation-of-beta"],
  [id="sparse-matrix"]
) { font-size: 40px; }
body.ml-lecture-11 .reveal .slides section:is(
  [id="title-slide"],
  [id="k-fold-cross-validation"],
  [id="bias-variance-trade-off"],
  [id="why-we-care"],
  [id="a-useful-decomposition-for-squared-error"],
  [id="where-cross-validation-fits"],
  [id="regularization"],
  [id="what-is-linear-regression-doing"],
  [id="what-is-lasso-regression-doing"],
  [id="what-is-lasso-regression-doing-1"],
  [id="what-is-ridge-regression-doing"],
  [id="what-is-ridge-regression-doing-1"],
  [id="choosing-between-lasso-ridge-and-elastic-net"],
  [id="intuition-on-different-penalties"],
  [id="regularization-affects-the-interpretation-of-beta"],
  [id="sparse-matrix"]
) pre code { font-size: 24px !important; line-height: 1.25; }

body.ml-lecture-11 .reveal .slides section:is(
  [id="k-fold-cross-validation-1"],
  [id="bias-vs.-variance"],
  [id="regularization-1"],
  [id="elastic-net-regression-with-cross-validation-in-r"],
  [id="how-regularization-addresses-the-bias-variance-trade-off"]
) { font-size: 36px; }
body.ml-lecture-11 .reveal .slides section:is(
  [id="k-fold-cross-validation-1"],
  [id="bias-vs.-variance"],
  [id="regularization-1"],
  [id="elastic-net-regression-with-cross-validation-in-r"],
  [id="how-regularization-addresses-the-bias-variance-trade-off"]
) pre code { font-size: 22px !important; line-height: 1.25; }

body.ml-lecture-11 .reveal .slides section:is(
  [id="training-validation-and-test-datasets"],
  [id="underfit-vs.-optimal-vs.-overfit"],
  [id="the-biasvariance-trade-off-curve"],
  [id="where-cross-validation-fits-1"],
  [id="what-is-elastic-net-regression-doing"],
  [id="how-expensive-is-it-to-make-beta-large"],
  [id="lassoridge-regression-with-cross-validation-in-r"]
) { font-size: 32px; }
body.ml-lecture-11 .reveal .slides section:is(
  [id="training-validation-and-test-datasets"],
  [id="underfit-vs.-optimal-vs.-overfit"],
  [id="the-biasvariance-trade-off-curve"],
  [id="where-cross-validation-fits-1"],
  [id="what-is-elastic-net-regression-doing"],
  [id="how-expensive-is-it-to-make-beta-large"],
  [id="lassoridge-regression-with-cross-validation-in-r"]
) pre code { font-size: 20px !important; line-height: 1.25; }

body.ml-lecture-12 .reveal .slides section:is(
  [id="title-slide"],
  [id="decision-trees"],
  [id="decision-trees-1"],
  [id="decision-tree-terminologies"],
  [id="fitting-a-decision-tree-recursive-splits-2"],
  [id="tuning-and-pruning-trees"],
  [id="why-complexity-control-matters"],
  [id="important-tuning-choices-for-a-single-tree"],
  [id="bias-variance-tradeoff-in-trees"],
  [id="tune-the-maximum-tree-depth-or-minimum-node-size"],
  [id="how-to-interpret-the-pruning-penalty"],
  [id="pruning"],
  [id="hyperparameter-tuning"]
) { font-size: 40px; }
body.ml-lecture-12 .reveal .slides section:is(
  [id="title-slide"],
  [id="decision-trees"],
  [id="decision-trees-1"],
  [id="decision-tree-terminologies"],
  [id="fitting-a-decision-tree-recursive-splits-2"],
  [id="tuning-and-pruning-trees"],
  [id="why-complexity-control-matters"],
  [id="important-tuning-choices-for-a-single-tree"],
  [id="bias-variance-tradeoff-in-trees"],
  [id="tune-the-maximum-tree-depth-or-minimum-node-size"],
  [id="how-to-interpret-the-pruning-penalty"],
  [id="pruning"],
  [id="hyperparameter-tuning"]
) pre code { font-size: 24px !important; line-height: 1.25; }

body.ml-lecture-12 .reveal .slides section:is(
  [id="tree-logic"],
  [id="classification-and-regression-trees-cart"],
  [id="regression-tree-with-wildfire-smoke-data"],
  [id="fitting-a-decision-tree-recursive-splits"]
) { font-size: 36px; }
body.ml-lecture-12 .reveal .slides section:is(
  [id="tree-logic"],
  [id="classification-and-regression-trees-cart"],
  [id="regression-tree-with-wildfire-smoke-data"],
  [id="fitting-a-decision-tree-recursive-splits"]
) pre code { font-size: 22px !important; line-height: 1.25; }

body.ml-lecture-12 .reveal .slides section:is(
  [id="fitting-a-decision-tree"],
  [id="fitting-a-decision-tree-recursive-splits-1"],
  [id="prune-the-tree-by-tuning-cost-complexity"]
) { font-size: 32px; }
body.ml-lecture-12 .reveal .slides section:is(
  [id="fitting-a-decision-tree"],
  [id="fitting-a-decision-tree-recursive-splits-1"],
  [id="prune-the-tree-by-tuning-cost-complexity"]
) pre code { font-size: 20px !important; line-height: 1.25; }

body.ml-lecture-13 .reveal .slides section:is(
  [id="title-slide"],
  [id="random-forest"],
  [id="bootstrap"],
  [id="bagging-bootstrap-aggregation"],
  [id="split-variable-randomization"],
  [id="why-decorrelating-trees-helps"],
  [id="random-forest-diagram"],
  [id="accuracy-of-the-tree"],
  [id="oob-error-free-cross-validation"],
  [id="examining-variable-importance"],
  [id="vip-why-shuffle-instead-of-remove"],
  [id="gradient-boosted-trees"],
  [id="gradient-boosted-trees-1"],
  [id="analogy-learning-from-your-mistakes"],
  [id="building-up-a-gradient-boosted-tree-model"],
  [id="visual-example-of-boosting-in-action"],
  [id="what-is-a-gradient"],
  [id="nrounds-and-eta-must-be-tuned-together"],
  [id="extreme-gradient-boosting-with-xgboost"],
  [id="practical-tuning-guidance-for-xgboost"],
  [id="random-forest-vs.-gradient-boosted-trees-when-to-use-which"]
) { font-size: 40px; }
body.ml-lecture-13 .reveal .slides section:is(
  [id="title-slide"],
  [id="random-forest"],
  [id="bootstrap"],
  [id="bagging-bootstrap-aggregation"],
  [id="split-variable-randomization"],
  [id="why-decorrelating-trees-helps"],
  [id="random-forest-diagram"],
  [id="accuracy-of-the-tree"],
  [id="oob-error-free-cross-validation"],
  [id="examining-variable-importance"],
  [id="vip-why-shuffle-instead-of-remove"],
  [id="gradient-boosted-trees"],
  [id="gradient-boosted-trees-1"],
  [id="analogy-learning-from-your-mistakes"],
  [id="building-up-a-gradient-boosted-tree-model"],
  [id="visual-example-of-boosting-in-action"],
  [id="what-is-a-gradient"],
  [id="nrounds-and-eta-must-be-tuned-together"],
  [id="extreme-gradient-boosting-with-xgboost"],
  [id="practical-tuning-guidance-for-xgboost"],
  [id="random-forest-vs.-gradient-boosted-trees-when-to-use-which"]
) pre code { font-size: 24px !important; line-height: 1.25; }

body.ml-lecture-13 .reveal .slides section:is(
  [id="limitation-of-cart"],
  [id="bagging-reducing-variance-by-averaging"],
  [id="random-forest-algorithm"],
  [id="out-of-bag-samples-for-estimating-the-accuracy"],
  [id="gradient-boosted-trees-2"],
  [id="tuning-hyperparameters-with-xgboost"],
  [id="random-forest-vs.-gradient-boosted-trees-2"]
) { font-size: 36px; }
body.ml-lecture-13 .reveal .slides section:is(
  [id="limitation-of-cart"],
  [id="bagging-reducing-variance-by-averaging"],
  [id="random-forest-algorithm"],
  [id="out-of-bag-samples-for-estimating-the-accuracy"],
  [id="gradient-boosted-trees-2"],
  [id="tuning-hyperparameters-with-xgboost"],
  [id="random-forest-vs.-gradient-boosted-trees-2"]
) pre code { font-size: 22px !important; line-height: 1.25; }

body.ml-lecture-13 .reveal .slides section:is(
  [id="tune-the-learning-rate-in-gradient-descent"],
  [id="random-forest-vs.-gradient-boosted-trees-1"]
) { font-size: 32px; }
body.ml-lecture-13 .reveal .slides section:is(
  [id="tune-the-learning-rate-in-gradient-descent"],
  [id="random-forest-vs.-gradient-boosted-trees-1"]
) pre code { font-size: 20px !important; line-height: 1.25; }


/* Lecture 10: reserve figure geometry before lazy images load, and keep
   diagrams independent of Reveal's stretch/fragment sizing. */
body.ml-lecture-10 .reveal .slides section.slide.level2 .lec10-image {
  position: relative;
  width: min(100%, var(--lec10-image-width));
  aspect-ratio: var(--lec10-image-ratio);
  margin: .2em auto .35em;
}
body.ml-lecture-10 .reveal .slides section.slide.level2 .lec10-image > p {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}
body.ml-lecture-10 .reveal .slides section.slide.level2 .lec10-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  object-fit: contain;
}
body.ml-lecture-10 .lec10-training-image {
  --lec10-image-width: 100%;
  --lec10-image-ratio: 1323 / 488;
}
body.ml-lecture-10 .lec10-overfitting-image {
  --lec10-image-width: 760px;
  --lec10-image-ratio: 1228 / 968;
}
body.ml-lecture-10 .lec10-workflow-image {
  --lec10-image-width: 972px;
  --lec10-image-ratio: 940 / 580;
}
body.ml-lecture-10 .lec10-uniform-image {
  --lec10-image-width: 75%;
  --lec10-image-ratio: 415 / 424;
}
body.ml-lecture-10 .lec10-examples-image {
  --lec10-image-width: 802px;
  --lec10-image-ratio: 567 / 424;
}

/* Page 2 includes the variable definitions alongside the original goals. */
body.ml-lecture-10 .reveal .slides section#goals-of-linear-regression {
  font-size: 32px;
}
body.ml-lecture-10 .reveal .slides .lec10-variable-key {
  font-size: 28px;
  line-height: 1.25;
  padding: .3em .5em;
  margin: .25em 0 .35em;
  background: var(--clean-surface-soft);
  border-left: 4px solid var(--clean-accent);
  border-radius: 8px;
}
body.ml-lecture-10 .reveal .slides .lec10-variable-key p {
  margin: .1em 0;
}
body.ml-lecture-10 .reveal .slides .lec10-variable-key code {
  font-size: 1em;
}
