/*
 * DGM conference pages: polish layer for the event element family
 * (exhibition-section and its siblings, everything inside .dgm-ex-root).
 *
 * Additive: it only refines type sizes, spacing, card surfaces and grids of
 * the existing elements. Take the stylesheet out and the pages look as before.
 * CRM widgets are left alone: every rule skips what sits inside a widget.
 *
 * Section 7 is the one part outside the elements: the header buttons and the
 * styles for the menu fit levels that JavaScript/event-menu-fit.js sets.
 * Both files are switched per site with Tools/EventPolish/switch.php.
 *
 * Scale, old to new (px): 9-11 -> 12 | 12-12.5 -> 13 | 13-13.5 -> 15 |
 * 14-14.5 -> 15/16 | 15-15.5 -> 17. Body copy of the new DGM elements is 16,
 * the smallest text there is 12; this brings the conference pages to the same floor.
 */

/* ---------- 1. type floor and scale ---------- */

.dgm-ex-root :is(.text-\[9px\], .text-\[9\.5px\], .text-\[10px\], .text-\[10\.5px\], .text-\[11px\]):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 12px;
    line-height: 1.4;
}
.dgm-ex-root :is(.text-xs, .text-\[12px\], .text-\[12\.5px\]):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 13px;
    line-height: 1.5;
}
.dgm-ex-root :is(.text-\[13px\], .text-\[13\.5px\], .text-sm):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 15px;
}
.dgm-ex-root :is(.text-\[14px\], .text-\[14\.5px\]):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 16px;
}
.dgm-ex-root :is(.text-\[15px\], .text-\[15\.5px\]):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 17px;
}
/* small running text (card descriptions, notes) is prose, not a label: 14 */
.dgm-ex-root :is(p, div):is(.text-xs, .text-\[12px\], .text-\[12\.5px\]):is(.leading-relaxed, .leading-snug):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 14px;
    line-height: 1.55;
}
/* running text keeps a comfortable line height at the new sizes */
.dgm-ex-root :is(.text-\[13px\], .text-\[13\.5px\], .text-sm, .text-\[14\.5px\]).leading-relaxed:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    line-height: 1.6;
}
.dgm-ex-root :is(.text-\[13px\], .text-\[13\.5px\]).leading-snug:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    line-height: 1.45;
}
/* icons that carried a text size keep their optical size */
.dgm-ex-root i[class*="fa-"]:is(.text-\[10px\], .text-\[11px\], .text-\[12px\], .text-xs):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 0.8em;
}
.dgm-ex-root :is(a, button, span) > i[class*="fa-"]:is(.text-\[10px\], .text-\[11px\], .text-\[12px\], .text-xs):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 0.82em;
}
/* wide-tracked capitals: at 12 px the old tracking runs too wide */
.dgm-ex-root .uppercase:is(.tracking-\[0\.24em\], .tracking-\[0\.22em\], .tracking-\[0\.2em\], .tracking-\[0\.18em\], .tracking-\[0\.16em\]):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    letter-spacing: 0.12em;
}

/* ---------- 2. section heads ---------- */

/* pill label above a headline */
.dgm-ex-root span.rounded-full.border.uppercase:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    padding: 0.3rem 0.8rem;
    letter-spacing: 0.08em;
    gap: 0.45rem;
}
.dgm-ex-root h2:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    text-wrap: balance;
}
.dgm-ex-root h2.tracking-tight:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    letter-spacing: -0.025em;
}
/* section headline on sub pages: 20/24 -> 22/28 */
.dgm-ex-root h2.text-xl:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 1.375rem;
    line-height: 1.2;
}
@media (min-width: 640px) {
    .dgm-ex-root h2.text-xl.sm\:text-2xl:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
        font-size: 1.75rem;
    }
}
/* the lead under a headline reads as a lead, not as card text */
.dgm-ex-root header > div.text-sm:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *),
.dgm-ex-root header > h2 + div.text-sm:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 16px;
    line-height: 1.65;
    margin-top: 0.75rem;
}
@media (min-width: 1024px) {
    .dgm-ex-root header div.text-base.leading-relaxed:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
        font-size: 1.0625rem;
        line-height: 1.65;
    }
}

/* ---------- 3. cards and rows ---------- */

