/* Gemeinsame Secondary-Aktion bleibt auch ohne die App-Shell auf Loginseiten lesbar. */
body a.sp-privacy-document__trigger.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
    min-height: max(2.75rem, 44px);
    padding: 0.5rem 1rem;
    border: 1px solid var(--hessen-blue-100, #14006e);
    border-radius: 0.25rem;
    background: var(--hessen-white, #fff);
    color: var(--hessen-blue-100, #14006e);
    font-family: var(--sp-cd-font-family, Arial, sans-serif);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
    text-transform: none;
    vertical-align: middle;
}

/* Außerhalb echter Footer hält die eigenständige Aktion Abstand zum Vorgänger. */
body a.sp-privacy-document__trigger.button-secondary:not(:where(footer *, #colophon *, #wpfooter *, .custom-footer *)) {
    margin-top: 1rem;
}

body a.sp-privacy-document__trigger.button-secondary:not(:where(footer *, #colophon *, #wpfooter *, .custom-footer *)):hover,
body a.sp-privacy-document__trigger.button-secondary:not(:where(footer *, #colophon *, #wpfooter *, .custom-footer *)):focus {
    background: var(--hessen-blue-10, #f0faff);
    color: var(--hessen-blue-100, #14006e);
    text-decoration: none;
}

body a.sp-privacy-document__trigger.button-secondary:focus-visible {
    outline: 3px solid var(--hessen-blue-60, #6e82f0);
    outline-offset: 2px;
}

/* Im Colophon bleibt Datenschutz ein normaler, fluchtender Nachbar der Rechtslinks. */
body :is(footer, #colophon, #wpfooter, .custom-footer) a.sp-privacy-document__trigger {
    margin-top: 0;
    min-height: 0;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    vertical-align: baseline;
}

body :is(footer, #colophon, #wpfooter, .custom-footer) .sp-privacy-document__icon {
    display: none;
}

.sp-privacy-document__icon {
    flex: 0 0 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

.sp-privacy-document[hidden] {
    display: none;
}

.sp-privacy-document,
.sp-privacy-document * {
    box-sizing: border-box;
}

.sp-privacy-document {
    position: fixed;
    z-index: 1000000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(0.75rem, 3vw, 2rem);
    color: var(--hessen-gray-100, #232328);
    font-family: var(--sp-cd-font-family, Arial, sans-serif);
}

.sp-privacy-document__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 35, 55, 0.72);
}

.sp-privacy-document__panel {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(56rem, 100%);
    max-height: min(52rem, calc(100vh - clamp(1.5rem, 6vw, 4rem)));
    max-height: min(52rem, calc(100dvh - clamp(1.5rem, 6vw, 4rem)));
    overflow: hidden;
    background: var(--hessen-white, #fff);
    border: 1px solid var(--border-color, #d2d2d7);
    border-radius: 0.5rem;
    box-shadow: var(--layer2);
}

.sp-privacy-document__panel:focus {
    outline: 3px solid var(--hessen-blue-60, #6e82f0);
    outline-offset: 3px;
}

.sp-privacy-document__header {
    display: flex;
    margin: 0;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #d2d2d7);
}

.sp-privacy-document__header h2 {
    min-width: 0;
    overflow-wrap: anywhere;
    margin: 0;
    padding: 0;
    color: var(--hessen-blue-100, #14006e);
    font-size: 1.5rem;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: normal;
    text-transform: none;
}

.sp-privacy-document .sp-privacy-document__close {
    min-height: max(2.75rem, 44px);
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--hessen-blue-100, #14006e);
    border-radius: 0.25rem;
    background: var(--hessen-white, #fff);
    color: var(--hessen-blue-100, #14006e);
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    text-transform: none;
}

.sp-privacy-document .sp-privacy-document__close:hover,
.sp-privacy-document .sp-privacy-document__close:focus,
.sp-privacy-document .sp-privacy-document__close:focus-visible {
    background: var(--hessen-gray-10, #f1f3f5);
    outline: 3px solid var(--hessen-blue-60, #6e82f0);
    outline-offset: 2px;
}

.sp-privacy-document__content {
    overflow: auto;
    overscroll-behavior: contain;
    padding: 1.75rem 2rem;
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Rechtstext erhält eigene Typorollen statt Login-/Theme-Hero-Überschriften. */
.sp-privacy-document__content :is(h2, h3, h4, h5, h6) {
    margin: 1.5rem 0 0.75rem;
    padding: 0;
    color: var(--hessen-blue-100, #14006e);
    font-family: inherit;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
}

.sp-privacy-document__content h2 {
    font-size: 1.25rem;
}

/* Hauptabschnitte und Kontaktangaben gliedern lange Erklärungen ohne Textänderung. */
.sp-privacy-document__content > h2:not(:first-child) {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--hessen-gray-40, #d2d2d7);
}

.sp-privacy-document__content :is(h3, h4) {
    font-size: 1.125rem;
}

.sp-privacy-document__content :is(h5, h6) {
    font-size: 1rem;
}

.sp-privacy-document__content :is(p, ul, ol, dl, blockquote, address, table) {
    margin: 0 0 1rem;
    font-size: inherit;
    line-height: inherit;
}

.sp-privacy-document__content :is(ul, ol) {
    padding-left: 1.5rem;
}

.sp-privacy-document__content li + li {
    margin-top: 0.375rem;
}

.sp-privacy-document__content li > :is(ul, ol) {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.sp-privacy-document__content address {
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--hessen-blue-100, #14006e);
    border-radius: 0 0.25rem 0.25rem 0;
    background: var(--hessen-gray-10, #fafaff);
    font-style: normal;
}

.sp-privacy-document__content dt {
    margin-top: 1rem;
    font-weight: 700;
}

.sp-privacy-document__content dd {
    margin: 0.375rem 0 1rem 1.25rem;
}

.sp-privacy-document__content > :first-child {
    margin-top: 0;
}

.sp-privacy-document__content > :last-child {
    margin-bottom: 0;
}

.sp-privacy-document__content table {
    width: 100%;
    border-collapse: collapse;
}

.sp-privacy-document__content caption,
.sp-privacy-document__content th,
.sp-privacy-document__content td {
    padding: 0.6rem;
    border: 1px solid var(--border-color, #d2d2d7);
    text-align: left;
    vertical-align: top;
}

.sp-privacy-document__content a {
    color: var(--hessen-blue-100, #14006e);
    font-family: inherit;
    font-weight: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

html.sp-privacy-document-is-open,
html.sp-privacy-document-is-open body {
    overflow: hidden;
}

@media (max-width: 32rem) {
    .sp-privacy-document {
        padding: 0.5rem;
    }

    .sp-privacy-document__panel {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .sp-privacy-document__header {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 1rem;
    }

    .sp-privacy-document__content {
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-privacy-document,
    .sp-privacy-document * {
        scroll-behavior: auto;
        transition: none;
    }
}
