/*
    Warmduscher – Blogbeitrag ("Heat Index")

    Einzelansicht passend zur Archivübersicht (css/archive.css).
    Der Tokenblock ist bewusst dupliziert: beide Dateien werden nie
    gemeinsam geladen und bleiben so unabhängig voneinander.

    Wird nur auf Blogbeiträgen geladen (siehe functions-archive.php).
*/

.wd-single,
.wd-related {
    --wd-ink: var(--body-text-color, #231f1e);
    --wd-accent: var(--color-main, #ffb326);
    --wd-paper: #faf8f5;
    --wd-surface: #ffffff;
    --wd-line: rgba(35, 31, 30, 0.14);
    --wd-line-strong: rgba(35, 31, 30, 0.85);
    --wd-muted: #746c69;

    --wd-radius: 16px;
    --wd-gap: 28px;
    --wd-column: 720px;

    --wd-display: var(--font-heading), "Anton", "Helvetica Neue", Arial, sans-serif;
    --wd-body: var(--font-text), system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

    --wd-utility-size: 0.75rem;
    --wd-utility-tracking: 0.14em;
}

body.single-post {
    background-color: #faf8f5;
}

body.single-post .page-content {
    margin-top: 110px;
    padding-bottom: 72px;
}

@media (max-width: 768px) {
    body.single-post .page-content {
        margin-top: 96px;
        padding-bottom: 48px;
    }
}

/*
    Der Beitrag steht als eine zentrierte Spalte. Vorher lief der Text
    linksbündig im 1140px-Container – das sah nach einer zweiten, leeren
    Spalte aus statt nach Absicht. Kopf, Bild und Text teilen sich jetzt
    dieselbe Breite und Achse.
*/
.wd-single {
    max-width: var(--wd-column);
    margin: 0 auto;
    font-family: var(--wd-body);
}

/* ---------------------------------------------------------------
   Kopfbereich

   Alles linksbündig auf einer gemeinsamen Kante. Zentriert wird nur die
   Spalte selbst (siehe .wd-single), nicht ihr Inhalt.
   --------------------------------------------------------------- */

.wd-single .wd-single__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: var(--wd-utility-tracking);
    text-transform: uppercase;
    color: var(--wd-muted);
    text-decoration: none;
}

.wd-single .wd-single__back:hover {
    color: var(--wd-ink);
    text-decoration: none;
}

.wd-single__back svg {
    transition: transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.wd-single__back:hover svg {
    transform: translateX(-4px);
}

.wd-single__eyebrow {
    margin: 0 0 14px;
    font-size: var(--wd-utility-size);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--wd-accent);
    overflow-wrap: break-word;
}

.wd-single .wd-single__eyebrow a {
    color: inherit;
    text-decoration: none;
}

.wd-single .wd-single__eyebrow a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wd-single .wd-single__title {
    font-family: var(--wd-display);
    /*
        Das Parent-Theme zentriert h1 global (budigital/style.css: h1, .h1).
        Alle anderen Eigenschaften überschreiben wir ohnehin, text-align
        muss hier ausdrücklich mit.
    */
    text-align: left;
    font-size: clamp(1.875rem, 4vw, 3.25rem);
    line-height: 1.04;
    letter-spacing: -0.015em;
    color: var(--wd-ink);
    margin: 0;
    padding: 0;
    /* Deutsche Komposita sauber trennen statt überlaufen lassen */
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
}

.wd-single__lead {
    margin: 22px 0 0;
    font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
    line-height: 1.6;
    color: var(--wd-muted);
}

/*
    Meta-Zeile auf der Linie – dasselbe Bauteil wie der Zähler im Archiv.
    Die Linie läuft über die volle Breite, nicht nur unter dem Kopftext.
*/
.wd-single__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--wd-line-strong);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wd-muted);
}

.wd-single__meta-right {
    color: var(--wd-ink);
}

/* ---------------------------------------------------------------
   Beitragsbild
   --------------------------------------------------------------- */
.wd-single__figure {
    margin: 36px 0 0;
    padding: 0;
}

.wd-single__figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--wd-radius);
    background: rgba(35, 31, 30, 0.06);
}

.wd-single__figure figcaption {
    margin-top: 12px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--wd-muted);
}

@media (max-width: 639px) {
    .wd-single__figure img {
        aspect-ratio: 4 / 3;
        border-radius: 12px;
    }
}

/* ---------------------------------------------------------------
   Inhalt
   Schmales Textmass, links bündig zum Kopfbereich.
   --------------------------------------------------------------- */
.wd-single__content {
    margin-top: 48px;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--wd-ink);
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
}

.wd-single__content > *:first-child {
    margin-top: 0;
}

.wd-single__content p {
    margin: 0 0 1.5em;
}

.wd-single__content :is(h2, h3, h4) {
    font-family: var(--wd-display);
    color: var(--wd-ink);
    line-height: 1.18;
    letter-spacing: -0.01em;
}

.wd-single__content h2 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    margin: 2.2em 0 0.6em;
}

.wd-single__content h3 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    margin: 1.8em 0 0.5em;
}

.wd-single__content h4 {
    font-size: 1.125rem;
    margin: 1.6em 0 0.4em;
}

.wd-single__content :is(ul, ol) {
    margin: 0 0 1.5em;
    padding-left: 1.35em;
}

.wd-single__content li {
    margin-bottom: 0.5em;
}

.wd-single__content li::marker {
    color: var(--wd-accent);
}

.wd-single .wd-single__content a {
    color: var(--wd-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: var(--wd-accent);
}

.wd-single .wd-single__content a:hover {
    text-decoration-thickness: 2px;
}

.wd-single__content :is(img, figure, video, iframe) {
    max-width: 100%;
    height: auto;
}

.wd-single__content figure {
    margin: 2em 0;
}

.wd-single__content img {
    border-radius: 12px;
}

.wd-single__content hr {
    margin: 2.5em 0;
    border: 0;
    border-top: 1px solid var(--wd-line);
}

.wd-single__content :is(table) {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.5em;
    font-size: 0.9375rem;
}

.wd-single__content :is(th, td) {
    padding: 10px 12px;
    border-bottom: 1px solid var(--wd-line);
    text-align: left;
}

/*
    Das globale blockquote der style.css ist auf volle Containerbreite
    ausgelegt (50px). Im schmalen Textmass wird es hier zurückgenommen.
*/
.wd-single__content blockquote {
    margin: 2.5em 0 !important;
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
    line-height: 1.35;
    padding-left: 68px;
    background-size: 44px;
}

@media (max-width: 639px) {
    .wd-single__content blockquote {
        padding-left: 0;
        padding-top: 54px;
        background-position: top left;
    }
}

/* ---------------------------------------------------------------
   Weitere Beiträge
   Übernimmt Raster und Karte aus der Übersicht.
   --------------------------------------------------------------- */
.wd-related {
    margin-top: 72px;
    padding-top: 36px;
    border-top: 2px solid var(--wd-line-strong);
    font-family: var(--wd-body);
}

.wd-related .wd-related__title {
    font-family: var(--wd-display);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--wd-ink);
    margin: 0 0 28px;
}

.wd-related .wd-archive__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--wd-gap);
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 1023px) {
    .wd-related .wd-archive__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639px) {
    .wd-related .wd-archive__grid {
        grid-template-columns: minmax(0, 1fr);
        --wd-gap: 20px;
    }

    .wd-related {
        margin-top: 48px;
    }
}