/* one shadow for every white card: a hairline and a soft, offset lift */
.dgm-ex-root :is(article, ol, ul, div, a, details).rounded-2xl.border.bg-white:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 10px 28px -18px rgb(15 23 42 / 0.18);
}
.dgm-ex-root a.rounded-2xl.border.bg-white:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *),
.dgm-ex-root article.group.rounded-2xl.border.bg-white:has(a):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    transition: box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.dgm-ex-root a.rounded-2xl.border.bg-white:hover:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *),
.dgm-ex-root article.group.rounded-2xl.border.bg-white:has(a):hover:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgb(15 23 42 / 0.05), 0 18px 36px -20px rgb(15 23 42 / 0.26);
}
/* small fact cards: a little more room */
.dgm-ex-root article.rounded-2xl.p-4:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    padding: 1.25rem;
}
.dgm-ex-root article.rounded-2xl.p-4 > .mt-2\.5:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    margin-top: 0.75rem;
}
.dgm-ex-root article.rounded-2xl.p-4 h3.text-sm:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 16px;
    line-height: 1.3;
}
/* icon tiles 36 -> 40 */
.dgm-ex-root .h-9.w-9.rounded-lg:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
}
/* numbered steps */
.dgm-ex-root ol.rounded-2xl > li.grid:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    grid-template-columns: 34px 1fr;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.dgm-ex-root ol.rounded-2xl > li.grid > .rounded-full:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    width: 34px;
    height: 34px;
}
.dgm-ex-root ol.rounded-2xl.px-5:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
/* link rows */
.dgm-ex-root a.rounded-xl.border.bg-white.px-4.py-3:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    padding: 0.95rem 1.15rem;
    border-radius: 0.875rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
    transition: box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.dgm-ex-root a.rounded-xl.border.bg-white.px-4.py-3:hover:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    transform: translateY(-1px);
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 12px 24px -16px rgb(15 23 42 / 0.22);
}
.dgm-ex-root .grid.gap-2:has(> a.rounded-xl.border):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    gap: 0.75rem;
}
/* buttons inside the elements */
.dgm-ex-root a.rounded-lg:is(.px-3\.5, .px-4).text-\[13px\]:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 14.5px;
    padding: 0.65rem 1.1rem;
}

/* ---------- 3b. a headline stays with its block ---------- */

/* The space above a section head has to be clearly larger than the space below it, or the
   headline floats between two blocks. The first head of a page (the page title) is left alone. */

/* section head on sub pages: label, headline, lead */
.dgm-ex-root header.mb-5:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    margin-bottom: 1.25rem;
}
#crm__widgets > * ~ .dgm-ex-root header.mb-5:has(h2),
#crm__widgets > * ~ * > .dgm-ex-root header.mb-5:has(h2) {
    padding-top: 1.25rem;
}
/* large left-aligned headline in the middle of a page */
#crm__widgets > * ~ .dgm-ex-root header.text-left.mb-8:has(h2),
#crm__widgets > * ~ * > .dgm-ex-root header.text-left.mb-8:has(h2) {
    padding-top: 2rem;
    margin-bottom: 1.25rem;
}
@media (min-width: 1024px) {
    #crm__widgets > * ~ .dgm-ex-root header.mb-5:has(h2),
    #crm__widgets > * ~ * > .dgm-ex-root header.mb-5:has(h2) {
        padding-top: 1.75rem;
    }
    #crm__widgets > * ~ .dgm-ex-root header.text-left.mb-8:has(h2),
    #crm__widgets > * ~ * > .dgm-ex-root header.text-left.mb-8:has(h2) {
        padding-top: 2.75rem;
        margin-bottom: 1.5rem;
    }
}
/* the topic grid brings its own space above the cards: the head must not add a second one */
.dgm-ex-root header:has(+ div .event-session-type-topic-grid) {
    margin-bottom: 0;
}
/* on phones the topic head needs more air above than the grid leaves below it */
@media (max-width: 639px) {
    .dgm-ex-root header:has(+ div .event-session-type-topic-grid) {
        padding-top: 1.5rem;
    }
}
/* a centred section head directly under a widget (exhibitor logos) has no space of its own above */
.custom-compiled-plugin-element + .dgm-ex-root.pt-1 > div > header.text-center:first-child,
custom-compiled-plugin-element + .dgm-ex-root.pt-1 > div > header.text-center:first-child {
    padding-top: 5rem;
}
@media (min-width: 1024px) {
    .custom-compiled-plugin-element + .dgm-ex-root.pt-1 > div > header.text-center:first-child,
    custom-compiled-plugin-element + .dgm-ex-root.pt-1 > div > header.text-center:first-child {
        padding-top: 5.5rem;
    }
}

/* ---------- 4. grids without holes ---------- */

