/*
 * K&E ACF Elementor Bridge — Dashboard legacy restoration
 * Based on the original Brötje dashboard markup + compiled theme CSS.
 * Scoped to .ke-section-dashboard to avoid leaking into Elementor.
 */

.ke-section-dashboard .dashboard_heading,
.ke-section-dashboard .gridwrapper {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.ke-section-dashboard .dashboard_heading {
    margin-bottom: 20px;
}

.ke-section-dashboard .gridwrapper {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px 20px;
    grid-auto-flow: row;
    width: 100%;
    height: 100%;
}

.ke-section-dashboard .gridwrapper > .item {
    background-color: #fff;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    cursor: pointer;
    transition: all ease 300ms;
    position: relative;
    min-width: 0;
}

.ke-section-dashboard .gridwrapper > .item:hover {
    box-shadow: 0 0 11px 0 rgb(0 0 0 / 15%);
    transition: all ease 300ms;
}

.ke-section-dashboard .gridwrapper > .item:hover .ke_btn a {
    transform: scale(1.1);
}

.ke-section-dashboard .gridwrapper > .item h2,
.ke-section-dashboard .gridwrapper > .item p,
.ke-section-dashboard .gridwrapper > .item span,
.ke-section-dashboard .gridwrapper > .item .ke_btn {
    margin: 0;
    width: 100%;
    position: relative;
    z-index: 10;
}

.ke-section-dashboard .gridwrapper > .item h2 {
    margin-bottom: 20px;
}

.ke-section-dashboard .gridwrapper > .item p {
    margin-bottom: auto;
}

.ke-section-dashboard .gridwrapper > .item .ke_btn {
    margin-top: auto;
}

.ke-section-dashboard .gridwrapper > .item .ke_btn.clean {
    margin-left: -14px;
}

/* Info / Contact */
.ke-section-dashboard .gridwrapper > .item.contact {
    position: relative;
}

.ke-section-dashboard .gridwrapper > .item.contact:hover h2 {
    transform: scale(1.1);
    transition: all ease 300ms;
}

.ke-section-dashboard .gridwrapper > .item.contact svg,
.ke-section-dashboard .gridwrapper > .item.contact img {
    width: 100px;
    max-width: 100px;
    height: auto;
    margin-bottom: 20px;
    fill: var(--e-global-color-accent, #e20020);
}

.ke-section-dashboard .gridwrapper > .item.contact h2 {
    margin-bottom: 0;
    margin-top: auto;
    transform-origin: left;
    transform: scale(1);
    transition: all ease 300ms;
}

.ke-section-dashboard .gridwrapper > .item.contact > a {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
}

/* Link / Locations */
.ke-section-dashboard .gridwrapper > .item.locations {
    flex-wrap: nowrap;
}

.ke-section-dashboard .gridwrapper > .item.locations::after {
    pointer-events: none;
}

.ke-section-dashboard .gridwrapper > .item.locations.dashboard-overlay-red::after,
.ke-section-dashboard .gridwrapper > .item.locations.dashboard-overlay-grey::after,
.ke-section-dashboard .gridwrapper > .item.locations.dashboard-overlay-gray::after,
.ke-section-dashboard .gridwrapper > .item.locations.dashboard-overlay-black::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    transition: all ease 500ms;
}

.ke-section-dashboard .gridwrapper > .item.locations.dashboard-overlay-red::after {
    background: rgba(226, 0, 32, var(--ke-dashboard-overlay-opacity, 0));
}

.ke-section-dashboard .gridwrapper > .item.locations.dashboard-overlay-grey::after,
.ke-section-dashboard .gridwrapper > .item.locations.dashboard-overlay-gray::after {
    background: rgba(65, 65, 65, var(--ke-dashboard-overlay-opacity, 0));
}

.ke-section-dashboard .gridwrapper > .item.locations.dashboard-overlay-black::after {
    background: rgba(0, 0, 0, var(--ke-dashboard-overlay-opacity, 0));
}

.ke-section-dashboard .gridwrapper > .item.locations.dashboard-overlay-multiply::after {
    mix-blend-mode: multiply;
}

.ke-section-dashboard .gridwrapper > .item.locations h2,
.ke-section-dashboard .gridwrapper > .item.locations p,
.ke-section-dashboard .gridwrapper > .item.locations .colbla p,
.ke-section-dashboard .gridwrapper > .item.locations .ke_btn span {
    color: var(--ke-dashboard-font-color, inherit) !important;
}

.ke-section-dashboard .gridwrapper > .item.locations .colbla {
    width: 100%;
    position: relative;
    z-index: 10;
}

.ke-section-dashboard .gridwrapper > .item.locations .colbla p {
    margin-bottom: 20px;
}

.ke-section-dashboard .gridwrapper > .item.locations .ke_btn a {
    color: var(--e-global-color-accent, #e20020);
}

.ke-section-dashboard .gridwrapper > .item.locations .ke_btn a span::after {
    position: absolute;
    right: -15px;
    bottom: 2px;
}

.ke-section-dashboard .gridwrapper > .item.locations.dashboard-link-enabled {
    cursor: pointer;
}

.ke-section-dashboard .gridwrapper > .item.locations.dashboard-link-disabled {
    cursor: inherit;
}

/* Wide link / Portal */
.ke-section-dashboard .gridwrapper > .item.portal {
    position: relative;
    padding-right: 50%;
    overflow: hidden;
    flex-wrap: nowrap;
}

.ke-section-dashboard .gridwrapper > .item.portal > img {
    position: absolute;
    top: 60%;
    left: 50%;
    height: 90%;
    width: auto;
    max-width: none;
    transform: translateY(-50%);
    opacity: .3;
}

.ke-section-dashboard .gridwrapper > .item.portal .ke_btn.clean a {
    padding-left: 20px;
}

.ke-section-dashboard .gridwrapper > .item.portal .ke_btn.clean a span {
    margin-bottom: -10px;
    font-size: .9rem;
}

.ke-section-dashboard .gridwrapper > .item.portal .ke_btn.clean a span::after {
    display: none;
    content: "";
}

.ke-section-dashboard .gridwrapper > .item.portal .ke_btn.clean a i {
    font-size: inherit;
    margin-right: 5px;
}

/* News */
.ke-section-dashboard .gridwrapper > .item.news {
    padding: 0;
}

.ke-section-dashboard .gridwrapper > .item.news:hover .item {
    box-shadow: none !important;
}

.ke-section-dashboard .gridwrapper > .item.news .ke_news,
.ke-section-dashboard .gridwrapper > .item.news .container.flex,
.ke-section-dashboard .gridwrapper > .item.news .item.flex-item {
    width: 100%;
    height: 100%;
}

.ke-section-dashboard .gridwrapper > .item.news .item.flex-item {
    padding: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: flex;
    flex-direction: column;
}

.ke-section-dashboard .gridwrapper > .item.news .news_image {
    width: 100%;
    max-height: none !important;
}

.ke-section-dashboard .gridwrapper > .item.news .news_image img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    height: auto !important;
}

.ke-section-dashboard .gridwrapper > .item.news .news_content {
    padding: 0 20px 20px 20px !important;
    aspect-ratio: 1 / 1;
    margin-top: -8px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.ke-section-dashboard .gridwrapper > .item.news .news_content h2 {
    margin-top: 15px !important;
    margin-bottom: 20px !important;
}

.ke-section-dashboard .gridwrapper > .item.news .news_content .ke_btn {
    margin-top: auto;
    margin-bottom: 20px !important;
}

.ke-section-dashboard .gridwrapper > .item.news .news_content .ke_btn span {
    margin: 5px 0 !important;
}

.ke-section-dashboard .gridwrapper > .item.news .categorie_list {
    margin-bottom: 30px;
    padding-left: 0;
    list-style: none;
}

.ke-section-dashboard .gridwrapper > .item.news .categorie_list li:first-of-type {
    display: block;
    width: 100%;
}

.ke-section-dashboard .gridwrapper > .item.news .categorie_list li:nth-of-type(2) {
    margin-left: 0 !important;
}

/* Video */
.ke-section-dashboard .gridwrapper > .item.video {
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    overflow: hidden;
    padding-right: 30%;
}

.ke-section-dashboard .gridwrapper > .item.video::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--e-global-color-accent, #e20020);
    mix-blend-mode: multiply;
    z-index: 5;
    pointer-events: none;
}

.ke-section-dashboard .gridwrapper > .item.video h2,
.ke-section-dashboard .gridwrapper > .item.video p,
.ke-section-dashboard .gridwrapper > .item.video span,
.ke-section-dashboard .gridwrapper > .item.video .ke_btn {
    color: #fff;
}

.ke-section-dashboard .gridwrapper > .item.video > img.dashboard-video-play-image {
    position: absolute;
    top: 50%;
    right: -5%;
    height: 350px;
    width: 350px;
    max-width: none;
    transform: translateY(-50%);
    opacity: 0;
    transition: all ease 300ms;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.ke-section-dashboard .gridwrapper > .item.video:hover > img.dashboard-video-play-image {
    opacity: 1;
    transition: all ease 500ms;
}

.ke-section-dashboard .gridwrapper > .item.video .openvideo {
    cursor: pointer;
}

/* Dashboard layout variants */
.ke-section-dashboard.dashboard-layout-five_block .gridwrapper {
    grid-template-areas:
        "item1 item1 item2 item3"
        "item4 item5 item5 item3";
}

.ke-section-dashboard.dashboard-layout-five_block .item1 { grid-area: item1 !important; }
.ke-section-dashboard.dashboard-layout-five_block .item2 { grid-area: item2 !important; }
.ke-section-dashboard.dashboard-layout-five_block .item3 { grid-area: item3 !important; }
.ke-section-dashboard.dashboard-layout-five_block .item4 { grid-area: item4 !important; }
.ke-section-dashboard.dashboard-layout-five_block .item5 { grid-area: item5 !important; }

.ke-section-dashboard.dashboard-layout-five_block
.gridwrapper > .item:not(.item1):not(.item3):not(.item5) {
    aspect-ratio: 1 / 1;
    height: auto !important;
    width: auto !important;
}

.ke-section-dashboard.dashboard-layout-four_block .gridwrapper {
    grid-template-areas:
        "item1 item1 item2 item2"
        "item3 item3 item4 item4";
}

.ke-section-dashboard.dashboard-layout-four_block .item1 { grid-area: item1 !important; }
.ke-section-dashboard.dashboard-layout-four_block .item2 { grid-area: item2 !important; }
.ke-section-dashboard.dashboard-layout-four_block .item3 { grid-area: item3 !important; }
.ke-section-dashboard.dashboard-layout-four_block .item4 { grid-area: item4 !important; }
.ke-section-dashboard.dashboard-layout-four_block .item5 { display: none; }

.ke-section-dashboard.dashboard-layout-four_block .gridwrapper > .item.news .ke_btn {
    margin-top: 15px !important;
}

.ke-section-dashboard.dashboard-layout-four_row .gridwrapper {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: 1fr;
    grid-template-areas: "item1 item2 item3 item4";
}

.ke-section-dashboard.dashboard-layout-four_row .item1 { grid-area: item1 !important; }
.ke-section-dashboard.dashboard-layout-four_row .item2 { grid-area: item2 !important; }
.ke-section-dashboard.dashboard-layout-four_row .item3 { grid-area: item3 !important; }
.ke-section-dashboard.dashboard-layout-four_row .item4 { grid-area: item4 !important; }

.ke-section-dashboard.dashboard-layout-four_row .gridwrapper > .item.news .ke_btn {
    margin-top: 15px !important;
}

/* Tablet / mobile behavior from legacy theme */
@media screen and (max-width: 1210px) {
    .ke-section-dashboard .gridwrapper {
        max-width: 100vw;
        padding: 0 20px;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        display: flex !important;
        flex-direction: column;
    }

    .ke-section-dashboard .gridwrapper > .item {
        flex-wrap: nowrap;
        aspect-ratio: unset !important;
        min-height: 200px;
        max-width: calc(100vw - 50px) !important;
    }

    .ke-section-dashboard .gridwrapper > .item.video {
        padding-right: 20px !important;
    }

    .ke-section-dashboard .gridwrapper > .item.news h2 {
        margin-top: 0 !important;
    }

    .ke-section-dashboard .gridwrapper > .item.news .ke_btn {
        margin: 20px 0;
    }

    .ke-section-dashboard .gridwrapper > .item .ke_btn {
        margin-top: 10px;
    }

    .ke-section-dashboard .gridwrapper > .item .ke_btn a {
        padding: 2px 20px;
    }
}
