/*header (filter)*/
.news > header {
    margin-bottom: 3rem;
}

.filter {
    position: relative;
}

.filter__button {
    border: none;
    background-color: var(--gray-500);
    border-radius: var(--border-radius-large);
    color: white;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.6em 2.1em;
    gap: 0.5em;
    font-size: 1em;
    cursor: pointer;
}

.filter__button:hover {
    background-color: var(--gray-600);
}

.filter__button > img {
    translate: 0 1px;
    rotate: 90deg;
}

.filter__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: fit-content;
    background-color: var(--gray-500);
    border-radius: var(--border-radius-medium);
    margin-top: 0.5rem;
    padding: 1em;
    display: none;
    flex-direction: column;
    gap: 0.5em;
    z-index: 1;
}

.filter__dropdown.active {
    display: flex;
}

.filter__dropdown__item {
    color: var(--gray-50);
    cursor: pointer;
}

.filter__dropdown__item:hover {
    color: white;
}

.filter__dropdown__item.selected {
    color: white;
}

#no_news {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4em;
    font-weight: 500;
    color: var(--gray-200);
}

/*news cards*/
.news__card {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 13rem;
    text-align: left;
}

.news__card__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.news__card:not(.background_image__meta) .news__card__content {
    margin-top: 1rem;
}

.news__card:nth-of-type(2n + 2) {
    text-align: right;
    justify-items: end;
}

.news__card:nth-of-type(2n + 2) .card_image {
    grid-column: 2;
    margin-right: 0;
    margin-left: 5rem;
}

.news__card:nth-of-type(2n + 2) .news__card__content {
    grid-column: 1;
    align-items: flex-end;
}

.news__card:nth-of-type(2n + 2) .news__card__url {
    margin-left: auto;
}

.card_image {
    display: block;
    margin-right: 5rem;
    overflow: hidden;
    border-radius: var(--border-radius-medium);
}

.card_image > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news__card__content > * {
    display: block;
    text-align: inherit;
}

.news__card__meta {
    font-size: 0.8em !important;
    font-weight: 400 !important;
    opacity: var(--text-opacity-contrast);
}

.news__card__title {
    font-size: 3.6em;
    font-weight: 800;
    line-height: 1.2;
    margin: 5px 0 15px;
    max-width: 50vw;
    user-select: none;
}

.news__card__title:hover {
    text-decoration: none;
}

.news__card__description {
    font-size: 1em;
    font-weight: 400;
    opacity: var(--text-opacity-convergence);
    margin-bottom: 15px;
    max-width: calc(50vw - var(--side-margin) - 2em);
}

.news__card__url {
    font-size: 0.8em !important;
    width: fit-content;
}

/* paginator */
.news > footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2.5em;
    margin-bottom: 3em;
}

/* mobile collapsing */
@media screen and (max-width: 1200px) {
    .news__card {
        grid-auto-flow: row;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        text-align: center;
        margin-bottom: 13rem;
    }

    .news__card:nth-of-type(2n + 2) {
        text-align: center;
        justify-items: stretch;
    }

    .news__card:nth-of-type(2n + 2) .card_image {
        grid-column: unset;
        margin-right: 0;
        margin-left: 0;
    }

    .news__card:nth-of-type(2n + 2) .news__card__content {
        grid-column: unset;
        align-items: center;
    }

    .news__card:nth-of-type(2n + 2) .news__card__url {
        margin-left: 0;
    }

    .card_image {
        margin-right: 0;
    }

    .news__card__content {
        align-items: center;
    }

    .news__card__title {
        max-width: 80vw;
        font-size: 2.8em;
        text-align: center !important;
    }

    .news__card__description {
        max-width: min(80vw, 400px);
    }
}

@media (max-width: 600px) {
    .card_image {
        height: 300px;
    }

    .news__card__title {
        max-width: unset !important;
        font-size: 2.4em;
    }

    .news__card__description {
        max-width: unset !important;
    }
}

.footer__create_article__url {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}
