/**
 * Eigenwerbung / Promo-Streifen (wiederverwendbar).
 * Abstand Hauptnavigation → Subnav-Zeile / Subnav-Spalten / main.unter-Promo: siehe ff-subnav.css (.ff-subnav-inner, main.ff-home).
 * Hier nur das Promo-„Kästchen“ (u. a. --ff-promo-v-gap Margins beim Modifier between-subnav).
 * Bewegung: ff-promo-banner-motion.js (kein CSS-@keyframes).
 */

/*
 * Platz Subnav-Unterstrich/Text → Banner und Banner → Hero (vertikale Margins des Streifens selbst).
 * calc margin-top: Zielbezug zur Schrift, nicht nur zur Aktiv-Unterstrich-Unterkante — siehe ff-subnav Hub-Links.
 */
.ff-promo-banner.ff-promo-banner--between-subnav {
    margin-top: calc(var(--ff-promo-v-gap) - 6px) !important;
    margin-bottom: calc(var(--ff-promo-v-gap) - 4px) !important;
}

.ff-promo-banner {
    --ff-promo-bg: #b43526;
    --ff-promo-v-gap: 17px;
    /* Gleiche Effektbreite wie .ff-home-wrap / Hub-Grid: max. 1000px, seitlich wie --ff-layout-gutter */
    width: min(var(--ff-layout-max), calc(100% - 2 * var(--ff-layout-gutter)));
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    height: 57px;
    margin-top: var(--ff-promo-v-gap);
    margin-bottom: var(--ff-promo-v-gap);
    padding: 0;
    background: var(--ff-promo-bg);
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.ff-promo-banner__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0 auto;
    /* Luft zum roten Balkenrand links/rechts */
    padding: 0 clamp(14px, 4vw, 22px);
    box-sizing: border-box;
    overflow: hidden;
}

.ff-promo-banner__left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex: 0 1 auto;
    min-width: 0;
}

.ff-promo-banner__middle {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    padding-inline: 0;
    /* Heft + Subline zusammen weiter links (wie manuell +36 px zusätzlich) */
    transform: translateX(-54px);
    isolation: isolate;
}

/*
 * Heft bleibt im 57px-Balken (mehrfach overflow:hidden). --ff-heft-fit / translateY wenn oben/unten clipped.
 */
.ff-promo-banner__cover {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: clamp(124px, 38vw, 166px);
    height: 100%;
    max-height: 57px;
    overflow: hidden;
    transform: translateZ(0);
}

.ff-promo-banner__cover img {
    display: block;
    --ff-heft-fit: 1;
    width: calc(75px * var(--ff-heft-fit));
    height: calc(106px * var(--ff-heft-fit));
    object-fit: contain;
    opacity: 1;
    transform: rotate(17.18deg) translateY(calc(27px * var(--ff-heft-fit)));
    transform-origin: center center;
    filter: drop-shadow(6px 2px 9px rgba(0, 0, 0, 0.24));
}

.ff-promo-banner.ff-promo-banner--js-motion .ff-promo-banner__cover,
.ff-promo-banner.ff-promo-banner--js-motion .ff-promo-banner__cover img,
.ff-promo-banner.ff-promo-banner--js-motion .ff-promo-banner__subline {
    will-change: transform;
}

.ff-promo-banner.ff-promo-banner--footer-bottom.ff-promo-banner--js-motion-footer .ff-promo-banner__cover,
.ff-promo-banner.ff-promo-banner--footer-bottom.ff-promo-banner--js-motion-footer .ff-promo-banner__cover img {
    will-change: transform;
}

.ff-promo-banner.ff-promo-banner--footer-bottom.ff-promo-banner--js-motion-footer .ff-promo-banner__subline {
    will-change: clip-path;
}

.ff-promo-banner__subline {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    /* weniger Überlapp ⇒ +3 px mehr Abstand Heft ↔ Text */
    margin-inline-start: -29px;
    position: relative;
    z-index: 1;
    transform: translateZ(0);
}

