/* Content additions inherit al-folio's typography, layout and theme tokens. */
.content-page {
  --text:var(--global-text-color);
  --muted:#595959;
  --accent:var(--global-theme-color);
  --surface:var(--global-bg-color);
  --soft:var(--global-code-bg-color);
  --line:color-mix(in srgb,var(--global-text-color) 20%,var(--global-bg-color));
  --on-button:var(--global-bg-color);
  min-width:0;
  margin-bottom:3rem;
}
html[data-theme="dark"] .content-page { --muted:#d0d0d0; }
.content-page [hidden] { display:none!important; }
.content-page .post-header { margin-bottom:1.75rem; }
.content-page .post-title { font-size:2rem; line-height:1.25; overflow-wrap:anywhere; }
.content-page .post-description { font-size:1rem; line-height:1.6; margin-bottom:1rem; }
.content-page .post-meta,.content-page .entry-meta,.content-page .publication-year { color:var(--muted); font-size:.875rem; line-height:1.6; }
.content-page .post-meta { margin-bottom:.35rem; }
.content-page .post-content { font-size:1rem; line-height:1.65; }
.content-page .prose { max-width:82ch; min-width:0; }
.content-page .post-content>h2,.content-page .home-section>h2 { font-size:1.5rem; font-weight:400; line-height:1.3; margin-top:2rem; margin-bottom:1rem; overflow-wrap:anywhere; }
.content-page .post-content>h3 { font-size:1.2rem; font-weight:500; line-height:1.4; margin-top:1.75rem; margin-bottom:.8rem; overflow-wrap:anywhere; }
.content-page .post-content p,.content-page .post-content li { line-height:1.65; }
.content-page a { overflow-wrap:anywhere; }
.content-page :focus-visible { outline:2px solid var(--global-theme-color); outline-offset:3px; }
.content-page .post-content img { display:block; max-width:100%; height:auto; }
.content-page .post-content svg { max-width:100%; }
.content-page .post-content figure { max-width:100%; margin-inline:0; }
.content-page .post-content :not(pre)>code { color:#0056b3; overflow-wrap:anywhere; white-space:normal; }
.content-page .post-content pre,.content-page .publication pre { max-width:100%; min-width:0; overflow:auto; padding:1rem; background:var(--global-code-bg-color); color:var(--global-text-color); font-size:.9rem; line-height:1.65; }
.content-page .post-content pre code,.content-page .publication pre code { color:inherit; background:transparent; font-size:inherit; white-space:pre; overflow-wrap:normal; word-break:normal; }
.content-page .post-content .highlighter-rouge,.content-page .post-content .highlight { max-width:100%; min-width:0; }
.content-page .post-content .highlight pre { color:#24292f; background:#f6f8fa; }
.content-page .post-content .highlight :is(.c,.ch,.cd,.cm,.cp,.cpf,.c1,.cs,.gl,.gt) { color:#57606a; }
.content-page .post-content .highlight .gr { color:#b31d28; }
.content-page .post-content table { display:block; width:100%; max-width:100%; overflow-x:auto; border-collapse:collapse; margin-bottom:1rem; }
.content-page .post-content th,.content-page .post-content td { border-bottom:1px solid var(--line); padding:.6rem .75rem; vertical-align:top; }
.content-page .post-content th { font-weight:500; }
.content-page .article-body .katex-display { max-width:100%; overflow-x:auto; overflow-y:hidden; padding-block:.3rem; }
.content-page .article-body .katex-display>.katex { min-width:max-content; }
.content-page .copy-code { display:block; margin:0 0 .4rem auto; padding:.35rem .7rem; min-height:36px; border:1px solid var(--line); border-radius:.2rem; background:var(--global-bg-color); color:var(--global-text-color); font:inherit; font-size:.875rem; cursor:pointer; }
.content-page .copy-code:hover { border-color:var(--global-theme-color); }

/* The original compact introduction and floating portrait. */
.content-home .post-title { font-size:2.4rem; }
.content-home .home-role { font-size:1.1rem; margin-bottom:0; }
.content-home .profile.content-profile { width:28%; max-width:220px; margin:0 0 1rem 1.75rem; }
.content-home .profile.content-profile img { width:100%; height:auto; aspect-ratio:1; object-fit:cover; object-position:50% 26%; }
.content-home .home-introduction { min-width:0; }
.content-home .home-links { margin-top:1rem; }
.content-home .home-section { clear:both; margin-top:2rem; }
.content-home .focus-list { padding-left:1.25rem; }
.content-home .focus-list li { margin-bottom:.5rem; }
.content-page .content-social { margin:1rem 0; text-align:left; }
.content-page .content-social .contact-icons { font-size:1.7rem; line-height:1.5; }
.content-page .content-social a { display:inline-block; margin-right:.7rem; color:var(--global-text-color); }
.content-page .content-social svg { width:1.6rem; height:1.6rem; }

/* Plain lists retain previews without introducing a card system. */
.content-page .project-entry { display:grid; grid-template-columns:8.5rem minmax(0,1fr); gap:1.25rem; align-items:start; padding:1.25rem 0; border-bottom:1px solid var(--line); }
.content-page .project-image { display:block; }
.content-page .project-image img { display:block; width:100%; height:auto; object-fit:contain; }
.content-page .project-card-body { min-width:0; }
.content-page .project-card-body h3 { font-size:1.2rem; line-height:1.4; font-weight:500; margin:0 0 .6rem; }
.content-page .project-card-body p { margin-bottom:.6rem; }
.content-page .entry-meta { margin-bottom:.4rem; }
.content-page .entry-meta a { text-decoration:underline; text-underline-offset:.15em; }
.content-page .writing-row { padding:1.25rem 0; border-bottom:1px solid var(--line); }
.content-page .writing-row h3 { font-size:1.2rem; line-height:1.4; font-weight:500; margin:0 0 .6rem; }
.content-page .writing-row p { margin-bottom:.6rem; }
.content-page .writing-controls { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:1.25rem; margin-bottom:.75rem; }
.content-page .writing-controls label { display:block; margin-bottom:.4rem; }
.content-page .writing-controls .form-control { color:var(--global-text-color); background:var(--global-bg-color); border-color:var(--line); font-size:1rem; }
.content-page .result-count { min-height:1.5rem; font-size:.875rem; color:var(--muted); }
.content-page .availability,.content-page .unavailable-note { font-size:.9rem; color:var(--global-text-color); }
.content-page .feed-link { margin-top:1.5rem; }

/* Bibliography entries retain full titles, DOI links and accessible BibTeX. */
.content-page .publications { margin-top:1.5rem; }
.content-page .publications ol.bibliography { list-style:none; padding:0; margin:0; }
.content-page .publications ol.bibliography>li { margin:0; }
.content-page .publication { display:grid; grid-template-columns:minmax(0,1fr); gap:1.25rem; align-items:start; padding:1.25rem 0; border-top:1px solid var(--line); }
.content-page .publications li:first-child>.publication { border-top:0; }
.content-page .publication.has-preview { grid-template-columns:8.5rem minmax(0,1fr); }
.content-page .publication-thumbnail { min-width:0; align-self:start; }
.content-page .publication-thumbnail img { display:block; width:100%; height:auto; object-fit:contain; }
.content-page .publication-body { min-width:0; overflow-wrap:anywhere; }
.content-page .publication .title { font-size:1rem; line-height:1.5; font-weight:600; margin:0 0 .4rem; }
.content-page .publication p { margin:0 0 .35rem; }
.content-page .publication-authors,.content-page .publication-venue { font-size:.9rem; line-height:1.6; }
.content-page .publication-description { font-size:.95rem; line-height:1.6; margin-top:.55rem!important; }
.content-page .publication-links { display:flex; flex-wrap:wrap; align-items:baseline; gap:.25rem .9rem; font-size:.875rem; margin-top:.5rem; }
.content-page .publication-links a,.content-page .publication-links summary { padding:.15rem 0; }
.content-page .publication-links details { min-width:0; max-width:100%; }
.content-page .publication-links details[open] { flex-basis:100%; }
.content-page .publication-links summary { color:var(--global-theme-color); cursor:pointer; }
.content-page .publication pre { margin-top:.75rem; font-size:.85rem; }

/* Long-form navigation stays in the normal reading flow. */
.content-page .back-link { margin-bottom:1rem; font-size:.9rem; }
.content-page .article-toc { max-width:82ch; padding:1rem 0; margin:1.5rem 0 2rem; border-block:1px solid var(--line); }
.content-page .article-toc h2 { font-size:1.1rem; font-weight:500; margin:0 0 .75rem; }
.content-page .article-toc ol { padding-left:1.25rem; margin-bottom:0; columns:2; column-gap:2rem; }
.content-page .article-toc li { break-inside:avoid; font-size:.95rem; line-height:1.5; }
.content-page .article-toc a { display:inline-block; padding:.15rem 0; }
.content-page .contact-form { max-width:40rem; margin-top:1.5rem; }
.content-page .contact-form label { display:block; margin-top:1rem; }
.content-page .contact-form .form-control { color:var(--global-text-color); background:var(--global-bg-color); border-color:var(--line); }

/* Optional educational matrix, isolated from the page's presentation. */
.content-page .matrix-disclosure { max-width:45rem; margin-top:2rem; border-top:1px solid var(--line); padding-top:.75rem; }
.content-page .matrix-disclosure>summary { padding:.5rem 0; min-height:44px; cursor:pointer; color:var(--global-theme-color); }
.content-page .matrix-lab { padding:1.25rem; margin-top:.75rem; border:1px solid var(--line); background:var(--global-code-bg-color); }
.content-page .matrix-lab-heading h2 { font-size:1.25rem; line-height:1.4; }
.content-page .matrix-lab-heading .eyebrow { font-size:.85rem; margin-bottom:.4rem; }
.content-page .matrix-lab-heading>p { font-size:.95rem; line-height:1.65; }
.content-page .matrix-stage { display:grid; grid-template-columns:1fr auto 1fr auto 1fr; gap:.65rem; align-items:center; margin-block:1.25rem; }
.content-page .matrix-unit { min-width:0; }
.content-page .matrix-unit>p { font:500 .95rem/1.5 ui-monospace,monospace; margin-bottom:.4rem; }
.content-page .matrix-unit>p span { font-size:.75rem; }
.content-page .matrix-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
.content-page .matrix-cell { aspect-ratio:1; display:grid; place-items:center; min-width:0; border:1px solid var(--line); background:var(--global-bg-color); color:var(--global-text-color); font:500 .95rem/1 ui-monospace,monospace; }
.content-page button.matrix-cell { min-width:44px; min-height:44px; cursor:pointer; }
.content-page .matrix-cell.is-used { border-color:var(--global-theme-color); box-shadow:inset 0 0 0 1px var(--global-theme-color); }
.content-page .matrix-cell.is-active { color:var(--global-bg-color); background:var(--global-theme-color); border-color:var(--global-theme-color); }
.content-page .matrix-operator { padding-top:1.25rem; }
.content-page .matrix-expression { min-height:3rem; font:.875rem/1.7 ui-monospace,monospace; overflow-wrap:anywhere; }
.content-page .matrix-controls { display:flex; flex-wrap:wrap; gap:.65rem; }
.content-page .matrix-controls button { padding:.4rem .7rem; min-height:40px; border:1px solid var(--line); border-radius:.2rem; color:var(--global-text-color); background:var(--global-bg-color); cursor:pointer; }

@media(max-width:767px) {
  .content-page .article-toc ol { columns:1; }
}
@media(max-width:575px) {
  .content-page .post-title { font-size:1.75rem; }
  .content-home .post-title { font-size:2.1rem; }
  .content-home .profile.content-profile { float:none!important; width:160px; max-width:100%; margin:0 auto 1rem; }
  .content-page .project-entry,.content-page .publication.has-preview { grid-template-columns:5.5rem minmax(0,1fr); gap:.875rem; }
  .content-page .project-card-body h3 { font-size:1.05rem; }
  .content-page .writing-controls { grid-template-columns:minmax(0,1fr); gap:.8rem; }
  .content-page .matrix-lab { padding:1rem; }
  .content-page .matrix-stage { grid-template-columns:1fr auto 1fr; gap:.75rem; }
  .content-page .matrix-input .matrix-cell { min-height:32px; }
  .content-page .matrix-equals { display:none; }
  .content-page .matrix-output { grid-column:1/-1; justify-self:center; width:100%; max-width:12rem; }
  .content-page .matrix-output>p::before { content:"= "; }
}
