/* ==========================================================================
   Aktuelles / Blog – horizontales Layout
   Gilt nur für die Seite aktuelles.html (section#aktuell.news)
   Aufbau: .news-hero (füllt beim Laden den ganzen Bildschirm)
           .news-more (weitere Beiträge, erscheinen erst beim Scrollen)
   ========================================================================== */

.news {
    --news-red: #cc2123;
    --news-dark: #3c3c3b;
    --news-ink: #1f1f1e;
    --news-muted: #6b6b69;
    --news-bg: #f2f2f2;
    --news-card: #ffffff;
    --news-line: #e2e0dc;
    --news-gap: 24px;
    --news-ease: cubic-bezier(.2, .7, .2, 1);
}

/* Basis überschreibt die alten #aktuell-Regeln aus main.css */
.aktuelles #aktuell.news {
    background: var(--news-bg);
    padding: 120px 6% 80px;
    color: var(--news-dark);
    position: relative;
}

.news h1,
.news h2,
.news h3 {
    margin: 0;
}

.news a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Intro (Headline + Einleitung, Desktop links neben dem Top-Beitrag) ---------- */

.news-intro {
    position: relative;
}

.news-intro__eyebrow {
    display: inline-block;
    font: italic 600 14px/1 'Open Sans', sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--news-red);
    margin-bottom: 12px;
}

.news-intro h1 {
    font-family: Goldman, sans-serif;
    font-style: italic;
    font-size: 56px;
    line-height: 1;
    color: var(--news-ink);
    margin-bottom: 22px !important;
}

.news-intro h1 span {
    color: var(--news-red);
}

.news-intro__lead {
    font-size: 16px;
    line-height: 25px;
    max-width: 60ch;
    margin: 0;
}

.news-hint {
    display: none;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--news-dark);
    white-space: nowrap;
}

.news-hint__track {
    position: relative;
    width: 64px;
    height: 2px;
    background: var(--news-line);
    overflow: hidden;
}

.news-hint__track::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 40%;
    background: var(--news-red);
    animation: news-hint 1.8s var(--news-ease) infinite;
}

@keyframes news-hint {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

/* ---------- Tag ---------- */

.news-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 14px 5px;
    font: 600 11px/1.2 'Open Sans', sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: var(--news-red);
    color: #fff;
    clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
}

.news-tag--light {
    background: #fff;
    color: var(--news-red);
}

/* ---------- Karten allgemein ---------- */

.news-card {
    position: relative;
    background: var(--news-card);
    min-width: 0;
}

.news-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    outline: none;
}

.news-card__link:focus-visible {
    box-shadow: 0 0 0 3px var(--news-red);
}

.news-card__media {
    position: relative;
    overflow: hidden;
    margin: 0;
    background: #d9d7d3;
}

.news-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--news-ease);
}

.news-card__link:hover .news-card__media img,
.news-card__link:focus-visible .news-card__media img {
    transform: scale(1.05);
}

.news-card__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 22px 22px;
}

.news-card__title {
    font: 700 17px/1.35 'Open Sans', sans-serif !important;
    text-transform: none !important;
    color: var(--news-ink);
    overflow-wrap: break-word;
}

.news-card__excerpt {
    font-size: 14px;
    line-height: 21px;
    color: var(--news-muted);
    margin: 0;
}

.news-card__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--news-red);
}

.news-card__more svg {
    width: 18px;
    height: 10px;
    transition: transform .3s var(--news-ease);
}

.news-card__link:hover .news-card__more svg {
    transform: translateX(5px);
}

/* roter Balken beim Hover */
.news-card::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background: var(--news-red);
    transition: width .4s var(--news-ease);
    pointer-events: none;
}

.news-card:hover::after,
.news-card:focus-within::after {
    width: 100%;
}

/* ---------- Top-Beitrag ---------- */

.news-card--featured {
    background: var(--news-ink);
    color: #fff;
}

.news-card--featured .news-card__link {
    position: relative;
}

.news-card--featured .news-card__media {
    position: absolute;
    inset: 0;
}

.news-card--featured .news-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0) 30%, rgba(20, 20, 20, .55) 60%, rgba(20, 20, 20, .92) 100%);
}

.news-card--featured .news-card__body {
    position: relative;
    margin-top: auto;
    padding: 40px 44px 44px;
    gap: 16px;
}

.news-card--featured .news-card__title {
    font: italic 400 34px/1.15 Goldman, sans-serif !important;
    color: #fff;
    hyphens: manual;
    -webkit-hyphens: manual;
    max-width: 24ch;
}

