/* Page module - Post List: blog posts, programmes or case studies with filter, search, sort and pages */
.el-posts {
    padding-block: clamp(32px, calc(32px + 8 * (100vw - 1280px) / 640), 40px) clamp(56px, calc(56px + 19 * (100vw - 1280px) / 640), 75px);
    scroll-margin-top: 100px;
    color: var(--el-color-blue-dark);
}

/* Search + sort */
.el-posts-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.el-posts-search {
    position: relative;
    display: flex;
    flex: 0 1 596px;
    align-items: center;
}

.el-posts-search svg {
    position: absolute;
    left: 12px;
    color: var(--el-color-muted);
    pointer-events: none;
}

.el-posts-search input {
    width: 100%;
    height: 44px;
    padding: 0 18px 0 40px;
    border: 1px solid #c9d1d9;
    border-radius: 999px;
    background: var(--el-color-white);
    font: inherit;
    font-size: 16px;
    color: var(--el-color-navy);
    transition: border-color var(--el-transition);
}

.el-posts-search input::placeholder {
    color: #8a96a2;
}

.el-posts-search input:focus {
    border-color: var(--el-color-blue-dark);
    outline: none;
}

.el-posts-sort {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 16px;
    border-left: 1px solid #d5dbe1;
    min-height: 46px;
}

.el-posts-sort label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--el-color-navy);
}

.el-posts-sort select {
    height: 44px;
    padding: 0 38px 0 18px;
    border: 1px solid #d5dbe1;
    border-radius: 999px;
    background: var(--el-color-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%230c1d27' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
    font: inherit;
    font-size: 17px;
    color: var(--el-color-blue-dark);
    cursor: pointer;
    appearance: none;
}

.el-posts-sort select:focus-visible {
    border-color: var(--el-color-blue-dark);
    outline: none;
}

.el-posts-apply {
    min-height: 44px;
}

/* "Showing 8 of 49 programmes", pushed to the right of the bar. */
.el-posts-showing {
    margin: 0 0 0 auto;
    font-size: 16px;
    color: var(--el-color-muted);
}

/* Category pills */
.el-posts-cats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: clamp(20px, calc(20px + 4 * (100vw - 1280px) / 640), 24px);
}

.el-posts-cats-label {
    margin-right: 6px;
    padding-left: 6px;
    font-size: 16px;
    color: var(--el-color-muted);
}

/* The pills follow the label on the same line and wrap under it (the list's items join
   the label's row). Phones scroll them sideways instead, see below. */
.el-posts-cats ul {
    display: contents;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.el-posts-cat {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 10px 0 20px;
    border: 1px solid #dfe4e9;
    border-radius: 999px;
    background: var(--el-color-white);
    font-size: 17px;
    font-weight: 500;
    color: var(--el-color-blue-dark);
    transition: background-color var(--el-transition), border-color var(--el-transition), color var(--el-transition);
}

.el-posts-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 999px;
    background: #e9edf1;
    font-size: 13px;
    font-weight: 600;
    color: var(--el-color-blue-dark);
    transition: background-color var(--el-transition), color var(--el-transition);
}

a.el-posts-cat:hover,
a.el-posts-cat:focus-visible {
    border-color: var(--el-color-blue-dark);
    color: var(--el-color-blue-dark);
}

.el-posts-cat.is-active,
a.el-posts-cat.is-active:hover {
    border-color: var(--el-color-blue-dark);
    background: var(--el-color-blue-dark);
    color: var(--el-color-white);
}

.el-posts-cat.is-active .el-posts-count {
    background: var(--el-color-orange);
    color: var(--el-color-white);
}

/* Results: fades while the next view loads (post_list.js). */
.el-posts-results {
    margin-top: clamp(48px, calc(48px + 40 * (100vw - 1280px) / 640), 88px);
    transition: opacity 0.2s;
}

.el-posts.is-loading .el-posts-results {
    opacity: 0.45;
    pointer-events: none;
}

/* First row: 2 large cards (716px at 1920). Then 3 to a row (483px). */
.el-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, calc(16px + 4 * (100vw - 1280px) / 640), 20px);
}

.el-posts-grid.is-large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(24px, calc(24px + 19 * (100vw - 1280px) / 640), 43px);
}

