/* Site-wide design, shared with the diesel blog:
   Source Sans 3 / Source Serif 4, a 740px reading column, accessible colors,
   and the card, button and page-section components used by Home and Portfolio.
   Loaded after the Bootstrap theme, so it wins on typography, color and layout. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --ink: #232f3e;         /* titles        13.6:1 on white */
  --text: #40474f;        /* body           9.4:1 */
  --text-soft: #5d6570;   /* secondary      5.9:1 (5.1:1 on light grey) */
  --accent: #146eb4;      /* h2, active nav 5.4:1 */
  --link: #00786f;        /* links          5.4:1 */
  --warm: #b35900;        /* small labels   4.8:1 */
  --warm-fill: #ff9900;   /* decorative only, never text */
  --rule: #e3e7ec;
  --code-bg: #eef1f4;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --read: 740px;
  --wide: 1140px;
}

/* ---------- base ---------- */
html, body { height: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
body * { box-sizing: border-box; }

a { color: var(--link); text-decoration: none; }
a:hover, a:focus { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

strong, b { color: var(--ink); font-weight: 700; }

/* Links inside running text are underlined, so they don't rely on color alone. */
#pageContent p a, #pageContent li a, #pageContent .dek a {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
}
#pageContent p a:hover, #pageContent li a:hover { text-decoration-color: var(--link); }
#pageContent .card-desc a, #pageContent .page-toc a, #pageContent .pub-list a, #pageContent .contact a,
#pageContent .btn-row a, #pageContent .jump a { text-decoration: none; }

/* ---------- layout: reading column ---------- */
#pageContent.standardPadding { padding: 0; }
#pageContent.standardPadding .articleBandContent {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 36px 20px 56px 20px;
}
/* Article text (markdown sections) sits in the reading column;
   raw-HTML layouts such as the Portfolio gallery keep the wide container. */
#pageContent .articleBandContent > .section.level1,
#pageContent .articleBandContent > .section.level2 {
  max-width: var(--read);
  margin-left: auto;
  margin-right: auto;
}
/* Keep the footer at the bottom on short pages. */
#pageContent.standardPadding { min-height: calc(100vh - 150px); }
#pageContent .main-container, #pageContent .container-fluid { max-width: none; padding: 0; margin: 0; }

/* ---------- typography ---------- */
#pageContent p, #pageContent li { font-size: 17px; line-height: 1.7; }
#pageContent p { margin: 0 0 18px 0; }
#pageContent ul, #pageContent ol { margin: 0 0 18px 0; padding-left: 1.3em; }
#pageContent li { margin-bottom: 6px; }

#pageContent h1, #pageContent h2, #pageContent h3, #pageContent h4, #pageContent h5 {
  font-family: var(--sans);
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
}
#pageContent h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 600;
  line-height: 1.18;
  margin: 8px 0 20px 0;
  text-wrap: balance;
}
#pageContent h2 {
  font-family: var(--serif);
  color: var(--accent);
  font-size: clamp(22px, 3.4vw, 28px);
  font-weight: 600;
  line-height: 1.25;
  margin: 40px 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--rule);
}
#pageContent h3 { font-size: 20px; font-weight: 700; line-height: 1.3; margin: 32px 0 10px 0; }
#pageContent h4 { font-size: 17px; font-weight: 600; line-height: 1.5; margin: 22px 0 8px 0; }
#pageContent h5 { font-size: 15px; font-weight: 700; margin: 18px 0 6px 0; }
#pageContent h2 strong, #pageContent h3 strong { color: inherit; font-weight: inherit; }

/* Papers lists citations as <h4>; keep them readable as body text. */
#pageContent .section.level2 > h4 { font-weight: 400; color: var(--text); margin: 0 0 14px 0; }
#pageContent .section.level2 > h4 strong { font-weight: 600; }

#pageContent blockquote {
  margin: 24px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--warm-fill);
  color: var(--text-soft); font-size: 17px; font-style: italic;
}
#pageContent hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }

#pageContent code {
  font-family: var(--mono); font-size: 0.88em; background: var(--code-bg);
  padding: 0.1em 0.4em; border-radius: 4px; color: var(--ink);
}
#pageContent pre { background: var(--code-bg); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; overflow-x: auto; }
#pageContent pre code { background: none; padding: 0; }

