/* ===== Article System Shared Styles ===== */
/* Requires base.css to be loaded first */

/* ===== Page Background ===== */
.articles-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

[data-theme="dark"] .articles-page {
    background: var(--bg-gradient);
}

/* ===== Container ===== */
.articles-page .container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 20px;
}

/* ===== Header ===== */
.articles-page header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.articles-page header h1 {
    color: var(--secondary);
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
}

/* ===== Stats ===== */
.stats {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 10px;
}

/* ===== Articles Grid ===== */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
}

/* ===== Article Card ===== */
.article-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.article-content-wrapper {
    padding: 25px;
}

.article-title {
    margin-top: 0;
    margin-bottom: 15px;
}

.article-title a {
    text-decoration: none;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: var(--primary-dark);
}

.article-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 15px 0;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.article-meta-mobile {
    display: none;
}

.article-description {
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 0;
}

.article-card .article-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-card .article-description {
    flex: 1;
    min-width: 0;
}

.article-card .article-image {
    width: 200px;
    height: 150px;
    object-fit: cover !important;
    max-width: none !important;
    overflow: hidden;
    border-radius: var(--radius);
    display: none;
    flex-shrink: 0;
    align-self: flex-start;
}

.article-card .article-image.show {
    display: block;
}

@media (min-width: 768px) {
    .article-card .article-content {
        flex-direction: row;
        align-items: flex-start;
        gap: 15px;
    }

    .article-card .article-description {
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
        padding-bottom: 4px;
    }
}

@media (min-width: 1024px) {
    .article-card .article-content {
        gap: 20px;
    }
}

/* ===== Articles List Style (non-grid) ===== */
.article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-list .article-card {
    border-bottom: 1px solid var(--border-light);
    padding: 25px 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.article-list .article-card:last-child {
    border-bottom: none;
}

.article-list .article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.article-list .article-title a {
    font-size: 1.5rem;
    font-weight: 700;
}

.article-list .article-card .article-content {
    margin-top: 15px;
    line-height: 1.7;
    color: var(--text);
}

.article-list .article-card .article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
}

.hidden {
    display: none;
}

/* ===== Navigation Bar (articles pages) ===== */
/* Inherits sticky + backdrop-filter + underline-hover from base.css */
.articles-page > nav:first-of-type {
    margin-bottom: 30px;
}

/* ===== Pagination ===== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px 0;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    font-size: 1rem;
}

.pagination-wrapper a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background-color: var(--surface);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid var(--border);
}

.pagination-wrapper a:hover:not(.current-page) {
    background-color: var(--surface-hover);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    border-color: var(--primary);
}

.pagination-wrapper .current-page {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    font-weight: 600;
}

.pagination-wrapper span {
    padding: 0 5px;
    color: var(--text-light);
}

.pagination-info {
    text-align: center;
    color: var(--text-light);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 1rem;
}

/* ===== Footer ===== */
/* Inherits gradient-top-bar + surface-bg + shadow from base.css */
.articles-page footer {
    margin-top: 40px;
}

/* ===== Controls ===== */
.controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.controls label {
    margin-right: 10px;
    font-weight: 500;
    color: var(--secondary);
}

.controls input {
    width: 70px;
    padding: 8px 12px;
    border: 1px solid var(--border-input);
    border-radius: 6px;
    font-size: 1rem;
}

.controls button {
    padding: 8px 16px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.controls button:hover {
    background-color: var(--primary-dark);
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    .articles-page .container {
        padding: 10px;
    }

    .articles-page header {
        padding: 15px 10px;
        margin-bottom: 20px;
    }

    .articles-page header h1 {
        font-size: 1.8rem;
    }

    .stats {
        font-size: 0.9rem;
    }

    .article-content-wrapper {
        padding: 15px;
    }

    .article-title a {
        font-size: 1.2rem;
    }

    .article-card .article-meta {
        display: none;
    }

    .article-card .article-meta-mobile {
        display: block;
        color: var(--text-light);
        font-size: 0.8rem;
        margin: 10px 0;
    }

    .article-card .article-content {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 15px;
        flex-wrap: nowrap;
    }

    .article-card .article-description {
        flex: 1;
        min-width: 0;
        display: -webkit-box;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
        padding-bottom: 4px;
    }

    .article-card .article-image {
        width: 100px;
        height: 80px;
        flex-shrink: 0;
        object-fit: cover !important;
        max-width: none !important;
        overflow: hidden;
        border-radius: var(--radius);
    }

    .article-card .article-image.show {
        display: block;
    }

    .pagination-wrapper {
        padding: 15px 10px;
        gap: 4px;
    }

    .pagination-wrapper a {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.9rem;
    }

    .pagination-info {
        font-size: 0.9rem;
        margin-top: 10px;
        padding-top: 10px;
    }

    .articles-page > nav:first-of-type {
        margin-bottom: 15px;
    }

    .articles-page .nav-container {
        flex-direction: row;
        padding: 10px 15px;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--primary) var(--border);
        align-items: center;
        justify-content: flex-start;
    }

    .articles-page .nav-container::-webkit-scrollbar {
        height: 4px;
    }

    .articles-page .nav-container::-webkit-scrollbar-track {
        background: var(--border);
        border-radius: 2px;
    }

    .articles-page .nav-container::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 2px;
    }

    .articles-page .nav-list {
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: auto;
        display: flex;
        flex-direction: row;
    }

    .articles-page .nav-item {
        margin: 0 8px;
        flex-shrink: 0;
    }

    .articles-page .nav-link {
        padding: 12px 0;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .articles-page .language-switcher {
        justify-content: flex-start;
        width: auto;
        margin: 0 0 0 15px;
        flex-wrap: nowrap;
        flex-shrink: 0;
        gap: 8px;
    }

    .articles-page .language-link {
        padding: 6px 10px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .controls label {
        margin-right: 0;
    }
}
