/* ══════════════════════════════════════════════════════════════
   LESESTOFF — Artikelliste, Archiv und Einzelbeitrag
   Wird nur auf Blog-Kontexten geladen (siehe inc/enqueue.php).
   ══════════════════════════════════════════════════════════════ */

:root {
    /* Einheitliche Artikelbreite — etwas großzügiger als die reine
       Lesebreite, damit Kacheln und Navigation nicht eingeengt wirken. */
    --article-width: 860px;
    --article-width-wide: 1040px;
}

/* ── Kopfbereich der Liste ──────────────────────────────────── */
.archive-header {
    padding-block: clamp(7rem, 12vw, 10rem) clamp(2rem, 5vw, 3.5rem);
    background: linear-gradient(180deg, rgba(101, 175, 2, 0.06), transparent);
    text-align: center;
}

.archive-header__content {
    max-width: 720px;
    margin-inline: auto;
}

.archive-header__title {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--color-dark, #111827);
    margin: 0.5rem 0 1rem;
}

.archive-header__description {
    color: var(--color-gray-600, #4b5563);
    font-size: 1.05rem;
    line-height: 1.7;
}

.archive-header__description p:last-child {
    margin-bottom: 0;
}

/* ── Karten-Raster ──────────────────────────────────────────── */
.archive-posts {
    padding-top: clamp(1rem, 3vw, 2rem);
}

.archive-posts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.25rem);
}

/* ── Artikelkarte ───────────────────────────────────────────── */
.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.10);
    border-color: rgba(101, 175, 2, 0.35);
}

.post-card__image-link {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-bg, #f8f9fa);
}

.post-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.post-card:hover .post-card__image {
    transform: scale(1.04);
}

.post-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem 1.5rem 1.65rem;
    gap: 0.55rem;
}

.post-card__date {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary, #65AF02);
}

