/* =============================================================================
   CAI design refresh — 2026
   A presentation layer loaded AFTER main_v2.css. It only improves spacing,
   hierarchy, cards and rhythm. No brand colours or logos are changed, and
   font sizes / weights are left to main_v2.css.

   Palette in use (all pre-existing in main_v2.css):
     #004191  brand blue        #657C9D  medium blue     #C1CAD8  light blue
     #505a60  heading grey       #333     body text       #F1F0EC  soft grey bg
     #C9CCD2  footer bg          #e0e3e5  hairline        #f4f4f4  panel grey
   ============================================================================= */

:root {
    --cai-blue: #004191;
    --cai-blue-2: #657C9D;
    --cai-blue-light: #C1CAD8;
    --cai-ink: #505a60;
    --cai-text: #333;
    --cai-soft: #F1F0EC;
    --cai-line: #e6e8ec;
    --cai-radius: 12px;
    --cai-shadow: 0 1px 2px rgba(16, 39, 71, 0.06), 0 1px 3px rgba(16, 39, 71, 0.05);
    --cai-shadow-lift: 0 14px 30px rgba(0, 65, 145, 0.13);
    --cai-content-max: 1170px;
}

/* ----------------------------------------------------------------------------
   1. Typography & reading rhythm
   ------------------------------------------------------------------------- */
body {
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Left-aligned prose reads far better than the old full justification. */
p,
.pub_abstract {
    text-align: left;
    text-justify: auto;
}

/* main_v2.css pads .container by 7% per side from 768px up, which wastes a
   lot of width on laptops (≈90px each side at 1280px). Bring it in. */
@media screen and (min-width: 768px) {
    .container {
        padding-left: 3%;
        padding-right: 3%;
    }
}

/* Keep long-form intro paragraphs to a comfortable measure. */
.section > .container > p,
.section > .container > div > p {
    max-width: 72ch;
}
.section > .container > p.lead,
.section > .container > p.text-center {
    max-width: none;
}
/* Pages whose paragraphs should span the full container width — opt out of
   the reading-measure cap by adding .prose-full to the container. */
.section > .container.prose-full > p,
.section > .container.prose-full > div > p {
    max-width: none;
}

a {
    transition: color 0.15s ease;
}

/* ----------------------------------------------------------------------------
   2. Headings — stronger hierarchy with a brand accent
   ------------------------------------------------------------------------- */
h3 {
    color: var(--cai-ink);
    line-height: 1.2;
    margin: 0 0 26px;
    letter-spacing: -0.01em;
}

/* Section headings inside content get a short brand-blue underline accent. */
.content .section > .container > h3,
.content .section > .container > div > h3 {
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.content .section > .container > h3::after,
.content .section > .container > div > h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 54px;
    height: 3px;
    border-radius: 3px;
    background: var(--cai-blue);
}

h4 {
    color: var(--cai-ink);
}

/* ----------------------------------------------------------------------------
   3. Section spacing — generous, consistent vertical rhythm
   ------------------------------------------------------------------------- */
.section {
    padding-top: 40px;
}
.content > .section:last-child {
    padding-bottom: 20px;
}

/* The intro / lead band */
.section-gray {
    background-color: var(--cai-soft);
    padding-top: 22px;
    padding-bottom: 22px;
    margin-bottom: 8px;
}
.section-gray .lead {
    max-width: 60rem;
    margin: 0 auto;
    color: #3c4651;
    line-height: 1.55;
}

hr {
    border-top: 1px solid var(--cai-line);
    margin: 28px 0;
}

/* ----------------------------------------------------------------------------
   4. Header & navigation polish
   ------------------------------------------------------------------------- */
.header {
    border-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

#mainNav > li > a {
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    border-radius: 0;
}
#mainNav > li > a:hover,
#mainNav > li > a:focus {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    text-decoration: none;
}
#mainNav > li.active > a,
#mainNav > li.dropdown:hover > a {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    box-shadow: inset 0 -3px 0 var(--cai-blue-light);
}

/* Dropdown menus: softer, modern */
.header .dropdown-menu,
.dropdown-menu {
    border: 1px solid var(--cai-line);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 30px rgba(16, 39, 71, 0.16);
    margin-top: 6px;
}
.dropdown-menu > li > a {
    border-radius: 7px;
    padding: 7px 14px;
    transition: background 0.12s ease, color 0.12s ease;
}
.dropdown-menu > li > a:hover {
    background: var(--cai-soft) !important;
    color: var(--cai-blue) !important;
}

/* ----------------------------------------------------------------------------
   5. Card system (used by news, people, generic panels)
   ------------------------------------------------------------------------- */