/* ---------- media: never wider than the screen ---------- */
#pageContent img, #pageContent video, #pageContent iframe { max-width: 100%; }
#pageContent img { height: auto; }
/* Center figures only (knitr figures and images alone in a paragraph); inline images keep their place. */
#pageContent .section .figure img, #pageContent .section p > img:only-child {
  display: block; margin-left: auto; margin-right: auto; border-radius: 6px;
}
#pageContent .caption, #pageContent figcaption {
  font-size: 14px; line-height: 1.5; color: var(--text-soft); text-align: center; margin: 10px 0 24px 0;
}
#pageContent .MathJax_Display, #pageContent mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; }

/* Tables scroll sideways inside the column instead of stretching the page. */
#pageContent .section table {
  display: block; max-width: 100%; overflow-x: auto;
  border-collapse: collapse; font-size: 15px; margin: 18px auto 26px auto; width: auto;
}
#pageContent .section table th, #pageContent .section table td {
  padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: top;
}
#pageContent .section table caption { color: var(--ink); font-size: 15px; font-weight: 600; text-align: left; caption-side: top; padding: 0 0 10px 0; }
#pageContent .section table thead th {
  color: var(--text-soft); font-size: 13px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; border-bottom: 2px solid var(--rule);
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: saturate(160%) blur(8px); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
.site-header .sh-inner {
  max-width: var(--wide); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px;
}
.site-header .sh-brand {
  font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink);
  letter-spacing: 0.01em; white-space: nowrap;
}
.site-header .sh-brand:hover { color: var(--accent); text-decoration: none; }
.site-header .sh-nav { display: flex; gap: 4px; }
.site-header .sh-nav a {
  font-size: 15.5px; font-weight: 600; color: var(--text); padding: 8px 12px; border-radius: 6px;
}
.site-header .sh-nav a:hover { background: var(--bg-subtle); color: var(--ink); text-decoration: none; }
.site-header .sh-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.site-header .sh-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -8px; padding: 0;
  background: none; border: 0; border-radius: 8px; color: var(--ink); cursor: pointer;
}
.site-header .sh-toggle:hover { background: var(--bg-subtle); }
.site-header .sh-toggle svg { width: 24px; height: 24px; }
.site-header .sh-toggle .i-close { display: none; }
.site-header.open .sh-toggle .i-open { display: none; }
.site-header.open .sh-toggle .i-close { display: block; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule); background: var(--bg-subtle);
  font-family: var(--sans); font-size: 14px; color: var(--text-soft);
}
.site-footer .sf-inner {
  max-width: var(--wide); margin: 0 auto; padding: 26px 20px 34px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
}
.site-footer .sf-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--text-soft); font-weight: 600; }
.site-footer a:hover { color: var(--link); }

/* ---------- buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
#pageContent a.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 22px; border-radius: 8px;
  font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.2;
  border: 2px solid var(--accent); text-decoration: none; transition: background-color .15s, color .15s;
  text-transform: none; letter-spacing: normal; box-shadow: none;
}
#pageContent a.btn-primary { background: var(--accent); color: #fff; }
#pageContent a.btn-primary:hover { background: #0f5a94; border-color: #0f5a94; color: #fff; }
#pageContent a.btn-secondary { background: #fff; color: var(--accent); }
#pageContent a.btn-secondary:hover { background: var(--bg-subtle); color: var(--accent); }

.eyebrow {
  display: inline-block; font-family: var(--sans); font-size: 13px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--warm); margin-bottom: 12px;
}

/* ---------- page sections (Home, Portfolio) ---------- */
.wrap-wide { max-width: var(--wide); margin: 0 auto; padding: 0 20px; }
.page-block { padding: 56px 0; }
.page-block + .page-block { border-top: 1px solid var(--rule); }
.page-block.subtle { background: var(--bg-subtle); }
#pageContent .page-block h2 { margin-top: 0; }
#pageContent .page-block > .wrap-wide > h2 { margin-bottom: 20px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
#pageContent .block-head h2 { border: 0; padding: 0; margin: 0; color: var(--ink); }
.block-head .more { font-weight: 600; font-size: 16px; white-space: nowrap; }
#pageContent .block-intro { color: var(--text-soft); max-width: 46em; margin: 8px 0 26px 0; }

/* Page title block (Portfolio and other listing pages). */
.page-title { padding: 44px 0 8px 0; }
#pageContent .page-title h1 { margin: 0 0 12px 0; }
#pageContent .page-title .dek { font-size: 19px; color: var(--text-soft); max-width: 40em; margin: 0; }