@media (min-width: 1024px) {
    .dgm-ex-root .grid.lg\:grid-cols-4:has(> :nth-child(3):last-child):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *),
    .dgm-ex-root .grid.lg\:grid-cols-4:has(> :nth-child(6):last-child):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .dgm-ex-root .grid.lg\:grid-cols-4:has(> :nth-child(2):last-child):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *),
    .dgm-ex-root .grid.lg\:grid-cols-3:has(> :nth-child(2):last-child):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *),
    .dgm-ex-root .grid.lg\:grid-cols-3:has(> :nth-child(4):last-child):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *),
    /* link rows read in one line each: two per row instead of four narrow ones */
    .dgm-ex-root .grid.lg\:grid-cols-4:has(> a.rounded-xl.border):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- 5. browser surfaces ---------- */

.dgm-ex-root :is(a, button, summary):focus-visible:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 0.5rem;
}
.dgm-ex-root :is(p, li) > a:not([class]):not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}

@media (prefers-reduced-motion: reduce) {
    .dgm-ex-root :is(a, article) {
        transition: none !important;
    }
    .dgm-ex-root :is(a, article):hover {
        transform: none !important;
    }
}

/* ---------- 7. header: buttons, and a menu that fits its length ---------- */

@media (min-width: 1280px) {
    /* the three buttons on the right: one line each, one height */
    .dgm-page-shell .mainmenu.js-vue-menu-scope > .container > .flex > nav + div > a,
    .dgm-page-shell .mainmenu.js-vue-menu-scope > .container > .flex > nav + div #options-menu {
        white-space: nowrap;
        min-height: 2rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope > .container > .flex > nav + div > a {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope > .container > .flex > nav + div #options-menu {
        font-size: 0.8125rem;
    }
}

/* language button over a dark hero: same glass as the login button next to it, not the
   site's primary colour (a dark primary was unreadable there) */
.dgm-page-shell--fullscreen-hero:not(.dgm-page-shell--fullscreen-hero-dark) .dgm-mainmenu-overlay-actions #options-menu {
    border-color: color-mix(in oklab, #fff 18%, transparent);
    background: color-mix(in oklab, var(--primary-500, var(--primary, #40834d)) 28%, transparent);
    color: #fff;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 24px rgb(0 0 0 / 0.18);
    transition: background-color 0.22s ease, border-color 0.22s ease;
}
.dgm-page-shell--fullscreen-hero:not(.dgm-page-shell--fullscreen-hero-dark) .dgm-mainmenu-overlay-actions #options-menu:is(:hover, :focus-visible) {
    border-color: color-mix(in oklab, #fff 30%, transparent);
    background: color-mix(in oklab, var(--primary-500, var(--primary, #40834d)) 42%, transparent);
    color: #fff;
}

/* The fit levels are set by event-menu-fit.js (data-mm-fit on the menu). Without the script
   nothing below applies and the header is as before.
   Spacing between the cells comes from margin-inline-end on every child but the last. */
@media (min-width: 1280px) {
    /* measured mode: no cell gives way below its content, so the row shows honestly whether it fits */
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit] > .container > .flex > nav {
        flex: 0 0 auto;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit] > .container > .flex > nav a {
        white-space: nowrap;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit] > .container > .flex > :first-child,
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit] > .container > .flex > nav + div {
        min-width: max-content;
    }
    /* the logo is drawn at its set height; before, a narrow cell squeezed a wide logo down to half */
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit] > .container > .flex > :first-child img {
        max-width: none;
        width: auto;
    }
    /* the logo starts on the same line as the page content, not at the window edge */
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit] > .container {
        padding-left: 1.5rem;
    }

    /* level 1: tighter spacing */
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="1"] > .container > .flex > :not(:last-child) {
        margin-inline-end: 1.5rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="1"] > .container > .flex > nav > div > a {
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="1"] > .container > .flex > nav + div > :not(:last-child) {
        margin-inline-end: 0.5rem;
    }

    /* from level 1 on the header may use the whole window width, so the type shrinks as late as possible */
    .dgm-page-shell .mainmenu.js-vue-menu-scope:is([data-mm-fit="1"], [data-mm-fit="2"], [data-mm-fit="3"]) > .container {
        max-width: none;
    }

    /* levels 2 and 3: tighter still, type and logo one step smaller */
    .dgm-page-shell .mainmenu.js-vue-menu-scope:is([data-mm-fit="2"], [data-mm-fit="3"]) > .container > .flex > :not(:last-child) {
        margin-inline-end: 1rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope:is([data-mm-fit="2"], [data-mm-fit="3"]) > .container > .flex > nav > :not(:last-child) {
        margin-inline-end: 0;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope:is([data-mm-fit="2"], [data-mm-fit="3"]) > .container > .flex > nav > div > a {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
        font-size: 0.8125rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope:is([data-mm-fit="2"], [data-mm-fit="3"]) > .container > .flex > nav > div > a > i {
        width: 0.6rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope:is([data-mm-fit="2"], [data-mm-fit="3"]) > .container > .flex > nav + div > :not(:last-child) {
        margin-inline-end: 0.375rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="2"] #logo img,
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="2"] > .container > .flex > :first-child img {
        height: 1.5rem !important;
    }

    /* level 3: the small arrows behind the entries go, the logo one more step */
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="3"] > .container > .flex > nav > div > a > i {
        display: none;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="3"] > .container > .flex > nav > div > a {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="3"] #logo img,
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="3"] > .container > .flex > :first-child img {
        height: 1.375rem !important;
    }

    /* level 4: not even that fits: hamburger menu, as on tablets */
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="4"] > .container > .flex {
        justify-content: space-between;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="4"] > .container > .flex > nav,
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="4"] > .container > .flex > nav + div {
        display: none;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="4"] > .container > .flex > .xl\:hidden {
        display: block;
    }
    html[data-dgm-mm-fit="4"] .dgm-mainmenu-mobile.xl\:hidden {
        display: block;
    }
}
@media (min-width: 1536px) {
    /* from 1536 px the menu type is 16 px: step down from there */
    .dgm-page-shell .mainmenu.js-vue-menu-scope[data-mm-fit="1"] > .container > .flex > nav > div > a {
        font-size: 0.9375rem;
    }
    .dgm-page-shell .mainmenu.js-vue-menu-scope:is([data-mm-fit="2"], [data-mm-fit="3"]) > .container > .flex > nav > div > a {
        font-size: 0.875rem;
    }
}