.card-surface {
    background: #fff;
    border: 1px solid var(--cai-line);
    border-radius: var(--cai-radius);
    box-shadow: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card-surface:hover {
    transform: translateY(-3px);
    box-shadow: var(--cai-shadow-lift);
}

/* ----------------------------------------------------------------------------
   6. Latest-news carousel cards
   ------------------------------------------------------------------------- */
.owl-carousel .owl-stage-outer {
    height: auto;
    padding: 6px 0 12px;
}
.owl-carousel .owl-item {
    display: flex;
}
.news_item {
    width: 100%;
    height: auto;
    float: none;
    padding: 8px;
    display: flex;
    /* Flex item inside .owl-item: without this its min-width is the
       min-content width, and the nowrap one-line title makes long titles
       push the card wider than its slot (uneven gaps in the carousel). */
    min-width: 0;
    box-sizing: border-box;
}
.news_item_text {
    min-width: 0;
}
.news_item > a {
    display: flex;
    flex-direction: column;
    /* As a flex item its size was being influenced by the image's intrinsic
       width (landscape images made the card ~15px narrower than portrait
       ones). Fix the basis and allow shrinking so every card fills its slot. */
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--cai-line);
    border-radius: var(--cai-radius);
    overflow: hidden;
    box-shadow: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.news_item > a:hover {
    transform: translateY(-4px);
    box-shadow: var(--cai-shadow-lift);
    text-decoration: none;
}
.news_item img {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 168px;
    max-height: none;
    /* Show the whole image: scale it until its width OR height fits the box
       and letterbox the rest on a soft ground, instead of cropping. */
    object-fit: contain;
    object-position: center;
    background: var(--cai-soft);
    margin: 0;
    display: block;
    border-radius: 0;
}
.news_item_text {
    padding: 14px 16px 18px;
    color: var(--cai-text);
}
.news_item_text dt {
    float: none;
    margin: 0 0 8px;
}
.news_item_text dd {
    margin: 0 0 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cai-blue-2);
}
.news_item_text dt .fa-calendar-alt {
    color: var(--cai-blue-2);
}
.news_item_text p {
    margin: 0;
    line-height: 1.4;
    color: #2c343d;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* News cards (carousel + news grid): date icon and date on one row, a tight
   gap to the title, and a single-line title so every card is the same height
   (image 168px + one date row + one title row). The post page reuses
   .news_item_text without the .news_item wrapper and is deliberately excluded. */
.news_item .news_item_text dt,
.news_item .news_item_text dd {
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    line-height: 1.3;
}
.news_item .news_item_text dt {
    margin-right: 6px;
}
.news_item .news_item_text p {
    margin-top: 5px;
    /* Up to two lines, in a fixed two-line box: every title fits at
       standard widths and all cards keep exactly the same height. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    overflow: hidden;
    line-height: 1.4;
    min-height: 2.8em;
}

/* Carousel dots */
.owl-theme .owl-dots .owl-dot span {
    background: #cfd6df;
    transition: background 0.15s ease, width 0.15s ease;
}
.owl-theme .owl-dots .owl-dot.active span,
.owl-theme .owl-dots .owl-dot:hover span {
    background: var(--cai-blue);
}

/* ----------------------------------------------------------------------------
   7. Spotlight list
   ------------------------------------------------------------------------- */
.spotlight-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
}
@media (min-width: 992px) {
    .spotlight-grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 36px;
    }
}
.spotlight-item {
    margin: 0;
}
.spotlight-item > a {
    display: grid;
    grid-template-columns: 108px 1fr;   /* fits the longest labels (SIGGRAPH'25, PACM HCI'24) with room */
    align-items: baseline;
    gap: 14px;
    padding: 11px 12px;
    border-radius: 9px;
    color: var(--cai-text);
    transition: background 0.13s ease;
}
.spotlight-item > a:hover {
    background: var(--cai-soft);
    text-decoration: none;
}
.spotlight-venue {
    display: inline-block;
    white-space: nowrap;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--cai-blue);
    background: #eaf0f8;
    border: 1px solid #d8e2f0;
    border-radius: 999px;
    padding: 2px 6px;
    line-height: 1.5;
}
.spotlight-title {
    color: #2c343d;
    line-height: 1.45;
}
.spotlight-item > a:hover .spotlight-title {
    color: var(--cai-blue);
}
.spotlight-award {
    color: #f0ad4e;
    margin-left: 6px;
}

/* ----------------------------------------------------------------------------
   8. Responsive media (e.g. homepage YouTube embed)
   ------------------------------------------------------------------------- */
.media-frame {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--cai-radius);
    overflow: hidden;
    box-shadow: none;
}
.media-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ----------------------------------------------------------------------------
   9. Premonition / call-out box
   ------------------------------------------------------------------------- */
.premonition {
    margin: 0;
    border-left-width: 5px;
    box-shadow: none;
    align-items: start;
}
.premonition .fa {
    opacity: 0.55;
}
.premonition .content {
    line-height: 1.6;
}
.premonition.warning {
    background-color: #fcf8f2;
}
/* The notice title is <p class="header">, which collides with the site-nav
   .header rule above and picked up its box-shadow. */
.premonition .header {
    box-shadow: none;
    border-bottom: 0;
}

