#list-page .card-columns {
    height: 100%;
}

#list-page .card {
    background-color: var(--secondary-color) !important;
    box-shadow: 0px 8px 56px rgba(15, 80, 100, 0.16);
    border-radius: .75rem;
    cursor: context-menu;
    overflow: hidden;
    border: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#list-page .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0.6rem 0.85rem 0.4rem !important;
}

/* Allow full title display - multi-line support */
#list-page .card-title {
    min-height: 3.2rem;
    max-height: 3.2rem;
    margin-bottom: 0.35rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

#list-page .card-title h5 {
    font-size: 0.85rem;
    line-height: 1.3;
    margin: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Fixed height for tags area */
#list-page .card-tags {
    min-height: 1.2rem;
    margin-bottom: 0.25rem;
}

#list-page .card-text {
    overflow: hidden;
    margin: 0;
    height: 1.1rem;
    max-height: 1.1rem;
}

#list-page .card-text p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.1rem;
    height: 1.1rem;
    color: var(--text-secondary-color);
}

#list-page .card a {
    text-decoration: none;
}

#list-page .card a h5 {
    color: var(--text-color) !important;
}

#list-page .card:hover {
    transition: all 0.3s ease-out;
    transform: translateY(-7px);
}

#list-page .card-text * {
    background-color: var(--secondary-color) !important;
}

#list-page .post-footer {
    padding: 0.35rem 0.85rem;
    background-color: var(--secondary-color) !important;
    color: var(--text-color) !important;
    border-top: none;
    font-size: 0.75rem;
}

#list-page .post-footer a.btn {
    background: var(--primary-color) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 2rem;
    padding: 0.3rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--primary-color) 30%, transparent);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    cursor: pointer;
}

#list-page .post-footer a.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--primary-color) 50%, transparent);
    color: #fff !important;
}

#list-page .post-footer a.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--primary-color) 30%, transparent);
}

#list-page .post-footer a.btn:focus {
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-color) 35%, transparent) !important;
}

#list-page .card > .card-header {
    padding: 0 !important;
    border: none !important;
    background-color: var(--secondary-color) !important;
}

#list-page .card > .card-header .card-img-top {
    width: 100%;
    height: 150px !important;
    object-fit: cover;
    background-color: transparent !important;
}

/* pagination - compact right-aligned */
#paginationRow {
    justify-content: flex-end !important;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

#paginationRow .col-auto {
    margin: 0.5rem 0 !important;
}

#list-page .pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

#list-page .page-item {
    margin: 0;
}

/* Hide page numbers, only show prev/next */
#list-page .page-item:not(:first-child):not(:last-child) {
    display: none;
}

#list-page .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
    background-color: transparent !important;
    color: var(--primary-color) !important;
    transition: all 0.2s ease;
    text-decoration: none;
}

#list-page .page-item .page-link svg {
    width: 14px;
    height: 14px;
}

#list-page .page-item .page-link:hover {
    background-color: color-mix(in srgb, var(--primary-color) 15%, transparent) !important;
    border-color: var(--primary-color);
}

#list-page .page-item .page-link:focus {
    box-shadow: none;
    outline: none;
}

#list-page .page-item.disabled .page-link {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

#list-page .page-item.active .page-link {
    border-color: var(--primary-color);
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Page indicator between arrows */
#paginationRow .pagination-info {
    font-size: 0.75rem;
    color: var(--text-secondary-color);
    font-weight: 500;
    padding: 0 0.25rem;
    opacity: 0.7;
}

/* Don't hide the middle item when it's the page indicator */
#list-page .page-item:nth-child(2) {
    display: flex !important;
    align-items: center;
}

/* ========================================
   Filter Container & Styles
   ======================================== */

.filters-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tag-filter-section {
    flex: 1;
    min-width: 220px;
    max-width: 280px;
    background-color: var(--secondary-color);
    border-radius: 0.65rem;
    box-shadow: 0px 2px 12px rgba(15, 80, 100, 0.08);
    overflow: hidden;
}

.tag-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.tag-filter-header:hover {
    background-color: color-mix(in srgb, var(--primary-color) 5%, transparent);
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
    letter-spacing: 0.01em;
}

.results-info {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
}

#resultsCount {
    font-weight: 600;
}

.expand-arrow {
    font-size: 0.75rem;
    color: var(--text-color);
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.expand-arrow.rotated {
    transform: rotate(180deg);
}

.tag-filter-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.tag-filter-collapse.expanded {
    max-height: 250px;
}

.tag-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.45rem 0.75rem 0.65rem;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary-color) 30%, transparent) transparent;
}

.tag-filter-list::-webkit-scrollbar {
    width: 4px;
}

.tag-filter-list::-webkit-scrollbar-track {
    background: transparent;
}

.tag-filter-list::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary-color) 30%, transparent);
    border-radius: 4px;
}

.tag-filter-list::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--primary-color) 50%, transparent);
}

/* Checkbox Tag Styles */
.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.8125rem;
    color: var(--text-color);
    border-radius: 0.3rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tag-checkbox:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
}

.tag-checkbox.active {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
}

.tag-checkbox input[type="checkbox"] {
    display: none;
}

.tag-checkbox .checkmark {
    width: 14px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.5;
}

.tag-checkbox.active .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
    opacity: 1;
}

.tag-checkbox.active .checkmark::after {
    content: '';
    width: 4px;
    height: 7px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.tag-checkbox .tag-text {
    font-weight: 500;
    flex: 1;
}

.tag-checkbox .tag-count {
    font-size: 0.7rem;
    opacity: 0.5;
    margin-left: auto;
}

.tag-checkbox.active .tag-count {
    opacity: 0.7;
    color: var(--primary-color);
}

.clear-filters-btn {
    padding: 0.2rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--primary-color) 40%, transparent);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.clear-filters-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Card Tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.card-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--primary-color);
    background-color: color-mix(in srgb, var(--primary-color) 12%, transparent);
    border-radius: 1rem;
}

/* Animation for filtering */
.blog-card {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.blog-card.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-color);
}

.no-results p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
    }

    .tag-filter-section {
        max-width: 100%;
        width: 100%;
    }
}