/* ---------- 8. header row below 1280 px ---------- */

/* Below 1280 px (hamburger header) the header row is a breakpoint-capped container: logo and menu button
   jumped between the window edge (0 to 8 px at 390, 768 and 1024 px) and up to 150 px inside (at 1023 and
   1279 px), while the hero and the page content always start 24 px from the edge. Full width with the same
   24 px gutter instead, as it already is from 1280 px up. */
@media (max-width: 1279.98px) {
    .dgm-page-shell .mainmenu.js-vue-menu-scope > .container {
        max-width: none;
        padding-left: 1rem;      /* plus the 8 px of the logo cell: 24 px */
        padding-right: 1.5rem;   /* the menu button's icon then ends 24 px from the edge */
    }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
    .dgm-page-shell .mainmenu.js-vue-menu-scope > .container {
        padding-left: 1.5rem;    /* from 1024 px the logo cell has no padding of its own */
    }
}

/* ---------- 9. older elements that pushed the page sideways ---------- */

/* Image grid (older element, template ContentElements/ImageGrid.html): the tile row has a negative margin for
   its gutters, but its container has no side padding, so the row was 8 px (phones) to 16 px wider than the
   window and the whole page could be pushed sideways (MSE 2026 home). Keep the row inside its container. */
#crm__widgets section > .container.px-0 > .flex.flex-wrap.-m-1 {
    margin-left: 0;
    margin-right: 0;
}

/* ---------- 10. home page modules (sections below the hero) ---------- */

/*
 * DGM conference HOME pages: polish overlay, loads after event-polish.css.
 *
 * Covers everything from the first block under the hero down to the footer.
 * The heroes are not touched here. CRM widgets (.custom-compiled-plugin-element)
 * are never styled inside; only the space around them.
 *
 * Home-only rules are scoped to the start pages: the full-screen hero shell
 * (.dgm-page-shell--fullscreen-hero), or a page whose widget area opens with an
 * event hero section (home pages without that shell, e.g. MSE Research Data Forum). Rules for single
 * elements (news cards, venue card, process panel, footer) also apply on sub
 * pages that use the same element, on purpose: same element, same look.
 *
 * Order follows the page: 0 tokens, 1 rhythm, 2 recent updates, 3 small section
 * labels (exhibitors), 4 scope cards, 5 topics head, 6 process panel, 7 venue,
 * 8 event strip, newsletter and footer.
 */

/* ---------- 0. tokens ---------- */