/* ----------------------------------------------------------------------------
   10. People — leadership rows and student card grid
   ------------------------------------------------------------------------- */
.person {
    float: none;
}
.person + .clearfix + hr {
    display: none;          /* card layout no longer needs rules between people */
}

/* Featured / leadership person (single, full width) */
.person-feature {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    /* no card frame for the standalone people (head, assistants): they sit
       directly on the page under their own section heading */
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 0 8px;
    margin-bottom: 18px;
}
.person-feature .personpic {
    float: none;
    width: 150px;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    margin: 0;
    flex: 0 0 auto;
}
.person-feature .personinfo {
    float: none;
    flex: 1 1 auto;
    min-width: 0;
}
.person-feature .personinfo p {
    margin: 8px 0;
}

/* Grid of postdocs / PhD students — always two cards per row */
.people-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 0 0 8px;
}
.people-grid .person {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--cai-line);
    border-radius: var(--cai-radius);
    box-shadow: none;
    padding: 18px 20px;
    margin: 0;
}
.people-grid .personpic {
    float: none;
    width: 150px;
    height: auto;
    max-height: 180px;
    object-fit: cover;      /* only crops portraits taller than 6:5 */
    border-radius: 10px;
    margin: 0;
    flex: 0 0 auto;
}
/* When the photo is wrapped in a link, the <a> is the flex item, not the
   <img>; without this it shrinks to make room for long affiliation text. */
.people-grid .person > a {
    flex: 0 0 auto;
    display: block;
    line-height: 0;
}
.people-grid .personinfo {
    float: none;
    flex: 1 1 auto;
    min-width: 0;
}
.people-grid .personinfo h4 {
    margin: 2px 0 6px;
}
.people-grid .personinfo p {
    margin: 4px 0;
    line-height: 1.5;
}
.people-grid .personinfo span {
    margin: 0 0 5px 22px;
    top: 0;
    word-break: break-word;
}
.people-grid .personinfo .fa {
    color: var(--cai-blue-2);
}
/* Neutralise the legacy float-clearing separators inside the grid wrapper so
   they don't consume grid cells. */
.people-grid > .clearfix,
.people-grid > hr {
    display: none;
}

/* People list (alumni / theses): tidy two-line rows */
dl.peoplelist dd {
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f1f3;
}
dl.peoplelist dd span.status {
    color: #6b7681;
}
/* Column label above the right-floated supervisor names in the student lists
   ("Supervisors"), placed inside the section <h3>. */
h3 .list-head {
    float: right;
    line-height: 1.2;
    letter-spacing: normal;
    color: #6b7681;
    margin-top: 10px;
}
dl.peoplelist dt {
    color: var(--cai-blue-2);
}

/* ----------------------------------------------------------------------------
   11. Publications / bibliography entries
   ------------------------------------------------------------------------- */
.pub_author {
    color: #5a6470;
}

/* Tag buttons -> pills */
.pub_tags .button.bg_greydark {
    background: #fff;
    border: 1px solid var(--cai-line);
    border-radius: 999px;
    padding: 3px 4px;
    margin-right: 6px;
    box-shadow: none;
    transition: border-color 0.13s ease, background 0.13s ease;
}
.pub_tags .button.bg_greydark:hover {
    background: var(--cai-soft);
    border-color: var(--cai-blue-light);
}
.pub_tags .button.bg_greydark a {
    color: var(--cai-blue) !important;
    padding: 0 9px;
}
.pub_tags .button.bg_greydark a:hover {
    color: var(--cai-blue) !important;
    text-decoration: none;
}
.pub_tags .button.bg_greydark.margin-left-10 {
    background: var(--cai-blue);
    border-color: var(--cai-blue);
}
.pub_tags .button.bg_greydark.margin-left-10 a {
    color: #fff !important;
}

.pub_abstract,
.pub_links,
.pub_bibtex {
    border-radius: 9px;
    border: 1px solid var(--cai-line);
    margin-top: 8px;
}

.thumbnail {
    height: 104px;
    border-radius: 8px;
    border: 1px solid var(--cai-line);
    margin: 4px 22px 6px 0;
}

/* ----------------------------------------------------------------------------
   12. Footer polish
   ------------------------------------------------------------------------- */
.footer-v1 .footer {
    padding: 52px 0 44px;
}
.headline.custom-headline-homepage {
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
    padding-bottom: 8px;
}
.footer-v1 .footer h2 {
    letter-spacing: 0.02em;
}
.footer-v1 .link-list a,
.footer-v1 address a {
    transition: color 0.13s ease;
}
.footer-v1 .footer p {
    line-height: 1.65;
}
#footer.footer-v1 {
    height: auto;
}
.footer-v1 .copyright {
    padding: 16px 0;
}

/* ----------------------------------------------------------------------------
   13. Back-to-top button — modern circular
   ------------------------------------------------------------------------- */
