/**
 * Ratgeber: overview, topics, article, article cards
 *
 * Same language as the other pages: surfaces separated by tone steps
 * (ground > card > raised), one radius (8px), no borders, no shadows. The
 * head reuses the page hero tile (sections.css), the close the call band.
 * The offer box inside an article sits on the light ground, like every
 * other place where the page asks for a call.
 *
 * Loaded on the overview, topics, articles and landing pages (cards).
 *
 * @package Asivo
 */

/* ================================
   Head: topics under the title
   ================================ */

.blog-topics {
    margin-top: var(--space-5);
}

.blog-topics__list,
.blog-pages ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-topics__link,
.blog-pages .page-numbers {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-md);
    background-color: var(--color-dark-bg);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text-body);
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.blog-topics__link:hover,
.blog-pages a.page-numbers:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-white);
}

.blog-topics__link[aria-current="page"],
.blog-pages .page-numbers.current {
    background-color: var(--color-text-body);
    color: var(--color-dark-bg);
}

.blog-pages {
    margin-top: var(--space-6);
}

.blog-pages .page-numbers {
    background-color: var(--color-card-bg);
}

/* ================================
   Cards
   ================================ */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background-color: var(--color-card-bg);
    transition: background-color var(--transition-fast);
}

.post-card:hover,
.post-card:focus-within {
    background-color: var(--color-surface-hover);
}

.post-card:focus-within {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.post-card__media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.post-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: var(--space-4);
}

.post-card__title {
    margin: 0;
    font-size: var(--text-lg);
    line-height: 1.2;
    letter-spacing: -0.01em;
    hyphens: auto;
}

.post-card__link {
    color: var(--color-white);
    text-decoration: none;
}

/* The title link covers the whole card. */
.post-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.post-card__link:focus-visible {
    outline: none;
}

.post-card__excerpt {
    max-width: none;
    margin: var(--space-2) 0 0;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--color-text-body);
}

.post-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    max-width: none;
    margin: auto 0 0;
    padding-top: var(--space-3);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

/* The newest article on the overview: large, on the raised surface. */
.post-card--feature {
    margin-bottom: var(--space-3);
    background-color: var(--color-surface-hover);
}

.post-card--feature .post-card__body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    column-gap: var(--space-6);
    padding: var(--space-6);
}

.post-card--feature .post-card__title {
    grid-row: 1 / span 2;
    font-size: var(--text-2xl);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.post-card--feature .post-card__excerpt {
    margin: 0;
    font-size: var(--text-base);
}

.post-card--feature .post-card__meta {
    grid-column: 2;
}

.post-card--feature.post-card--image {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.post-card--feature.post-card--image .post-card__media {
    aspect-ratio: auto;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.post-card--feature.post-card--image .post-card__body {
    display: flex;
}

.blog-empty {
    max-width: none;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background-color: var(--color-card-bg);
    font-family: var(--font-ui);
    color: var(--color-text-body);
}

.blog-related__all {
    margin: var(--space-4) 0 0;
    font-family: var(--font-ui);
}

.blog-related__all a {
    color: var(--color-text-body);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-underline-offset: 0.25em;
}

.blog-related .section__title {
    margin-bottom: var(--space-4);
}

/* ================================
   Article head
   ================================ */

.post-head .page-hero__title {
    max-width: 18em;
    font-size: clamp(2rem, 1.2rem + 3.6vw, 4.5rem);
    line-height: 1.02;
    hyphens: auto;
}

.post-head__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.post-head__photo {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    object-position: top;
}

.post-head__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-3);
    max-width: none;
    margin: 0;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.post-head__author {
    font-weight: var(--font-semibold);
    color: var(--color-white);
}

.post-head__topic {
    color: var(--color-primary-light);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-underline-offset: 0.25em;
}

/* ================================
   Article body: reading width, contents beside it
   ================================ */

.post-section {
    padding-top: var(--space-8);
}

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 44rem);
    grid-template-areas: "main";
}

.post-layout--toc {
    grid-template-columns: minmax(0, 44rem) minmax(13rem, 17rem);
    grid-template-areas: "main toc";
    justify-content: space-between;
    column-gap: var(--space-10);
}

.post-main {
    grid-area: main;
    min-width: 0;
}

.post-toc {
    grid-area: toc;
    position: sticky;
    top: calc(var(--header-h) + var(--space-3));
    align-self: start;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background-color: var(--color-card-bg);
}

.post-toc__title {
    max-width: none;
    margin: 0 0 var(--space-2);
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-white);
}

.post-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-toc__list li + li {
    margin-top: var(--space-1);
}

.post-toc__list a {
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    line-height: 1.4;
    color: var(--color-text-body);
    text-decoration: none;
}

.post-toc__list a:hover,
.post-toc__list a:focus-visible {
    color: var(--color-white);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-underline-offset: 0.25em;
}

/* The short answer in the head: the first thing to read and to quote. */
.post-answer {
    max-width: 62ch;
    margin: var(--space-5) 0 0;
    font-size: var(--text-lg);
    line-height: 1.5;
    color: var(--color-text-body);
}

