.em-repair-block {
    /* Farben der Lebach-Seite */
    --em-red: #e30614;
    --em-blue: #004799;
    --em-navy: #04142a;
    --em-text: #0a0a0a;
    --em-muted: #5a626d;
    --em-card: #f3f5f7;
    --em-border: #e2e6ea;
    --em-white: #ffffff;
    --em-media-column: 21rem;

    box-sizing: border-box;
    width: 100%;
    margin: 2rem 0;
    font-family: inherit;
    color: var(--em-text);
}

.em-repair-block *,
.em-repair-block *::before,
.em-repair-block *::after {
    box-sizing: border-box;
}

.em-repair-block h1,
.em-repair-block h2,
.em-repair-block h3,
.em-repair-block h4 {
    margin-top: 0;
    margin-bottom: 0;
}

.em-repair__card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, var(--em-media-column));
    align-items: stretch;
    gap: 1.5rem;
    padding: 1.125rem;
    border: 0.0625rem solid var(--em-border);
    border-radius: 0.875rem;
    background: var(--em-card);
    box-shadow: 0 0.375rem 1.375rem rgba(4, 20, 42, 0.06);
    overflow: hidden;
}

/* Beim Wechsel links/rechts bleibt die Bildspalte exakt gleich breit. */
.em-repair-block--image-left .em-repair__card {
    grid-template-columns: minmax(16rem, var(--em-media-column)) minmax(0, 1fr);
}

.em-repair-block--image-left .em-repair__media {
    order: -1;
}

/* Ohne Frontend-Bild keine leere zweite Spalte. */
.em-repair__card:not(:has(> .em-repair__media)) {
    grid-template-columns: minmax(0, 1fr);
}

.em-repair__content {
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr);
    gap: 1.125rem;
    align-items: start;
    min-width: 0;
    padding: 0.875rem 0.5rem 0.875rem 0.625rem;
}

.em-repair__icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.25rem;
    height: 4.25rem;
    margin-top: 1.25rem;
    border-radius: 999rem;
    background: var(--em-red);
    color: var(--em-white);
    flex: 0 0 auto;
}

.em-repair__icon-wrap svg {
    width: 2.25rem;
    height: 2.25rem;
}

.em-repair__icon-image {
    display: block;
    width: 2.375rem;
    height: 2.375rem;
    object-fit: contain;
    /* Hochgeladene Reparatur-SVGs erscheinen weiß im roten Kreis. */
    filter: brightness(0) invert(1);
}

.em-repair__copy {
    min-width: 0;
}

.em-repair__badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    margin: 0 0 0.5rem;
    padding: 0.25rem 0.6875rem 0.1875rem;
    border-radius: 999rem;
    background: var(--em-red);
    color: var(--em-white);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.em-repair__innerblocks,
.em-repair__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
    row-gap: 0;
}

/* Core-Überschrift: bewusst niedrige CSS-Spezifität, damit WP-Typografieoptionen weiter funktionieren. */
:where(.em-repair__innerblocks) > :where(.wp-block-heading.em-repair__title),
:where(.em-repair__innerblocks) > :where(.block-editor-inner-blocks) > :where(.block-editor-block-list__layout) > :where(.wp-block-heading.em-repair__title) {
    grid-column: 1 / -1;
    margin: 0 0 0.5rem;
    color: var(--em-text);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

:where(.em-repair__innerblocks) > :where(.wp-block-paragraph),
:where(.em-repair__innerblocks) > :where(.block-editor-inner-blocks) > :where(.block-editor-block-list__layout) > :where(.wp-block-paragraph) {
    margin-top: 0;
    color: 1rem;
}

:where(.em-repair__innerblocks) > :where(.em-repair__description),
:where(.em-repair__innerblocks) > :where(.block-editor-inner-blocks) > :where(.block-editor-block-list__layout) > :where(.em-repair__description) {
    grid-column: 1 / -1;
    max-width: 47.5rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
}

:where(.em-repair__innerblocks) > :where(.em-repair__text),
:where(.em-repair__innerblocks) > :where(.block-editor-inner-blocks) > :where(.block-editor-block-list__layout) > :where(.em-repair__text) {
    grid-column: 1 / -1;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.45;
}

:where(.em-repair__innerblocks) > :where(.em-repair__fact),
:where(.em-repair__innerblocks) > :where(.block-editor-inner-blocks) > :where(.block-editor-block-list__layout) > :where(.em-repair__fact) {
    position: relative;
    min-height: 2rem;
    margin-bottom: 0;
    padding-left: 2.5rem;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.em-repair__fact strong {
    font-weight: 800;
}

.em-repair__fact em {
    color: var(--em-muted);
    font-style: normal;
}

.em-repair__fact--hours::before,
.em-repair__fact--location::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.0625rem;
    display: block;
    width: 1.5rem;
    height: 1.5rem;
}

/* Standard-Uhr in Elektro-Meyer-Rot. */
.em-repair__fact--hours::before {
    border: 0.1875rem solid var(--em-red);
    border-radius: 999rem;
}

.em-repair__fact--hours::after {
    content: '';
    position: absolute;
    left: 0.6875rem;
    top: 0.3125rem;
    width: 0.125rem;
    height: 0.5rem;
    border-radius: 0.125rem;
    background: var(--em-red);
    box-shadow: 0.1875rem 0.375rem 0 -0.01875rem var(--em-red);
    transform-origin: 0.0625rem 0.4375rem;
}

/* Standard-Standortpin in Elektro-Meyer-Rot. */
.em-repair__fact--location::before {
    border-radius: 50% 50% 50% 0;
    background: var(--em-red);
    transform: rotate(-45deg) scale(0.8);
}

.em-repair__fact--location::after {
    content: '';
    position: absolute;
    left: 0.53125rem;
    top: 0.53125rem;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: var(--em-white);
}

/* Hochgeladene Zeit-/Standort-SVGs werden als Maske genutzt und dadurch exakt rot. */
.em-repair-block--has-hours-icon .em-repair__fact--hours::before,
.em-repair-block--has-location-icon .em-repair__fact--location::before {
    border: 0;
    border-radius: 0;
    background: var(--em-red);
    transform: none;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.em-repair-block--has-hours-icon .em-repair__fact--hours::before {
    -webkit-mask-image: var(--em-hours-icon);
    mask-image: var(--em-hours-icon);
}

.em-repair-block--has-location-icon .em-repair__fact--location::before {
    -webkit-mask-image: var(--em-location-icon);
    mask-image: var(--em-location-icon);
}

.em-repair-block--has-hours-icon .em-repair__fact--hours::after,
.em-repair-block--has-location-icon .em-repair__fact--location::after {
    content: none;
}

.em-repair__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    margin-top: 1.25rem;
    padding: 0.5625rem 1.125rem;
    border-radius: 999rem;
    background: var(--em-red);
    color: var(--em-white) !important;
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
}

.em-repair__button:hover,
.em-repair__button:focus {
    filter: brightness(0.94);
}

.em-repair__media {
    min-width: 0;
    min-height: 13.75rem;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #e7e9ed;
}

.em-repair__media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 13.75rem;
    object-fit: cover;
}

