.kloster-kachel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--kk-height, 150px);
    min-height: 120px;
    overflow: hidden;
    isolation: isolate;
    color: #fff !important;
    background: var(--kk-overlay, #98002e) !important;
    text-decoration: none !important;
    text-align: center;
    box-sizing: border-box;
}

.kloster-kachel--has-image {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    vertical-align: top;
}

.kloster-kacheln {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 18px;
}

.kloster-kacheln > p {
    margin: 0;
}

.kloster-kachel__bild {
    position: relative;
    z-index: 0;
    display: block;
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    transition: transform 1s ease;
}

.kloster-kachel__overlay {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: var(--kk-overlay, #98002e) !important;
    opacity: 0;
    transition: opacity 1s ease;
}

.kloster-kachel__bildtext,
.kloster-kachel__text {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    padding-top: 10px;
    color: #fff !important;
    font-family: "Vollkorn";
    font-size: 20px;
    font-style: italic;
    font-weight: 700;
    line-height: 1.2 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
    overflow-wrap: anywhere;
    transition: opacity 1s ease;
}

.kloster-kachel__bildtext {
    text-transform: uppercase;
    left: 50%;
    right: auto;
    width: 216px !important;
    transform: translateX(-50%);
    padding-top: 0 !important;
    line-height: 1.2em !important;
    font-family: "Vollkorn", serif;
    color: #fff;
    font-weight: 400;
    font-style: italic;
    font-size: 24px;
}

.kloster-kachel__text {
    opacity: 0;
    background: #98002e !important;
    font-family: "Vollkorn";
    font-weight: normal;
    font-style: italic;
    font-size: 20px;
    line-height: 1.2 !important;
    padding-top: 10px !important;
    transition: opacity 1s ease;
}

.kloster-kachel:hover .kloster-kachel__bildtext,
.kloster-kachel:focus-visible .kloster-kachel__bildtext {
    opacity: 0;
}

.kloster-kachel:hover .kloster-kachel__text,
.kloster-kachel:focus-visible .kloster-kachel__text {
    opacity: 1;
}

.kloster-kachel:hover .kloster-kachel__overlay,
.kloster-kachel:focus-visible .kloster-kachel__overlay {
    opacity: 1;
}

.kloster-kachel:not(.kloster-kachel--has-overlay-text):hover .kloster-kachel__bildtext,
.kloster-kachel:not(.kloster-kachel--has-overlay-text):focus-visible .kloster-kachel__bildtext {
    opacity: 1;
}

.kloster-kachel:hover .kloster-kachel__bild {
    transform: scale(1.035);
}

.kloster-kachel:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.kloster-kachel:active {
    transform: translateY(1px);
}

@media (max-width: 767px) {
    .kloster-kacheln {
        flex-direction: column;
        align-items: stretch;
    }

    .kloster-kachel--has-image {
        display: flex;
        width: 100% !important;
        max-width: 100%;
    }

    .kloster-kachel__bild {
        position: absolute;
        inset: 0;
        width: 100% !important;
        height: 100% !important;
        max-width: none;
        object-fit: cover;
    }
}

@media (hover: none) {
    .kloster-kachel:hover:not(:focus-visible) .kloster-kachel__bildtext {
        opacity: 1;
    }

    .kloster-kachel:hover:not(:focus-visible) .kloster-kachel__text,
    .kloster-kachel:hover:not(:focus-visible) .kloster-kachel__overlay {
        opacity: 0;
    }

    .kloster-kachel:hover:not(:focus-visible) .kloster-kachel__bild {
        transform: none;
    }
}