.dgm-page-shell {
    /* one vertical rhythm for the home pages: free space between two modules */
    --home-gap: 5rem;          /* phones: 80 */
    --home-first: 3.5rem;      /* first block under the hero */
    --home-card-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 10px 28px -18px rgb(15 23 42 / 0.18);
    --home-card-shadow-hover: 0 2px 4px rgb(15 23 42 / 0.05), 0 18px 36px -20px rgb(15 23 42 / 0.26);
    --home-hairline: var(--color-border, rgb(15 23 42 / 0.1));
    --home-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 640px) {
    .dgm-page-shell {
        --home-gap: 6rem;
        --home-first: 4rem;
    }
}
@media (min-width: 1024px) {
    .dgm-page-shell {
        --home-gap: 8rem;      /* desktop: 128 */
        --home-first: 4.5rem;
    }
}

/* ---------- 1. one vertical rhythm on the home pages ---------- */

/* Every module is separated by --home-gap (128 desktop, 96 tablet, 80 phone), measured from
   the last visible content of one module to the first of the next. Sections only carry space
   above themselves; the space below is zero, so two paddings never add up.
   Before: 128 to 200 px on desktop, depending on which section followed which. */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > section.dgm-ex-root,
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > .dgm-ce-space > section.dgm-ex-root {
    padding-top: var(--home-gap);
    padding-bottom: 0;
}
/* No tinted band on the home pages: the "light-gray" theme (bg-muted/30) was only 1-2 RGB steps
   off the page colour, so it read as a smudge, not as a surface. The scope cards are the surface. */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets section.dgm-ex-root.bg-muted\/30 {
    background-color: transparent;
}
/* an html frame at the end of a section brought 32 px of frame margin into the gap below */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets section.dgm-ex-root > div > div.mx-auto > .frame:last-child {
    margin-bottom: 0;
}
/* the first block under the hero sits a little closer to it */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > section.dgm-ex-root:has(.news-list) {
    padding-top: var(--home-first);
}
/* wrappers of single elements add their own small margins: the rhythm owns that space now */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > .dgm-ce-space:has(> section.dgm-ex-root) {
    margin-top: 0;
    margin-bottom: 0;
}
/* the CRM topic grid ends with 40 px of its own padding: the next section takes that off */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > section.dgm-ex-root:has(.event-session-type-topic-grid) + section.dgm-ex-root,
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > section.dgm-ex-root:has(.event-session-type-topic-grid) + .dgm-ce-space > section.dgm-ex-root {
    padding-top: calc(var(--home-gap) - 2.5rem);
}
/* an EMPTY topic grid (no cards rendered, CellMAT) still keeps its 40 + 40 px of padding: the next
   section takes off both, so the head over it and the head after it keep the gap */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > section.dgm-ex-root:has(.event-session-type-topic-grid):not(:has(.event-session-type-topic-grid .grid > *)) + section.dgm-ex-root,
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > section.dgm-ex-root:has(.event-session-type-topic-grid):not(:has(.event-session-type-topic-grid .grid > *)) + .dgm-ce-space > section.dgm-ex-root {
    padding-top: calc(var(--home-gap) - 5rem);
}
/* event-polish 3b gives these heads their own padding on sub pages; on the home pages the
   section padding above already carries the rhythm (supersedes 3b "topic head on phones" and
   "centred section head directly under a widget" for home pages only) */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets .dgm-ex-root header:has(+ div .event-session-type-topic-grid),
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) :is(.custom-compiled-plugin-element, custom-compiled-plugin-element) + .dgm-ex-root.pt-1 > div > header.text-center:first-child {
    padding-top: 0;
}
/* a logo widget straight under the news cards without a head of its own (CellMAT media partner)
   touched the cards once the section paddings were gone: half a gap, it belongs to the block above */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > section.dgm-ex-root + :is(custom-compiled-plugin-element, .custom-compiled-plugin-element) {
    margin-top: calc(var(--home-gap) / 2);
}
/* a plain content element straight after an element section (BdT: the "Gefördert durch" funding
   logo under "Veranstalter & Förderung") touched the cards once the section bottom padding was gone:
   half a gap, it belongs to the section above */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > :is(section.dgm-ex-root, .dgm-ce-space:has(> section.dgm-ex-root)) + .frame {
    margin-top: calc(var(--home-gap) / 2);
}
/* a section that is only a head (BdT "Biologisierung trifft auf Medizintechnik": label, headline,
   lead, and an empty card grid) kept the head's bottom margin (28 / 40 px) as extra space before
   the next section: the empty grid takes it back (it has no height of its own) */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets section.dgm-ex-root > div > header:last-child {
    margin-bottom: 0;
}
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets section.dgm-ex-root > div > header.mb-7 + .dgm-ex-card-grid:not(:has(> *)) {
    margin-top: -1.75rem;
}
@media (min-width: 640px) {
    :is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets section.dgm-ex-root > div > header.mb-7 + .dgm-ex-card-grid:not(:has(> *)) {
        margin-top: -2.5rem;
    }
}
/* a head that opens its section starts at the section padding (the scope head carried 32 px more) */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets section.dgm-ex-root > div > header:first-child {
    margin-top: 0;
}
/* the old page-html news block (section.pb-6 with an h2 label) right under the hero had no space
   above its label (8 px): it gets the same distance as the element version */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > :is(section[class*="hero"], section[class*="hero"] + span.ce-anchor) + .frame-type-html > section.pb-6:has(.news-list):first-child {
    padding-top: var(--home-first);
}
/* an old news list (TYPO3 news plugin in a container, MSE Research Data Forum) brought its frame's
   32 px bottom margin and its list wrapper's 16 px (mb-4) into the gap before the next element section */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > div.container:has(+ section.dgm-ex-root) > .frame:last-child {
    margin-bottom: 0;
}
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > div.container:has(+ section.dgm-ex-root) > .frame[class*="frame-type-news"]:last-child > div > div.mb-4:last-child {
    margin-bottom: 0;
}
/* an old news wrapper inside the element (section#news.pb-6, LightMAT) added 24 px below the cards */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets .dgm-ex-root .frame > section.pb-6:has(.news-list) {
    padding-bottom: 0;
}
/* the page ends with the same gap before the footer (it collapses with the 32 px margin of the
   widget area, so the larger of the two is the gap) */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) footer:has(.dgm-footer-nav) {
    margin-top: var(--home-gap);
}