.post-answer strong {
    font-weight: var(--font-semibold);
    color: var(--color-white);
}

.post-figure {
    margin: 0 0 var(--space-6);
}

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

.post-figure figcaption,
.post-content figcaption {
    margin-top: var(--space-1);
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

/* ================================
   Article text
   ================================ */

.post-content {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text-body);
}

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

.post-content p {
    max-width: none;
    margin-bottom: 0;
}

.post-content h2 {
    margin-top: var(--space-8);
    font-size: var(--text-2xl);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--color-white);
    scroll-margin-top: calc(var(--header-h) + var(--space-3));
}

.post-content h3 {
    margin-top: var(--space-5);
    font-size: var(--text-lg);
    line-height: 1.25;
    color: var(--color-white);
}

.post-content h2 + *,
.post-content h3 + * {
    margin-top: var(--space-2);
}

.post-content a {
    color: var(--color-white);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-underline-offset: 0.2em;
}

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

.post-content ul {
    margin-left: 0;
    padding: 0;
    list-style: none;
}

.post-content ul li {
    position: relative;
    padding-left: var(--space-3);
}

.post-content ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.68em;
    width: 0.4em;
    height: 0.4em;
    border-radius: 2px;
    background-color: var(--color-accent);
}

.post-content ol {
    margin-left: 0;
    padding-left: 1.5em;
}

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

.post-content li {
    margin-bottom: 0;
}

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

.post-content blockquote {
    margin-inline: 0;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background-color: var(--color-card-bg);
    font-size: var(--text-lg);
    color: var(--color-white);
}

/* Tables scroll inside their own box on a phone, never the page. */
.post-content .wp-block-table {
    margin-inline: 0;
    overflow-x: auto;
}

.post-content table {
    width: 100%;
    min-width: 34rem;
    border-collapse: separate;
    border-spacing: 0 4px;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.post-content th,
.post-content td {
    padding: var(--space-2);
    text-align: left;
    vertical-align: top;
    border: 0;
    background-color: var(--color-card-bg);
}

.post-content thead th {
    background-color: transparent;
    padding-block: 0 var(--space-1);
    font-weight: var(--font-semibold);
    color: var(--color-text-secondary);
}

.post-content td:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-weight: var(--font-semibold);
    color: var(--color-white);
}

.post-content td:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Info box (pattern "Infokasten"). */
.post-content .post-note {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background-color: var(--color-card-bg);
}

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

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

/* Offer box ([asivo_hinweis]): the light ground, dark ink. */
.post-hint {
    margin-block: var(--space-6);
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-md);
    background-color: var(--color-text-body);
    color: var(--color-dark-bg);
}

.post-content .post-hint {
    margin-top: var(--space-6);
}

.post-hint p {
    max-width: 52ch;
    margin: 0;
}

.post-hint__title {
    font-family: var(--font-headline);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.post-hint__text {
    margin-top: var(--space-2);
    font-size: var(--text-base);
    line-height: 1.55;
}

.post-hint__action,
.post-hint .contact-actions {
    margin-top: var(--space-3);
}

.post-content a.btn {
    text-decoration: none;
}

.post-content a.btn--primary {
    color: var(--color-white);
}

.post-content a.btn--whatsapp {
    color: var(--color-dark-bg);
}

/* ================================
   Author
   ================================ */

.post-author {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-10);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background-color: var(--color-card-bg);
}

.post-author__photo {
    width: 112px;
    height: 140px;
    border-radius: var(--radius-md);
    object-fit: cover;
    object-position: top;
}

.post-author__text p {
    max-width: none;
    margin: var(--space-1) 0 0;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--color-text-body);
}

.post-author__text .post-author__name {
    margin: 0;
    font-family: var(--font-headline);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-white);
}

.post-author__more a {
    font-family: var(--font-ui);
    color: var(--color-white);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-underline-offset: 0.25em;
}

/* ================================
   Responsive
   ================================ */

@media (max-width: 1100px) {
    .post-layout--toc {
        grid-template-columns: minmax(0, 44rem);
        grid-template-areas: "toc" "main";
    }

    .post-toc {
        position: static;
        margin-bottom: var(--space-5);
    }
}

@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-card--feature .post-card__body,
    .post-card--feature.post-card--image {
        grid-template-columns: 1fr;
    }

    .post-card--feature .post-card__body {
        row-gap: var(--space-2);
        padding: var(--space-4);
    }

    .post-card--feature .post-card__title {
        grid-row: auto;
    }

    .post-card--feature .post-card__meta {
        grid-column: auto;
    }

    .post-card--feature.post-card--image .post-card__media {
        aspect-ratio: 16 / 9;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
}

@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .post-author {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: var(--space-3);
    }

    .post-author__photo {
        width: 72px;
        height: 90px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .post-card,
    .blog-topics__link,
    .blog-pages .page-numbers {
        transition: none;
    }
}