/* ---------- cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.card-grid.fit { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
#pageContent a.card {
  display: flex; flex-direction: column; height: 100%;
  background: #fff; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden;
  color: inherit; text-decoration: none;
  box-shadow: 0 1px 2px rgba(23, 34, 48, 0.05);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
#pageContent a.card:hover, #pageContent a.card:focus-visible {
  box-shadow: 0 10px 24px rgba(23, 34, 48, 0.12); transform: translateY(-2px); border-color: #cfd6de;
}
.card .card-img { aspect-ratio: 4 / 3; background: var(--bg-subtle); border-bottom: 1px solid var(--rule); overflow: hidden; }
#pageContent .card .card-img img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; margin: 0; border-radius: 0;
}
.card .card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 20px 18px; flex: 1; }
.card .card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: #e8f1fa; border-radius: 999px; padding: 2px 9px; line-height: 1.6;
}
.tag.lang { color: #7a3d00; background: #fdeedb; }
.tag.soon { color: var(--text-soft); background: #eceff3; }
#pageContent .card .card-title {
  font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.3; color: var(--ink); margin: 0;
}
#pageContent a.card:hover .card-title { color: var(--accent); }
#pageContent .card .card-desc { font-size: 15px; line-height: 1.55; color: var(--text-soft); margin: 0; }

/* ---------- home ---------- */
.home-hero { background: linear-gradient(180deg, var(--bg-subtle) 0%, #fff 100%); border-bottom: 1px solid var(--rule); }
.home-hero .wrap-wide {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: 56px; align-items: center;
  padding-top: 64px; padding-bottom: 64px;
}
#pageContent .home-hero h1 { font-size: clamp(36px, 5.6vw, 54px); margin: 0 0 18px 0; }
#pageContent .home-hero .lede { font-size: 19px; line-height: 1.65; color: var(--text); max-width: 36em; margin: 0; }
.home-hero .photo { justify-self: center; width: 100%; max-width: 320px; }
#pageContent .home-hero .photo img {
  width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%; display: block; margin: 0;
  box-shadow: 0 0 0 8px #fff, 0 14px 36px rgba(23, 34, 48, 0.16);
}

#pageContent .pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
#pageContent .pub-list li {
  margin: 0; padding: 16px 20px; background: #fff; border: 1px solid var(--rule); border-radius: 10px;
  font-size: 16px; line-height: 1.55;
}
.pub-list .pub-year { font-weight: 700; color: var(--warm); margin-right: 8px; font-variant-numeric: tabular-nums; }
#pageContent .pub-list .pub-title { font-weight: 600; }
.pub-list .pub-venue { display: block; color: var(--text-soft); font-style: italic; font-size: 15px; margin-top: 2px; }

.contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; }
#pageContent .contact h2 { border: 0; padding: 0; margin: 0; color: var(--ink); }
#pageContent .contact p { margin: 8px 0 0 0; max-width: 34em; }
.contact .links { display: flex; flex-wrap: wrap; gap: 10px; }
#pageContent .contact .links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--rule); background: #fff; font-weight: 600; font-size: 15px; color: var(--ink);
}
#pageContent .contact .links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
#pageContent .contact .links a.email { background: var(--accent); border-color: var(--accent); color: #fff; }
#pageContent .contact .links a.email:hover { background: #0f5a94; color: #fff; }

