*,
*::before,
*::after {
    box-sizing: border-box;
}

.ct-container {
    margin-bottom: 16px;
}

#article-filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 30px;
}

#article-filters {
    flex: 0 0 280px;
    max-width: 100%;
}

#article-filters form {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
}

#article-search {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
}

#article-search:focus {
    border-color: #f3082b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(243, 8, 43, 0.1);
}

.accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.accordion-item {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.accordion-header::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.accordion-header.active {
    border-color: #f3082b;
    color: #f3082b;
}

.accordion-header.active::after {
    transform: rotate(180deg);
}

.accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.3s ease-in-out;
}

.accordion-content.open {
    grid-template-rows: 1fr;
}

.accordion-content > div.filter-content-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 8px 16px 8px;
    min-height: 0;
    max-height: 300px;
    overflow-y: auto;
    transition:
        padding-top 0.3s ease-in-out,
        padding-bottom 0.3s ease-in-out;
}

.accordion-content:not(.open) > div.filter-content-inner {
    padding-top: 0;
    padding-bottom: 0;
}

.filter-content-inner::-webkit-scrollbar {
    width: 6px;
}

.filter-content-inner::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filter-content-inner::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.filter-content-inner::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.filter-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.filter-item:hover {
    background: #f9f9f9;
}

.filter-item input[type='checkbox'] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #f3082b;
}

.filter-item span {
    flex: 1;
}

.filter-count {
    margin-left: auto;
    color: #777;
    font-size: 14px;
}

.no-tags {
    color: #999;
    font-size: 14px;
    text-align: center;
    margin: 0;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: #444;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    transition: all 0.2s ease;
}

.filter-select:focus,
.filter-input:focus {
    border-color: #f3082b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(243, 8, 43, 0.1);
}

#article-apply-desktop,
.btn-reset {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
}

#article-apply-desktop {
    background-color: #f3082b;
    color: white;
    border: none;
}

#article-apply-desktop:hover {
    background-color: #d3071f;
}

.btn-reset {
    background-color: #fff;
    color: #f3082b;
    border: 1px solid #f3082b;
}

.btn-reset:hover {
    background-color: #fff5f6;
}

#article-results {
    flex: 1;
    min-width: 0;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 1200px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
}

@media (max-width: 600px) {
    .article-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.article-card-wrapper {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    overflow: hidden;
}

.article-card-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #e8e8e8;
}

.article-card-link-full {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.article-card-link-full:hover {
    color: inherit;
}

.article-card {
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
}

.article-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.article-card-link-full:hover .article-card::after {
    opacity: 1;
}

.article-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.article-card-link-full:hover .article-card-image {
    transform: scale(1.05);
}

.article-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f8f8 0%, #ececec 100%);
    position: relative;
    overflow: hidden;
}

.article-card-image-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%);
    }
    100% {
        transform: translateX(100%) translateY(100%);
    }
}

.article-card-image-placeholder svg {
    color: #bbb;
    opacity: 0.4;
    position: relative;
    z-index: 1;
}

.article-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.article-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
    letter-spacing: -0.02em;
}

.article-card-link-full:hover .article-card-title {
    color: #f3082b;
}

.article-card-excerpt {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid #f0f0f0;
}

.article-card-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

.article-card-date svg {
    flex-shrink: 0;
    color: #999;
}

.article-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: #f5f5f5;
    color: #666;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.article-tag::before {
    content: '#';
    font-size: 0.85em;
    opacity: 0.6;
}

.article-card-link-full:hover .article-tag {
    background: #f3082b;
    color: white;
    border-color: #f3082b;
}

.article-card-link-full:hover .article-tag::before {
    opacity: 0.9;
}

.no-articles {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.no-articles svg {
    color: #ccc;
    margin-bottom: 20px;
}

.no-articles p {
    font-size: 1.1rem;
    color: #666;
    margin: 0 0 20px 0;
}

.btn-reset-inline {
    display: inline-block;
    padding: 10px 24px;
    background-color: #f3082b;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-reset-inline:hover {
    background-color: #d3071f;
}

.article-pagination {
    margin-top: 40px;
    margin-bottom: 60px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.article-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: all 0.2s ease;
}

.article-page-link.active,
.article-page-link:hover {
    background: #f3082b;
    color: white;
    border-color: #f3082b;
}

#mobile-action-bar {
    display: none;
    gap: 10px;
    margin-bottom: 20px;
    margin-top: 30px;
    align-items: center;
}

.mobile-search-form {
    flex: 1;
}

.mobile-search-form .search-input-wrapper {
    position: relative;
}

.mobile-search-form .search-icon {
    display: none;
}

.mobile-search-form input {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    line-height: 1.2;
}

.mobile-search-form input:focus {
    background-color: #fff;
    border-color: #f3082b;
    box-shadow: 0 0 0 3px rgba(243, 8, 43, 0.1);
    outline: none;
}

#mobile-filter-open {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: #f3082b;
    color: white;
    border: 1px solid #f3082b;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#mobile-filter-open:hover {
    opacity: 0.85;
}

#mobile-filter-open svg {
    display: block;
}

#filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

#filter-overlay.show {
    display: block;
}

@media (max-width: 900px) {
    #article-filter-wrapper {
        flex-direction: column;
    }

    #mobile-action-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    #article-search {
        display: none;
    }

    #article-filters {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        max-width: 80%;
        height: 100%;
        background: white;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    #article-filters.show {
        left: 0;
    }

    #article-filters form {
        position: static;
        top: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding-bottom: 80px;
    }

    .article-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (min-width: 901px) {
    #article-filter-wrapper {
        flex-direction: row;
        gap: 30px;
    }

    #article-filters {
        flex: 0 0 280px;
    }

    #article-results {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .article-card-title {
        font-size: 1.1rem;
    }

    .article-card-excerpt {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
    }

    .article-card-content {
        padding: 16px;
    }
}