/* Only one post: one wide card, image left and text right from 768px (no empty half row). */
.el-posts-grid.is-single {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
    .el-posts-grid.is-single .el-post-card {
        flex-direction: row;
    }

    .el-posts-grid.is-single .el-post-card-media {
        flex: 0 0 50%;
    }

    .el-posts-grid.is-single .el-post-card-body {
        justify-content: center;
        padding: clamp(24px, calc(24px + 24 * (100vw - 1280px) / 640), 48px);
    }
}

.el-posts-grid + .el-posts-grid {
    margin-top: clamp(32px, calc(32px + 27 * (100vw - 1280px) / 640), 59px);
}

/* Card sizes on the first (large) row. The card itself: assets/css/post-card.css */
.is-large .el-post-card {
    --el-card-radius: clamp(28px, calc(28px + 12 * (100vw - 1280px) / 640), 40px);
    --el-card-pad: clamp(24px, calc(24px + 12 * (100vw - 1280px) / 640), 36px);
}

.is-large .el-post-card-tag {
    padding: 5px 22px;
    font-size: clamp(15px, calc(15px + 2 * (100vw - 1280px) / 640), 17px);
}

.is-large .el-post-card-title {
    font-size: clamp(38px, calc(38px + 18 * (100vw - 1280px) / 640), 56px);
}

.is-large .el-post-card-text {
    margin-top: 18px;
    font-size: clamp(17px, calc(17px + 3 * (100vw - 1280px) / 640), 20px);
}

/* Arrow link, like "How the cycle works"; a little smaller on the 3-up cards. */
.el-posts-grid:not(.is-large) .el-post-card-btn {
    font-size: 16px;
}

/* Pages */
.el-posts-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 6px;
    margin-top: clamp(48px, calc(48px + 32 * (100vw - 1280px) / 640), 80px);
    font-size: 15px;
}

.el-posts-pages a,
.el-posts-pages span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 4px;
    border-radius: 999px;
    color: var(--el-color-muted);
}

.el-posts-pages .current {
    background: var(--el-color-light);
    font-weight: 600;
    color: var(--el-color-navy);
}

.el-posts-pages .dots {
    min-width: 16px;
}

.el-posts-prev svg {
    transform: rotate(180deg);
}

.el-posts-pages .el-posts-prev,
.el-posts-pages .el-posts-next {
    color: var(--el-color-navy);
}

.el-posts-pages .is-disabled {
    color: #c3cbd3;
}

.el-posts-empty {
    margin: 0;
    padding: 48px 24px;
    border-radius: 24px;
    background: #f0f4f7;
    font-size: 18px;
    text-align: center;
    color: var(--el-color-muted);
}

.el-posts-empty a {
    margin-left: 4px;
    font-weight: 600;
    color: var(--el-color-orange);
}

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

    .is-large .el-post-card-title {
        font-size: 32px;
    }
}

@media (max-width: 767px) {
    .el-posts-grid.is-large {
        grid-template-columns: 1fr;
    }

    .el-posts-search {
        flex-basis: 100%;
    }

    .el-posts-sort {
        padding-left: 0;
        border-left: 0;
    }

    .el-posts-showing {
        flex-basis: 100%;
        margin-left: 0;
        font-size: 15px;
    }

    .el-posts-cats {
        flex-direction: column;
        align-items: flex-start;
    }

    .el-posts-cats-label {
        padding-left: 0;
    }

    /* Pills scroll sideways instead of wrapping into many rows. */
    .el-posts-cats ul {
        display: flex;
        flex-wrap: nowrap;
        width: calc(100% + 2 * var(--el-gutter));
        margin-inline: calc(-1 * var(--el-gutter));
        padding-inline: var(--el-gutter);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .el-posts-cats ul::-webkit-scrollbar {
        display: none;
    }

    .el-posts-cat {
        min-height: 44px;
        font-size: 16px;
        white-space: nowrap;
    }
}

@media (max-width: 575px) {
    .el-posts-grid {
        grid-template-columns: 1fr;
    }

    .el-posts-grid + .el-posts-grid {
        margin-top: 16px;
    }

    .el-posts-grid.is-large {
        gap: 16px;
    }
}
