/* Recent Posts block styles */

.recent-posts {
    --recent-posts-card-bg: color-mix(in oklch, var(--color-cwc-blue-03) 30%, white);
    --recent-posts-gap: clamp(1.5rem, 3vw, 3rem);
    --recent-posts-vector-height: calc(clamp(31rem, 40vw, 37.875rem) + 5rem);

    background: var(--color-white);
    overflow: hidden;
    padding: clamp(8rem, 11vw, 13.5rem) 0 clamp(4rem, 8vw, 8rem);
    position: relative;
}

.recent-posts__background {
    height: var(--recent-posts-vector-height);
    inset-block-start: 0;
    inset-inline: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    z-index: 0;
}

.recent-posts__vector {
    display: block;
    height: 100%;
    min-height: var(--recent-posts-vector-height);
    object-fit: cover;
    opacity: 0.75;
    width: 100%;
}

.recent-posts__inner {
    position: relative;
    z-index: 1;
}

.recent-posts__header {
    align-items: start;
    display: grid;
    gap: clamp(1.5rem, 5vw, 5rem);
    grid-template-columns: minmax(0, 0.9fr) minmax(20rem, 1.1fr);
    margin: 3rem auto clamp(2rem, 4vw, 3.25rem);
    max-width: 1280px;
}