/* ---------- papers ---------- */
.tag.award { color: #7a4a00; background: #fff1cc; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
#pageContent .jump a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px;
  border: 1px solid var(--rule); border-radius: 999px; background: #fff;
  font-weight: 600; font-size: 15px; color: var(--ink);
}
#pageContent .jump a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.jump a span { font-size: 12.5px; font-weight: 700; color: var(--text-soft); background: var(--bg-subtle); border-radius: 999px; padding: 0 8px; }
.pubs-block { scroll-margin-top: 70px; }
#pageContent .pubs-block h2 { max-width: 880px; }
#pageContent ol.pubs { list-style: none; margin: 0; padding: 0; max-width: 880px; }
#pageContent ol.pubs li.pub {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 20px;
  margin: 0; padding: 18px 0; border-bottom: 1px solid var(--rule);
}
#pageContent ol.pubs li.pub:last-child { border-bottom: 0; }
.pub .pub-year { font-weight: 700; color: var(--warm); font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums; padding-top: 1px; }
#pageContent .pub a.pub-title { font-size: 17px; font-weight: 600; line-height: 1.45; color: var(--link); }
.pub .pub-authors { font-size: 15px; color: var(--text); margin-top: 4px; }
.pub .pub-authors b { color: var(--ink); }
.pub .pub-venue { font-size: 15px; color: var(--text-soft); line-height: 1.5; }
.pub .pub-venue em { font-style: italic; }
.pub .pub-alt { font-size: 14.5px; color: var(--text-soft); margin-top: 6px; line-height: 1.5; }
.pub .pub-alt .tag { margin-right: 4px; }
.pub .pub-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- about ---------- */
.about-hero .wrap-wide {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 44px; align-items: start;
  padding-top: 48px; padding-bottom: 48px;
}
#pageContent .about-hero .photo img {
  width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%; display: block; margin: 0;
  box-shadow: 0 0 0 6px #fff, 0 10px 28px rgba(23, 34, 48, 0.14);
}
#pageContent .about-hero h1 { margin: 0 0 16px 0; }
#pageContent .about-hero p { max-width: 42em; }
#pageContent .skill-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
#pageContent .skill-chips li {
  margin: 0; padding: 6px 14px; border-radius: 999px; background: #e8f1fa; color: #0f5a94;
  font-size: 15px; font-weight: 600;
}
.award-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.award { background: #fff; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.award .award-img { position: relative; background: #fff; aspect-ratio: 3 / 1; border-bottom: 1px solid var(--rule); overflow: hidden; }
#pageContent .award .award-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; margin: 0; border-radius: 0; }
.award .award-body { padding: 14px 18px 18px 18px; }
.award .award-rank { display: block; font-weight: 700; color: var(--ink); font-size: 16px; }
#pageContent .award .award-body p { font-size: 15px; line-height: 1.55; color: var(--text-soft); margin: 4px 0 0 0; }
.logo-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.logo-row .logo {
  display: flex; align-items: center; justify-content: center; width: 150px; height: 150px; padding: 14px;
  background: #fff; border: 1px solid var(--rule); border-radius: 12px;
}
#pageContent .logo-row img { max-width: 100%; max-height: 100%; width: auto; height: auto; margin: 0; }
#pageContent .logo-row a.logo:hover { border-color: var(--accent); }

/* ---------- research articles ---------- */
.article-kicker {
  max-width: var(--read); margin: 8px auto 12px auto;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warm);
}
.article-kicker a { color: var(--text-soft); }
.article-kicker span[aria-hidden] { color: var(--rule); font-weight: 400; }
#pageContent p.dek { font-size: 20px; line-height: 1.55; color: var(--text-soft); margin: -6px 0 26px 0; max-width: 38em; }

/* Figures: fill the column (the Rmd width/height percentages made them small). */
#pageContent .section .figure img, #pageContent .section .float img, #pageContent .section p > img:only-child,
#pageContent section.level1 figure img, #pageContent section.level1 p > img:only-child {
  width: auto !important; height: auto !important; max-width: 100%; max-height: 82vh;
}
/* Download previews (image inside a download link, e.g. Built-up Areas). */
#pageContent .section a[download] > img { width: auto !important; height: auto !important; max-width: 100%; display: block; margin: 0 auto; border-radius: 6px; }
#pageContent .section .figure, #pageContent .section .float, #pageContent section.level1 .quarto-figure { margin: 28px 0; }
#pageContent .section .float img { display: block; margin: 0 auto; border-radius: 6px; }
#pageContent .section .float .figcaption { font-size: 14px; line-height: 1.5; color: var(--text-soft); text-align: center; margin: 10px 0 0 0; }

/* Data tables (replacing pictures of tables). */
#pageContent figure.data-table {
  margin: 30px 0 30px 50%; transform: translateX(-50%);
  width: max-content; max-width: min(1000px, calc(100vw - 40px));
}
#pageContent figure.data-table figcaption {
  font-size: 15px; font-weight: 600; color: var(--ink); text-align: left; margin: 0 0 10px 0; line-height: 1.45;
}
.data-table .table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: 10px; background: #fff;
}
#pageContent .data-table table {
  display: table; width: 100%; margin: 0; border-collapse: collapse; font-size: 14.5px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
#pageContent .data-table th, #pageContent .data-table td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--rule); vertical-align: top; }
#pageContent .data-table table thead th {
  white-space: normal; min-width: 64px;
  text-transform: none; letter-spacing: normal; font-size: 13.5px; font-weight: 700; color: var(--ink);
  background: var(--bg-subtle); text-align: center; border-bottom: 1px solid var(--rule); vertical-align: bottom;
}
#pageContent .data-table .l, #pageContent .data-table tbody th { text-align: left; }
#pageContent .data-table tbody th { font-weight: 600; color: var(--ink); background: #fff; position: sticky; left: 0; }
#pageContent .data-table tbody tr:last-child > * { border-bottom: 0; }
#pageContent .data-table tr.group th {
  position: static; background: #eef3f8; color: var(--accent); font-size: 12.5px; letter-spacing: 0.06em;
  text-transform: uppercase; text-align: left;
}
#pageContent .data-table td.hp { white-space: normal; min-width: 190px; color: var(--text); font-size: 13.5px; line-height: 1.5; }
#pageContent .data-table.text table { white-space: normal; }
#pageContent .data-table.text td { min-width: 220px; }
#pageContent .data-table .corner { font-weight: 600; color: var(--text-soft); }
#pageContent .data-table .table-note { font-size: 13.5px; line-height: 1.5; color: var(--text-soft); margin: 10px 0 0 0; text-align: left; }