/* a long label wraps on phones ("How a DGM conference comes together"): as a flex box the icon
   then stood alone at the left edge of a full-width pill. Inline flow keeps icon and words together,
   centred, with balanced lines. Meant for every element head on the conference sites, not only the
   home pages: it is the same element everywhere, and a one-line pill looks the same as before. */
@media (max-width: 639px) {
    .dgm-ex-root header > span.rounded-full.border.uppercase:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
        display: inline-block;
        max-width: 100%;
        text-align: center;
        text-wrap: balance;
        border-radius: 0.875rem;
    }
    .dgm-ex-root header > span.rounded-full.border.uppercase > i:first-child:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
        margin-right: 0.45rem;
    }
}

/* section heads: label, headline, lead. The scope head used other steps than the rest
   (label to headline 14 instead of 16, headline 24 instead of 30 on phones, 30 instead of 36 on tablets) */
.dgm-ex-root header > span.rounded-full + h2.mt-3\.5:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    margin-top: 1rem;
}
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) .dgm-ex-root header h2.text-2xl.sm\:text-3xl.lg\:text-4xl {
    font-size: 1.875rem;
    line-height: 1.2;
}
@media (min-width: 640px) {
    :is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) .dgm-ex-root header h2.text-2xl.sm\:text-3xl.lg\:text-4xl {
        font-size: 2.25rem;
        line-height: 1.15;
    }
}

/* ---------- 2. recent updates (news-list, a webwidget, not a CRM widget) ---------- */

/* the label alone heads this block: it sits close to its cards (56 -> 24) */
.dgm-ex-root header:has(+ div .news-list) {
    margin-bottom: 1.5rem;
}
.dgm-ex-root header:has(+ div .news-list) + div .news-list:not(h2 + .news-list) .grid.mt-4 {
    margin-top: 0;
}
.dgm-ex-root .frame:has(.news-list) {
    /* phones: the html frame added 16 px each side; the news column was 310 instead of 342 px */
    padding-left: 0;
    padding-right: 0;
}
/* the cards: family surface (16 px radius, hairline, offset shadow) instead of the thin 8 px tile */
#crm__widgets .news-list .grid > button.group {
    gap: 1rem;
    padding: 0.875rem 1rem 0.875rem 0.875rem;
    border-radius: 1rem;
    border-color: var(--home-hairline);
    background-color: #fff;
    box-shadow: var(--home-card-shadow);
    transition: box-shadow 220ms var(--home-ease), border-color 220ms var(--home-ease), translate 220ms var(--home-ease);
}
/* hover: a small lift instead of the 105 % zoom (zoom blurred the text and pushed into the neighbours) */
#crm__widgets .news-list .grid > button.group:hover {
    scale: none;
    translate: 0 -2px;
    border-color: color-mix(in oklab, var(--primary, #40834d) 28%, transparent);
    box-shadow: var(--home-card-shadow-hover);
}
/* thumbnails 48 -> 72 px (the source images are 300 px) */
#crm__widgets .news-list .grid > button.group > div.h-12.w-12 {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 0.625rem;
}
#crm__widgets .news-list .grid > button.group > div.h-12.w-12 img {
    transition: scale 400ms var(--home-ease);
}
#crm__widgets .news-list .grid > button.group:hover > div.h-12.w-12 img {
    scale: 1.04;
}
/* title: reads as a headline of the card */
#crm__widgets .news-list .grid > button.group > p {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.005em;
    color: rgb(15 23 42);
    transition: color 220ms var(--home-ease);
}
/* on hover the title takes the element's own hover colour again (revert-layer hands it back to
   the CDN utility; labels and accents stay in the site's own colour by the owner's rule) */
