/*
 * Homepage hero banner on mobile (text block with background image + "Direct Shoppen" / "#projectprijs" buttons).
 * The CMS text uses &nbsp; and <br> to position things on desktop, which overlaps the image on phones.
 * Mobile: image on top (fixed height, centered = "Black Friday" panel), overlay title hidden, buttons stacked below.
 * Matches the block via the project price button, or add CSS class "lichtxl-hero" to the block in the CMS.
 * Plain CSS (not SCSS): Shopware's scssphp warns "Array to string conversion" on :has() selectors.
 */
@media (max-width: 767.98px) {
    .cms-block.lichtxl-hero,
    .cms-block:has(.cms-element-text a[href$="#projectprijs"]) {
        --lichtxl-hero-image-height: 360px;
        background-color: #222222;
    }

    :is(.cms-block.lichtxl-hero, .cms-block:has(.cms-element-text a[href$="#projectprijs"])) .cms-block-background {
        height: var(--lichtxl-hero-image-height);
        bottom: auto;
        object-fit: cover;
        object-position: center;
    }

    :is(.cms-block.lichtxl-hero, .cms-block:has(.cms-element-text a[href$="#projectprijs"])) .cms-block-container {
        padding: 0 !important;
    }

    :is(.cms-block.lichtxl-hero, .cms-block:has(.cms-element-text a[href$="#projectprijs"])) .cms-block-container-row {
        margin: 0;
    }

    :is(.cms-block.lichtxl-hero, .cms-block:has(.cms-element-text a[href$="#projectprijs"])) .cms-block-container-row > [class*="col"] {
        padding: 0;
    }

    :is(.cms-block.lichtxl-hero, .cms-block:has(.cms-element-text a[href$="#projectprijs"])) .cms-element-text {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: calc(var(--lichtxl-hero-image-height) + 16px) 16px 20px;
        font-size: 0; /* removes the &nbsp; spacing around the buttons */
    }

    :is(.cms-block.lichtxl-hero, .cms-block:has(.cms-element-text a[href$="#projectprijs"])) .cms-element-text > :is(h1, h2, h3, h4, h5, h6, p) {
        display: none;
    }

    :is(.cms-block.lichtxl-hero, .cms-block:has(.cms-element-text a[href$="#projectprijs"])) .cms-element-text > div {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    :is(.cms-block.lichtxl-hero, .cms-block:has(.cms-element-text a[href$="#projectprijs"])) .cms-element-text br {
        display: none;
    }

    :is(.cms-block.lichtxl-hero, .cms-block:has(.cms-element-text a[href$="#projectprijs"])) .cms-element-text a.btn {
        display: block;
        width: 100%;
        margin: 0;
        padding: 12px 16px;
        font-size: 1rem;
        line-height: 1.3;
        text-align: center;
        white-space: normal;
    }
}
