/*  ARTICLE PAGE */
.article-page {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    flex: 1;
    padding: 0 24px 90px;
}

/*  BREADCRUMBS */
.article-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 28px;
    color: var(--text-muted);
    font-size: 13px;
}

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

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

.article-breadcrumbs span {
    color: #cbd5e1;
}

/*  ARTICLE HEADER */
.article-header {
    max-width: 1000px;
    margin: 0 auto;
    padding: 35px 0 48px;
    text-align: center;
}

.article-header-category {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.article-header h1 {
    margin: 18px 0 0;
    color: var(--text-dark);
    font-size: 46px;
    line-height: 1.14;
    font-weight: 600;
    letter-spacing: -1.6px;
}

.article-lead {
    max-width: 850px;
    margin: 22px auto 0;
    color: var(--text-gray);
    font-size: 18px;
    line-height: 1.65;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    color: var(--text-muted);
    font-size: 13px;
}

.article-meta-separator {
    color: #cbd5e1;
}

/*  ARTICLE LAYOUT */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 740px) 250px;
    gap: 70px;
    align-items: start;
    justify-content: center;
}

/*  ARTICLE CONTENT */
.article-content {
    color: var(--text-gray);
    font-size: 17px;
    line-height: 1.78;
}

.article-content p {
    margin: 0 0 22px;
}

.article-content h2 {
    margin: 48px 0 18px;
    color: var(--text-dark);
    font-size: 28px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.5px;
    scroll-margin-top: 90px;
}

.article-content h2:first-of-type {
    margin-top: 18px;
}

.article-content ul {
    margin: 0 0 24px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 7px;
}

.article-content strong {
    color: var(--text-dark);
}

.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 32px auto;
    border-radius: 12px;
}

/*  BLOCKQUOTE */
.article-content blockquote {
    position: relative;
    margin: 30px 0;
    padding: 20px 24px;
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    background: var(--primary-soft);
    color: var(--text-dark);
    font-size: 18px;
    line-height: 1.6;
    font-weight: 600;
}

/*  EXAMPLES */
.article-example {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0;
}

.article-example-item {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--white);
}

.article-example-item p {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.6;
}

.article-example-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-example-label.bad {
    color: #dc2626;
}

.article-example-label.good {
    color: #16a34a;
}

/*  TIP */
.article-tip {
    display: flex;
    gap: 15px;
    margin: 32px 0;
    padding: 20px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 10px;
    background: #f8faff;
}

.article-tip-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--primary);
    font-size: 15px;
    font-weight: 800;
}

.article-tip strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-dark);
    font-size: 15px;
}

.article-tip p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/*  SIDEBAR */
.article-sidebar {
    position: sticky;
    top: 95px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.article-sidebar-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
}

.sidebar-title {
    margin-bottom: 14px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 700;
}

.article-toc {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.article-toc a {
    display: block;
    padding: 7px 8px;
    margin-left: -8px;
    border-radius: 5px;
    color: var(--text-gray);
    font-size: 13px;
    line-height: 1.45;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.article-toc a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

/*  SIDEBAR PROMO */
.article-sidebar-promo {
    background: linear-gradient(145deg, #eff6ff, #f8fafc);
    border-color: rgba(37, 99, 235, 0.1);
}

.promo-title {
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 700;
}

.article-sidebar-promo p {
    margin: 9px 0 16px;
    color: var(--text-gray);
    font-size: 13px;
    line-height: 1.55;
}

.article-promo-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--white);
    background: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.article-promo-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/*  TABLET */
@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

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

/*  MOBILE */
@media (max-width: 650px) {
    .article-page {
        padding: 0 16px 60px;
    }

    .article-breadcrumbs {
        padding-top: 20px;
        font-size: 12px;
    }

    .article-header {
        padding: 42px 0 36px;
    }

    .article-header h1 {
        font-size: 34px;
        letter-spacing: -1px;
    }

    .article-lead {
        font-size: 16px;
    }

    .article-content {
        font-size: 16px;
        line-height: 1.7;
    }

    .article-content h2 {
        margin-top: 38px;
        font-size: 24px;
    }

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

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

    .article-content blockquote {
        padding: 17px 18px;
        font-size: 16px;
    }
}

/*  SMALL MOBILE */
@media (max-width: 420px) {
    .article-header h1 {
        font-size: 30px;
    }

    .article-header-category {
        font-size: 11px;
    }

    .article-meta {
        flex-wrap: wrap;
    }
}

/* ============================================
   АДАПТИВНЫЕ ТАБЛИЦЫ
   ============================================ */

.article-content {
    min-width: 0;
}

.article-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0;
}

.article-content table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 15px;
    background: var(--white);
    border: 1px solid var(--border);
}

.article-content table thead {
    background: #f8fafc;
}

.article-content table th {
    padding: 12px 16px;
    color: var(--text-dark);
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.article-content table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
}

.article-content table tr:last-child td {
    border-bottom: none;
}

@media (max-width: 650px) {

    .article-table-wrapper {
        margin: 20px 0;
    }

    .article-content table {
        min-width: 560px;
        font-size: 14px;
    }

    .article-content table th,
    .article-content table td {
        padding: 8px 10px;
    }
}