.posts-grid {
    width: 100%;
    padding: 0 clamp(30px, 5vw, 60px);
    margin: 0 auto;
}

.posts-grid__container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Section */
.posts-grid__header {
    margin-bottom: 55px;
}

.posts-grid__header-top {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.posts-grid__header-title {
    font-family: 'Lexend', sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 40px;
    line-height: 100%;
    letter-spacing: -2px;
    color: #000;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.posts-grid__search-wrapper {
    flex: 1;
    margin-bottom: 0;
    max-width: 600px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.posts-grid__search-input-container {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    max-width: 219px;
}

.posts-grid__search-icon {
    position: absolute;
    right: 16px;
    width: 20px;
    height: 20px;
    color: #AAAAAA;
    pointer-events: none;
    z-index: 1;
}

.posts-grid__search-input {
    width: 100%;
    max-width: 219px;
    padding: 12px 48px 12px 0;
    border: none;
    border-bottom: 1px solid #E0E0E0;
    border-radius: 0;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: #000;
    background: transparent;
    transition: border-bottom-color 0.3s ease;
}

.posts-grid__search-input:focus {
    outline: none;
    border-bottom-color: #2ecc71;
}

.posts-grid__search-input::placeholder {
    color: #AAAAAA;
}

.posts-grid__search-button {
    width: 71px;
    height: 21px;
    padding: 0 20px;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    background: #fff;
    color: #AAAAAA;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.posts-grid__search-button:hover {
    border-color: #2ecc71;
    color: #2ecc71;
}

.posts-grid__filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.posts-grid__filter-button {
    color: var(--brand-2);
    text-transform: uppercase;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    background-color: rgba(46, 204, 113, 0);
    border: 1px solid #2ECC70;
    border-radius: 20px;
    padding-top: .5rem;
    padding-bottom: .5rem;
    padding-left: 20px;
    padding-right: 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    line-height: 9px;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease;
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
}

.posts-grid__filter-button:hover {
    /* border-color is set via inline style from category color */
    color: var(--brand-2);
}

.posts-grid__filter-button--active {
    /* border-color and background-color are set via inline style from category color */
    color: var(--brand-2);
}

/* Category button colors - assign to buttons via data attributes */
.posts-grid__filter-button[data-category-name*="CATEGORY 1"],
.posts-grid__filter-button[data-category-name*="1"] {
    border-color: #2ecc71;
}

.posts-grid__filter-button[data-category-name*="CATEGORY 2"],
.posts-grid__filter-button[data-category-name*="2"] {
    border-color: #1abc9c;
}

.posts-grid__filter-button[data-category-name*="CATEGORY 3"],
.posts-grid__filter-button[data-category-name*="3"] {
    border-color: #e74c3c;
}

.posts-grid__clear-filters {
    color: #AAAAAA;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    line-height: 9px;
    letter-spacing: 1px;
    text-decoration: underline;
    text-decoration-style: solid;
    text-decoration-offset: 0%;
    text-decoration-thickness: 0%;
    transition: color 0.3s ease;
    margin-left: 0;
    white-space: nowrap;
    display: inline-block;
}

.posts-grid__clear-filters:hover {
    color: #2ecc71;
}

.posts-grid__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.posts-grid__item {
    display: flex;
    flex-direction: column;
}

.posts-grid__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    overflow: hidden;
}

.posts-grid__image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 343 / 175;
    overflow: hidden;
    background: #f5f5f5;
}

.posts-grid__image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.posts-grid__item.has-category-badge .posts-grid__image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 15.71%, rgba(0, 0, 0, 0) 30%);
    z-index: 1;
    pointer-events: none;
}

.posts-grid__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.posts-grid__category-badge {
    position: absolute;
    top: 17px;
    left: unset;
    right: 24.5px;
    padding-left: 20px;
    padding-right: 20px;
    border-radius: 20px;
    border: 1px solid #2ecc71;
    background: transparent;
    color: #2ecc71;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 12px;
    line-height: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 21.13868522644043px;
    z-index: 2;
    white-space: nowrap;
    box-sizing: border-box;
    opacity: 1;
}

