/* ==========================================================================
   BARTRION — Articles list / detail
   ========================================================================== */

.articles-page,
.article-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

/* ── Hero списка ───────────────────────────────────────────────────────── */

.articles-hero {
    position: relative;
    margin-bottom: 40px;
    padding: 56px 40px;
    text-align: center;
    background:
        radial-gradient(120% 140% at 50% -30%, rgba(2, 132, 199, 0.16) 0%, rgba(79, 70, 229, 0.06) 45%, transparent 75%),
        var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.articles-hero::after {
    content: '';
    position: absolute;
    inset: auto -80px -140px auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.12), transparent 68%);
    pointer-events: none;
}

.articles-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    margin-bottom: 18px;
    border-radius: 9999px;
    background: rgba(2, 132, 199, 0.1);
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.articles-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.articles-hero p {
    max-width: 660px;
    margin: 0 auto;
    font-size: 1.08rem;
    line-height: 1.65;
    color: var(--text-muted);
}

/* ── Сетка и карточки ──────────────────────────────────────────────────── */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: rgba(2, 132, 199, 0.45);
    box-shadow: var(--shadow-card-hover);
}

.article-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background:
        radial-gradient(120% 120% at 15% 10%, rgba(2, 132, 199, 0.22), transparent 55%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #312e81 100%);
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    overflow: hidden;
}

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

.article-card:hover .article-card-media img {
    transform: scale(1.04);
}

.article-card-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

.article-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    padding: 24px 24px 22px;
}

.article-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.article-card-top time {
    white-space: nowrap;
}

.article-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 9999px;
    background: rgba(2, 132, 199, 0.1);
    color: var(--accent-blue);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.article-card-title {
    margin: 0;
    font-size: 1.22rem;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.article-card-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-card-title a:hover {
    color: var(--accent-blue);
}

.article-card-subtitle {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.article-card-summary {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(203, 213, 225, 0.6);
    font-size: 13px;
    color: var(--text-muted);
}

.article-card-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: var(--accent-blue);
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
}

.article-read-more:hover {
    text-decoration: underline;
}

.article-read-more:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 3px;
}

.article-card:hover .article-read-more svg {
    transform: translateX(3px);
}

.article-read-more svg {
    transition: transform 0.2s ease;
}

/* ── Пагинация и пустое состояние ──────────────────────────────────────── */

.articles-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 48px;
}

.articles-page-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.articles-page-link:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

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

.articles-page-status {
    font-size: 14px;
    color: var(--text-muted);
}

.articles-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 72px 24px;
    text-align: center;
    background: var(--bg-panel);
    border: 1px dashed var(--border-color);
    border-radius: 24px;
    color: var(--text-muted);
}

.articles-empty h2 {
    margin: 4px 0 0;
    color: var(--text-main);
    font-size: 1.4rem;
}

.articles-empty p {
    margin: 0 0 8px;
}

/* ── Страница статьи ───────────────────────────────────────────────────── */

.article-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 2000;
    pointer-events: none;
}

.article-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-indigo));
    transition: width 0.1s linear;
}

.article-page {
    max-width: 1080px;
}

.article-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.article-breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-breadcrumbs a:hover {
    color: var(--accent-blue);
}

.article-shell {
    padding: 48px 56px 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

.article-header {
    margin-bottom: 30px;
}

.article-header-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.article-title {
    margin: 0 0 18px;
    font-size: clamp(1.75rem, 3.4vw, 2.6rem);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.article-subtitle {
    margin: 0 0 22px;
    font-size: 1.18rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.article-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(203, 213, 225, 0.7);
    font-size: 13.5px;
    color: var(--text-muted);
}

.article-header-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.article-cover {
    margin: 0 0 34px;
    border-radius: 18px;
    overflow: hidden;
    background: #0f172a;
}

.article-cover img {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Типографика статьи ────────────────────────────────────────────────── */

.article-content {
    font-size: 1.06rem;
    line-height: 1.78;
    color: #1e293b;
    overflow-wrap: break-word;
}

.article-content > *:first-child {
    margin-top: 0;
}

.article-content > *:last-child {
    margin-bottom: 0;
}

.article-content p {
    margin: 0 0 1.15em;
}

.article-content h2 {
    margin: 2.1em 0 0.7em;
    padding-left: 16px;
    border-left: 4px solid var(--accent-blue);
    font-size: 1.55rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text-main);
}

.article-content h3 {
    margin: 1.8em 0 0.6em;
    font-size: 1.24rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--text-main);
}

.article-content h4 {
    margin: 1.5em 0 0.5em;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-main);
}

