/* =============================================================
   POST — Indsigt-artikel (single.php)
   Simpel opsætning: hero + centreret tekstkolonne.
   Alt indhold kommer fra standard-editoren, så denne fil styler
   kun almindelige elementer (p, h2-h4, lister, billeder, citater).
   Wrapper, relaterede artikler og CTA ligger i single.css.
============================================================= */

/* ------------------------------------------------------------
   1. HERO
------------------------------------------------------------ */
.post-hero {
    width: calc(100% - 2 * var(--space-lg));
    max-width: var(--max-width-content);
    margin: var(--space-sm) auto 0;
    padding: var(--space-3xl) var(--space-xl) var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    background: var(--color-bg-card);
}

.post-hero__text {
    max-width: 960px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
}

.post-hero__crumb {
    font-size: var(--font-size-secondary);
    color: var(--color-neutral-text);
}

.post-hero__crumb a {
    color: var(--color-neutral-text);
    text-decoration: none;
}

.post-hero__crumb a:hover {
    color: var(--color-primary);
}

.post-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm-plus);
    font-size: var(--font-size-secondary);
    color: var(--color-neutral-text);
}

.post-hero__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

.post-hero__title {
    font-size: var(--font-size-h1);
    line-height: var(--line-height-h1);
    letter-spacing: var(--letter-spacing-h1);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
    text-wrap: balance;
    /* Lange danske ord skal kunne deles på smalle skærme */
    hyphens: auto;
    overflow-wrap: anywhere;
}

.post-hero__image {
    margin: var(--space-2xl) 0 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-hero__image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* ------------------------------------------------------------
   2. BRØDTEKST — ToC venstre, tekst centreret
   Tredje kolonne er tom og holder teksten i midten.
------------------------------------------------------------ */
.post-body {
    width: calc(100% - 2 * var(--space-lg));
    max-width: var(--max-width-content);
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    background: var(--color-bg-card);
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 220px;
    gap: var(--space-2xl);
    align-items: start;
}

.post-content {
    grid-column: 2;
    width: 100%;
    max-width: var(--max-width-text);
    margin: 0 auto;
}

/* Indholdsfortegnelse — vises kun ved 2+ H2 (styres af main.js) */
.post-toc {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: calc(var(--topnav-height) + var(--space-2xl));
}

.post-toc__label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-caption);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-neutral-text);
}

.post-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--color-border);
}

.post-toc__list a {
    display: block;
    margin-left: -1px;
    padding: 7px 0 7px var(--space-md);
    border-left: 2px solid transparent;
    font-size: var(--font-size-secondary);
    line-height: 1.45;
    color: var(--color-neutral-text);
    text-decoration: none;
    transition: color var(--duration-fast), border-color var(--duration-fast);
}

.post-toc__list a:hover,
.post-toc__list .article-sidebar__toc-item--active a {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

/* ------------------------------------------------------------
   3. TYPOGRAFI I BRØDTEKST — kun standard-elementer
------------------------------------------------------------ */
.post-content {
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-text-primary);
}

.post-content > * {
    margin-top: 0;
    margin-bottom: 0;
}

.post-content > * + * {
    margin-top: 1.1em;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    scroll-margin-top: calc(var(--topnav-height) + var(--space-2xl));
}

.post-content h2 {
    font-size: var(--font-size-h3);
    line-height: var(--line-height-h3);
    letter-spacing: var(--letter-spacing-h3);
    margin-top: var(--space-2xl);
}

.post-content h3 {
    font-size: 22px;
    line-height: var(--line-height-h4);
    margin-top: var(--space-xl);
}

.post-content h4 {
    font-size: var(--font-size-h4);
    line-height: var(--line-height-h4);
    margin-top: var(--space-lg);
}

.post-content > :is(h2, h3, h4):first-child {
    margin-top: 0;
}

/* Afsnit lige efter en overskrift sidder tættere på den */
.post-content :is(h2, h3, h4) + * {
    margin-top: var(--space-sm-plus);
}

.post-content strong {
    font-weight: var(--font-weight-semibold);
}

.post-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.post-content a:hover {
    text-decoration-thickness: 2px;
}

/* Lister — base.css nulstiller list-style globalt */
.post-content ul,
.post-content ol {
    padding-left: 1.4em;
}

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }

.post-content li + li {
    margin-top: var(--space-sm);
}

.post-content li::marker {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

/* Billeder */
.post-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.post-content figure {
    margin-left: 0;
    margin-right: 0;
}

.post-content > figure,
.post-content > .wp-block-image,
.post-content > .wp-block-gallery {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.post-content figcaption,
.post-content .wp-element-caption {
    margin-top: var(--space-sm);
    font-size: var(--font-size-secondary);
    line-height: var(--line-height-secondary);
    color: var(--color-neutral-text);
    text-align: left;
}

/* Galleri — 2 kolonner */
.post-content .wp-block-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.post-content .wp-block-gallery figure {
    margin: 0;
    width: 100% !important;
}

.post-content .wp-block-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Citater — ét simpelt udtryk, uanset om det er blok eller figur */
.post-content blockquote {
    margin: var(--space-2xl) 0;
    padding: var(--space-xs) 0 var(--space-xs) var(--space-xl);
    border-left: 3px solid var(--color-primary-light);
    font-size: 22px;
    line-height: 1.45;
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
}

.post-content blockquote > * + * {
    margin-top: var(--space-md);
}

/* Sidste linje i citatet (afsender) og <cite> vises som byline */
.post-content blockquote cite,
.post-content blockquote p:last-child:not(:first-child) {
    display: block;
    font-size: var(--font-size-secondary);
    font-style: normal;
    font-weight: var(--font-weight-regular);
    color: var(--color-neutral-text);
}

.post-content figure:has(> blockquote) {
    margin: 0;
}

/* Video og andre embeds */
.post-content iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--radius-md);
}

/* Tabeller */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-secondary);
}

.post-content th,
.post-content td {
    padding: var(--space-sm-plus) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.post-content th {
    font-weight: var(--font-weight-semibold);
    background: var(--color-bg-inactive);
}

.post-content hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: var(--space-2xl) 0;
}

/* ------------------------------------------------------------
   RESPONSIV
------------------------------------------------------------ */
@media (max-width: 1200px) {
    .post-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .post-content,
    .post-toc {
        grid-column: 1;
    }

    .post-toc {
        grid-row: auto;
        position: static;
        width: 100%;
        max-width: var(--max-width-text);
        margin: 0 auto;
    }
}

@media (max-width: 1024px) {
    .post-hero__title {
        font-size: 42px;
    }
}

@media (max-width: 767px) {
    .post-hero,
    .post-body {
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }

    .post-hero {
        padding-top: var(--space-2xl);
        padding-bottom: var(--space-lg);
    }

    .post-body {
        padding-top: var(--space-2xl);
        padding-bottom: var(--space-2xl);
    }

    .post-hero__title {
        font-size: 34px;
    }

    .post-hero__image {
        margin-top: var(--space-xl);
    }

    .post-hero__image img {
        aspect-ratio: 4 / 3;
    }

    .post-content {
        font-size: 17px;
    }

    .post-content blockquote {
        font-size: 19px;
        padding-left: var(--space-lg);
    }

    .post-content .wp-block-gallery {
        grid-template-columns: minmax(0, 1fr);
    }
}
.post-toc[hidden] { display: block; visibility: hidden; }
@media (max-width: 1200px) { .post-toc[hidden] { display: none; } }