.recent-posts__heading {
    color: var(--color-cwc-blue-01);
    font-family: var(--font-quincy);
    font-size: clamp(2.75rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1;
    margin: 0;
}

.recent-posts__heading span {
    color: var(--color-secondary);
}

.recent-posts__intro {
    color: var(--color-dark);
    font-size: var(--text-20px);
    font-weight: 300;
    line-height: 1.35;
    margin: 0;
    max-width: 44rem;
}

.recent-posts__grid {
    container-type: inline-size;
    display: grid;
    gap: var(--recent-posts-gap);
    grid-template-columns: repeat(3, minmax(0, 397px));
    justify-content: center;
    position: relative;
}

.recent-posts__controls,
.recent-posts__pagination {
    display: none;
}

.recent-posts__grid::before {
    background: var(--color-cwc-blue-03);
    content: "";
    height: 16px;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: min(250px, calc(((100cqw - (2 * var(--recent-posts-gap))) / 3) * 250 / 397));
    transform: translateX(-50%);
    width: 100vw;
    z-index: 0;
}

.recent-posts__card {
    display: flex;
    flex-direction: column;
    max-width: 397px;
    min-height: 100%;
    position: relative;
    width: 100%;
    z-index: 1;
}

.recent-posts__image-link {
    aspect-ratio: 397 / 250;
    border-radius: 1.25rem 1.25rem 0 0;
    display: block;
    max-height: 250px;
    max-width: 397px;
    overflow: hidden;
    width: 100%;
}

.recent-posts__image {
    display: block;
    height: 100%;
    max-height: 250px;
    max-width: 397px;
    object-fit: cover;
    width: 100%;
}

.recent-posts__image--placeholder {
    background:
        linear-gradient(
            135deg,
            color-mix(in oklch, var(--color-cwc-blue-03) 45%, white),
            color-mix(in oklch, var(--color-cwc-blue-01) 18%, white)
        );
}

.recent-posts__body {
    background: var(--recent-posts-card-bg);
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: clamp(1.5rem, 3vw, 2rem) clamp(1.5rem, 3vw, 2rem) 2.25rem;
}

.recent-posts__title {
    color: var(--color-cwc-blue-01);
    font-family: var(--font-quincy);
    font-size: var(--text-30px);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 1.75rem;
}

.recent-posts__title::after {
    background: var(--color-secondary);
    content: "";
    display: block;
    height: 4px;
    margin-top: 0.45rem;
    width: 3rem;
}

.recent-posts__title a {
    color: inherit;
    text-decoration: none;
}

.recent-posts__title a:hover,
.recent-posts__title a:focus {
    color: var(--color-cwc-blue-02);
}

.recent-posts__excerpt {
    color: var(--color-dark);
    font-size: var(--text-18px);
    line-height: 1.45;
}

.recent-posts__excerpt p {
    margin: 0;
}

.recent-posts__read-more {
    align-self: flex-start;
    color: var(--color-secondary);
    display: inline-block;
    font-size: var(--text-18px);
    font-weight: 700;
    line-height: 1.2;
    margin-top: auto;
    padding-top: clamp(1.75rem, 3vw, 2.75rem);
    text-decoration: underline;
    text-decoration-thickness: 4px;
    text-underline-offset: 0.35rem;
}

.recent-posts__read-more:hover,
.recent-posts__read-more:focus {
    color: var(--color-secondary-800) !important;
}

.recent-posts__footer {
    display: flex;
    justify-content: center;
    margin-top: clamp(3rem, 5vw, 4.75rem);
}

.recent-posts__blog-link.button {
    background: var(--color-white);
    font-size: var(--text-18px);
    min-width: 10rem;
    text-align: center;
}

@media (max-width: 1024px) {
    .recent-posts__background {
        height: clamp(33rem, 59vw, 38rem);
    }

    .recent-posts__vector {
        min-height: clamp(33rem, 59vw, 38rem);
    }

    .recent-posts__header {
        grid-template-columns: 1fr;
        max-width: 48rem;
        text-align: center;
    }

    .recent-posts__intro {
        margin-inline: auto;
    }

    .recent-posts__grid {
        grid-template-columns: repeat(2, minmax(0, 397px));
    }

    .recent-posts__grid::before {
        top: min(250px, calc(((100cqw - var(--recent-posts-gap)) / 2) * 250 / 397));
    }
}

@media (max-width: 640px) {
    .recent-posts {
        padding: 6.25rem 0 3.25rem;
    }

    .recent-posts__background {
        height: 30rem;
    }

    .recent-posts__vector {
        min-height: 30rem;
        object-position: center top;
    }

    .recent-posts__header {
        gap: 1rem;
        margin-bottom: 1.75rem;
        text-align: center;
    }

    .recent-posts__heading {
        font-size: var(--text-40px);
    }

    .recent-posts__intro {
        font-size: var(--text-14px);
        line-height: 1.35;
        max-width: 20rem;
    }

    .recent-posts__grid {
        grid-template-columns: minmax(0, 18.25rem);
        margin-inline: auto;
        max-width: 18.25rem;
    }

    .recent-posts__grid::before {
        height: 0.75rem;
        top: min(184px, calc(100cqw * 250 / 397));
    }

    .recent-posts__card {
        display: none;
    }

    .recent-posts__card.is-active {
        display: flex;
    }

    .recent-posts__controls {
        display: block;
    }

    .recent-posts__control {
        align-items: center;
        background: var(--color-secondary);
        border: 0;
        border-radius: 50%;
        color: var(--color-white);
        display: flex;
        height: 3rem;
        justify-content: center;
        padding: 0;
        position: absolute;
        top: 10rem;
        width: 3rem;
        z-index: 3;
    }

    .recent-posts__control:hover,
    .recent-posts__control:focus-visible {
        background: var(--color-secondary-800);
    }

    .recent-posts__control svg {
        fill: none;
        height: 1.75rem;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2.5;
        width: 1.75rem;
    }

    .recent-posts__control--previous {
        left: -1.5rem;
    }

    .recent-posts__control--next {
        right: -1.5rem;
    }

    .recent-posts__image-link {
        border-radius: 0.5rem 0.5rem 0 0;
    }

    .recent-posts__body {
        padding: 1.25rem;
    }

    .recent-posts__title {
        font-size: var(--text-24px);
        margin-bottom: 1rem;
    }

    .recent-posts__excerpt,
    .recent-posts__read-more {
        font-size: var(--text-14px);
    }

    .recent-posts__read-more {
        padding-top: 1.75rem;
        text-decoration-thickness: 3px;
    }

    .recent-posts__footer {
        align-items: center;
        flex-direction: column;
        margin-top: 1.25rem;
    }

    .recent-posts__pagination {
        display: flex;
        gap: 0.75rem;
        justify-content: center;
        margin-top: 1.5rem;
    }

    .recent-posts__dot {
        align-items: center;
        background: transparent;
        border: 0;
        display: flex;
        height: 1.5rem;
        justify-content: center;
        padding: 0;
        width: 1.5rem;
    }

    .recent-posts__dot::before {
        background: var(--color-cwc-blue-01);
        border-radius: 50%;
        content: "";
        height: 0.5rem;
        opacity: 0.45;
        width: 0.5rem;
    }

    .recent-posts__dot.is-active::before {
        opacity: 1;
    }

    .recent-posts__blog-link.button {
        font-size: var(--text-14px);
        min-height: 2.25rem;
        min-width: 8.5rem;
        padding: 0.5rem 0.85rem;
    }
}
