/* UED public layout fixes. Keep Dresscode components and their event handlers. */

/* Restore the header's original table layout, overridden by inline flex rules. */
body #headerLine2 {
    overflow: visible !important;
}
body #headerLine2 .headerLineContainer {
    display: table !important;
    table-layout: fixed;
    height: 45px !important;
}
body #headerLine2 .headerLineColumn {
    display: table-cell !important;
    float: none !important;
    vertical-align: middle;
}
body #headerLine2 .headerLineColumn:first-child:has(#geoPosition):not(:has(#geoPosition li)) {
    width: 0;
    padding: 0;
}
body #headerLine2 #subMenu {
    display: inline-block !important;
    vertical-align: middle;
}
body #headerLine2 .headerLineColumn:last-child {
    width: 350px;
    white-space: nowrap;
}

/* Neutralize the inline four-column lock; use the component's media queries. */
body.index #right .index-banners-wrap {
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 24px 0;
}
body.index #right .index-banners {
    display: block !important;
    width: auto;
    min-height: 0;
}
body.index #right .index-banners .elem-column {
    display: inline-block !important;
    float: none;
    flex: none !important;
    max-width: none !important;
    min-height: 0;
    padding: 0;
    background: transparent;
}
body.index #right .index-banners .elem-wrap {
    display: inline-block;
    overflow: visible;
}
body.index #right .index-banners .name {
    max-height: none;
    overflow: visible;
    overflow-wrap: break-word;
}

/* An empty menu must not create a blank accordion; populated menus remain live. */
body #leftFooter .column:has(> .heading:empty):not(:has(.footerMenu li)) {
    display: none;
}
body #footer .footerRow--policy > td {
    padding: 20px 24px 24px;
}
body #footer .footerRow--policy .pilink {
    color: #e5e7eb;
    text-decoration: underline;
    text-underline-offset: 3px;
}
body #footer .footerRow--policy .pilink:hover,
body #footer .footerRow--policy .pilink:focus-visible {
    color: #ffffff;
}
body #footer .footerRow--policy .pilink:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

/* Keep the existing cookie handler; move the notice away from the chat launcher. */
body .cookie-notice {
    left: 18px;
    right: auto;
    bottom: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

@media (max-width: 1024px) {
    /* Preserve the whole raster banner. The original CTA gets its own lower row. */
    body.index #slider .slideBox > li > span[data-large] {
        box-sizing: content-box;
        height: 0;
        /* Current slide assets: 1181x421 (largest ratio) and 1181x404. */
        padding-top: 35.6478%;
        padding-bottom: 60px;
        background-size: 100% auto;
        background-repeat: no-repeat;
        background-position: center top;
        background-color: #101620;
        transform: none;
    }
    body.index #slider .sliderContent {
        top: auto;
        bottom: 10px;
        left: 0;
        right: 0;
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
        text-align: center;
        transform: none;
    }
    body.index #slider .sliderContent .cButton {
        height: 40px;
        margin-top: 0;
        line-height: 40px;
    }
    body.index #slider > .pager {
        bottom: 66px;
    }
    body .cookie-notice {
        left: 12px;
        right: 12px;
        width: auto;
        bottom: calc(130px + env(safe-area-inset-bottom, 0px));
        max-height: calc(100vh - 160px);
        max-height: calc(100dvh - 160px);
        border-radius: 10px;
    }
}

@media (max-width: 650px) {
    body #headerLine2 .headerLineColumn:last-child {
        width: 200px;
    }
}

@media (max-width: 550px) {
    /* Retain all six existing links; readable titles above uncropped equipment. */
    body.index #right .index-banners {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin: 0;
    }
    body.index #right .index-banners .elem-column {
        display: contents !important;
    }
    body.index #right .index-banners .elem-wrap {
        width: 100%;
        height: 100%;
        padding: 0;
    }
    body.index #right .index-banners .elem-column:nth-child(n) .elem {
        height: 100%;
        min-height: 240px;
        padding: 14px 12px 140px;
    }
    body.index #right .index-banners .elem-column:nth-child(n) .text-wrap {
        width: 100%;
    }
    body.index #right .index-banners .name {
        margin-bottom: 0;
        font-size: 14px;
        line-height: 18px;
        text-shadow: none;
    }
    body.index #right .index-banners .bg {
        top: auto;
        bottom: 0;
        height: 136px;
        background-position: center bottom;
        background-size: contain;
        background-color: #ffffff;
    }
}