#crm__widgets .news-list .grid > button.group:hover > p {
    color: revert-layer;
}
/* four items on a small laptop (1024-1279): two rows of two, the titles had 160 px in four columns */
@media (min-width: 1024px) and (max-width: 1279px) {
    #crm__widgets .news-list .grid.lg\:grid-cols-4:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* three or two news items: no empty fourth column */
@media (min-width: 1024px) {
    #crm__widgets .news-list .grid.lg\:grid-cols-4:has(> :nth-child(3):last-child) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    #crm__widgets .news-list .grid.lg\:grid-cols-4:has(> :nth-child(2):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (prefers-reduced-motion: reduce) {
    #crm__widgets .news-list .grid > button.group,
    #crm__widgets .news-list .grid > button.group img {
        transition: none;
    }
    #crm__widgets .news-list .grid > button.group:hover {
        translate: none;
    }
    #crm__widgets .news-list .grid > button.group:hover img {
        scale: none;
    }
}

/* ---------- 3. small section labels written as an h2 (exhibitors, supporters, old "Recent Updates") ---------- */

/* The element: page HTML writes a section label as h2.text-sm.font-semibold.tracking-wider.uppercase
   in primary-600 (14 px). It appears as "Recent Updates", "Already Confirmed Exhibitors",
   "Confirmed Supporters" and "Everything you need to know about the conference". Every instance in
   the main column takes the pill of the element heads; inside an element (.dgm-ex-root) the element
   head already has its own label, inside a CRM widget nothing is touched. Meant for all pages of the
   conference sites (same element), the sweep covers the sub pages. */
#crm__widgets h2.text-sm.font-semibold.tracking-wider.uppercase:not(.dgm-ex-root *, .custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    display: table;
    width: fit-content; /* the h2 often carries .container (width 100 %) */
    max-width: calc(100% - 3rem);
    padding: 0.3rem 0.8rem;
    border: 1px solid color-mix(in oklab, var(--primary, #40834d) 30%, transparent);
    border-radius: 9999px;
    background: color-mix(in oklab, var(--primary, #40834d) 5%, transparent);
    /* text colour stays the label's own (text-primary-600): the site colour is the owner's choice */
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.08em;
    /* a long label that wraps on phones stays centred in balanced lines */
    text-align: center;
    text-wrap: balance;
}
/* centred where the label was centred (its own text-center or a centred parent) */
#crm__widgets :is(h2.text-center, .text-center > h2).text-sm.font-semibold.tracking-wider.uppercase:not(.dgm-ex-root *, .custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    margin-left: auto;
    margin-right: auto;
}
/* the logo wall is its own module: the rhythm gap above, a head-sized gap below */
:is(.dgm-page-shell--fullscreen-hero, .dgm-page-shell:has(#crm__widgets > section:first-of-type[class*="-hero"])) #crm__widgets > section.dgm-ex-root + .frame-type-html:has(> h2.text-sm.uppercase:first-child) {
    margin-top: var(--home-gap);
    margin-bottom: 1.5rem;
}

/* ---------- 4. scope cards (dgm-ex-card-grid--simple) ---------- */

/* icon tile 48 px with a 16 px glyph looked empty: glyph 20, radius in step with the card */
.dgm-ex-root .dgm-ex-card-grid--simple article > .flex.h-12.w-12:first-child:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    border-radius: 0.75rem;
    font-size: 1.25rem;
}
/* icon, title and text: the title belongs to its text, the icon stands a little apart */
.dgm-ex-root .dgm-ex-card-grid--simple article > .flex.h-12.w-12:first-child + h3:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    margin-top: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.dgm-ex-root .dgm-ex-card-grid--simple article > h3 + div:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    margin-top: -0.25rem;
}
/* a card without a link does not lift: the lift promised a click that did not exist */
.dgm-ex-root .dgm-ex-card-grid--simple article.group:not(:has(a)):hover:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    translate: none;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 10px 28px -18px rgb(15 23 42 / 0.18);
}

