/* News list (/blog/, /dev-updates/): title band, search, tag pills, post grid, pagination.
   Values measured on live roc.ai (Divi_Child blog.css). Loaded only by the news list templates, after style.css
   and media.css. Desktop rules first, then the responsive tiers (1600, 1450, 1300, 1024 to 475, 475). */

:root {
    --news-gap: clamp(18px, 1.82vw, 35px);
    --news-image-h: 273px;
    --news-pad-x: 0px;
    --news-pad-top: 150px;
}

/* ==========================================================================
   Frame and title band
   ========================================================================== */
.news {
    background: var(--color-cream);
}

.news__wrap {
    max-width: 1340px;
    margin: 0 auto;
    padding: var(--news-pad-top) var(--news-pad-x) 0;
    border-bottom: 1px solid var(--color-ink);
}

.news__title-band {
    padding-bottom: clamp(32px, 3.2vw, 64px);
}

.news__title {
    padding-bottom: 10px;
    font-family: var(--font-bold);
    font-size: clamp(60px, 6vw, 120px);
    font-weight: 500;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--color-ink);
}

.news__body {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding-bottom: 128px;
}

/* ==========================================================================
   Search and tag pills
   ========================================================================== */
.news__filters {
    display: flex;
    justify-content: space-between;
    position: relative;
    width: 100%;
    margin-bottom: 64px;
}

.news__search {
    display: flex;
}

.news__search-input {
    box-sizing: border-box;
    width: 264px;
    padding: 10px 50px 10px 10px;
    border: 1px solid var(--color-steel);
    border-radius: 50px;
    background: transparent url("../images/search-magnifier.png") no-repeat center right 20px / 20px;
    font-family: var(--font-medium);
    font-size: 18px;
    text-align: center;
    color: var(--color-ink);
    appearance: none;
}

.news__search-input::placeholder {
    opacity: 1;
    font-family: var(--font-bold);
    color: var(--color-ink);
}

.news__tags {
    display: flex;
    justify-content: space-between;
    gap: 48px;
    padding: clamp(10px, 1vw, 20px) 0;
    border-bottom: 1px solid var(--color-steel);
    list-style: none;
}

.news__tag {
    font-family: var(--font-medium);
    font-size: 18px;
    color: var(--color-slate);
}

.news__tag:hover,
.news__tag.is-active {
    padding-bottom: clamp(10px, 1vw, 20px);
    border-bottom: 4px solid var(--color-ink);
    font-family: var(--font-bold);
    color: var(--color-ink);
}

.news__empty {
    display: flex;
    flex-direction: column;
    width: 322px;
    margin-bottom: 64px;
    font-family: var(--font-regular);
    font-size: 16px;
}

.news__empty strong {
    font-family: var(--font-bold);
    font-weight: 400;
}

/* ==========================================================================
   Grid and post cards
   ========================================================================== */
.news__results {
    width: 100%;
}

.news__grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: clamp(40px, 3.96vw, 76px) var(--news-gap);
    width: 100%;
    margin-bottom: 4.375vw;
}

.news__grid:has(.post-card:nth-child(3)) {
    row-gap: 64px;
    margin-bottom: 128px;
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: calc(33% - 1vw);
}

.post-card__image {
    position: relative;
    margin-bottom: 31px;
}

.post-card__image img {
    display: block;
    width: 100%;
    height: var(--news-image-h);
    object-fit: cover;
    object-position: bottom left;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 5.85% 100%, 0 91%);
}

.post-card__tag {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 165px;
    height: 24px;
    padding-top: 2px;
    border-right: 3px solid var(--color-cream);
    border-bottom: 3px solid var(--color-cream);
    background: var(--color-rust);
    font-family: var(--font-bold);
    font-size: 16px;
    line-height: 20px;
    text-transform: uppercase;
    color: var(--color-cream);
}

.news--dev .post-card__tag {
    width: 210px;
}

.post-card__title {
    margin-bottom: 10px;
    padding-bottom: 10px;
    font-family: var(--font-bold);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.33;
    color: var(--color-ink);
}

.post-card__text {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
}

.post-card__text p {
    font-family: var(--font-regular);
    font-size: 18px;
    line-height: 1.33;
    color: var(--color-ink);
}

.post-card__date {
    font-family: var(--font-regular);
    font-size: 16px;
    line-height: 1;
    color: var(--color-slate);
}

/* ==========================================================================
   Pagination (shared with the media coverage list) and View More
   ========================================================================== */
.pager {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.pager__numbers {
    display: flex;
    gap: 10px;
}

.pager .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-family: var(--font-medium);
    font-size: 18px;
    color: var(--color-ink);
}

.pager .page-numbers:not(.prev):not(.next) {
    width: 51px;
    height: 51px;
}

.pager .page-numbers.current {
    border: 1px solid var(--color-steel);
}

.pager a.page-numbers:not(.prev):not(.next):hover {
    color: var(--color-rust);
}

.pager .prev,
.pager .next {
    gap: 15px;
    width: 115px;
    height: 56px;
    border: 1px solid var(--color-steel);
}

.pager .prev {
    margin-right: min(clamp(220px, 15vw, 300px), 10vw);
}

