@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
:root {
    --light-grey-green: #CDD0CE;
    --off-white: #e9edea;
    --dark-grey-green: #525553;
    --text-font-size: 1em;
    --small-font-size: 0.9em;
}

/* Only apply these styles on category pages */
body.category {
    font-family: "Montserrat", sans-serif;
    margin: 0;
}

body.category .page-content {
    padding-inline: clamp(1rem, 5vw, 4em);
    padding-block: 2.5em;
    background-color: #F8F8F8;
}

body.category .header {
    background-color: var(--light-grey-green);
    padding: clamp(1.25rem, 5vw, 4em);
}

body.category h1 {
    font-size: 36px;
    margin-top: 0;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

body.category .description-wrapper {
    position: relative;
    transition: max-height 0.3s ease-in-out;
    overflow: hidden;
}

body.category .description-wrapper.truncated {
    max-height: 120px;
}

body.category .description-text {
    font-size: var(--text-font-size);
    line-height: 1.5;
    margin: 0;
}

body.category .description-text p {
    margin-top: 0;
    margin-bottom: 0.8em;
}

/* Remove the margin from the very last paragraph to prevent extra space at the bottom */
body.category .description-text p:last-child {
    margin-bottom: 0;
}

body.category .description-text a span{
    font-weight: 600 !important;
}

body.category .description-wrapper.expanded {
    max-height: 5000px;
}

body.category .read-more-button {
    background-color: var(--off-white);
    border-radius: 6px;
    border: 1px solid var(--dark-grey-green);
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8em;
    text-transform: uppercase;
    margin-top: 10px;
    display: none;
}

body.category .read-more-button:active {
    box-shadow: none;
    transform: translate(1px, 1px);
}

/* ARTICLE STYLES - Only on category pages */
body.category .article-card {
    background-color: white;
    border: 1px solid var(--light-grey-green);
    border-radius: 6px;
    padding: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;

    @media (min-width: 595px) and (max-width: 700px) {
        max-width: 50%;
    }
    @media (min-width: 701px) {
        max-width: 230px;
    }

}

body.category .article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #d0d0d0;
}

body.category .article-card img {
    width: 100%;
    aspect-ratio: 10 / 9;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

body.category .article-card-placeholder {
    width: 100%;
    aspect-ratio: 10 / 9;
    background-color: #f6f6f6;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9em;
}

body.category .article-card a {
    text-decoration: none;
    color: inherit;
}

body.category .article-card .title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #191919;
    line-height: 1.3;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.category .article-card .title:hover {
    color: var(--dark-grey-green);
}

body.category .article-card .article-excerpt {
    font-size: 0.8em;
    color: #4a4a4a;
    margin: 0 0 6px 0;
    line-height: 1.45;
}

body.category .article-card .tags {
    font-size: 0.8em;
    margin-top: auto;
    padding-top: 6px;
    margin-bottom: 0;
    color: #6e6e6e;
}


body.category .articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    align-items: stretch;
    gap: 10px;
}

/* Mobile Layout: Single column below 595px */
@media (max-width: 594px) {
    body.category .articles-container {
        grid-template-columns: 1fr;
    }
}

/* --- FILTER CONTROLS STYLES --- */
body.category .filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 2em;
    font-family: "Inter", sans-serif;
}

body.category .filter-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

body.category .filter-label {
    font-size: var(--small-font-size);
    font-weight: 400;
    color: var(--dark-grey-green);
    margin-bottom: 6px;
    display: block;
}

body.category .filter-select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 10px;
    border: 1px solid var(--light-grey-green);
    border-radius: 6px;
    background-color: white;
    color: var(--dark-grey-green);
    font-size: var(--small-font-size);
    font-weight: 500;
    cursor: pointer;

    /* Customizing dropdown appearance */
    appearance: none;
    -webkit-appearance: none;
    /* Inline SVG for the dropdown arrow (dark-grey-green color) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23525553' d='M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.929l-4.243-4.243-1.414 1.414L9.293 12.95z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 15px;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

/* Pagination styles */
body.category .page-content nav[class*="pagination"] {
    margin-top: 2em;
    display: flex;
    justify-content: center;
}

body.category .page-content .nav-links {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
}

body.category .page-content .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 8px 10px;
    border: 1px solid var(--light-grey-green);
    border-radius: 6px;
    background-color: white;
    color: var(--dark-grey-green);
    text-decoration: none;
    font-size: var(--small-font-size);
    white-space: nowrap;
    transition: all 0.2s ease;
}

body.category .page-content .page-numbers:hover,
body.category .page-content .page-numbers.current {
    background-color: var(--dark-grey-green);
    color: white;
    border-color: var(--dark-grey-green);
}