.category-view {
    margin: 20px 0;
    display: table;
    width: 100%;
}

.filters {
    margin-bottom: 20px;
}

.search-container {
    display: flex;
    gap: 10px;
    
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: rgb(250, 250, 250);
}

input[type=text].search-input {
    width: calc(100% - 30px);
    background-color: transparent;
    border: none;
    padding-right: 30px; /* Make room for the clear button */
    padding: 0px;
}

.clear-search-button {
    height: 100%;
    font-size: 25px;
    color: #999;
    cursor: pointer;
    background-color: transparent;
    
    padding: 0px;
}
.clear-search-button:hover {
    background-color: transparent;
}



.search-button {
    padding: 8px 20px;
    background: #b28780;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 10px;
}

.search-button:hover {
    background: #9a726b;
    color: white;
}

.search-and-clear {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.search-form {
    flex: 1;
}
.clear-filters-wrapper{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: -6px;
}
.clear-filters-button {
    height: 40px;
    padding: 0 20px;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.clear-filters-button:hover {
    background: #555;
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.tag-filter input[type=checkbox]{
    margin-right: 4px;
}
.tag-filter {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background: #f0f0f0;
    border-radius: 15px;
    cursor: pointer;
}

.tag-filter.select-all {
    font-weight: bold;
    margin-right: 15px;
}

.select-all-checkbox {
    margin-right: 5px;
}

.tag-filter.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tag-filter.disabled input {
    cursor: not-allowed;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.post-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    background-color: rgb(253, 249, 244);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.post-card.disabled::after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
}

.post-card img {
    aspect-ratio: 3/2;
    object-fit: contain;
    width: 100%;
}

.post-card h3 {
    color: #b28780;
    font-family: avenir-lt-w01_85-heavy1475544, avenir-lt-w05_85-heavy, sans-serif;
    text-align: center;
    font-size: 16px;
    margin: 10px;
    padding: 0;
}

.post-card p {
    color: #5d3c37;
    font-size: 15px;
    font-family: avenir-lt-w01_85-heavy1475544, avenir-lt-w05_85-heavy, sans-serif;
    text-align: center;
    -webkit-line-clamp: 3;
    line-clamp: 3; 
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
    margin: 10px;
    padding: 0;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post-tags {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto; /* This pushes the tags to the bottom */
}

.tag {
    background: #e0e0e0;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.tag.disabled {
    opacity: 0.5;
    background-color: #ddd;
}

.pagination {
    text-align: center;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
    color: #333;
    background: #fff;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #f5f5f5;
    border-color: #b28780;
}

.pagination .current {
    background: #b28780;
    color: white;
    border-color: #b28780;
}

.pagination.top {
    margin-bottom: 30px;
}

.pagination.bottom {
    margin-top: 30px;
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}