.article-content ul,
.article-content ol {
    margin: 0 0 1.2em;
    padding-left: 1.35em;
}

.article-content li {
    margin-bottom: 0.45em;
}

.article-content li::marker {
    color: var(--accent-blue);
}

.article-content a {
    color: var(--accent-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content a:hover {
    color: var(--accent-hover);
}

.article-content strong {
    font-weight: 700;
    color: var(--text-main);
}

.article-content blockquote {
    margin: 1.6em 0;
    padding: 18px 24px;
    border-left: 4px solid var(--accent-indigo);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: rgba(79, 70, 229, 0.06);
    color: var(--text-main);
    font-style: italic;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.article-content table {
    width: 100%;
    margin: 1.4em 0;
    border-collapse: collapse;
    font-size: 0.96rem;
}

.article-content th,
.article-content td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}

.article-content th {
    background: #f1f5f9;
    font-weight: 600;
}

.article-content hr {
    margin: 2em 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

/* ── Подвал статьи, CTA, соседние статьи ───────────────────────────────── */

.article-footer {
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid rgba(203, 213, 225, 0.7);
}

.article-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.article-share-label {
    font-size: 14px;
    color: var(--text-muted);
}

.article-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    color: var(--text-main);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.article-share-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.article-share-btn.is-copied {
    border-color: #16a34a;
    color: #15803d;
    background: #f0fdf4;
}

.article-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-top: 28px;
    padding: 32px 36px;
    border-radius: 22px;
    background:
        radial-gradient(90% 160% at 100% 0%, rgba(79, 70, 229, 0.45), transparent 60%),
        linear-gradient(135deg, #0f172a, #1e293b);
    color: #e2e8f0;
    box-shadow: var(--shadow-lg);
}

.article-cta-text h2 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    color: #ffffff;
}

.article-cta-text p {
    margin: 0;
    max-width: 560px;
    font-size: 0.96rem;
    line-height: 1.6;
    color: #cbd5e1;
}

.article-cta-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.article-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.45);
    color: #ffffff;
}

.article-cta-link {
    color: #cbd5e1;
    font-size: 13.5px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-cta-link:hover {
    color: #ffffff;
}

.article-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.article-nav-item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px 22px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-panel);
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.article-nav-item:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.article-nav-next {
    text-align: right;
}

.article-nav-label {
    font-size: 12.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.article-nav-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
}

.article-related {
    margin-top: 56px;
}

.article-related > h2 {
    margin: 0 0 24px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.article-related .article-card-title {
    font-size: 1.08rem;
}

.article-related .article-card-summary {
    -webkit-line-clamp: 2;
}

/* ── Адаптивность ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .article-shell {
        padding: 36px 32px 32px;
    }

    .article-cta {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px;
    }

    .article-cta-actions {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .articles-page,
    .article-page {
        padding: 28px 16px 60px;
    }

    .articles-hero {
        padding: 40px 22px;
        border-radius: 20px;
    }

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

    .article-shell {
        padding: 28px 20px 24px;
        border-radius: 20px;
    }

    .article-header-meta {
        gap: 8px 16px;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.32rem;
        padding-left: 12px;
    }

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

    .article-nav-next {
        text-align: left;
    }

    .articles-pagination {
        gap: 10px;
        flex-wrap: wrap;
    }

    .articles-page-status {
        width: 100%;
        text-align: center;
        order: -1;
    }
}
