/* Verbindliche Kontrastgestaltung. Nach allen bisherigen Stylesheets einbinden.
 * Gilt ohne JavaScript und ohne zusätzliche Klasse am body.
 * Textziel: WCAG 2.2 AA, mindestens 4,5:1 auch für große Schrift.
 */
:root {
    --gifr-text: #3b3b3b;
    --gifr-link-blue: #006780;
    --gifr-button-gray: #535b62;
    --gifr-contrast-ink: #282828;
    --gifr-contrast-link: #9b4300;
    --gifr-contrast-link-hover: #713100;
}

a {
    color: var(--gifr-contrast-link);
}

a:hover, a:focus-visible {
    color: var(--gifr-contrast-link-hover);
}

/* Wichtige Legacy-Hoverfarben gezielt im Haupt- und Untermenü überschreiben. */
#menue #gifr-navigation li > :is(a, .submenu-toggle) {
    position: relative;
    display: inline-block;
    box-sizing: border-box;
    width: auto;
    max-width: 100%;
    color: var(--gifr-text) !important;
    font-weight: 400;
    text-decoration: none;
}

#menue #gifr-navigation li > :is(a, .submenu-toggle)::after {
    content: '';
    position: absolute;
    inset: auto 0 -5px;
    height: 4px;
    background: #D1801F;
    pointer-events: none;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 240ms ease-out;
}

#menue #gifr-navigation :is(li.act, li.actsub) > :is(a, .submenu-toggle)::after,
#menue #gifr-navigation a[aria-current="page"]::after,
#menue #gifr-navigation li > :is(a, .submenu-toggle):focus-visible::after {
    transform: scaleX(1);
}

@media (max-width: 1200px) {
    .mob_button {
        background: #D1801F;
    }

    .mob_button span,
    .mob_button span::before,
    .mob_button span::after {
        background-color: #fff;
    }

    .mobnavvisible.mob_button span {
        background-color: transparent;
    }

    #menue #gifr-navigation .submenu-toggle {
        margin-bottom: 5px;
    }
}

@media (hover: hover) and (pointer: fine) {
    #menue #gifr-navigation li > :is(a, .submenu-toggle):hover::after {
        transform: scaleX(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    #menue #gifr-navigation li > :is(a, .submenu-toggle)::after {
        transition: none;
    }
}

#content.startseite .grauerbg :is(h1, h2, li) {
    color: var(--gifr-contrast-link);
}

.orangerbg, #content .frame.bildtextorange,
.orangerbg :is(h1, h2, h3, li, a),
.bildtextorange :is(h1, h2, h3, li, a),
#footer .orangerbg, #footer .orangerbg :is(.rahmen, a),
#footer > .rahmen > .frame-type-textmedia {
    color: var(--gifr-contrast-ink);
}

.orangerbg a:hover, .orangerbg a:focus-visible,
.bildtextorange a:hover, .bildtextorange a:focus-visible,
#footer .orangerbg a:hover, #footer .orangerbg a:focus-visible {
    color: #000;
}

.dunkelgrauerbg a, #footer .dunkelgrauerbg a,
.dunkelgrauerbg .ui-accordion-content a {
    color: #fff !important;
    text-decoration: none;
}

#footer a:hover, #footer a:focus-visible {
    opacity: 1;
}

.btn, #cookie_einstellungen,
.btn:hover, .btn:focus, .btn.focus,
.btn-secondary:hover, .btn-secondary:focus,
.btn:not(:disabled):not(.disabled):active,
.btn:not(:disabled):not(.disabled).active {
    color: #fff;
    background-color: var(--gifr-button-gray);
    border-color: var(--gifr-button-gray);
}

.btn:hover, .btn:focus-visible, #cookie_einstellungen:hover {
    background-color: #3b4248;
    border-color: #3b4248;
}

.mediaconsent .blockedcontentbox {
    color: var(--gifr-contrast-ink);
    background: #fff;
}

.mediaconsent .blockedcontentbox a:not(.btn) {
    color: var(--gifr-contrast-link);
}

.team .image-caption {
    position: static;
    box-sizing: border-box;
    width: 100%;
    background: #fff;
    height: auto;
    min-height: var(--gifr-caption-height, 0px);
    overflow-wrap: anywhere;
}

.team #content .frame:not(.portraits) .ce-gallery:has(.image-caption) .ce-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.team #content .frame:not(.portraits) .ce-gallery:has(.image-caption) .ce-row::after {
    display: none;
}


.leistungen #header ul li:is(:hover, :active, :focus-within, .act, .active) {
    background-color: #D1801F;
}

.leistungen #header ul li:is(:hover, :active, :focus-within, .act, .active) a {
    color: #fff;
}

/* Text vor wechselnden Fotos erhält eine verlässlich deckende Lesefläche. */
.bgbild:has(.ce-bodytext) > .rahmen {
    color: var(--gifr-contrast-ink);
    background: #fff;
}

/* Inline-Anbieterfarbe auf der eigenen Seite, ohne Eingriff ins Fremd-iframe. */
#powered_321med {
    color: #3b3b3b !important;
    background: transparent !important;
    /* Helle Kontur hält den Text auch vor dunklen Flächen lesbar. */
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff,
                 -1px 1px 0 #fff, 1px 1px 0 #fff;
}

a:focus-visible, button:focus-visible {
    outline: 3px solid #282828;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px #fff;
}

/* Preserve the menu symbol when the operating system replaces background colors. */
@media (forced-colors: active) and (max-width: 1200px) {
    .mob_button {
        box-sizing: border-box;
        color: ButtonText;
        background: ButtonFace;
        border: 2px solid ButtonText;
    }

    .mob_button span,
    .mob_button span::before,
    .mob_button span::after {
        box-sizing: border-box;
        background: transparent;
        border-top: 3px solid ButtonText;
    }

    .mobnavvisible.mob_button span {
        border-top: 0;
    }

    .mob_button:focus-visible {
        outline: 3px solid Highlight;
        outline-offset: 3px;
    }
}

@media (forced-colors: active) {
    #header.slider .owl-nav button {
        color: ButtonText;
        background: ButtonFace;
        border: 2px solid ButtonText;
        box-shadow: none;
    }

    #header.slider .owl-nav button::before { border-color: ButtonText; }

    #header.slider .owl-nav button:hover {
        color: HighlightText;
        background: Highlight;
    }

    #header.slider .owl-nav button:hover::before { border-color: HighlightText; }

    #header.slider .owl-nav button:focus-visible {
        outline: 3px solid Highlight;
        outline-offset: 3px;
    }
}
