/* top search */
#search_wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    text-align: center;
}

#search_wrapper h1 {
    font-size: 36px;
    font-style: normal;
    font-weight: 600;
}
/* generic */
#page-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

section {
    padding: 16px;
    display: flex;
    gap: 24px;
    flex-direction: column;
}

section h2 {
    color: white;
    text-align: center;
    font-size: 48px;
    font-style: normal;
    font-weight: 600;
    line-height: 48px; /* 100% */
}

#categories_container, 
#articles,
#downloads {
    width: 100%;
    max-width: 1450px;
    margin: 0px auto;
}

/* categories */
#categories_list {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.category_image {
    background: radial-gradient(50% 50% at 50% 50%, #505460 0%, #100F0F 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
}

.category_image img {
    width: 75%;
    display: block;
    margin: 0 auto;
}

.category_title {
    display: flex;
    padding: 16px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    align-self: stretch;
    background: #222;
    height: 88px;
}

.category_title a {
    text-decoration: none;
}

.category_title h3 {
    color: #FFF;
    text-align: center;
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px; /* 125% */
    letter-spacing: 0.32px;
    text-transform: uppercase;
    display: -webkit-box;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* generic articles */
#articles {
    display: flex;
    gap: 16px;
    flex-direction: column;
    width: 100%;
    padding-top: 0;
}

/* orderings */
#sort {
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: stretch;
}

#sort label {
    text-transform: uppercase;
}

#sort select {
    display: flex;
    height: 44px;
    padding: 8px;
    justify-content: space-between;
    align-items: center;
    flex: 1 0 0;
    background-color: black;
    color: #FFF;
    border: 1px solid #FFF;
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    text-transform: uppercase;
}

/* filters */
#desktop_filter {
    display: none;
}

#mobile_filter_button {
    height: 44px;
    padding: 8px;
    background-color: black;
    color: #FFF;
    border: 1px solid #FFF;
    width: 100%;
}

#mobile_filter_form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    flex-direction: column;
    gap: 16px;
    z-index: 9;
    padding: 16px;
}

#close_filter {
    position: absolute;
    top: 20px;
    right: 20px;
    fill: #FFF;
}

.filter_content_type {
    display: flex;
    flex-direction: column;
    gap: 16px;

}

.filter p {
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 36px;
    letter-spacing: 0.28px;
    margin-bottom: 8px;
}

.form-control {
    display: grid;
    grid-template-columns: 1em auto;
    gap: 0.5em;
    color: #FFF;
    text-transform: uppercase;
    align-items: center;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

input[type="checkbox"] {
    /* Add if not using autoprefixer */
    -webkit-appearance: none;
    /* Remove most all native input styles */
    appearance: none;
    /* For iOS < 15 */
    background-color: transparent;
    /* Not removed via appearance */
    margin: 0;

    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 0.05em solid currentColor;
    transform: translateY(-0.075em);

    display: grid;
    place-content: center;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transform-origin: bottom left;
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    /* Windows High Contrast Mode */
    background-color: CanvasText;
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:focus {
    outline: max(2px, 0.15em) solid currentColor;
    outline-offset: max(2px, 0.15em);
}

/* articles */
#articles_list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.article {
    background-color: #0C0D0D;
}

.article img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
    
.article_item {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #0C0D0D;
    height: 200px;
}
        
.article_item a {
    text-decoration: none;
}

.article_item .article_type {
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    letter-spacing: 1.28px;
    opacity: 0.6;
}

.related_article_article_title {
    overflow: hidden;
    color: #FFF;
    text-overflow: ellipsis;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: 0.4px;
    height: 114px;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    display: -webkit-box;
}

/* pagination */
#pagination {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

#pagination a, #pagination span {
    padding: 0px 8px;
    text-decoration: none;
    align-items: center;
    display: flex;
}

#pagination svg {
    fill: white;
}

#pagination .active {
    border-bottom: 1px solid var(--brand-colour, #ECE81A);
}


/* 1280, 1920, 2560 */
/* 640, 960, 1280*/


@media screen and (min-width: 960px) {
    /* search */
    #search_wrapper h1 {
        font-size: 48px;
    }

    /* generic */
    section {
        padding: 0px 64px;
        display: flex;
        gap: 32px;
        flex-direction: column;
    }

    /* search  */
    #search_banner {
        padding: 32px 0;
    }

    /* articles */
    #articles_list {
        grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    }
}

@media screen and (min-width: 1280px) {
    /* search */
    #search_wrapper h1 {
        font-size: 64px;
    }

    /* categories */
    .category_image {
        height: unset;
    }

    /* headers */
    #articles h2 {
        text-align: left;
        border-bottom: 1px solid var(--brand-colour);
        font-size: 48px;
        font-style: normal;
        font-weight: 500;
        line-height: normal;
    }

    /* generic articles */
    #articles_wrapper {
        display: flex;
        align-items: flex-start;
        gap: 24px;
    }

    /* sort */
    #sort {
        justify-content: flex-end;
    }
    #sort select {
        max-width: 150px;
    }

    /* filters */
    #mobile_filter,
    #mobile_articles_filter_by {
        display: none;
    }

    #desktop_filter {
        display: flex;
        gap: 16px;
        align-items: center;
        min-width: 140px;
    }

    /* articles */
    #articles {
        gap: 32px;
    }

    #articles_list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media screen and (min-width: 1400px) {
    /* categories */
    #categories_list {
        gap: 16px;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media screen and (min-width: 1900px) {
    #categories_list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .category {
        width: 100%;
    }

    /* articles */
    #articles_list {
        grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
    }

    /* articles */
    #articles_list {
        grid-template-columns: repeat(4, 1fr);
    }
}