.backToTop {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cai-blue) !important;
    box-shadow: 0 6px 18px rgba(0, 65, 145, 0.35);
    text-indent: 0;
    font-size: 0;                  /* collapse the legacy "back to top" text */
    color: transparent;
    display: none;
    align-items: center;
    justify-content: center;
}
.backToTop::before {
    /* Font Awesome is loaded as the JS/SVG framework, so there is no icon
       webfont for a glyph-based ::before to use. Draw the chevron as an
       inline SVG instead — no font dependency. */
    content: "";
    /* main.js shows the button via jQuery fadeIn(), which sets display:block,
       so flex centring on the parent never applies — centre absolutely. */
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 15l7-7 7 7'/></svg>") center / contain no-repeat;
}

/* ----------------------------------------------------------------------------
   14. Responsive refinements
   ------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .person-feature {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }
    .person-feature .personpic {
        width: 130px;
        height: auto;
    }
    .spotlight-item > a {
        grid-template-columns: 100px 1fr;
        gap: 12px;
    }
    .people-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   PART 2 — consistency across the remaining page types
   ============================================================================ */

/* ----------------------------------------------------------------------------
   15. Content-frame card — used to frame prose / list / detail pages so every
       secondary page sits in the same surface as the homepage cards.
   ------------------------------------------------------------------------- */
.container.content-card {
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--cai-line);
    border-radius: var(--cai-radius);
    box-shadow: none;
    padding: 30px 30px 15px;
}
.container.content-card > h3:first-child,
.container.content-card > p:first-child {
    margin-top: 0;
}
/* YouTube / video embeds inside content become responsive */
.container.content-card iframe[src*="youtube"],
.section .container iframe[src*="youtube"] {
    width: 100%;
    max-width: 680px;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
    margin: 18px auto;
    border: 0;
    border-radius: var(--cai-radius);
    box-shadow: none;
}

/* List-style pages (Datasets, Software, Workshops) — render the hr-separated
   <h2> blocks as a clean, scannable list inside the content card. */
.container.content-card h2 {
    color: var(--cai-ink);
    margin: 0 0 4px;
    line-height: 1.35;
}
.container.content-card h2 a {
    color: var(--cai-blue);
}
.container.content-card h2 a:hover {
    color: var(--cai-blue);
    text-decoration: underline;
}
/* the venue sub-heading is marked up as <h2 style="font-size:100%"> */
.container.content-card h2[style*="font-size"] {
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cai-blue-2);
    margin: 0 0 8px;
}
.container.content-card hr {
    margin: 20px 0;
}
.container.content-card ul {
    padding-left: 20px;
}
.container.content-card li {
    margin-bottom: 1px;
}

/* ----------------------------------------------------------------------------
   16. News listing — responsive card grid (reuses the .news_item card)
   ------------------------------------------------------------------------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-left: 0;
}
/* .row carries clearfix ::before/::after pseudos — they'd otherwise occupy the
   first grid cell and shove the opening card into column 2. */
.news-grid::before,
.news-grid::after {
    content: none;
    display: none;
}
.news-grid .news_item {
    width: 100%;
    padding: 0;
}

/* ----------------------------------------------------------------------------
   17. Open Projects — Shuffle.js grid as cards + styled filter pills
       (item box height stays fixed so Shuffle's layout maths is untouched)
   ------------------------------------------------------------------------- */
figure.picture-item {
    border: 0 !important;
    /* Vertical gutter between rows. main_v2.css meant to set this via an
       uncompiled SCSS variable ($picture-gutter), so it was effectively 0 and
       row borders touched. Shuffle includes margins when it measures items,
       so this becomes real spacing in its absolute layout. */
    margin-bottom: 28px;
}
/* The grid container clips overflow (main_v2.css); release it so the top
   row's hover lift and shadow aren't cut off. Shuffle hides filtered-out
   items with visibility:hidden, so nothing stray becomes visible. */
