/* Keep the original masthead in flow. Only the upper contact row scrolls away. */
@media screen {
    html.rk-kopf-aktiv { scroll-padding-top: calc(var(--rk-adminhoehe, 0px) + var(--rk-menueleiste, 62px) + 6px) !important; }
    html.rk-kopf-aktiv #page-container #main-content .rk-header {
        position: sticky !important;
        top: calc(var(--rk-adminhoehe, 0px) - var(--rk-kopf-vorlauf, 0px)) !important;
        bottom: auto !important;
        z-index: 150;
        overflow: visible;
        padding-bottom: 4px !important;
    }
    html.rk-kopf-aktiv #page-container .rk-header .rs-nav,
    html.rk-kopf-aktiv #page-container .rk-header .rs-nav > a:first-child { height: var(--rk-navreihe, 60px) !important; min-height: 0; }
    html.rk-kopf-aktiv .rk-header.rk-kopf-klein { box-shadow: 0 3px 12px rgb(20 26 30 / 15%); }
    html.rk-kopf-aktiv #page-container .rk-header.rk-kopf-klein .rs-nav > a:first-child .rk-logo {
        width: auto !important;
        max-width: 100% !important;
        height: calc(var(--rk-navreihe, 60px) - 7px) !important;
        top: auto !important;
        bottom: 3px !important;
    }
    html.rk-kopf-aktiv #page-container .wb-wegweiser { top: calc(var(--rk-adminhoehe, 0px) + var(--rk-menueleiste, 62px)) !important; }
    html.rk-kopf-aktiv .rs-desktop .rs-dropdown { max-height: var(--rk-platz-im-menue, 65vh); overflow-y: auto; overscroll-behavior: contain; }
    html.rk-kopf-aktiv #page-container .rs-mobilemenu[open] > .rs-mobile-panel {
        box-sizing: border-box;
        max-height: var(--rk-platz-im-menue, 60vh) !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        top: calc(100% + 4px) !important;
    }
    html.rk-kopf-aktiv #page-container .rs-desktop details > summary:focus-visible,
    html.rk-kopf-aktiv #page-container .rs-mobilemenu summary:focus-visible {outline-offset: 2px}
}
/* The original photo or video continues behind the sticky header. Extending its paint
   rather than moving the section keeps titles, links and the seasonal notice in place. */
@media screen {
    #page-container #main-content .rk-kopf-hintergrund:is(.rs-project-hero,.rs-videohero) {
        box-shadow: 0 calc(0px - var(--rk-bildueberstand)) 0 0 #151c20;
        overflow: visible !important;
        clip-path: inset(calc(0px - var(--rk-bildueberstand)) 0 0);
    }
    #page-container #main-content .rk-kopf-hintergrund.rs-videohero .rs-background-video,
    #page-container #main-content #start.rk-kopf-hintergrund.rs-project-hero .rs-head-photo {
        top: calc(0px - var(--rk-bildueberstand)) !important;
        height: calc(100% + var(--rk-bildueberstand)) !important;
    }
    #main-content .rk-kopf-hintergrund.rs-videohero::before { top: calc(0px - var(--rk-bildueberstand)) !important; }
    #main-content .rk-kopf-blende + :is(.rb-ferien, .rs-holiday) {position: relative; z-index: 3;}
}
@media screen and (max-width:600px) {
    #page-container #main-content #start.rk-kopf-hintergrund.rs-project-hero:has(.rhg-headerfoto) .rs-head-photo {
        height: calc(var(--rk-fotostreifen) + var(--rk-bildueberstand)) !important;
    }
}
@media screen and (forced-colors:none) and (prefers-contrast:no-preference) {
    html:not(.rhg-kontrast) #page-container #main-content .rk-header:not(.rk-kopf-blende) {
        background: #363b41 !important;
    }
    html:not(.rhg-kontrast) #page-container #main-content .rk-header.rk-kopf-blende {
        --rk-kopf-flaeche: var(--rk-kopf-deckung, 1);
        background: rgb(54 59 65 / var(--rk-kopf-flaeche)) !important;
        border-bottom-color: rgb(224 43 32 / var(--rk-kopf-flaeche)) !important;
        box-shadow: 0 3px 12px rgb(20 26 30 / calc(.15 * var(--rk-kopf-flaeche)));
    }
    html:not(.rhg-kontrast) #page-container #main-content .rk-kopf-blende:has(.rs-desktop details[open],.rs-mobilemenu[open]) {
        --rk-kopf-flaeche: 1;
    }
    html:not(.rhg-kontrast) #page-container #main-content .rk-kopf-blende::before {
        content:"";position:absolute;z-index:-1;inset:0 0 -8px;pointer-events:none;
        background:linear-gradient(180deg,rgb(9 16 20 / 70%),rgb(9 16 20 / 50%) 65%,transparent);
        opacity:calc(1 - var(--rk-kopf-flaeche));
    }
    html:not(.rhg-kontrast) #page-container #main-content .rk-kopf-blende .rk-logo {
        background:transparent !important;box-shadow:none !important;
    }
    html:not(.rhg-kontrast) #page-container #main-content .rk-kopf-blende :is(.rs-contact-strip a,.rs-desktop > a,.rs-navgroup > summary,.rs-socials a,.rs-mobilemenu > summary) {
        color:white !important;
    }
    html:not(.rhg-kontrast) #page-container #main-content .rk-kopf-blende .rs-mobilemenu[open] > .rs-mobile-panel,
    html:not(.rhg-kontrast) #page-container #main-content .rk-kopf-blende .rs-dropdown {
        background:#fff !important;
    }
    html:not(.rhg-kontrast) #page-container #main-content .rk-kopf-blende :is(a,summary):focus-visible {
        outline:2px solid currentColor;outline-offset:2px;
    }
}
/* Logged-in editors can have a second toolbar row at tablet widths. */
@media screen and (min-width: 783px) {
    html.rk-kopf-aktiv.rk-admin-fest { margin-top: var(--rk-adminhoehe, 32px) !important; }
    html.rk-kopf-aktiv #wpadminbar { height: auto; min-height: 32px; }
    html.rk-kopf-aktiv #wpadminbar > .quicklinks { display: flow-root; }
}
@media screen and (max-width: 760px) {
    html.rk-kopf-aktiv #page-container .rk-header { --rk-navreihe: 50px; }
    html.rk-kopf-aktiv #page-container .rs-nav .rs-mobilemenu { margin-left: auto; }
    html.rk-kopf-aktiv #page-container .rk-kopf-klein .rs-nav > .rs-socials { display: none !important; }
    html.rk-kopf-aktiv #page-container .rk-header .rs-nav > a:first-child { min-width: 78px; }
    html.rk-kopf-aktiv #page-container .wb-wegweiser { position: static !important; }
}