/* ---------- 6. "From Abstract to Program" process panel (.program-slideshow, CDN styles) ---------- */

/* same width as the venue card below it (952), a radius in the card family, the 10 and 11 px
   monospace labels raised to 12 px with at most 0.14em tracking */
.program-slideshow {
    max-width: 952px;
    border-radius: 1.25rem;
    /* the CDN shadow (0 40 80 -50, 70 % black) spread a grey rim along the sides and a dirty field
       below; one soft shadow that only shows under the panel: the negative spread equals half the blur */
    box-shadow: 0 28px 48px -24px rgb(2 6 23 / 0.42), inset 0 1px 0 rgb(255 255 255 / 0.06);
    /* a solid colour under the gradients: same look, and the panel counts as a painted surface
       for spacing checks (heads.mjs measured into its padding before) */
    background-color: var(--ps-deep);
}
.dgm-ex-root .frame:has(> .program-slideshow) {
    /* phones: the html frame added 16 px on each side, the panel was 310 instead of 342 px wide */
    padding-left: 0;
    padding-right: 0;
}
.program-slideshow .scene-tab-label {
    font-size: 12px;
    letter-spacing: 0.12em;
}
/* phones: three tabs share about 98 px each; long German labels ("Begutachtung") ran into each other
   (already at 10 px before). Less tracking keeps them apart at 12 px. */
@media (max-width: 639px) {
    .program-slideshow .scene-tab-label {
        letter-spacing: 0.02em;
    }
}
@media (max-width: 379px) {
    .program-slideshow .scene-tab-label {
        letter-spacing: 0;
    }
}
.program-slideshow .scene-eyebrow {
    font-size: 12px;
    letter-spacing: 0.14em;
}
.program-slideshow .scene-body {
    font-size: 1rem;
    line-height: 1.6;
    color: rgb(255 255 255 / 0.8);
}
.program-slideshow .program-slideshow-caption {
    font-size: 12px;
    letter-spacing: 0.12em;
    color: rgb(255 255 255 / 0.62);
}

/* ---------- 7. venue card (VenueCardContainer) ---------- */

/* phones: the card had a second 24 px inset inside the section's own, 294 px wide on a 390 screen */
@media (max-width: 639px) {
    .dgm-ex-root .mx-auto.max-w-\[1000px\].px-6:has(> .dgm-venue-card) {
        padding-left: 0;
        padding-right: 0;
    }
}
/* body text is running text: 16 px like the rest of the page (was 15) */
.dgm-venue-card .dgm-venue-card__body p.text-sm:not(.custom-compiled-plugin-element *, custom-compiled-plugin-element *) {
    font-size: 1rem;
    line-height: 1.6;
}
/* photo credit 10 -> 12 px */
/* article. lifts the rule one step above the CDN's .dgm-venue-card .dgm-venue-credit, so it does
   not depend on load order */
article.dgm-venue-card .dgm-venue-credit {
    font-size: 12px;
    line-height: 1.35;
    padding: 0.25rem 0.55rem;
}

/* ---------- 8. event strip, newsletter, footer (shared page layout) ---------- */

/* column heads and "Connect with us": 10 px monospace with 0.16-0.18em -> 12 px, 0.1em */
.dgm-page-shell footer:has(.dgm-footer-nav) .dgm-footer-nav > li > a.font-mono,
.dgm-page-shell footer:has(.dgm-footer-nav) p.font-mono.uppercase {
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.1em;
}
.dgm-page-shell footer:has(.dgm-footer-nav) p.font-mono.uppercase {
    color: rgb(71 85 105);
}
/* legal line 12 -> 13 px, a touch more air between the links */
.dgm-page-shell footer:has(.dgm-footer-nav) div.border-t.text-xs {
    font-size: 13px;
}
/* the note under the newsletter form keeps 12 px but a calmer line */
.dgm-page-shell footer:has(.dgm-footer-nav) form + p.text-xs {
    line-height: 1.6;
}
