.cdgw-public-content {
    margin-bottom: 42px;
}

.cdgw-public-content-has-image {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
    gap: clamp(28px, 5vw, 70px);
    align-items: start;
}

.cdgw-public-content-text > :first-child {
    margin-top: 0;
}

.cdgw-public-content-image {
    width: 100%;
}

.cdgw-public-featured-image-link {
    display: block;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: none !important;
}

.cdgw-public-featured-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    border-radius: 16px;
}

.cdgw-internal-content {
    /* Breakout auf bis zu 1600px, auch wenn der normale Post-Container schmaler ist */
    width: min(1600px, calc(100vw - 70px));
    max-width: 1600px;
    margin: 42px 0 0 50%;
    padding: clamp(32px, 4vw, 58px);
    border-top: 0;
    border-radius: 22px;
    background: rgb(242, 244, 249);
    transform: translateX(-50%);
}

.cdgw-internal-content-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 22px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #00305e;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
}

.cdgw-internal-login-notice {
    margin: 36px 0;
    padding: 28px 30px;
    border-radius: 18px;
    background: rgb(242, 244, 249);
    border: 1px solid rgba(0, 48, 94, 0.12);
    color: #00305e;
}

.cdgw-internal-login-notice strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.cdgw-internal-login-notice p {
    margin: 0 0 10px 0;
}

.cdgw-internal-login-notice p:last-child {
    margin-bottom: 0;
}

.cdgw-internal-login-notice a {
    color: #00305e;
    font-weight: 700;
    text-decoration: underline;
}

.cdgw-ppc-back-button-wrap {
    margin-top: 42px;
}

@media (max-width: 980px) {
    .cdgw-public-content-has-image {
        grid-template-columns: 1fr;
    }

    .cdgw-public-content-image {
        max-width: 620px;
    }
}

@media (max-width: 768px) {
    .cdgw-internal-content {
        width: 100%;
        margin-left: 0;
        transform: none;
    }
}


/* Ab 0.2.0 wird interner Inhalt nicht mehr direkt im Seiten-HTML ausgegeben,
   sondern erst nach Login-Prüfung per AJAX nachgeladen. Deshalb kein globales
   body:not(.logged-in)-Ausblenden mehr, damit gecachte Body-Klassen den
   nachgeladenen Inhalt nicht versehentlich verstecken. */

/* Login-Lightbox für öffentliche Rückblicke */
.cdgw-ppc-login-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cdgw-ppc-login-modal.is-open {
    display: flex;
}

.cdgw-ppc-login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 22, 43, 0.68);
    backdrop-filter: blur(3px);
}

.cdgw-ppc-login-modal-box {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 34px;
    border-radius: 18px;
    background: #ffffff;
    color: #00305e;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.cdgw-ppc-login-modal-box h2 {
    margin: 0 0 22px 0;
    color: #00305e;
}

.cdgw-ppc-login-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #f3f5f7;
    color: #00305e;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.cdgw-ppc-login-modal-content input[type="text"],
.cdgw-ppc-login-modal-content input[type="email"],
.cdgw-ppc-login-modal-content input[type="password"] {
    width: 100%;
    max-width: 100%;
}

.cdgw-ppc-login-modal-content input[type="submit"],
.cdgw-ppc-login-modal-content button,
.cdgw-ppc-login-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 14px;
    border: 0;
    background: #00305e;
    color: #ffffff !important;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
}

html.cdgw-ppc-login-modal-open,
html.cdgw-ppc-login-modal-open body {
    overflow: hidden;
}


/* Version 0.1.5: Login-Link als Button und robustere Membership-Lightbox */
.cdgw-ppc-login-button,
.cdgw-ppc-internal-area-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 6px 8px 0 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: #00305e;
    color: #ffffff !important;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: none !important;
}

.cdgw-ppc-internal-area-link {
    background: transparent;
    color: #00305e !important;
    border: 1px solid rgba(0, 48, 94, 0.24);
}

.cdgw-ppc-login-modal-content form,
.cdgw-ppc-membership-form form {
    margin: 0;
}

.cdgw-ppc-login-modal-content label,
.cdgw-ppc-membership-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: #00305e;
}

.cdgw-ppc-login-modal-content input[type="text"],
.cdgw-ppc-login-modal-content input[type="email"],
.cdgw-ppc-login-modal-content input[type="password"],
.cdgw-ppc-membership-form input[type="text"],
.cdgw-ppc-membership-form input[type="email"],
.cdgw-ppc-membership-form input[type="password"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 48, 94, 0.2);
    border-radius: 10px;
}

.cdgw-ppc-login-help {
    margin-top: 16px;
}

@media (max-width: 768px) {
    .cdgw-internal-content {
        padding: 26px 20px;
        border-radius: 16px;
    }
}

/* Version 0.1.6: Simple-Membership-Login sauber in der Lightbox darstellen */
.cdgw-ppc-swpm-login-form .swpm-login-widget-form,
.cdgw-ppc-swpm-login-form form,
.cdgw-ppc-membership-form form {
    margin: 0;
}

.cdgw-ppc-swpm-login-form label,
.cdgw-ppc-membership-form label {
    display: block;
    margin: 0 0 6px 0;
    color: #00305e;
    font-weight: 700;
}

.cdgw-ppc-swpm-login-form input[type="text"],
.cdgw-ppc-swpm-login-form input[type="email"],
.cdgw-ppc-swpm-login-form input[type="password"],
.cdgw-ppc-membership-form input[type="text"],
.cdgw-ppc-membership-form input[type="email"],
.cdgw-ppc-membership-form input[type="password"] {
    width: 100%;
    max-width: 100%;
    margin-bottom: 14px;
}

.cdgw-ppc-swpm-login-form input[type="submit"],
.cdgw-ppc-swpm-login-form button,
.cdgw-ppc-membership-form input[type="submit"],
.cdgw-ppc-membership-form button {
    border-radius: 14px;
    background: #00305e;
    color: #fff !important;
    border: 0;
    padding: 12px 22px;
    font-weight: 700;
}


.cdgw-ppc-internal-placeholder {
    margin-top: 42px;
}

.cdgw-ppc-internal-loading {
    color: #00305e;
}

.cdgw-internal-login-notice .cdgw-ppc-login-button {
    margin-top: 10px;
}


/* 0.2.2: Wenn ein Beitrag keinen öffentlichen Inhalt hat, rückt der interne Bereich näher an den Hero heran. */
body.cdgw-ppc-no-public-content .cdgw-internal-content {
    margin-top: clamp(18px, 2vw, 28px);
}

body.cdgw-ppc-no-public-content .cdgw-internal-content > :first-child {
    margin-top: 0;
}


/* 0.2.3: Wenn ein Beitrag nur internen Inhalt hat, keinen großen Leerraum vor dem Block lassen. */
body.cdgw-ppc-no-public-content .cdgw-internal-content,
.cdgw-internal-content.cdgw-internal-content--no-public {
    margin-top: 0;
}

body.cdgw-ppc-no-public-content .cdgw-public-content {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