/* "On this page" (built by include_footer.html on long articles). */
.page-toc {
  margin: 0 0 30px 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg-subtle);
  font-size: 15.5px;
}
.page-toc summary {
  cursor: pointer; padding: 12px 16px; font-weight: 700; color: var(--ink); list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.page-toc summary::-webkit-details-marker { display: none; }
.page-toc summary::after { content: "▾"; color: var(--text-soft); transition: transform .15s; }
.page-toc[open] summary::after { transform: rotate(180deg); }
#pageContent .page-toc ol { margin: 0; padding: 0 16px 14px 36px; }
#pageContent .page-toc li { margin: 4px 0; font-size: 15.5px; line-height: 1.45; }

/* Tap / click to enlarge figures. */
img.zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 2000; background: rgba(15, 20, 28, 0.88);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.lightbox button {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.14); color: #fff; font-size: 24px; line-height: 44px; cursor: pointer;
}

/* Quarto page: drop Quarto's column grid so the site header, column and footer match other pages. */
body.quarto-light #quarto-content, body.quarto-light #quarto-document-content {
  display: block; max-width: none; width: auto; margin: 0; padding: 0;
}
body.quarto-light #title-block-header { display: none; }
#pageContent .articleBandContent > section.level1 { max-width: var(--read); margin-left: auto; margin-right: auto; }

#TOC { font-family: var(--sans); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  #pageContent p, #pageContent li { font-size: 16px; }
  #pageContent.standardPadding .articleBandContent { padding: 24px 16px 44px 16px; }
  #pageContent h2 { margin-top: 32px; }
  #pageContent h3 { font-size: 18px; }
  #pageContent .section table { font-size: 14px; }

  .site-header .sh-inner { padding: 0 16px; min-height: 56px; flex-wrap: wrap; }
  .site-header .sh-brand { font-size: 17px; }
  .site-header .sh-toggle { display: inline-flex; }
  .site-header .sh-nav {
    display: none; flex-direction: column; gap: 0;
    width: 100%; margin: 0 -16px; width: calc(100% + 32px);
    border-top: 1px solid var(--rule); padding: 6px 0 10px 0;
  }
  .site-header.open .sh-nav { display: flex; }
  .site-header .sh-nav a { padding: 12px 16px; border-radius: 0; font-size: 16px; }
  .site-header .sh-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }

  .site-footer .sf-inner { padding: 22px 16px 30px 16px; flex-direction: column; align-items: flex-start; }

  .wrap-wide { padding: 0 16px; }
  .page-block { padding: 40px 0; }
  .page-title { padding: 28px 0 4px 0; }
  #pageContent .page-title .dek { font-size: 17px; }
  .card-grid { grid-template-columns: 1fr; gap: 18px; }

  .home-hero .wrap-wide { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; padding-bottom: 40px; }
  .home-hero .photo { order: -1; max-width: 190px; justify-self: start; }
  #pageContent .home-hero .lede { font-size: 17px; }
  .btn-row .btn { flex: 1 1 auto; }
  .contact { grid-template-columns: 1fr; }
  #pageContent .pub-list li { padding: 14px 16px; font-size: 15.5px; }

  #pageContent ol.pubs li.pub { grid-template-columns: 1fr; padding: 16px 0; }
  #pageContent .pub a.pub-title { font-size: 16.5px; }

  .about-hero .wrap-wide { grid-template-columns: 1fr; gap: 20px; padding-top: 28px; padding-bottom: 32px; }
  .about-hero .photo { max-width: 150px; }
  .award-grid { grid-template-columns: 1fr; }
  .logo-row { gap: 12px; }
  .logo-row .logo { width: calc(33.33% - 8px); height: auto; aspect-ratio: 1; padding: 10px; }

  #pageContent p.dek { font-size: 17.5px; }
  #pageContent figure.data-table { max-width: calc(100vw - 32px); }
  #pageContent .data-table table { font-size: 13.5px; }
  #pageContent .data-table th, #pageContent .data-table td { padding: 7px 9px; }
  .lightbox { padding: 10px; }
}

@media print {
  .site-header, .site-footer { display: none; }
}
