/* ---------------------------------------------------------------------
 * P4 News – SHK Weiß
 * Schmale, textbasierte News-Leiste mit Overlay-Detailansicht
 * ------------------------------------------------------------------- */

.p4-news {
    --p4-blue: #009fe3;
    --p4-blue-dark: #0078a8;
    --p4-ink: #1a2733;
    --p4-ink-soft: #5a6975;
    --p4-line: #e3e8ee;
    --p4-radius: 8px;

    box-sizing: border-box;
    padding: 18px 20px;
    background: #fff;
    border-top: 1px solid var(--p4-line);
    border-bottom: 1px solid var(--p4-line);
    color: var(--p4-ink);
    font-family: inherit;
}

.p4-news *,
.p4-news *::before,
.p4-news *::after {
    box-sizing: border-box;
}

.p4-news__inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

/* -------------------- Titel -------------------- */
.p4-news__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--p4-ink);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.p4-news__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--p4-blue);
    box-shadow: 0 0 0 4px rgba(0, 159, 227, 0.18);
    flex-shrink: 0;
}

/* -------------------- Liste -------------------- */
.p4-news__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    flex: 1;
    min-width: 0;
}

.p4-news__item {
    margin: 0;
    padding: 0;
    min-width: 0;
    max-width: 100%;
}

.p4-news__link {
    appearance: none;
    background: none;
    border: 0;
    padding: 4px 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    text-align: left;
    line-height: 1.4;
    max-width: 100%;
    min-width: 0;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.p4-news__link:hover,
.p4-news__link:focus-visible {
    color: var(--p4-blue-dark);
    border-bottom-color: currentColor;
    outline: none;
}

.p4-news__date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--p4-blue-dark);
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.p4-news__headline {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--p4-ink);
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.p4-news__link:hover .p4-news__headline,
.p4-news__link:focus-visible .p4-news__headline {
    color: var(--p4-blue-dark);
}

/* "mehr erfahren"-Hinweis (nur wenn Details vorhanden) */
.p4-news__more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--p4-blue-dark);
    opacity: 0.75;
    white-space: nowrap;
    transition: opacity 0.15s ease, gap 0.15s ease;
}

.p4-news__more svg {
    width: 12px;
    height: 12px;
}

.p4-news__link:hover .p4-news__more,
.p4-news__link:focus-visible .p4-news__more {
    opacity: 1;
    gap: 6px;
}

.p4-news__link[disabled],
.p4-news__link:disabled {
    cursor: default;
    color: var(--p4-ink);
    border-bottom-color: transparent;
}

.p4-news__link[disabled] .p4-news__headline,
.p4-news__link:disabled .p4-news__headline {
    color: var(--p4-ink);
}

.p4-news__tpl {
    display: none;
}

/* -------------------- Overlay -------------------- */
.p4-news__overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.p4-news__overlay[hidden] {
    display: none;
}

.p4-news__overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 40, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.p4-news__overlay-dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
    max-width: 640px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.p4-news__overlay-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: var(--p4-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.p4-news__overlay-close:hover {
    background: #f4f7fa;
}

.p4-news__overlay-close svg {
    width: 18px;
    height: 18px;
}

.p4-news__overlay-body {
    overflow-y: auto;
    padding: 0;
}

.p4-news__overlay-media {
    width: 100%;
    max-height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #f4f7fa;
    aspect-ratio: 16 / 9;
}

.p4-news__overlay-media:empty {
    display: none;
}

.p4-news__overlay-title {
    margin: 0;
    padding: 24px 28px 4px;
    font-size: 1.35rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--p4-ink);
    padding-right: 52px;
}

.p4-news__overlay-meta {
    padding: 0 28px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--p4-blue-dark);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.p4-news__overlay-meta:empty {
    display: none;
}

.p4-news__overlay-content {
    padding: 14px 28px 28px;
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--p4-ink);
}

.p4-news__overlay-content p {
    margin: 0 0 0.9em;
}

.p4-news__overlay-content p:last-child {
    margin-bottom: 0;
}

.p4-news__overlay-content ul,
.p4-news__overlay-content ol {
    margin: 0 0 0.9em;
    padding-left: 1.3em;
}

.p4-news__overlay-content li {
    margin-bottom: 0.3em;
}

.p4-news__overlay-content a {
    color: var(--p4-blue-dark);
    text-decoration: underline;
}

.p4-news__overlay-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

body.p4-news-locked {
    overflow: hidden;
}

/* -------------------- Mobile -------------------- */
@media (max-width: 720px) {
    .p4-news {
        padding: 14px 16px;
    }

    .p4-news__inner {
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }

    .p4-news__list {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .p4-news__link {
        width: 100%;
    }

    .p4-news__more {
        margin-left: auto;
    }

    .p4-news__overlay {
        padding: 0;
    }

    .p4-news__overlay-dialog {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }

    .p4-news__overlay-title,
    .p4-news__overlay-meta,
    .p4-news__overlay-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .p4-news__overlay-title {
        padding-right: 50px;
    }
}
