.page-articles,
.page-article-detail {
    background: var(--bg);
}

.articles-page {
    overflow: hidden;
}

/* Hero */
.articles-hero {
    padding: 1.75rem 0 2rem;
    background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}

.articles-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 2rem;
    align-items: center;
}

.articles-hero-copy h1 {
    color: var(--navy);
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.15;
    margin: 0.5rem 0 0.75rem;
    font-weight: 800;
}

.articles-hero-copy > p {
    color: var(--muted);
    max-width: 540px;
    font-size: 1rem;
    line-height: 1.75;
}

.articles-hero-visual img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.articles-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.articles-breadcrumb a:hover {
    color: var(--primary);
}

.articles-breadcrumb span:last-child {
    color: var(--navy);
    font-weight: 600;
}

/* Toolbar */
.articles-toolbar {
    padding: 0 0 1.5rem;
}

.articles-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.articles-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--navy);
    font-size: 0.84rem;
    font-weight: 600;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.articles-pill:hover,
.articles-pill.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(232, 99, 90, 0.06);
}

.articles-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
}

.articles-search-field {
    flex: 1 1 320px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    box-shadow: var(--shadow);
}

.articles-search-field i {
    color: var(--muted);
}

.articles-search-field input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--navy);
}

.articles-filter-wrap {
    position: relative;
}

.articles-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 100%;
    min-height: 48px;
    padding: 0 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--navy);
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.articles-filter-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 20;
    width: min(240px, calc(100vw - 2rem));
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 18px 40px rgba(26, 43, 72, 0.12);
}

.articles-filter-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.65rem;
}

.articles-filter-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0;
    color: var(--navy);
    font-size: 0.92rem;
    cursor: pointer;
}

.articles-filter-apply {
    width: 100%;
    margin-top: 0.75rem;
    justify-content: center;
}

/* Layout */
.articles-body {
    padding: 0 0 4rem;
}

.articles-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.75rem;
    align-items: start;
}

.articles-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.articles-section-head h2 {
    color: var(--navy);
    font-size: 1.35rem;
}

.articles-section-head span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}

/* Article list rows */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-row {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 45px rgba(26, 43, 72, 0.1);
}

.article-row-link {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 0;
    color: inherit;
    text-decoration: none;
}

.article-row-media img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    display: block;
}

.article-row-body {
    padding: 1.15rem 1.35rem 1.25rem;
    display: flex;
    flex-direction: column;
}

.article-row-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 0.55rem;
}

.badge-red { background: rgba(232, 99, 90, 0.12); color: #d04f46; }
.badge-orange { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.badge-green { background: rgba(16, 185, 129, 0.14); color: #047857; }
.badge-blue { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
.badge-purple { background: rgba(139, 92, 246, 0.14); color: #6d28d9; }
.badge-teal { background: rgba(20, 184, 166, 0.14); color: #0f766e; }

.article-row-body h3 {
    color: var(--navy);
    font-size: 1.08rem;
    line-height: 1.45;
    margin-bottom: 0.45rem;
}

.article-row-body > p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.article-row-meta i {
    margin-right: 0.2rem;
}

.article-row-author {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.article-row-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-size: 0.62rem;
    font-weight: 700;
}

.article-read-more {
    color: var(--primary);
    font-size: 0.86rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
}

/* Pagination */
.articles-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.articles-page-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--navy);
    font-size: 0.88rem;
    font-weight: 600;
}

.articles-page-nav.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.articles-page-nums {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.articles-page-num,
.articles-page-ellipsis {
    min-width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--navy);
    font-size: 0.88rem;
    font-weight: 600;
}

.articles-page-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.articles-page-ellipsis {
    border: none;
    background: transparent;
}

/* Sidebar */
.articles-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 96px;
}

.articles-sidebar-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.articles-sidebar-card h3 {
    color: var(--navy);
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
}

.articles-category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.articles-category-list a {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0;
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(26, 43, 72, 0.06);
}

.articles-category-list li:last-child a {
    border-bottom: none;
}

.articles-category-list a:hover {
    color: var(--primary);
}

.articles-category-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg);
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 0.85rem;
}

.articles-category-list em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.82rem;
}

.articles-sidebar-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.articles-sidebar-cta {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 1.35rem;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--navy) 0%, #243656 100%);
    color: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.articles-sidebar-cta h3 {
    font-size: 1.05rem;
    margin-bottom: 0.45rem;
}

.articles-sidebar-cta p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.86rem;
    line-height: 1.6;
    margin-bottom: 0.85rem;
}

.articles-sidebar-cta-art {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.12);
    align-self: end;
}

.articles-popular-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.articles-popular-list li {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 0.65rem;
    align-items: start;
}

.articles-popular-num {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 800;
}

.articles-popular-list a {
    color: var(--navy);
    font-size: 0.9rem;
    line-height: 1.45;
    font-weight: 600;
}

.articles-popular-list a:hover {
    color: var(--primary);
}

.articles-newsletter-card {
    background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
}

.articles-newsletter-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}

.articles-newsletter-card p {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 0.85rem;
}

.articles-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.articles-newsletter-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    background: #fff;
    color: var(--navy);
}

.articles-newsletter-form .btn-primary {
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* Empty */
.articles-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.articles-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 1.8rem;
}