.post-card__category {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent, #4B02AF);
    background: rgba(75, 2, 175, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
    text-decoration: none;
}

.post-card__title {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    /* lange deutsche Komposita sauber umbrechen */
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
}

.post-card__title a {
    color: var(--color-dark, #111827);
    text-decoration: none;
    transition: color 0.25s ease;
}

.post-card:hover .post-card__title a {
    color: var(--color-primary, #65AF02);
}

.post-card__excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-gray-600, #4b5563);
    margin: 0;
}

.post-card__more {
    margin-top: auto;
    padding-top: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-primary, #65AF02);
}

.post-card__more svg {
    transition: transform 0.25s ease;
}

.post-card:hover .post-card__more svg {
    transform: translateX(4px);
}

/* ganze Karte klickbar, Titel-Link bleibt für Screenreader/Tastatur */
.post-card__link-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.post-card__title a,
.post-card__category {
    position: relative;
    z-index: 2;
}

/* ── Leerzustand & Pagination ───────────────────────────────── */
.archive-posts__empty {
    text-align: center;
    padding-block: 4rem;
}

.pagination {
    margin-top: clamp(2.5rem, 5vw, 4rem);
    display: flex;
    justify-content: center;
}

.pagination .nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding-inline: 0.75rem;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--color-dark, #111827);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--color-primary, #65AF02);
    border-color: var(--color-primary, #65AF02);
    color: #ffffff;
}

/* ══════════════════════════════════════════════════════════════
   EINZELBEITRAG
   ══════════════════════════════════════════════════════════════ */

/*
 * Kopfbereich mit Seitenverhältnis statt fester Höhe.
 *
 * Vorher: `min-height: clamp(320px, 45vh, 520px)`. Auf breiten Bildschirmen
 * ergab das aus einem 3:2-Foto ein Band von fast 3:1 — von einer Person war
 * dann oft nur noch der Rumpf zu sehen. Mit einem Seitenverhältnis wächst
 * die Höhe mit der Breite mit, der Beschnitt bleibt moderat.
 */
/*
 * P143: Das Beitragsbild wird ganz gezeigt — nie beschnitten. Viele
 * Beitragsbilder sind Grafiken mit Text (z. B. «Epigenetik»), die im alten
 * 16:7-Band oben und unten abgeschnitten wurden und unter der schwebenden
 * Kopfzeile verschwanden. Jetzt: unter der Kopfzeile, in Containerbreite,
 * im eigenen Seitenverhältnis. Sehr hohe Bilder werden verkleinert, nicht
 * beschnitten (`contain`).
 */
.single-post__hero {
    padding: calc(var(--header-height, 80px) + 1.25rem) 1rem 0;
}

.single-post__hero-img-wrap {
    max-width: var(--container-max, 1200px);
    margin-inline: auto;
}

.single-post__hero-img-wrap img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 18px;
}


/*
 * WICHTIG: `section.single-post` — NICHT `.single-post`.
 * WordPress vergibt `single-post` auch als BODY-Klasse; eine unqualifizierte
 * Regel würde den Body einrücken und einen weißen Streifen über dem
 * Beitragsbild erzeugen.
 */
section.single-post {
    padding-top: clamp(2rem, 5vw, 3.5rem);
}

/* Der Artikel schob sich früher als Karte über die Unterkante des Bildes —
   das verdeckte den Bildinhalt (P143). Jetzt beginnt er darunter. */
section.single-post--with-hero {
    padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

/* ohne Beitragsbild braucht der Titel Abstand zur fixen Kopfzeile */
section.single-post--no-hero {
    padding-top: clamp(7rem, 12vw, 10rem);
}

/* ── Brotkrumen ─────────────────────────────────────────────── */
.breadcrumb,
.rank-math-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-gray-600, #4b5563);
    margin-bottom: 1.25rem;
}

.breadcrumb__link,
.rank-math-breadcrumb a {
    color: var(--color-gray-600, #4b5563);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb__link:hover,
.rank-math-breadcrumb a:hover {
    color: var(--color-primary, #65AF02);
}

.breadcrumb__separator {
    color: rgba(0, 0, 0, 0.25);
}

.breadcrumb__current {
    color: var(--color-dark, #111827);
    font-weight: 600;
    /* sehr lange Titel in der Brotkrume kürzen */
    max-width: min(100%, 32ch);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.single-post__header {
    max-width: var(--article-width);
    margin-inline: auto;
    text-align: center;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.single-post__categories {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.single-post__categories a {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent, #4B02AF);
    background: rgba(75, 2, 175, 0.08);
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
}

.single-post__title {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 800;
    line-height: 1.18;
    color: var(--color-dark, #111827);
    margin: 0 0 1rem;
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: break-word;
}

.single-post__meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: var(--color-gray-600, #4b5563);
}

/* Icon und Text jeweils auf einer Zeile */
.single-post__date,
.single-post__reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.single-post__meta-icon {
    flex-shrink: 0;
    opacity: 0.75;
}

.single-post__meta-sep {
    color: rgba(0, 0, 0, 0.25);
}

/* ── Lesbarer Fließtext ─────────────────────────────────────── */
.single-post__content {
    max-width: var(--article-width);
    margin-inline: auto;
    font-size: 1.06rem;
    line-height: 1.75;
    color: var(--color-gray-800, #1f2937);
}

.single-post__content > * + * {
    margin-top: 1.25rem;
}

.single-post__content h2 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--color-dark, #111827);
    margin-top: 2.75rem;
}

.single-post__content h3 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: clamp(1.15rem, 2.4vw, 1.4rem);
    font-weight: 700;
    color: var(--color-dark, #111827);
    margin-top: 2rem;
}

.single-post__content a {
    color: var(--color-primary, #65AF02);
    text-underline-offset: 3px;
}

.single-post__content ul,
.single-post__content ol {
    padding-left: 1.35rem;
}

.single-post__content li + li {
    margin-top: 0.5rem;
}

.single-post__content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    display: block;
}

.single-post__content figure {
    margin-inline: 0;
}

.single-post__content figcaption {
    font-size: 0.82rem;
    color: var(--color-gray-600, #4b5563);
    margin-top: 0.5rem;
    text-align: center;
}

.single-post__content blockquote {
    margin: 2rem 0;
    padding: 0.25rem 0 0.25rem 1.5rem;
    border-left: 3px solid var(--color-primary, #65AF02);
    font-size: 1.15rem;
    line-height: 1.6;
    font-weight: 600;
    color: var(--color-dark, #111827);
}

/* ══════════════════════════════════════════════════════════════
   Artikel aus ACF-Bausteinen
   Sektionen laufen im Artikel auf Lesebreite, ohne Seiten-Abstände.
   ══════════════════════════════════════════════════════════════ */
.single-post__sections > section {
    padding-block: clamp(1.25rem, 3vw, 2rem);
}

/* Volle Breite behalten die Bausteine, die davon leben */
/* T96: Einstieg markieren — nur der erste Absatz des ersten Textblocks
   (auch wenn davor der Kasten «Das Wichtigste in Kürze» steht, ein <aside>),
   so gross wie die Einleitungen der Seiten (.lead) und dunkler, ohne Fettdruck. */
.single-post__sections > section.fliesstext:first-of-type .fliesstext__text > p:first-child {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    line-height: 1.65;
    color: var(--color-gray-800);
}

.single-post__sections > section .container {
    max-width: var(--article-width);
    padding-inline: 0;
}

/*
 * Ausnahme: der CTA-Banner.
 *
 * Bei allen anderen Bausteinen ist `.container` nur die Textspalte —
 * beim CTA-Banner IST er die Karte: Er trägt Hintergrundbild, runde Ecken
 * und den Innenabstand. `padding-inline: 0` von oben nahm ihm genau den,
 * und die Überschrift klebte am Kartenrand.
 *
 * Ausserdem etwas breiter als die Textspalte: Der Banner ist eine
 * bewusste Unterbrechung im Lesefluss und darf ausbrechen.
 */
.single-post__sections > .cta-banner > .container {
    max-width: var(--article-width-wide);
    padding-inline: clamp(2rem, 5vw, 4rem);
}

/*
 * Und der Hintergrund läuft hier mit, statt fixiert zu sein.
 *
 * `background-attachment: fixed` bemisst `cover` am FENSTER, nicht am
 * Element. Auf der Startseite füllt die Karte 89 % der Fensterbreite, das
 * fällt nicht auf. Im Beitrag ist sie nur 60 % breit — das Bild wirkte
 * dadurch stark hineingezoomt und Katharina war am rechten Rand
 * angeschnitten. Mit `scroll` skaliert das Bild auf die Karte und die
 * Proportionen stimmen.
 */
.single-post__sections > .cta-banner > .container {
    background-attachment: scroll;
}

.single-post__sections > .feature-card-section .container,
.single-post__sections > .bgm-solutions .container,
.single-post__sections > .gesundheits-netzwerk .container {
    max-width: var(--article-width-wide);
}

/* Fließtext im Artikel: gleiche Lesetypografie wie klassische Beiträge */
.single-post__sections .fliesstext__text {
    font-size: 1.06rem;
    line-height: 1.75;
}

/* ── Kernaussagen-Box ───────────────────────────────────────── */
.kernaussagen {
    max-width: var(--article-width);
    margin: clamp(1.5rem, 4vw, 2.5rem) auto;
    padding: clamp(1.5rem, 3vw, 2rem);
    background: linear-gradient(135deg, rgba(101, 175, 2, 0.07), rgba(75, 2, 175, 0.05));
    border-radius: 18px;
}

.kernaussagen__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-dark, #111827);
    margin: 0 0 1rem;
}

.kernaussagen__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(101, 175, 2, 0.12);
    color: var(--color-primary, #65AF02);
    flex-shrink: 0;
}

.kernaussagen__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.kernaussagen__list li {
    position: relative;
    padding-left: 1.6rem;
    font-size: 0.97rem;
    line-height: 1.55;
    color: var(--color-gray-800, #1f2937);
}

.kernaussagen__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary, #65AF02);
}

/* ── Tags ───────────────────────────────────────────────────── */
.single-post__tags-list {
    max-width: var(--article-width);
    margin: 2.5rem auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.single-post__tags-list a {
    font-size: 0.78rem;
    color: var(--color-gray-600, #4b5563);
    background: rgba(0, 0, 0, 0.04);
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.single-post__tags-list a:hover {
    background: rgba(101, 175, 2, 0.12);
    color: var(--color-primary, #65AF02);
}

/* ── Autorenbox ─────────────────────────────────────────────── */
.author-box {
    max-width: var(--article-width);
    margin: clamp(2.5rem, 5vw, 4rem) auto 0;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.75rem;
    background: var(--color-bg, #f8f9fa);
    border-radius: 18px;
}

.author-box__avatar img {
    border-radius: 50%;
    display: block;
}

.author-box__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary, #65AF02);
}

.author-box__name {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0.15rem 0 0.5rem;
}

.author-box__bio {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--color-gray-600, #4b5563);
    margin: 0;
}

/* ── Vor/Zurück-Navigation ──────────────────────────────────── */
.post-navigation {
    max-width: var(--article-width);
    margin: clamp(2rem, 4vw, 3rem) auto 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.post-navigation__link {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    text-decoration: none;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.post-navigation__link:hover {
    border-color: rgba(101, 175, 2, 0.4);
    transform: translateY(-2px);
}

.post-navigation__link--next {
    text-align: right;
}

.post-navigation__direction {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary, #65AF02);
}

.post-navigation__title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-dark, #111827);
}

/* ── Ähnliche Beiträge ──────────────────────────────────────── */
.related-posts__heading {
    text-align: center;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: clamp(1.25rem, 3vw, 2rem);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .archive-posts__grid,
    .related-posts__grid {
        grid-template-columns: 1fr;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .post-navigation__link--next {
        text-align: left;
    }

    .author-box {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .post-card,
    .post-card__image,
    .post-card__more svg,
    .post-navigation__link {
        transition: none;
    }
}