.news-card--featured .news-card__excerpt {
    color: rgba(255, 255, 255, .85);
    font-size: 16px;
    line-height: 24px;
    max-width: 60ch;
}

.news-card--featured .news-card__more {
    align-self: flex-start;
    background: var(--news-red);
    color: #fff;
    padding: 10px 26px 11px;
    clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
    transition: background .3s;
}

.news-card--featured .news-card__link:hover .news-card__more {
    background: #a8191b;
}

.news-badge {
    position: absolute;
    top: 28px;
    left: 0;
    z-index: 2;
    padding: 8px 22px 8px 44px;
    font: italic 700 13px/1 Goldman, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--news-red);
    color: #fff;
    clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
}

/* ---------- Beitrag 2 + 3 ---------- */

.news-secondary {
    display: grid;
    gap: var(--news-gap);
}

.news-card--secondary .news-card__title {
    font: italic 400 19px/1.25 Goldman, sans-serif !important;
    hyphens: manual;
    -webkit-hyphens: manual;
}

.news-card--secondary .news-card__more {
    margin-top: auto;
}

/* ---------- Weitere Beiträge ---------- */

.news-more__head {
    display: flex;
    align-items: center;
    gap: 24px;
}

.news-more__head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--news-line);
}

.news-more__title {
    font: italic 400 30px/1.1 Goldman, sans-serif !important;
    text-transform: none !important;
    color: var(--news-ink);
}

.news-archive {
    display: grid;
    gap: 32px;
}

/* Archivkarten: Kategorie, Headline, „Weiterlesen“ – ohne Teaser (bleibt im HTML für die
   automatische Sortierung, falls die Karte nach vorne rückt) */
.news-archive .news-card__body {
    gap: 8px;
    padding: 18px 20px 20px;
}

.news-archive .news-card__excerpt {
    display: none;
}

.news-archive .news-card__more {
    margin-top: auto;
    padding-top: 6px;
}

.news-archive .news-tag {
    padding: 0;
    background: none;
    color: var(--news-red);
    clip-path: none;
}

.news-archive .news-card__title {
    font-size: 16px !important;
    line-height: 1.4 !important;
}

.news-card.is-in {
    animation: news-in .6s var(--news-ease) both;
}

@keyframes news-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Nachladen ---------- */

.news-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: center;
    padding: 30px;
    border: 2px dashed var(--news-line);
    color: var(--news-muted);
    font-size: 14px;
}

.news-loader__progress {
    width: 160px;
    height: 3px;
    background: var(--news-line);
}

.news-loader__progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--news-red);
    transition: width .5s var(--news-ease);
}

.news-loader__btn {
    font: 600 14px/1 'Open Sans', sans-serif;
    border: 0;
    cursor: pointer;
    padding: 10px 26px 11px;
    background: var(--news-dark);
    color: #fff;
    clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
    transition: background .3s;
}

.news-loader__btn:hover,
.news-loader__btn:focus-visible {
    background: var(--news-red);
}

.news-loader__spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--news-line);
    border-top-color: var(--news-red);
    border-radius: 50%;
    display: none;
    animation: news-spin .8s linear infinite;
}

.news-loader.is-busy .news-loader__spinner { display: block; }
.news-loader.is-busy .news-loader__btn { display: none; }

@keyframes news-spin {
    to { transform: rotate(360deg); }
}

/* Ende erreicht: Loader wird zur ruhigen Fläche mit der Bildmarke als Abschluss */
.news-loader.is-done {
    border: 0;
    padding: 0;
    background: url(../images/bildmarke-original.svg) center / 82% auto no-repeat;
}

.news-loader.is-done .news-loader__more { display: none; }

/* Ohne JS: alles sichtbar, kein Loader */
.news:not(.is-enhanced) .news-loader { display: none; }

/* ==========================================================================
   Mobil / Tablet (vertikal, < 1200px)
   ========================================================================== */

