/* ==========================================================================
   Block: Updates Archive
   ========================================================================== */

.block-posts-archive {
    margin-block-start: 0 !important;
}

/* ==========================================================================
   Header
   ========================================================================== */

.block-posts-archive__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6rem 0 1rem 0;
    background: url(../../../assets/images/gradient-4.png);
    background-size: 100px 100%;
    background-repeat: repeat-x;
}

.block-posts-archive__header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
}

/* Title */
.block-posts-archive__title {
    margin: 0 0 2rem;
}

/* Hero image */
.block-posts-archive__hero-image {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin-bottom: 3rem;
}

.block-posts-archive__hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Filter tabs
   ========================================================================== */

.block-posts-archive__filters {
    display: inline-flex;
    align-items: center;
    background: var(--wp--preset--color--white);
    border-radius: var(--radius-06);
    position: relative;
    /* Too many categories to fit are scrolled through rather than wrapped, so
       the bar stays one row and the sliding indicator keeps its track. The
       scrollbar is hidden: these read as pills, not as a scrolling panel. */
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.block-posts-archive__filters::-webkit-scrollbar {
    display: none;
}

.block-posts-archive__filter {
    /* Same box as a primary button; the indicator supplies the active fill */
    color: var(--wp--preset--color--contrast);
    background: none;
    border: none;
    border-radius: var(--radius-06);
    padding: 12px 24px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.25s ease;
    position: relative;
    z-index: 1;
    /* Never squashed to fit: the row scrolls instead */
    flex-shrink: 0;
    white-space: nowrap;
}

.block-posts-archive__filter.is-active {
    color: var(--wp--preset--color--warm-zwart);
}

.block-posts-archive__filter-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: var(--radius-06);
    background: var(--wp--preset--color--helder-blauw);
    pointer-events: none;
    z-index: 0;
}

.block-posts-archive__filter:hover:not(.is-active) {
    color: currentColor;
}

.block-posts-archive__filter:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ==========================================================================
   Content area
   ========================================================================== */

.block-posts-archive__inner {
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
    padding: 4rem 0 8rem;
}

/* ==========================================================================
   Card grid
   ========================================================================== */

.block-posts-archive__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

/* ==========================================================================
   Card
   ========================================================================== */

.block-posts-archive__card {
    background: var(--wp--preset--color--white);
    border-radius: var(--radius-06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.block-posts-archive__card[aria-hidden="true"] {
    display: none;
}

.block-posts-archive__card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    padding: 0;
}

.block-posts-archive__card-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
    border-radius: 10px;
}

/* Card image */
.block-posts-archive__card-image {
    position: relative;
    /* Flex items default to min-height:auto, and the image's intrinsic height
       becomes that minimum — which overrides the aspect ratio below. */
    min-height: 0;
    overflow: hidden;
    aspect-ratio: 399 / 223;
    flex-shrink: 0;
}

/* Only where there is a photo — the placeholder colour needs no scrim */
.block-posts-archive__card-image:has(img)::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.48) 100%);
    pointer-events: none;
}

.block-posts-archive__card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Category badge */
.block-posts-archive__card-badge {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    /* Over a photo. On a placeholder, style.css tints it to match the icon. */
    color: var(--wp--preset--color--helder-blauw-licht);
}

/* Card content */
.block-posts-archive__card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
    text-align: center;
}

/* Card title */
.block-posts-archive__card-title {
    margin: 0 0 1.5rem;
}

/* Card meta (event-type cards) */
.block-posts-archive__card-meta {
    display: flex;
    align-items: center;
    gap: 10px 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.block-posts-archive__card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.block-posts-archive__card-meta-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Card button */
/* Load more */
.block-posts-archive__load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .block-posts-archive__filter {
        transition: none;
    }
}

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

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

    .block-posts-archive__filter {
        padding: 10px;
    }
}
