/*
 * Fixed side logo ("Haaß Orthopädie-Schuhtechnik – 125 Jahre")
 * - the logo SVG in Templates/Page/Default.html stays untouched:
 *   a white plate with the lettering cut out
 * - logo.js wraps it into .site-logo and adds an identical copy whose plate is
 *   green; the white original shows where the logo overlaps the hero, photos or
 *   green areas, the green copy everywhere else (complementary clip paths)
 * - position as before: on load on the bottom edge of the hero image, after
 *   scrolling at the bottom of the screen, so at the end of the page it sits in
 *   the footer; always at the right edge of the page (max. 1600px)
 * - without JavaScript the theme rules for .logo apply unchanged
 */
:root {
    /* box of the theme logo: 400px (200px on phones) incl. 10px padding top and bottom */
    --site-logo-height: 400px;
    --site-logo-padding: 10px;
    --site-logo-green: var(--si-primary, #bcd233);
}

@media (max-width: 500px) {
    :root {
        --site-logo-height: 200px;
    }
}

.site-logo {
    position: fixed;
    z-index: 9000;
    /*
     * right edge of the page (max. 1600px), bottom of the screen;
     * on short pages logo.js lifts it to the bottom of the footer
     */
    top: calc(100% - var(--site-logo-height) - var(--site-logo-lift, 0px));
    right: max(0px, calc((100% - var(--haass-page-max-width, 1600px)) / 2));
    width: calc((var(--site-logo-height) - 2 * var(--site-logo-padding)) * 180 / 551);
    height: var(--site-logo-height);
    pointer-events: none;
}

/*
 * pages with hero: positioned by the bottom right corner like the theme logo
 * (translate -100% -100%), so it renders exactly as before
 */
.site-logo.has-hero {
    top: calc(100% - var(--site-logo-lift, 0px));
    right: auto;
    left: calc(100% - max(0px, calc((100% - var(--haass-page-max-width, 1600px)) / 2)));
    translate: -100% -100%;
}

/* on load: bottom of the box on the bottom edge of the hero image (set by logo.js) */
.site-logo.has-hero.is-anchored {
    top: var(--site-logo-top);
}

.site-logo.is-ready {
    transition: top 1s ease-in-out, opacity 0.3s ease, visibility 0.3s;
}

/* both copies fill the box exactly like the theme logo did */
.site-logo > .logo {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: var(--site-logo-padding) 0;
    translate: none;
    transition: none;
}

/* green plate (copy), the white original stays as it is */
.site-logo > .site-logo__green path {
    fill: var(--site-logo-green) !important;
}

/* step aside while the mobile menu or the image lightbox is open */
body:has(.offcanvas.show, .offcanvas.showing) .site-logo,
body.lg-on .site-logo {
    opacity: 0;
    visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .site-logo.is-ready {
        transition: none;
    }
}
