/* ==========================================================================
   Qybo Articles & Knowledge Base Styles
   Стили каталога статей и страниц лонгридов (светлая и тёмная темы)
   ========================================================================== */

/* --- Layout Containers --- */
.articles-wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

.article-read-wrapper {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Breadcrumbs --- */
.articles-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-top: 100px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.articles-breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.18s ease;
}

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

.articles-breadcrumbs span.sep {
    opacity: 0.45;
}

.articles-breadcrumbs span.current {
    color: var(--text-main);
    font-weight: 500;
}

/* ==========================================================================
   КАТАЛОГ СТАТЕЙ (articles/index.html)
   ========================================================================== */

.articles-hero {
    text-align: center;
    padding: 10px 0 36px;
}

.articles-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: var(--primary-soft);
    color: var(--primary-color);
    border: 1px solid rgba(194, 65, 12, 0.15);
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 16px;
}

.articles-hero-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 14px;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.articles-hero-desc {
    font-size: clamp(15.5px, 1.8vw, 17.5px);
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

/* --- Filter Pills --- */
.articles-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.articles-tag-pill {
    padding: 7px 18px;
    border-radius: 999px;
    border: 1px solid var(--border-card);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: default;
}

.articles-tag-pill.active {
    background: var(--primary-color);
    color: #FFFFFF;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(194, 65, 12, 0.25);
}

/* --- Grid of Articles --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 64px;
}

.article-card {
    background: var(--surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 26px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(194, 65, 12, 0.35);
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.article-card-badge {
    font-weight: 700;
    color: var(--primary-color);
    background: var(--primary-soft);
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid rgba(194, 65, 12, 0.12);
}

.article-card-dot {
    opacity: 0.5;
}

.article-card-title {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 12px;
    color: var(--text-main);
    transition: color 0.2s ease;
}

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

.article-card-excerpt {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 22px;
    flex-grow: 1;
}

.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-color);
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.article-card-footer svg {
    transition: transform 0.2s ease;
}

.article-card:hover .article-card-footer svg {
    transform: translateX(4px);
}

/* ==========================================================================
   СТРАНИЦА СТАТЬИ (articles/*.html)
   ========================================================================== */

.article-header {
    margin-bottom: 32px;
    text-align: left;
}

.article-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.article-main-title {
    font-size: clamp(26px, 3.6vw, 38px);
    font-weight: 800;
    line-height: 1.28;
    color: var(--text-main);
    margin-bottom: 18px;
    letter-spacing: -0.015em;
}

/* --- Summary Box (Резюме статьи) --- */
.article-summary-box {
    background: var(--surface);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 26px 30px;
    margin: 28px 0 36px;
    box-shadow: 0 4px 20px rgba(194, 65, 12, 0.08);
}

.article-summary-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    counter-reset: summary-counter;
}

.article-summary-item {
    position: relative;
    padding-left: 34px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
}

.article-summary-item strong {
    color: var(--text-main);
    font-weight: 750;
}

.article-summary-item::before {
    counter-increment: summary-counter;
    content: counter(summary-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(194, 65, 12, 0.2);
}

/* --- Article Body Typography --- */
.article-body {
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--text-main);
}

.article-body h2 {
    font-size: clamp(21px, 2.5vw, 26px);
    font-weight: 800;
    margin: 44px 0 16px;
    color: var(--text-main);
    line-height: 1.35;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.article-body h3 {
    font-size: 18px;
    font-weight: 750;
    margin: 26px 0 12px;
    color: var(--text-main);
    line-height: 1.4;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body ul, .article-body ol {
    margin: 0 0 22px 22px;
    padding: 0;
}

.article-body li {
    margin-bottom: 10px;
    line-height: 1.65;
}

.article-body hr {
    border: none;
    height: 1px;
    background: var(--border-light);
    margin: 36px 0;
}

.article-body kbd {
    display: inline-block;
    padding: 2px 7px;
    font-family: var(--font-family), monospace;
    font-size: 13.5px;
    font-weight: 700;
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    box-shadow: 0 2px 0 rgba(11, 31, 54, 0.1);
    color: var(--text-main);
    vertical-align: baseline;
    white-space: nowrap;
}

.article-body code {
    font-family: monospace;
    background: var(--surface-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid var(--border-light);
    color: var(--primary-color);
}

/* --- Step Card Component --- */
.article-step-card {
    background: var(--surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    margin: 20px 0 24px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease;
}

.article-step-card:hover {
    border-color: rgba(194, 65, 12, 0.25);
}

.article-step-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-step-card ol, .article-step-card ul {
    margin-bottom: 0;
}

/* --- Callout Info Boxes --- */
.article-callout {
    background: var(--surface-muted);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 16px 20px;
    margin: 24px 0;
    font-size: 15.5px;
    line-height: 1.65;
}

.article-callout.warning {
    border-left-color: #EAB308;
    background: rgba(234, 179, 8, 0.08);
}

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

/* --- In-article CTA Widget (Кьюбо призыв) --- */
.article-cta-box {
    background: var(--surface);
    border: 2px solid rgba(194, 65, 12, 0.35);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    margin: 40px 0;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 30px rgba(194, 65, 12, 0.07);
    overflow: hidden;
}

.article-cta-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #C2410C 0%, #FF6A14 50%, #6444F6 100%);
}

.article-cta-badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.article-cta-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.3;
}

.article-cta-desc {
    font-size: 15.5px;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.article-cta-features {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
}

.article-cta-features span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-cta-features svg {
    color: #16A34A;
    flex-shrink: 0;
}

.article-cta-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.article-cta-note {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* --- Features List (Чем локальное решение отличается) --- */
.article-advantages-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 24px 0 32px;
}

.article-advantage-item {
    background: var(--surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.article-advantage-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.article-advantage-text strong {
    display: block;
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.article-advantage-text p {
    margin: 0;
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* --- Bottom Nav & Return Link --- */
.article-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 16px;
}

.article-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: transform 0.2s ease;
}

.article-back-link:hover {
    transform: translateX(-4px);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .articles-hero-title {
        font-size: 26px;
    }
    .article-main-title {
        font-size: 24px;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .article-summary-box {
        padding: 20px;
    }
    .article-cta-box {
        padding: 24px 18px;
    }
    .articles-breadcrumbs {
        margin-top: 80px;
    }
}