.pager .next {
    margin-left: min(clamp(220px, 15vw, 300px), 10vw);
}

.pager a.prev:hover,
.pager a.next:hover {
    border-color: var(--color-rust);
}

.pager .is-placeholder {
    visibility: hidden;
}

.news__more {
    display: none;
}

.news__more-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 143px;
    height: 41px;
    border-radius: 50px;
    background: var(--color-rust);
    font-family: var(--font-bold);
    font-size: 3.475vw;
    color: var(--color-cream);
}

/* ==========================================================================
   Responsive tiers
   ========================================================================== */
@media (max-width: 1920px) {
    :root { --news-image-h: 273px; }
}

@media (min-width: 1921px) {
    :root { --news-image-h: 269px; }
}

@media (max-width: 1600px) {
    :root {
        --news-pad-x: 150px;
        --news-pad-top: 195px;
        --news-image-h: 248px;
    }

    .news__wrap { max-width: none; }

    .news__title {
        font-size: 120px;
        line-height: 110px;
    }

    .news__title-band { padding-bottom: 64px; }
}

@media (max-width: 1500px) {
    :root { --news-image-h: 238px; }
}

@media (max-width: 1450px) {
    :root {
        --news-pad-x: 140px;
        --news-pad-top: 181px;
    }
}

@media (max-width: 1300px) {
    :root {
        --news-pad-x: 125px;
        --news-image-h: 211px;
    }
}

@media (max-width: 1024px) {
    :root { --news-image-h: 169px; }
}

@media (min-width: 476px) and (max-width: 1024px) {
    :root {
        --news-pad-x: 100px;
        --news-pad-top: 95px;
    }

    .news__title {
        font-size: 87px;
        line-height: 110px;
    }

    .news--dev .news__title {
        font-size: 64px;
        line-height: 1.2;
    }

    .news__title-band { padding-bottom: 33px; }

    .news__filters { margin-bottom: 40px; }

    .news__tags {
        gap: 34px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .news__tag {
        font-size: 16px;
        white-space: nowrap;
    }

    .news__search-input {
        width: 148px;
        height: 40px;
        font-size: 16px;
    }

    .post-card__image { margin-bottom: 27px; }

    .post-card__title,
    .post-card__text p { font-size: 16px; }

    .news--dev .post-card__tag { width: 85%; }
}

@media (min-width: 501px) and (max-width: 850px) {
    .news--dev .news__title {
        font-size: 52px;
        line-height: 1.1;
    }

    .news--dev .post-card__tag { width: 100%; }
}

/* Live keeps 33% wide cards here, which no longer fit three per row and leave a third of the width empty:
   two equal columns instead. */
@media (min-width: 476px) and (max-width: 980px) {
    .post-card { width: calc((100% - var(--news-gap)) / 2); }
}

@media (max-width: 768px) {
    .news__pager { display: none; }

    .news__filters { display: contents; }

    .news__search {
        width: 100%;
        margin-bottom: 40px;
    }

    .news__tags { max-width: 100%; }

    .news__more {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 500px) {
    :root { --news-image-h: auto; }
}

@media (max-width: 475px) {
    :root {
        --news-pad-x: 15px;
        --news-pad-top: 95px;
    }

    .news__title {
        font-size: 18.75vw;
        line-height: 1.2;
    }

    .news--dev .news__title { font-size: 13vw; }

    .news__title-band { padding-bottom: 8vw; }

    .news__body {
        padding-bottom: 96px;
        border-bottom: 1px solid var(--color-steel);
    }

    .news__search {
        gap: 13px;
        margin-bottom: 3.125vw;
    }

    /* No tag row under the search (/dev-updates/): 40px to the first picture, as from 476 to 768px
       and between the cards (Evan, DIGITAL-329). */
    .news__search:last-child { margin-bottom: 40px; }

    .news__search-input {
        width: 175px;
        height: 41px;
        font-size: 15px;
    }
    /* live pads the placeholder box on phones, which moves the centred word 3.125vw / 2 right */
    .news__search-input::placeholder { padding-left: 3.125vw; }

    .news__tags {
        position: sticky;
        top: 0;
        z-index: 99;
        gap: 3.75vw;
        width: 100%;
        margin-bottom: 12.5vw;
        overflow-x: auto;
        background: var(--color-cream);
    }

    .news__tag {
        font-size: 3.25vw;
    }

    .news__grid,
    .news__grid:has(.post-card:nth-child(3)) {
        gap: 0;
        margin-bottom: 0;
    }

    .post-card {
        width: 100%;
        margin-bottom: 40px;
        padding-bottom: 60px;
        border-bottom: 1px solid var(--color-steel);
    }

    .post-card__image { margin-bottom: calc(4vw + 7px); }

    .post-card__tag {
        width: 25.6vw;
        height: 20px;
        font-size: 2.81vw;
    }

    .news--dev .post-card__tag { width: 25.6vw; }

    .post-card__title,
    .post-card__text p { font-size: 3.43vw; }

    .post-card__date { font-size: 2.8vw; }

    .news__empty { margin-bottom: 12.5vw; }
}

@media (hover: hover) {
    .news__more-button:hover { background: var(--color-rust-dark); }
}
