/* ==========================================================
   LATEST POSTS
========================================================== */

.latest-posts-wrapper,
.latest-posts,
.latest-posts-section,
.card-grid-row--latest-posts {
    width: 100%;
}

.latest-posts-wrapper {
    max-width: var(--container-content);
    margin-inline: auto;
}

.latest-posts-wrapper h2 {
    margin-bottom: 1.5rem;
}

.latest-posts-section {
    margin-inline: auto;
    margin-block: 0;
}

/* ==========================================================
   LATEST POSTS GRID
========================================================== */

.card-grid-row--latest-posts {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: clamp(1.5rem, 3vw, 2rem);
}

.card-grid-row--latest-posts>*,
.card-grid-row--latest-posts .wp-block-query,
.card-grid-row--latest-posts .wp-block-post-template,
.card-grid-row--latest-posts .wp-block-post-template>li,
.card-grid-row--latest-posts .wp-block-post {
    width: 100%;
    min-width: 0;
    height: 100%;

    display: flex;

    margin: 0 !important;
    padding: 0 !important;
}

.card-grid-row--latest-posts .wp-block-post-template {
    list-style: none;
}

/* ==========================================================
   LATEST POST CARD
========================================================== */

.latest-post-card {
    --card-title-color: var(--text-strong);
    position: relative;
    box-sizing: border-box;

    width: 100%;
    max-width: none;
    min-height: 330px;
    height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    padding: 3.25rem 1.5rem 1.5rem;
}

.latest-post-card__content {
    flex: 1;

    display: flex;
    flex-direction: column;
}

.latest-post-card__content>* {
    margin-block-start: 0 !important;
}

.latest-post-card__main {
    margin-block: auto;

    display: flex;
    flex-direction: column;
}

/* Titel */
.latest-post-card h3,
.latest-post-card h3 a,
.latest-post-card .latest-post-card__title,
.latest-post-card .latest-post-card__title a,
.latest-post-card .wp-block-post-title {
    position: static;
    z-index: 4;
    margin: 0 0 .5rem !important;

    color: var(--card-title-color);
    text-decoration: none;

    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.1;

    transition:
        color var(--transition-fast),
        text-decoration-color var(--transition-fast);
}

/* Excerpt */
.latest-post-card__excerpt,
.latest-post-card .wp-block-post-excerpt,
.latest-post-card .wp-block-post-excerpt__excerpt {
    margin: 0 !important;

    color: var(--text-soft);

    font-size: var(--font-body);
    line-height: 1.7;
}

.latest-post-card .wp-block-post-excerpt__excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;

    line-clamp: 3;
    -webkit-line-clamp: 3;
}

/* Meta */
.latest-post-card__meta {
    width: fit-content;

    display: inline-flex;
    align-items: center;

    margin: 1.1rem 0 !important;
    padding: .42rem .85rem;

    border-radius: 999px;

    background: rgba(85, 142, 136, .14);
    color: var(--wp--preset--color--secondary);

    font-size: .92rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .02em;
}

/* CTA */
.latest-post-card__cta {
    margin: 0 !important;
    padding-top: 1.25rem;

    align-self: flex-start;

    color: var(--wp--preset--color--primary);

    font-weight: 700;
    text-transform: lowercase;
}

/* Stretched Link */
.latest-post-card .wp-block-post-title a {
    color: var(--card-title-color);
    text-decoration: none;
}

.latest-post-card .wp-block-post-title a::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 3;
}

/* Card Focus */
.latest-post-card:has(.wp-block-post-title a:focus-visible) {
    outline: 3px solid var(--wp--preset--color--primary);
    outline-offset: 4px;

    box-shadow:
        0 0 0 6px rgba(242, 154, 58, .22),
        0 18px 42px rgba(0, 0, 0, .18);
}

/* Card ohne Ergebnisse */
.latest-post-card--empty {
    display: flex;
    flex-direction: column;
    justify-content: center;

    width: 100%;
    height: 100%;
}

.latest-post-card--empty .latest-post-card__content {
    flex: 1;
    display: flex;
}

.latest-post-card--empty .latest-post-card__main {
    margin-block: auto;
}

/* Title Hover + Focus */
.latest-post-card.card--interactive:hover,
.latest-post-card.card--interactive:has(.wp-block-post-title a:focus-visible) {
    --card-title-color: var(--wp--preset--color--primary);
}

.latest-post-card.card--interactive:hover h3,
.latest-post-card.card--interactive:hover h3 a,
.latest-post-card.card--interactive:hover .latest-post-card__title,
.latest-post-card.card--interactive:hover .latest-post-card__title a,
.latest-post-card.card--interactive:hover .wp-block-post-title,
.latest-post-card.card--interactive:hover .wp-block-post-title a,

.latest-post-card.card--interactive:has(.wp-block-post-title a:focus-visible) h3,
.latest-post-card.card--interactive:has(.wp-block-post-title a:focus-visible) h3 a,
.latest-post-card.card--interactive:has(.wp-block-post-title a:focus-visible) .latest-post-card__title,
.latest-post-card.card--interactive:has(.wp-block-post-title a:focus-visible) .latest-post-card__title a,
.latest-post-card.card--interactive:has(.wp-block-post-title a:focus-visible) .wp-block-post-title,
.latest-post-card.card--interactive:has(.wp-block-post-title a:focus-visible) .wp-block-post-title a {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: .12em;
}