.ff-promo-banner__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ff-promo-banner__logo img {
    display: block;
    width: auto;
    height: 31px;
    max-width: 125px;
    object-fit: contain;
}

.ff-promo-banner__divider {
    width: 1px;
    align-self: stretch;
    min-height: 34px;
    margin: auto 0;
    background: rgba(255, 255, 255, 0.95);
    flex-shrink: 0;
}

.ff-promo-banner__headline {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ff-promo-banner__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    height: 36px;
    padding: 0 20px;
    border: none;
    border-radius: 999px;
    background: #ffffffe5;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 500;
    font-size: 17px;
    line-height: 1;
    letter-spacing: 0.005em;
    color: #000000;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.ff-promo-banner__cta:hover {
    background: #ffffff;
    color: #000000;
}

.ff-promo-banner__cta:focus-visible {
    background: #ffffffe5;
    color: #000000;
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .ff-promo-banner__inner {
        gap: 8px;
    }

    .ff-promo-banner__left {
        gap: 10px;
    }

    .ff-promo-banner__middle {
        gap: 0;
        justify-content: center;
        transform: translateX(-52px);
    }

    .ff-promo-banner__cover {
        width: clamp(100px, 42vw, 140px);
    }

    .ff-promo-banner__cover img {
        --ff-heft-fit: 0.82;
        transform: rotate(17.18deg) translateY(calc(21px * var(--ff-heft-fit)));
        filter: drop-shadow(5px 2px 7px rgba(0, 0, 0, 0.2));
    }

    .ff-promo-banner__subline {
        font-size: clamp(13px, 3.8vw, 20px);
        margin-inline-start: -23px;
    }

    .ff-promo-banner__headline {
        font-size: clamp(14px, 4vw, 20px);
        white-space: normal;
    }

    .ff-promo-banner__cta {
        font-size: 17px;
        letter-spacing: 0.005em;
        padding: 0 14px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .ff-promo-banner__divider {
        min-height: 26px;
    }

    .ff-promo-banner__subline {
        font-size: 12px;
        white-space: normal;
        line-height: 1.1;
        max-width: 9rem;
        margin-inline-start: -15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ff-promo-banner__cover,
    .ff-promo-banner__subline {
        transform: none !important;
        will-change: auto !important;
    }

    .ff-promo-banner--footer-bottom .ff-promo-banner__cover--footer,
    .ff-promo-banner--footer-bottom .ff-promo-banner__subline {
        opacity: unset !important;
        visibility: unset !important;
    }

    .ff-promo-banner__subline {
        clip-path: none !important;
        -webkit-clip-path: none !important;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Footer-Motion (JS-Klasse): Heft/Text leicht beschleunigt, keine heißen Layout-Loops im Script */
.ff-promo-banner--footer-bottom.ff-promo-banner--js-motion-footer .ff-promo-banner__cover--footer,
.ff-promo-banner--footer-bottom.ff-promo-banner--js-motion-footer .ff-promo-banner__subline {
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .ff-promo-banner--footer-bottom.ff-promo-banner--js-motion-footer .ff-promo-banner__cover--footer,
    .ff-promo-banner--footer-bottom.ff-promo-banner--js-motion-footer .ff-promo-banner__subline {
        will-change: auto;
    }
}

/* ─── Footer unter dem Site-Footer: blauer 57 px-Streifen im Block, Heft unten im Streifen, oben frei. Kein zusätzlicher Balken am Viewport (Safe-Area = weiß). ─── */

/* Im Dokumentfluss direkt unter dem Footer — kein fixed, keine Überlagerung des Seitenhintergrunds. */
.ff-promo-footer-holder {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #ffffff;
    overflow: hidden;
    box-sizing: border-box;
    min-height: 0;
    pointer-events: none;
}

.ff-promo-footer-holder.ff-promo-footer-holder--visible {
    min-height: var(--ff-footer-banner-slot, 0px);
    pointer-events: auto;
}

body.ff-footer-bottom-promo .ff-promo-footer-holder.ff-promo-footer-holder--visible {
    margin-top: -10px;
}

/* Weniger Luft zum Promo-Banner: Body-Klasse `ff-footer-bottom-promo` (functions.php body_class) — greift ohne :has() und schlägt den Basis-Footer */
html body.ff-footer-bottom-promo footer#ff-footer .ff-footer-center {
    padding-bottom: 0 !important;
}

/* Fallback, falls Body-Klasse fehlen sollte (:has weniger konsistent bei einzelnen Engines) */
html body:has(.ff-promo-footer-holder) footer#ff-footer .ff-footer-center {
    padding-bottom: 0 !important;
}

.ff-promo-banner.ff-promo-banner--footer-bottom {
    overflow: hidden;
    width: min(var(--ff-layout-max), calc(100% - 2 * var(--ff-layout-gutter)));
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    height: auto !important;
    padding: 0;
    border: none;
    background: transparent;
    color: #000000;
    flex-shrink: 0;
    transform: translate3d(0, 100%, 0);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.ff-promo-footer-holder.ff-promo-footer-holder--visible .ff-promo-banner.ff-promo-banner--footer-bottom:not(.ff-promo-banner--closing) {
    transform: translate3d(0, 0, 0);
}

.ff-promo-banner.ff-promo-banner--footer-bottom.ff-promo-banner--closing {
    transform: translate3d(0, 100%, 0);
}

.ff-promo-footer-holder.ff-promo-footer-holder--measure {
    position: absolute;
    left: -9999px;
    visibility: hidden;
    pointer-events: none;
    min-height: 0;
}

.ff-promo-footer-holder.ff-promo-footer-holder--measure .ff-promo-banner.ff-promo-banner--footer-bottom {
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .ff-promo-banner.ff-promo-banner--footer-bottom {
        transition: none;
        transform: none;
    }

    .ff-promo-footer-holder:not(.ff-promo-footer-holder--visible) .ff-promo-banner.ff-promo-banner--footer-bottom {
        visibility: hidden;
    }

    .ff-promo-footer-holder.ff-promo-footer-holder--visible .ff-promo-banner.ff-promo-banner--footer-bottom:not(.ff-promo-banner--closing) {
        visibility: visible;
    }
}

/* overflow:hidden (Cover + Inner): Nudge nach unten vergrößert nicht die Seite – Überstand wird geklippt. */
.ff-promo-banner--footer-bottom .ff-promo-banner__inner {
    position: relative;
    align-items: flex-end;
    min-height: 57px;
    height: auto !important;
    max-height: none;
    padding-top: clamp(48px, 12vw, 72px);
    padding-bottom: 0;
    overflow: hidden;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__middle {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-self: flex-end;
    align-items: flex-end;
    justify-content: center;
    overflow: visible !important;
    height: auto !important;
    min-height: 0;
    max-height: none;
    transform: none;
    isolation: isolate;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__inner > * {
    position: relative;
    z-index: 1;
}

/* Blauer Streifen hinter allen Inhalten dieser Zeile … */
.ff-promo-banner--footer-bottom .ff-promo-banner__inner::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 57px;
    background: #c8d4ef;
    z-index: 0;
    pointer-events: none;
}

/* … Heft liegt optisch auf dem Streifen („drin“), Texte/Logo/Buttons darüber … */
.ff-promo-banner--footer-bottom .ff-promo-banner__left,
.ff-promo-banner--footer-bottom .ff-promo-banner__actions {
    position: relative;
    z-index: 2;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__left {
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    min-height: 57px;
    margin-bottom: 0;
    overflow: visible;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__actions {
    align-self: flex-end;
    min-height: 57px;
    align-items: center;
}

/* Heft weiter nach unten: translateY (--ff-footer-nudge-down); overflow am Cover klippt Überstand ohne extra Seitenhöhe */
.ff-promo-banner--footer-bottom .ff-promo-banner__cover--footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-shrink: 0;
    width: clamp(152px, 44vw, 216px);
    height: auto;
    max-height: none;
    overflow: hidden;
}

/*
 * --ff-footer-nudge-down > 0: Motiv weiter in den Streifen rutschen (translateY nach unten).
 * Kein negativer Margin: Abschneider ist das Cover (+ inner overflow:hidden zur Sicherheit).
 */
.ff-promo-banner--footer-bottom .ff-promo-banner__cover--footer img {
    display: block;
    --ff-heft-fit: 1.06;
    --ff-footer-nudge-down: 20px;
    width: calc(104px * var(--ff-heft-fit));
    height: calc(147px * var(--ff-heft-fit));
    object-fit: contain;
    object-position: bottom center;
    transform: translateY(var(--ff-footer-nudge-down));
    transform-origin: bottom center;
    margin: 0;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__subline {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    min-height: 57px;
    box-sizing: border-box;
    color: #000000;
    margin-inline-start: -36px;
    margin-bottom: 0;
    padding: 0;
    line-height: 1;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__divider {
    background: #000000;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__headline {
    color: #000000;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__logo img {
    filter: brightness(0);
}

.ff-promo-banner__actions {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Weiße Kapsel, schwarzer Text — Footer explizit (oberes Banner bleibt #ffffffe5) */
.ff-promo-banner--footer-bottom .ff-promo-banner__cta {
    background: #ffffff !important;
    color: #000000 !important;
    box-sizing: border-box;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__cta:hover {
    background: #f7f7f7 !important;
    color: #000000 !important;
}

.ff-promo-banner--footer-bottom .ff-promo-banner__cta:focus-visible {
    outline-color: #000000;
}

/* Close nur Icon — kein runder Kasten, kein Hover-Flächchen */
.ff-promo-banner__close--footer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    padding: 4px;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #000000;
    cursor: pointer;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    line-height: 0;
}

.ff-promo-banner__close--footer svg {
    display: block;
}

.ff-promo-banner__close--footer svg path {
    stroke: currentColor;
}

.ff-promo-banner__close--footer:focus-visible {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

.ff-promo-banner__close--footer:hover {
    background: transparent;
    opacity: 0.55;
}

@media (max-width: 900px) {
    .ff-promo-banner--footer-bottom .ff-promo-banner__inner {
        min-height: 57px;
        padding-top: clamp(44px, 14vw, 66px);
    }

    .ff-promo-banner--footer-bottom .ff-promo-banner__cover--footer img {
        --ff-heft-fit: 0.98;
        --ff-footer-nudge-down: 16px;
    }

    .ff-promo-banner--footer-bottom .ff-promo-banner__cover--footer {
        width: clamp(138px, 46vw, 188px);
    }

    .ff-promo-banner--footer-bottom .ff-promo-banner__subline {
        margin-inline-start: -22px;
    }

    .ff-promo-banner__actions {
        gap: 8px;
    }

    .ff-promo-banner--footer-bottom .ff-promo-banner__cta {
        padding: 0 14px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .ff-promo-banner--footer-bottom .ff-promo-banner__inner {
        padding-top: clamp(40px, 18vw, 60px);
    }

    .ff-promo-banner--footer-bottom .ff-promo-banner__cover--footer img {
        --ff-heft-fit: 0.98;
        --ff-footer-nudge-down: 14px;
    }

    .ff-promo-banner--footer-bottom .ff-promo-banner__subline {
        font-size: 12px;
        white-space: normal;
        line-height: 1.1;
        max-width: 9rem;
        margin-inline-start: -14px;
        min-height: 56px;
    }

    .ff-promo-banner--footer-bottom .ff-promo-banner__inner::before {
        height: 56px;
    }

    .ff-promo-banner--footer-bottom .ff-promo-banner__left,
    .ff-promo-banner--footer-bottom .ff-promo-banner__actions {
        min-height: 56px;
    }
}
