.hd-impressum-wrap,
.hd-impressum-wrap * {
    box-sizing: border-box;
}

.hd-impressum-wrap {
    width: 100%;
    background: var(--hd-bg, #f7fafc);
    padding: 38px 18px;
    color: var(--hd-primary, #12304a);
    font-family: "Poppins", Arial, sans-serif;
    font-weight: 300;
    overflow-x: hidden;
}

.hd-impressum-inner {
    width: min(100%, var(--hd-max-width, 1280px));
    margin: 0 auto;
}

.hd-impressum-hero {
    border-radius: 28px;
    padding: 46px 48px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #eef7fb 0%, #fff 58%, #f3faf7 100%);
    border: 1px solid rgba(18,48,74,.08);
}

.hd-impressum-hero h1,
.hd-impressum-card h2,
.hd-impressum-wide h2,
.hd-impressum-card h3 {
    font-family: "Bree Serif", Georgia, serif;
    font-weight: 400;
    color: var(--hd-primary, #12304a);
    line-height: 1.12;
    margin: 0;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.hd-impressum-hero h1 {
    font-size: clamp(34px, 4vw, 54px);
    margin-bottom: 14px;
}

.hd-impressum-hero p,
.hd-impressum-intro,
.hd-impressum-wide p {
    margin: 0;
    color: #5d6f7d;
    font-size: 18px;
    line-height: 1.7;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.hd-impressum-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hd-impressum-pills span,
.hd-impressum-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 600;
}

.hd-impressum-pills span {
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--hd-accent, #2f789f) 22%, transparent);
    color: var(--hd-accent, #2f789f) !important;
}

.hd-impressum-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.hd-impressum-card,
.hd-impressum-wide {
    background: var(--hd-card, #fff);
    border: 1px solid rgba(18,48,74,.08);
    border-radius: 28px;
    box-shadow: 0 16px 40px rgba(18,48,74,.08);
}

.hd-impressum-card {
    padding: 34px;
    min-width: 0;
}

.hd-impressum-badge {
    background: color-mix(in srgb, var(--hd-accent, #2f789f) 12%, #ffffff);
    color: var(--hd-accent, #2f789f) !important;
    margin-bottom: 22px;
}

.hd-impressum-badge-green {
    background: color-mix(in srgb, var(--hd-accent, #2f789f) 10%, #ffffff);
    color: var(--hd-accent, #2f789f) !important;
}

.hd-impressum-card h2 {
    font-size: clamp(28px, 2.6vw, 38px);
    margin-bottom: 14px;
}

.hd-impressum-card h3 {
    font-size: 24px;
    margin: 32px 0 13px;
}

.hd-impressum-list {
    display: grid;
    gap: 7px;
    font-size: 17px;
    line-height: 1.62;
    color: var(--hd-primary, #12304a);
}

.hd-impressum-line,
.hd-impressum-list,
.hd-impressum-line span {
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.hd-impressum-label {
    font-weight: 600;
}

.hd-impressum-wide {
    display: flex;
    gap: 22px;
    padding: 32px 36px;
    margin-top: 28px;
}

.hd-impressum-wide h2 {
    font-size: clamp(27px, 2.5vw, 36px);
    margin-bottom: 8px;
}

.hd-impressum-icon {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #f3ead9;
    color: #b89148;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    font-family: Georgia, serif;
}

.hd-impressum-credits {
    display: block;
}

/* Theme-Container mobil nahezu vollständig umgehen */
@media (max-width: 767px) {
    body .hd-impressum-wrap {
        position: relative;
        left: 50%;
        right: 50%;
        width: calc(100vw - (var(--hd-mobile-padding, 4px) * 2)) !important;
        max-width: calc(100vw - (var(--hd-mobile-padding, 4px) * 2)) !important;
        margin-left: calc(-50vw + var(--hd-mobile-padding, 4px)) !important;
        margin-right: calc(-50vw + var(--hd-mobile-padding, 4px)) !important;
        padding: 8px 0 !important;
    }

    .hd-impressum-inner {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .hd-impressum-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hd-impressum-hero,
    .hd-impressum-card,
    .hd-impressum-wide {
        border-radius: 16px;
        margin-left: 0;
        margin-right: 0;
    }

    .hd-impressum-hero {
        padding: 22px var(--hd-mobile-inner-padding, 10px);
        margin-bottom: 10px;
    }

    .hd-impressum-card {
        padding: 22px var(--hd-mobile-inner-padding, 10px);
    }

    .hd-impressum-wide {
        padding: 22px var(--hd-mobile-inner-padding, 10px);
        margin-top: 10px;
        gap: 12px;
    }

    .hd-impressum-hero p,
    .hd-impressum-intro,
    .hd-impressum-wide p,
    .hd-impressum-list {
        font-size: 16px;
        line-height: 1.6;
    }

    .hd-impressum-card h3 {
        font-size: 22px;
        margin-top: 24px;
    }

    .hd-impressum-pills {
        gap: 6px;
    }

    .hd-impressum-pills span {
        padding: 7px 11px;
    }
}

@media (max-width: 420px) {
    .hd-impressum-wide {
        display: block;
    }
    .hd-impressum-icon {
        margin-bottom: 14px;
    }
}


/* Fallback: Akzentfarbe sicher sichtbar, auch wenn color-mix nicht unterstützt wird */
@supports not (background: color-mix(in srgb, #000 10%, #fff)) {
    .hd-impressum-badge {
        background: #eef7fb;
        color: var(--hd-accent, #2f789f) !important;
    }
    .hd-impressum-badge-green {
        background: #eef7fb;
        color: var(--hd-accent, #2f789f) !important;
    }
    .hd-impressum-pills span {
        border-color: #d6e8f2;
        color: var(--hd-accent, #2f789f) !important;
    }
}

/* Akzentfarbe zusätzlich bei Links und markanten Elementen */
.hd-impressum-wrap a,
.hd-impressum-wrap a:visited {
    color: var(--hd-accent, #2f789f) !important;
}


/* Version 1.0.6: Mobile Außenränder rechts/links exakt über Adminwert, Standard 4px */
@media (max-width: 767px) {
    html body .hd-impressum-wrap {
        width: calc(100vw - (var(--hd-mobile-padding, 4px) * 2)) !important;
        max-width: calc(100vw - (var(--hd-mobile-padding, 4px) * 2)) !important;
        margin-left: calc(-50vw + var(--hd-mobile-padding, 4px)) !important;
        margin-right: calc(-50vw + var(--hd-mobile-padding, 4px)) !important;
    }
}


/* Version 1.0.7: obere Boxen/Pills immer sichtbar */
.hd-impressum-wrap .hd-impressum-pills {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hd-impressum-wrap .hd-impressum-pills span {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Mobile Außenrand niemals kleiner als 4px */
@media (max-width: 767px) {
    html body .hd-impressum-wrap {
        width: calc(100vw - 8px) !important;
        max-width: calc(100vw - 8px) !important;
        margin-left: calc(-50vw + 4px) !important;
        margin-right: calc(-50vw + 4px) !important;
    }
}


/* Version 1.0.8: harte mobile Breite: rechts/links 4px */
@media (max-width: 767px) {
    html body .hd-impressum-wrap {
        box-sizing: border-box !important;
        position: relative !important;
        left: 50% !important;
        width: calc(100vw - 8px) !important;
        max-width: calc(100vw - 8px) !important;
        min-width: calc(100vw - 8px) !important;
        margin-left: calc(-50vw + 4px) !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    html body .hd-impressum-wrap .hd-impressum-inner {
        width: 100% !important;
        max-width: 100% !important;
    }

    html body .hd-impressum-wrap .hd-impressum-hero,
    html body .hd-impressum-wrap .hd-impressum-card,
    html body .hd-impressum-wrap .hd-impressum-wide {
        width: 100% !important;
        max-width: 100% !important;
    }

    .hd-impressum-tmg-box {
        margin-bottom: 10px !important;
    }
}


/* Version 1.0.9: Abstand der § 5 TMG-Box zur darunterliegenden Box */
.hd-impressum-tmg-box {
    margin-bottom: 28px !important;
}

.hd-impressum-tmg-box h2 {
    margin-bottom: 14px !important;
}

@media (max-width: 767px) {
    .hd-impressum-tmg-box {
        margin-bottom: 14px !important;
    }

    .hd-impressum-tmg-box h2 {
        margin-bottom: 12px !important;
    }
}