.my-shuffle-container {
    overflow: visible;
}
/* Same hover as the news carousel card (.news_item > a): lift 4px + shadow. */
.picture-item__inner {
    background: #fff !important;
    border: 1px solid var(--cai-line);
    border-radius: var(--cai-radius);
    box-shadow: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.picture-item__inner:hover {
    transform: translateY(-4px);
    box-shadow: var(--cai-shadow-lift);
}
.picture-item__title {
    line-height: 1.38;
    color: #2c343d;
}
/* The whole card is wrapped in one link (a.picture-item__link); the title and
   supervisor are plain text inside it. Inherit colour and never underline, so
   the card's lift/shadow is the only hover feedback. */
.picture-item__link,
.picture-item__link:hover,
.picture-item__link:focus,
.picture-item__link:active {
    display: block;
    color: inherit;
    text-decoration: none;
}
.picture-item__title i {
    color: var(--cai-blue-2);
}

/* Filter buttons -> pills.
   NOTE: the filter markup leaves several <div>s unclosed, so .filter-options is
   actually an ancestor of the #grid shuffle container — do NOT set display on
   it or the grid layout collapses. Style the buttons inline instead. */
.filter-options .btn {
    display: inline-block;
    background: #fff;
    border: 1px solid var(--cai-line);
    border-radius: 999px;
    padding: 6px 15px;
    margin: 0 6px 8px 0;
    color: var(--cai-blue);
    cursor: pointer;
    transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}
/* main_v2's .btn-group .btn:first-child / :last-child give the outer buttons
   3px corners on one side only; keep every button a full pill. */
.btn-group .btn:first-child,
.btn-group .btn:last-child,
.btn-group .btn:not(:first-child),
.btn-group .btn {
    border-radius: 999px;
}
.filter-options .btn:hover {
    background: var(--cai-soft);
    border-color: var(--cai-blue-light);
}
.filter-options .btn.active {
    background: var(--cai-blue);
    border-color: var(--cai-blue);
    color: #fff;
}

/* ----------------------------------------------------------------------------
   18. Person detail page — render the standalone bio block as a feature card
       (listing-page leadership already carries .person-feature, so this
       :not() selector targets only the bio header on /people/<slug>/)
   ------------------------------------------------------------------------- */
.content .section > .container > .person:not(.person-feature) {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--cai-line);
    border-radius: var(--cai-radius);
    box-shadow: none;
    padding: 22px 26px;
    margin-bottom: 20px;
}
.content .section > .container > .person:not(.person-feature) .personpic {
    float: none;
    width: 150px;
    height: auto;          /* keep the photo's own aspect ratio — no cropping */
    object-fit: contain;
    border-radius: 14px;
    margin: 0;
    flex: 0 0 auto;
}
/* Person pages: the outer .container is raw HTML inside each _people/*.md, so
   opt the biography out of the reading-measure cap here instead of adding
   .prose-full to every file. */
.section > .container:has(> .person) > p,
.section > .container:has(> .person) > div > p {
    max-width: none;
}
.content .section > .container > .person:not(.person-feature) .personinfo {
    float: none;
    flex: 1 1 auto;
    min-width: 0;
}
/* Optional third column in the person card for funder / fellowship logos
   (used on /people/bulling/). Stacked, right-aligned, kept small. */
.person-logos {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}
.person-logos img {
    display: block;
    height: 130px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    object-position: right center;
    margin: 0;
}
.person-logos a {
    display: block;
    line-height: 0;
}
/* ERC and Marie Curie share a row; the wide Humboldt mark sits beneath. */
.person-logos-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

/* ----------------------------------------------------------------------------
   19. News detail page — image floated left, meta beside it, indented
       publications, and a three-column pager that never wraps
   ------------------------------------------------------------------------- */
.news_image {
    float: left;
    width: 25vw;
    max-width: 380px;
    height: auto;
    max-height: none;
    object-fit: cover;
    border-radius: var(--cai-radius);
    margin: 4px 28px 16px 0;
}
/* Title and meta sit beside the floated image; overflow:hidden makes them a
   block-formatting context so they don't extend underneath it (which also
   keeps the title's accent bar under the text rather than under the image). */
h3.news_item_title {
    margin-bottom: 12px;
    overflow: hidden;
}
/* Post meta: a two-column grid — icon | value — so each pair (date, tags)
   gets its own row with the icon inline. */