/* Legacy-Markup aus 1.0/1.1/1.2 bis zum nächsten Speichern. */
.em-repair__title,
.em-repair__title-block {
    margin: 0 0 0.5rem;
    color: var(--em-text);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.em-repair__text-block {
    position: relative;
    margin: 0;
    color: var(--em-text);
    font-size: 0.9375rem;
    line-height: 1.4;
}

.em-repair__text-block--description {
    grid-column: 1 / -1;
    max-width: 47.5rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
}

.em-repair__text-block--standard {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
}

.em-repair__text-block--hours,
.em-repair__text-block--location {
    min-height: 2rem;
    padding-left: 2.5rem;
}

.em-repair__text-block--hours::before,
.em-repair__text-block--location::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.0625rem;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--em-red);
}

.em-repair__text-block--hours::before {
    border-radius: 50%;
}

.em-repair__text-block--location::before {
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg) scale(0.8);
}

/* Noch älteres Facts-Markup. */
.em-repair__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 2rem;
    margin-top: 1.5rem;
}

.em-repair__facts .em-repair__fact {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: 0.75rem;
    padding-left: 0;
}

.em-repair__fact-icon {
    position: relative;
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.0625rem;
    border: 0.1875rem solid var(--em-red);
    border-radius: 999rem;
}

.em-repair__fact-icon--pin {
    border: 0;
    border-radius: 50% 50% 50% 0;
    background: var(--em-red);
    transform: rotate(-45deg) scale(0.8);
}

.em-repair__fact-icon--custom {
    border: 0;
    border-radius: 0;
    background: var(--em-red);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    transform: none;
}

@media (max-width: 1200px) {
    .em-repair__card,
    .em-repair-block--image-left .em-repair__card {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.875rem;
    }

    .em-repair__media,
    .em-repair-block--image-left .em-repair__media,
    .em-repair-block--image-right .em-repair__media {
        min-height: 15rem;
        order: -1;
    }

    .em-repair__media img {
        min-height: 15rem;
        max-height: 23.75rem;
    }
}

@media (max-width: 38.75rem) {
    .em-repair-block {
        margin: 1.25rem 0;
    }

    .em-repair__card {
        padding: 0.75rem;
        border-radius: 0.75rem;
    }

    .em-repair__content {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.5rem 0.25rem 0.75rem;
    }

    .em-repair__icon-wrap {
        width: 3.625rem;
        height: 3.625rem;
        margin-top: 0;
    }

    .em-repair__icon-wrap svg,
    .em-repair__icon-image {
        width: 1.9375rem;
        height: 1.9375rem;
    }

    .em-repair__innerblocks,
    .em-repair__innerblocks > .block-editor-inner-blocks > .block-editor-block-list__layout,
    .em-repair__facts {
        grid-template-columns: 1fr;
        gap: 0.9375rem;
    }

    :where(.em-repair__innerblocks) > :where(.wp-block-heading.em-repair__title),
    :where(.em-repair__innerblocks) > :where(.block-editor-inner-blocks) > :where(.block-editor-block-list__layout) > :where(.wp-block-heading.em-repair__title),
    .em-repair__title,
    .em-repair__title-block {
        font-size: 1.5rem;
    }

    :where(.em-repair__innerblocks) > :where(.em-repair__description),
    :where(.em-repair__innerblocks) > :where(.block-editor-inner-blocks) > :where(.block-editor-block-list__layout) > :where(.em-repair__description),
    .em-repair__text-block--description {
        margin-bottom: 0.25rem;
        font-size: 0.9375rem;
    }

    .em-repair__media,
    .em-repair__media img {
        min-height: 13.125rem;
    }
}


.em-repair__badge {
    position: relative;
    animation: em-repair-badge-pulse 3s ease-in-out infinite;
}

@keyframes em-repair-badge-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(227, 6, 20, 0);
    }

    50% {
        transform: scale(1.025);
        box-shadow: 0 0 0 0.2rem rgba(227, 6, 20, 0.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .em-repair__badge {
        animation: none;
    }
}