.posts-grid__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #fff;
}

.posts-grid__title {
    font-family: 'Lexend', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0px;
    vertical-align: middle;
    color: #000000;
    margin: 0 0 0.75rem 0;
}

.posts-grid__excerpt {
    font-family: 'Lexend', sans-serif;
    font-weight: 300;
    font-style: normal;
    font-size: 12px;
    line-height: 100%;
    letter-spacing: 0px;
    vertical-align: middle;
    color: #666;
    margin-bottom: 0;
    flex-grow: 1;
}

.posts-grid__excerpt a,
.posts-grid__content a {
    color: #2ecc71;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.posts-grid__excerpt a:hover,
.posts-grid__content a:hover {
    color: #27ae60;
}


.posts-grid__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
}

.posts-grid__reading-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #C1C1C1;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 12px;
    line-height: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.posts-grid__reading-time span {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 12px;
    line-height: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.posts-grid__reading-time svg {
    flex-shrink: 0;
}

.posts-grid__read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 134px;
    height: 21px;
    padding: 4px 5px 3px;
    border-radius: 20px;
    border: 1px solid #FFFFFF;
    background: #51BA6E;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    line-height: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    box-sizing: border-box;
}

.posts-grid__read-more-arrow {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.posts-grid__read-more svg {
    flex-shrink: 0;
    width: 13px;
    height: 13px;
}

.posts-grid__loader {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    margin-top: 2rem;
}

.posts-grid__loader-content {
    text-align: center;
}

.posts-grid__loader-content p {
    margin-top: 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #666;
}

.posts-grid__loader-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #51ba6e;
    border-radius: 50%;
    animation: posts-grid-spin 0.8s linear infinite;
}

@keyframes posts-grid-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.posts-grid__no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* Responsive */
@media (max-width: 1024px) {
    .posts-grid__header-top {
        gap: 1.5rem;
    }
    
    .posts-grid__header-title {
        font-size: 36px;
    }
    
    .posts-grid__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .posts-grid {
        padding: 0 20px;
    }
    
    .posts-grid__header {
        margin-bottom: 2rem;
    }
    
    .posts-grid__header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .posts-grid__header-title {
        font-size: 28px;
        line-height: 1.2;
        margin-bottom: 0;
        width: 100%;
    }
    
    .posts-grid__search-wrapper {
        width: 100%;
        max-width: 100%;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 0;
    }
    
    .posts-grid__search-input-container {
        width: 100%;
        max-width: 100%;
    }
    
    .posts-grid__search-input {
        width: 100%;
        max-width: 100%;
        padding: 12px 40px 12px 0;
        font-size: 14px;
    }
    
    .posts-grid__search-icon {
        right: 12px;
        width: 18px;
        height: 18px;
    }
    
    .posts-grid__search-button {
        width: 100%;
        height: 40px;
        padding: 0;
        margin-top: 0;
        font-size: 12px;
    }
    
    .posts-grid__filters {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        margin: 0;
        width: 100%;
    }
    
    .posts-grid__filter-button {
        font-size: 11px;
        padding: 8px 16px;
        line-height: 1;
        flex-shrink: 0;
    }
    
    .posts-grid__clear-filters {
        font-size: 11px;
        margin-left: 0;
        margin-top: 0;
        padding: 8px 0;
    }
    
    .posts-grid__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .posts-grid__header-title {
        font-size: 24px;
        letter-spacing: -1px;
    }
    
    .posts-grid__search-input {
        font-size: 13px;
        padding: 10px 36px 10px 0;
    }
    
    .posts-grid__search-icon {
        right: 10px;
        width: 16px;
        height: 16px;
    }
    
    .posts-grid__search-button {
        height: 38px;
        font-size: 11px;
    }
    
    .posts-grid__filter-button {
        font-size: 10px;
        padding: 6px 12px;
    }
    
    .posts-grid__clear-filters {
        font-size: 10px;
    }
    
    .posts-grid__header-top {
        gap: 1rem;
    }
    
    .posts-grid__header {
        margin-bottom: 1.5rem;
    }
}

