.cs-posts {
    padding-top: 4rem;
    padding-bottom: 4rem;
    background: #fafafa;
}

.cs-posts__filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e8e8e8;
    position: relative;
    z-index: 10;
}

.cs-posts__filters-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cs-posts__filters-label {
    color: #666;
    font-family: Aeonik;
    font-size: 1rem;
    font-weight: 400;
}

.cs-posts__dropdown {
    position: relative;
    min-width: 200px;
}

.cs-posts__dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    color: #26282a;
    font-family: Aeonik;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.cs-posts__dropdown-toggle:hover {
    border-color: #26282a;
}

.cs-posts__dropdown-icon {
    transition: transform 0.2s ease;
}

.cs-posts__dropdown.is-open .cs-posts__dropdown-icon {
    transform: rotate(180deg);
}

.cs-posts__dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 20;
    max-height: 300px;
    overflow-y: auto;
}

.cs-posts__dropdown.is-open .cs-posts__dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cs-posts__dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #f5f5f5;
    color: #666;
    font-family: Aeonik;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cs-posts__dropdown-item:last-child {
    border-bottom: none;
}

.cs-posts__dropdown-item:hover {
    background: #f9f9f9;
    color: #26282a;
}

.cs-posts__dropdown-item.active {
    background: #f5f5f5;
    color: #26282a;
    font-weight: 500;
}

.cs-posts__search {
    flex: 1;
    max-width: 400px;
}

.cs-posts__search-form {
    width: 100%;
}

.cs-posts__search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cs-posts__search-icon {
    position: absolute;
    left: 1rem;
    color: #999;
    pointer-events: none;
}

.cs-posts__search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    color: #26282a;
    font-family: Aeonik;
    font-size: 1rem;
    font-weight: 400;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cs-posts__search-input:focus {
    outline: none;
    border-color: #26282a;
}

.cs-posts__search-input::placeholder {
    color: #999;
}

.cs-posts__search-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.cs-posts__search-clear:hover {
    color: #26282a;
}

.cs-posts__active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 4px;
}

.cs-posts__active-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
}

.cs-posts__active-filter-label {
    color: #666;
    font-family: Aeonik;
    font-size: 0.875rem;
    font-weight: 400;
}

.cs-posts__active-filter-value {
    color: #26282a;
    font-family: Aeonik;
    font-size: 0.875rem;
    font-weight: 500;
}

.cs-posts__active-filter-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    margin-left: 0.25rem;
}

.cs-posts__active-filter-remove:hover {
    color: #26282a;
}

.cs-posts__results-count {
    margin-left: auto;
    color: #666;
    font-family: Aeonik;
    font-size: 0.875rem;
    font-weight: 400;
}

.cs-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.cs-posts__pagination {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cs-posts__pagination a,
.cs-posts__pagination span {
    padding: 0.75rem 1.25rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    color: #26282a;
    font-family: Aeonik;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    min-width: 44px;
    text-align: center;
}

.cs-posts__pagination a:hover {
    background: #26282a;
    color: #fff;
    border-color: #26282a;
}

.cs-posts__pagination .current {
    background: #26282a;
    color: #fff;
    border-color: #26282a;
}

.cs-posts__pagination .dots {
    border: none;
    background: none;
    padding: 0.75rem 0.5rem;
}

.cs-posts__empty {
    text-align: center;
    padding: 4rem 0;
    color: #666;
    font-family: Aeonik;
    font-size: 1.25rem;
}

.cs-post-item,
.cs-post-item:hover,
.cs-post-item:focus,
.cs-post-item:active {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    justify-content: flex-end;
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
}

.cs-post-item__image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}

.cs-post-item__image-overlay {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(0, 0, 0, 0.505) 55.08%,
        rgba(0, 0, 0, 0.7) 69.76%,
        rgba(0, 0, 0, 0.85)
    );
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.cs-post-item__image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.cs-post-item__placeholder {
    width: 100%;
    height: 100%;
    background: #e8e8e8;
}

.cs-post-item__content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    justify-content: flex-end;
    z-index: 3;
    position: relative;
    padding: 2rem;
}

.cs-post-item__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cs-post-item__category {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: Aeonik;
    font-size: 0.75rem;
    font-weight: 400;
    border-radius: 4px;
}

.cs-post-item__title-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.cs-post-item__icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.cs-post-item__title {
    color: #fff;
    font-family: Aeonik;
    font-size: 1.5rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.3;
    text-wrap: pretty;
    margin: 0;
    text-decoration: none;
}

.cs-post-item__title-line {
    display: inline;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.cs-post-item__subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-family: Aeonik;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
    margin: 0.25rem 0 0 0;
    text-wrap: pretty;
}

@media (max-width: 1150px) {
    .cs-post-item__content {
        padding: 1.5rem;
    }

    .cs-post-item__title {
        line-height: 1.2;
    }
}

@media (max-width: 1075px) {
    .cs-post-item__content {
        padding: 1.25rem;
    }
}

@media (max-width: 992px) {
    .cs-posts__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .cs-posts {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .cs-posts__filters {
        margin-bottom: 2rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cs-posts__filters-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .cs-posts__dropdown {
        width: 100%;
    }

    .cs-posts__search {
        max-width: 100%;
    }

    .cs-posts__active-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .cs-posts__results-count {
        margin-left: 0;
        text-align: center;
        padding-top: 0.5rem;
        border-top: 1px solid #e8e8e8;
    }

    .cs-posts__pagination {
        margin-top: 2rem;
        gap: 0.25rem;
    }

    .cs-posts__pagination a,
    .cs-posts__pagination span {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        min-width: 38px;
    }

    .cs-posts__pagination .prev,
    .cs-posts__pagination .next {
        flex: 1 0 auto;
        min-width: 80px;
    }

    .cs-post-item__title {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .cs-posts__grid {
        grid-template-columns: 1fr;
    }

    .cs-post-item__content {
        padding: 1.5rem;
    }

    .cs-post-item__title {
        font-size: 2rem;
        line-height: 1.25;
    }

    .cs-post-item__subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cs-posts__pagination a,
    .cs-posts__pagination span {
        padding: 0.5rem;
        font-size: 0.813rem;
        min-width: 34px;
    }

    .cs-posts__pagination .prev,
    .cs-posts__pagination .next {
        padding: 0.5rem 0.75rem;
    }
}