.articles-empty-state h2 {
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.articles-empty-state p {
    color: var(--muted);
    margin-bottom: 1.25rem;
}

/* Legacy grid (home + detail related) */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.articles-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 45px rgba(26, 43, 72, 0.1);
}

.article-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.article-card-cover img,
.article-card-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
}

.article-card-placeholder {
    background: linear-gradient(135deg, #eef2f8 0%, #e7edf7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 2rem;
}

.article-card-body {
    padding: 1.1rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 0.45rem;
}

.article-card-body h3 {
    color: var(--navy);
    font-size: 1.02rem;
    line-height: 1.45;
    margin-bottom: 0.55rem;
}

.article-card-body p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 0.75rem;
    flex: 1;
}

.article-card-author {
    color: var(--navy);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.65rem;
}

/* Detail page */
.article-detail-page {
    background: #f4f6f9;
}

.article-detail-top {
    padding: 1.5rem 0 2rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.article-detail-top .articles-breadcrumb {
    margin-bottom: 1rem;
}

.article-detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 1.35rem;
}

.article-detail-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.article-detail-meta-row i {
    color: var(--primary);
}

.article-detail-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 460px);
    gap: 2rem;
    align-items: center;
}

.article-detail-intro h1 {
    color: var(--navy);
    font-size: clamp(1.65rem, 3.2vw, 2.35rem);
    line-height: 1.22;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.article-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.article-detail-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
}

.article-detail-hero-cover img {
    width: 100%;
    border-radius: 16px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    box-shadow: 0 18px 50px rgba(26, 43, 72, 0.12);
}

.article-detail-body {
    padding: 2rem 0 3rem;
}

.article-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.75rem;
    align-items: start;
}

.article-detail-content-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.75rem 1.85rem;
    box-shadow: var(--shadow);
}

.article-detail-summary {
    background: #f8fafc;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.5rem;
}

.article-detail-summary h2 {
    color: var(--navy);
    font-size: 1rem;
    margin-bottom: 0.55rem;
}

.article-detail-summary p {
    color: #475569;
    line-height: 1.75;
    font-size: 0.95rem;
    margin: 0;
}

.article-detail-content {
    color: #334155;
    line-height: 1.9;
    font-size: 0.98rem;
}

.article-detail-content p {
    margin-bottom: 1.15rem;
}

.article-content-heading {
    color: var(--navy);
    font-size: 1.08rem;
    line-height: 1.45;
    margin: 1.75rem 0 0.85rem;
    font-weight: 700;
}

.article-content-footnote {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.article-detail-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

.article-detail-share-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.article-detail-share a,
.article-share-copy {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--navy);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.article-detail-share a:hover,
.article-share-copy:hover,
.article-share-copy.copied {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.article-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 92px;
}

.article-sidebar-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.article-sidebar-card h3 {
    color: var(--navy);
    font-size: 1.02rem;
    margin-bottom: 0.85rem;
}

.article-sidebar-card p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 1rem;
}

.article-sidebar-card .btn-primary,
.article-sidebar-card .btn-outline {
    width: 100%;
    margin-bottom: 0.55rem;
    justify-content: center;
}

.article-author-profile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.article-author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(232, 99, 90, 0.12);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.article-author-profile strong {
    display: block;
    color: var(--navy);
    font-size: 0.98rem;
}

.article-author-profile span {
    color: var(--muted);
    font-size: 0.82rem;
}

.article-author-profile-btn {
    margin-bottom: 0;
}

.article-sidebar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.article-sidebar-list-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
}

.article-sidebar-list-thumb {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--bg);
}

.article-sidebar-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-sidebar-list-copy strong {
    display: block;
    color: var(--navy);
    font-size: 0.88rem;
    line-height: 1.45;
    margin-bottom: 0.2rem;
}

.article-sidebar-list-copy em {
    color: var(--muted);
    font-size: 0.76rem;
    font-style: normal;
}

.article-sidebar-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
}

.article-detail-related {
    padding: 0 0 4rem;
}

.article-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.article-related-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(26, 43, 72, 0.1);
}

.article-related-cover img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.article-related-body {
    padding: 1rem 1.1rem 1.15rem;
}

.article-related-body time {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 0.45rem;
}

.article-related-body h3 {
    color: var(--navy);
    font-size: 1rem;
    line-height: 1.45;
    margin-bottom: 0.65rem;
}

.article-related-category {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1080px) {
    .articles-layout {
        grid-template-columns: 1fr;
    }

    .articles-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .articles-newsletter-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 960px) {
    .articles-hero-grid,
    .article-detail-hero-grid,
    .article-detail-layout {
        grid-template-columns: 1fr;
    }

    .article-detail-sidebar {
        position: static;
    }

    .article-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .article-row-link {
        grid-template-columns: 1fr;
    }

    .article-row-media img {
        min-height: 200px;
    }

    .articles-grid,
    .articles-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .articles-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .articles-grid,
    .articles-grid-compact,
    .article-related-grid {
        grid-template-columns: 1fr;
    }

    .articles-pagination {
        flex-direction: column;
    }

    .articles-filter-btn,
    .articles-search-row .articles-search-field {
        width: 100%;
    }

    .articles-filter-wrap {
        width: 100%;
    }

    .articles-filter-btn {
        width: 100%;
        justify-content: center;
    }
}