@media screen and (max-width: 1199px) {
    .news-intro { margin-bottom: 36px; }

    .news-card--featured {
        min-height: 520px;
        margin-bottom: var(--news-gap);
    }

    .news-card--featured .news-card__link { min-height: 520px; }

    .news-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .news-card__media { aspect-ratio: 16 / 10; }
    .news-card--featured .news-card__media { aspect-ratio: auto; }
    .news-card--secondary .news-card__body { flex: 1 1 auto; }

    .news-more { margin-top: 80px; }
    .news-more__head { margin-bottom: 28px; }

    .news-archive {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .news-loader {
        grid-column: 1 / -1;
        min-height: 200px;
    }

    .news-loader.is-done { grid-column: auto; }
}

@media screen and (max-width: 768px) {
    .aktuelles #aktuell.news { padding: 140px 20px 60px; }
    .news-intro h1 { font-size: 42px; }
    .news-secondary { grid-template-columns: 1fr; }
    .news-card--featured,
    .news-card--featured .news-card__link { min-height: 460px; }
    .news-card--featured .news-card__body { padding: 28px 24px 28px; }
    .news-card--featured .news-card__title { font-size: 24px !important; }
    .news-card--featured .news-card__excerpt { font-size: 15px; }
    .news-more { margin-top: 56px; }
    .news-more__title { font-size: 24px !important; }
    .news-archive { gap: 20px; }
}

/* ==========================================================================
   Desktop: horizontaler Streifen (>= 1200px)
   ========================================================================== */

@media screen and (min-width: 1200px) {
    .aktuelles #aktuell.news {
        flex: 0 0 auto;
        display: flex;
        align-items: stretch;
        width: max-content;
        min-width: 95vw;
        height: 100vh;
        padding: 0;
    }

    /* Hero = genau eine Bildschirmbreite (abzgl. der linken Navigation) */
    .news-hero {
        flex: 0 0 auto;
        width: calc(100vw - 105px);
        height: 100%;
        display: flex;
        gap: 40px;
        padding: 70px 72px 56px 64px;
    }

    .news-intro {
        flex: 0 0 clamp(230px, 17vw, 320px);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .news-intro__lead { max-width: 34ch; }

    .news-hint {
        display: flex;
        position: absolute;
        bottom: 0;
        left: 0;
    }

    .news-hero__grid {
        flex: 1 1 auto;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(0, 1.9fr) minmax(290px, 1fr);
        gap: var(--news-gap);
    }

    .news-card--featured .news-card__title { font-size: clamp(24px, min(3.6vh, 2.3vw), 38px) !important; }

    .news-secondary {
        grid-template-rows: repeat(2, minmax(0, 1fr));
        min-height: 0;
    }

    /* Einheitliche Bildhöhe; nur bei Platzmangel schrumpft das Bild, nie der Text */
    .news-card--secondary .news-card__media {
        flex: 0 1 58%;
        min-height: 60px;
    }

    .news-archive .news-card__media {
        flex: 0 1 50%;
        min-height: 60px;
    }

    .news-card--secondary .news-card__media img,
    .news-archive .news-card__media img {
        position: absolute;
        inset: 0;
    }

    .news-card--secondary .news-card__body { flex: 1 0 auto; }
    .news-card--secondary .news-card__excerpt { display: none; }

    .news-more {
        flex: 0 0 auto;
        height: 100%;
        display: flex;
        flex-direction: column;
        gap: 32px;
        padding: 70px 96px 56px 24px;
    }

    .news-more__head { min-height: 56px; }

    .news-archive {
        flex: 1 1 auto;
        min-height: 0;
        grid-auto-flow: column;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        grid-auto-columns: 320px;
    }

    .news-archive .news-card__body { flex: 1 0 auto; }

    .news-loader { grid-row: 1 / -1; }

    /* ungerade Anzahl: Logo sitzt in der freien Zelle unter der letzten Karte */
    .news-loader.is-single { grid-row: auto; }
}

/* Niedrige Bildschirme: etwas kompakter */
@media screen and (min-width: 1200px) and (max-height: 820px) {
    .news-hero,
    .news-more { padding-top: 48px; padding-bottom: 36px; }
    .news-more { gap: 24px; }
    .news-intro h1 { font-size: 46px; }
    .news-intro__lead { font-size: 15px; line-height: 22px; }
    .news-card--featured .news-card__body { padding: 28px 32px 32px; }
    .news-card--secondary .news-card__body { padding: 16px 20px 18px; gap: 8px; }
    .news-card--secondary .news-card__title { font-size: 17px !important; }
    .news-archive { gap: 24px; }
    .news-archive { grid-auto-columns: 350px; }
    .news-archive .news-card__media { min-height: 48px; }
    .news-archive .news-card__body { padding-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .news *,
    .news *::before,
    .news *::after {
        animation: none !important;
        transition: none !important;
    }
}