.content-card > .news_item_text {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    row-gap: 4px;
    align-items: baseline;
    padding: 0;
    overflow: hidden;
}
.content-card > .news_item_text dt,
.content-card > .news_item_text dd {
    float: none;
    margin: 0;
    line-height: 1.6;
    letter-spacing: normal;
    text-transform: none;
    color: var(--cai-text);
}
.content-card > .news_item_text dt {
    color: var(--cai-blue-2);
}
/* Publications listed in a post are indented under the announcement text. */
.news-pubs {
    margin-left: 40px;
}
.news-pubs > div:last-child {
    margin-bottom: 10px;
}
/* Pager: newer | all | older on one row, long titles ellipsised. */
.PageNavigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    width: 100%;
    margin: 0;
    overflow: visible;
}
.PageNavigation .next,
.PageNavigation .center,
.PageNavigation .prev {
    float: none;
    width: auto;
    height: auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.PageNavigation .next  { text-align: left; }
.PageNavigation .center { text-align: center; }
.PageNavigation .prev  { text-align: right; grid-column: 3; }
/* ----------------------------------------------------------------------------
   20. Mobile refinements for part 2
   ------------------------------------------------------------------------- */
@media (max-width: 767px) {
    /* Person card logos: a centred row beneath the info on phones. */
    .person-logos {
        margin-left: 0;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 18px;
        width: 100%;
        padding-bottom: 18px;
    }
    .person-logos img {
        height: 60px;
        width: auto;
        max-width: 140px;
        object-position: center;
    }
    /* News post: image becomes a full-width header, pager stacks. */
    .news_image {
        float: none;
        width: 100%;
        max-width: none;
        margin: 0 0 16px;
    }
    .news-pubs {
        margin-left: 0;
    }
    .PageNavigation {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .PageNavigation .next,
    .PageNavigation .center,
    .PageNavigation .prev {
        text-align: left;
        grid-column: auto;
        white-space: normal;
    }
    .content .section > .container > .person:not(.person-feature) {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }
    .content .section > .container > .person:not(.person-feature) .personpic {
        width: 130px;
        height: 130px;
    }
    .container.content-card {
        padding: 22px 20px;
    }
}

/* ----------------------------------------------------------------------------
   21. Publication detail pages — frameless layout + wrapping BibTeX
   ------------------------------------------------------------------------- */

/* Drop the card surface so the paper itself is the page, not a panel on it.
   The .content-card class is kept for its inner typography rules (hr rhythm,
   responsive embeds, list spacing) — only the frame is removed. */
/* .content-static: keeps the card frame but opts out of the hover shadow
   (news post pages). */
/* .content-plain: same frame removal for list pages (Software, Datasets,
   Workshops) without the publication-detail type scale that .content-flat
   also carries. */
.container.content-card.content-flat,
.container.content-card.content-plain {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    /* keep .container's own 15px side gutter so text never touches the
       viewport edge on small screens; only the card's inset is dropped. */
    padding: 0 15px;
}

/* Without a surrounding frame the rules become the structure, so they carry
   a little more air and sit lighter. */
.container.content-card.content-flat hr,
.container.content-card.content-plain hr {
    margin: 26px 0 18px;
    border: 0;
    border-top: 1px solid var(--cai-line);
}

/* Paper title */
.container.content-card.content-flat > h3 {
    line-height: 1.25;
}

/* Authors, venue line, and the Abstract / Links / BibTeX section headings —
   all marked up as <h4>. */
.container.content-card.content-flat > h4 {
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
    color: var(--cai-ink);
    margin: 0 0 12px;
}

/* Body copy: abstract, link rows, acknowledgements. */
.container.content-card.content-flat,
.container.content-card.content-flat p,
.container.content-card.content-flat div,
.container.content-card.content-flat li {
    line-height: 1.7;
}

/* BibTeX: wrap instead of overflowing. `pre-wrap` keeps the entry's own line
   breaks and indentation, while `overflow-wrap: anywhere` breaks the long
   unbroken strings (abstracts, DOIs, URLs) that used to force a scrollbar. */
.pub_bibtex {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
    tab-size: 2;
    line-height: 1.6;
    padding: 16px 18px;
    margin: 0;
    max-width: 100%;
    overflow-x: auto;
}

/* Inside a frameless page a bordered box reads as clutter; a soft fill marks
   the code block just as clearly. */
.content-flat .pub_bibtex {
    background: var(--cai-soft);
    border: 0;
    border-radius: 10px;
}
.content-flat .pub_links {
    border: 0;
    margin-top: 0;
}

@media (max-width: 767px) {
    .container.content-card.content-flat {
        padding: 0 15px;
    }
    .pub_bibtex {
        padding: 13px 14px;
    }
}

/* Long URLs in the Links list (Paper Access, Code, Dataset…) have no natural
   break opportunity and used to run past the page edge on narrow screens. */
.pub_links p,
.pub_links div {
    overflow-wrap: anywhere;
    min-width: 0;
}
.pub_links a {
    overflow-wrap: anywhere;
}

/* ----------------------------------------------------------------------------
   22. Shadows only on hover — every content surface is flat at rest and gains
       elevation when pointed at. (Cards with their own :hover rules above —
       news, people grid, project cards, .card-surface — already lift.
       Video embeds / .media-frame deliberately stay flat.)
   ------------------------------------------------------------------------- */
.container.content-card {
    transition: box-shadow 0.18s ease;
}
.container.content-card:not(.content-flat):not(.content-plain):not(.content-static):hover {
    box-shadow: var(--cai-shadow-lift);
}

/* ----------------------------------------------------------------------------
   23. Person cards — one consistent info rhythm for leadership cards, the
       postdoc/PhD grid, and the detail-page header. Replaces the legacy
       "span shifted up -5px next to an inline icon" hack, which each card
       type overrode with different numbers.
   ------------------------------------------------------------------------- */
.person .personinfo h3,
.person .personinfo h4 {
    margin: 0 0 10px;          /* clear gap between name and affiliation */
    line-height: 1.25;
}
.person .personinfo p {
    margin: 0 0 12px;
    line-height: 1.55;
}
.person .personinfo p:last-child {
    margin-bottom: 0;
}
/* Contact rows: the <p> holds icon/text pairs — lay them out as a two-column
   grid so every row aligns the same way regardless of icon width. */
.person .personinfo p:has(> span) {
    display: grid;
    grid-template-columns: 18px 1fr;
    column-gap: 10px;
    row-gap: 6px;
    align-items: baseline;
}
.person .personinfo p:has(> span) > span {
    display: block;
    position: static;          /* undo legacy top:-5px */
    margin: 0;
    word-break: break-word;
}
.person .personinfo p:has(> span) > .fa,
.person .personinfo p:has(> span) > svg {
    justify-self: center;
    color: var(--cai-blue-2);
    font-size: 14px;
}

/* ----------------------------------------------------------------------------
   24. Person page — the Publications block is a separate <section> appended
       after the person's own markdown section, which ends with an <hr>. Strip
       the section padding/margins so the gap matches the other subsections
       (just the <hr>'s own margin).
   ------------------------------------------------------------------------- */
.section.person-pubs {
    padding-top: 0;
}
.section:has(+ .section.person-pubs) {
    margin-bottom: 0 !important;
}

/* ----------------------------------------------------------------------------
   25. Publications page — the YEAR is the primary divider (bold, blue accent
       bar, generous space above); the publication TYPE is a quieter
       sub-label beneath it. main_v2.css had this the other way round.
   ------------------------------------------------------------------------- */
h2.bibliography {
    color: var(--cai-ink);
    line-height: 1.2;
    letter-spacing: -0.01em;
    position: relative;
    padding-bottom: 12px;
    margin: 56px 0 22px;
}
h2.bibliography::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 54px;
    height: 3px;
    border-radius: 3px;
    background: var(--cai-blue);
}
h2.bibliography:first-child {
    margin-top: 0;
}
h3.bibliography {
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cai-blue-2);
    line-height: 1.3;
    padding-bottom: 0;
    margin: 30px 0 14px;
}
h2.bibliography + h3.bibliography {
    margin-top: 0;
}
/* the global section-heading accent must not apply to the type label */
.content .section > .container > h3.bibliography::after {
    display: none;
}

/* ----------------------------------------------------------------------------
   26. Mobile navigation — hamburger placement and click-opened dropdown.
       (Bootstrap JS is not loaded; main.js toggles .collapse / .open.)
   ------------------------------------------------------------------------- */
@media (max-width: 991px) {
    /* Submenu opened by tap (main.js adds .open). Desktop keeps :hover. */
    #mainNav > li.dropdown.open > .dropdown-menu {
        display: block;
    }
    /* caret so the parent reads as expandable */
    #mainNav > li.dropdown > a::after {
        content: "";
        display: inline-block;
        width: 0.45em;
        height: 0.45em;
        margin-left: 0.5em;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-0.2em) rotate(45deg);
        transition: transform 0.15s ease;
    }
    #mainNav > li.dropdown.open > a::after {
        transform: translateY(0.1em) rotate(-135deg);
    }
}

@media (max-width: 767px) {
    .header-lower {
        position: relative;
        height: 48px;
    }
    /* Hamburger: fixed-size tap target, vertically centred at the right. */
    .navbar-toggler {
        float: none;
        position: absolute;
        top: 2px;              /* (48px bar - 44px button) / 2 — fixed px, since
                                  the containing block grows when the menu opens */
        right: 12px;
        width: 44px;
        height: 44px;
        padding: 0;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #fff;
        line-height: 1;
        cursor: pointer;
        z-index: 3;
    }
    .navbar-toggler[aria-expanded="true"] {
        background: rgba(255, 255, 255, 0.14);
    }
    .navbar-toggler-icon {
        background: transparent;
        font-size: inherit;
    }
    /* Open menu: full-width panel under the bar, items stacked. */
    .header .navbar-collapse {
        margin-top: 48px;
    }
    .navbar-collapse:not(.collapse) {
        display: block;
        background: var(--cai-blue);
        padding: 6px 0 10px;
    }
    #mainNav {
        float: none;
        margin: 0;
    }
    #mainNav > li {
        float: none;
        display: block;
    }
    #mainNav > li > a {
        display: block;
        padding: 10px 18px;
    }
    /* Submenu sits inline in the stacked list rather than floating. */
    #mainNav > li.dropdown.open > .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin: 0;
        padding: 0 0 6px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.18) !important;
    }
    #mainNav > li.dropdown.open > .dropdown-menu > li > a {
        display: block;
        padding: 9px 18px 9px 34px;
        color: #fff;
    }
}

/* ----------------------------------------------------------------------------
   27. Home page — vertical rhythm in vh so spacing scales with screen height.
       (1vh = 10.8px on a 1080p display; values chosen to match the previous
       pixel spacing there and compress on shorter screens.)
   ------------------------------------------------------------------------- */
@media (min-width: 768px) {
    .section-home {
        padding-top: 2vh;                 /* was 11px */
    }
    .section-home.section-gray {
        padding-top: 1.8vh;                   /* was 22px */
        padding-bottom: 1.8vh;
        margin-bottom: 2vh;              /* was 8px */
    }
    .content > .section-home:last-child {
        padding-bottom: 1.85vh;             /* was 20px */
        margin-bottom: 1.85vh !important;   /* .margin-bottom-20 */
    }
    .section-home .media-frame {
        margin: 0 auto;
    }
    .section-home .owl-carousel .owl-stage-outer {
        padding: 0.55vh 0 1.1vh;            /* was 6px / 12px */
    }
}

/* ----------------------------------------------------------------------------
   28. Phone layout fixes — projects page alignment + footer columns
   ------------------------------------------------------------------------- */
@media (max-width: 767px) {
    /* Open projects: line up title, filter rows and cards on the same 15px
       gutter, and show one full-width card per row instead of a lone 50%
       column. */
    .filters-group-wrap,
    .filters-group-wrap .row,
    .filters-group-wrap .filters-group,
    .filter-options {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }
    /* the two filter rows sit directly under .section (no .container), so
       give them the same 15px gutter as everything else */
    .section > .row:has(.filters-group),
    .container2 {
        padding: 0 15px;
    }
    .section > .row:has(.filters-group) [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
    }
    .my-shuffle-container {
        width: 100%;
        margin: 0;
    }
    #grid .picture-item,
    #grid .my-sizer-element {
        width: 100% !important;
        padding-left: 0;
        padding-right: 0;
    }
    /* Footer: the "about" and "links" columns were hidden on phones
       (hidden-xs); show all three, stacked. */
    .footer-v1 .footer .col-md-3 {
        width: 100%;
        box-sizing: border-box;
        padding-left: 0;        /* legacy 15px/40px padding + width:100% overflowed the viewport */
        padding-right: 0;
        float: none;
        margin-bottom: 28px;
    }
    .footer-v1 .footer .col-md-3:last-child {
        margin-bottom: 0;
    }
}

/* ----------------------------------------------------------------------------
   29. Open-project detail pages — arrangement only (no type/colour changes).
       The template splits each project file into title / main text / image +
       facts / literature; these rules lay those parts out.
   ------------------------------------------------------------------------- */
.project-page h1 {
    margin-bottom: 26px;
}
.project-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 36px 48px;
    align-items: start;
}
.project-main > p:first-child {
    margin-top: 0;
}
.project-main ul {
    padding-left: 22px;
}
.project-aside img {
    display: block;
    width: 100%;
    height: auto;
    float: none;
    padding: 0;
    margin: 0;
    border-radius: var(--cai-radius);
}
.project-facts {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--cai-line);
}
.project-fact {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 4px 12px;
    padding: 8px 0;
}
.project-fact + .project-fact {
    border-top: 1px solid var(--cai-line);
}
.project-fact > div {
    overflow-wrap: anywhere;
}
.project-literature {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--cai-line);
}
.project-literature > p {
    margin-bottom: 10px;
}
/* reference entries: hanging indent so the [n] markers line up */
.project-refs > p {
    margin: 0 0 8px;
    padding-left: 2.6em;
    text-indent: -2.6em;
}
@media (max-width: 991px) {
    .project-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .project-aside {
        order: -1;              /* image + facts first on narrow screens */
    }
    .project-aside img {
        max-width: 480px;
    }
}

/* ----------------------------------------------------------------------------
   30. Dataset / software detail pages — two-column arrangement: the page's
       own documentation on the left, an aside with downloads, contact and
       citation on the right. Type and colours unchanged.
   ------------------------------------------------------------------------- */
.detail-page .detail-title {
    margin-bottom: 26px;
}
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 36px 48px;
    align-items: start;
}
.detail-layout--single {
    grid-template-columns: minmax(0, 1fr);
}
/* the files carry their own .section/.container wrappers — neutralise them
   inside the main column so they don't re-impose the fixed page width */
.detail-main .section {
    padding-top: 0;
}
.detail-main .container {
    width: auto;
    max-width: none;
    padding: 0;
}
/* the site-wide 72ch reading measure targets .section > .container > p, which
   the files' own wrappers re-create inside the column — lift it here so the
   text fills the main column */
.detail-main .section > .container > p,
.detail-main .section > .container > div > p,
.detail-main > p {
    max-width: none;
}
.detail-main {
    min-width: 0;
    overflow-wrap: anywhere;   /* long raw URLs in the text must not widen the column */
}
.detail-main img {
    max-width: 100%;
    height: auto;
}
.detail-main iframe {
    max-width: 100%;
}
.detail-main table {
    max-width: 100%;
}
.detail-aside {
    position: sticky;
    top: 80px;
}
.detail-block {
    padding: 16px 0;
    border-top: 1px solid var(--cai-line);
}
.detail-block:first-child {
    padding-top: 0;
    border-top: 0;
}
.detail-block > p {
    margin: 0 0 8px;
}
.detail-downloads {
    list-style: none;
    padding: 0;
    margin: 0;
}
.detail-downloads li {
    margin: 0 0 6px;
    overflow-wrap: anywhere;
}
/* citation entries in the aside: no thumbnail column, tighter */
.detail-aside .margin-bottom-30 {
    margin-bottom: 14px !important;
}
.detail-aside .thumbnail {
    display: none;
}
@media (max-width: 991px) {
    .detail-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    .detail-aside {
        position: static;
    }
}
