/**
 * IPbot.ru — Стили статей
 * Цветовая схема синхронизирована с основным лендингом
 */

/* Global overflow protection */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* ═══════════════════════════════════
   SITE HEADER (articles pages)
   ═══════════════════════════════════ */

.site-header {
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.site-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text, #1f2937);
    font-weight: 700;
    font-size: 18px;
}

.site-header__logo img {
    border-radius: 6px;
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-header__nav a {
    font-size: 15px;
    color: var(--text-light, #6b7280);
    text-decoration: none;
}

.site-header__nav a:hover {
    color: var(--blue, #1a56db);
    text-decoration: none;
}

.site-header__nav a.active {
    color: var(--blue, #1a56db);
    font-weight: 500;
}

.site-header__nav a.btn--primary {
    color: #fff;
}

.site-header__nav a.btn--primary:hover {
    color: #fff;
}

.btn--sm {
    padding: 8px 18px;
    font-size: 14px;
}

/* ═══════════════════════════════════
   ARTICLE LAYOUT
   ═══════════════════════════════════ */

.article {
    padding: 2rem 0 4rem;
}

.article__header {
    max-width: 720px;
    width: 100%;
    margin-bottom: 2rem;
}

.article__header * {
    text-align: left;
    max-width: none;
}

.article__category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e8eefb;
    color: var(--blue, #1a56db);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 1rem;
}

.article__category:hover {
    text-decoration: none;
    background: #dce4f8;
}

.article__title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text, #1f2937);
}

.article__meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-light, #6b7280);
    font-size: 0.9rem;
}

.article__excerpt {
    font-size: 1.1rem;
    color: var(--text-light, #6b7280);
    line-height: 1.6;
    margin-top: 1rem;
    text-align: left;
}

.article__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 900px) {
    .article__layout {
        grid-template-columns: 1fr;
    }
    .article__sidebar {
        display: none;
    }
}

/* ═══════════════════════════════════
   ARTICLE BODY
   ═══════════════════════════════════ */

.article__body {
    max-width: 720px;
    width: 100%;
    min-width: 0;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text, #1f2937);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article__body h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text, #1f2937);
    text-align: left;
}

.article__body h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text, #1f2937);
    text-align: left;
}

.article__body p {
    margin-bottom: 1rem;
    text-align: left;
    max-width: none;
}

.article__body ul, .article__body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.article__body li {
    margin-bottom: 0.5rem;
    text-align: left;
}

.article__body blockquote {
    border-left: 4px solid var(--blue, #1a56db);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--bg-alt, #f5f7fa);
    border-radius: 0 8px 8px 0;
}

.article__body table {
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    width: 100%;
    table-layout: fixed;
}

.article__body table th,
.article__body table td {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.article__body th, .article__body td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border, #e5e7eb);
    text-align: left;
}

.article__body th {
    background: var(--bg-alt, #f5f7fa);
    font-weight: 600;
}

.article__body tr.highlight {
    background: #e8eefb;
    font-weight: 500;
}

/* ═══════════════════════════════════
   SIDEBAR & TABLE OF CONTENTS
   ═══════════════════════════════════ */

.article__sidebar {
    order: 2;
}

.article-toc {
    position: sticky;
    top: 5rem;
}

.sidebar-cta {
    background: linear-gradient(135deg, #1a56db 0%, #3b82f6 100%);
    color: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.sidebar-cta__title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-cta__subtitle {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
}

.sidebar-cta__btn {
    display: block;
    text-align: center;
    padding: 0.5rem 1rem;
    margin-top: 0.75rem;
    background: white;
    color: var(--blue, #1a56db);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.15s;
}

.sidebar-cta__btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.article-toc {
    background: var(--bg-alt, #f5f7fa);
    border-radius: 12px;
    padding: 1.25rem;
}

.article-toc__title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text, #1f2937);
}

.article-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc__item {
    margin-bottom: 0.25rem;
}

.article-toc__item--level-3 {
    padding-left: 1rem;
}

.article-toc__link {
    display: block;
    padding: 0.3rem 0;
    color: var(--text-light, #6b7280);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.3;
    transition: color 0.15s;
}

.article-toc__link:hover {
    color: var(--blue, #1a56db);
    text-decoration: none;
}

/* ═══════════════════════════════════
   INLINE CTA
   ═══════════════════════════════════ */

.article-cta-inline {
    background: #e8eefb;
    border: 1px solid #c5d4f5;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}

.article-cta-inline p {
    margin-bottom: 0.5rem;
    text-align: center;
}

.article-cta-inline .btn {
    display: inline-block;
    margin-top: 0.5rem;
}

/* ═══════════════════════════════════
   FAQ ACCORDION
   ═══════════════════════════════════ */

.article-faq {
    margin: 2rem 0;
}

.faq-item {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.faq-item__question {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-alt, #f5f7fa);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    transition: background 0.15s;
}

.faq-item__question:hover {
    background: #e8eefb;
}

.faq-item__question .icon {
    font-size: 1.25rem;
    color: var(--blue, #1a56db);
    transition: transform 0.2s;
}

.faq-item.open .faq-item__question .icon {
    transform: rotate(45deg);
}

.faq-item__answer {
    display: none;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border, #e5e7eb);
}

.faq-item.open .faq-item__answer {
    display: block;
}

/* ═══════════════════════════════════
   CHECKLIST
   ═══════════════════════════════════ */

.article-checklist {
    background: var(--bg-alt, #f5f7fa);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.article-checklist h3 {
    margin-top: 0;
}

.checklist-progress {
    background: var(--border, #e5e7eb);
    border-radius: 100px;
    height: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.checklist-progress__bar {
    background: var(--blue, #1a56db);
    height: 100%;
    border-radius: 100px;
    transition: width 0.3s ease;
}

.checklist-progress__text {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light, #6b7280);
    margin-top: 0.25rem;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
}

.checklist-item__input {
    margin-top: 0.25rem;
    accent-color: var(--blue, #1a56db);
}

.checklist-item__input:checked + .checklist-item__text {
    text-decoration: line-through;
    color: #999;
}

/* ═══════════════════════════════════
   FULL-WIDTH CTA BLOCK
   ═══════════════════════════════════ */

.section--cta {
    padding: 3rem 0;
}

.cta-block {
    background: linear-gradient(135deg, #1a56db 0%, #3b82f6 100%);
    color: white;
    border-radius: var(--radius, 12px);
    padding: 3rem 2rem;
    text-align: center;
}

.cta-block__title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.cta-block__text {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    max-width: none;
}

.cta-block .btn {
    background: white;
    color: var(--blue, #1a56db);
    font-weight: 600;
}

.cta-block .btn:hover {
    background: #f0f4ff;
}

/* ═══════════════════════════════════
   RELATED ARTICLES
   ═══════════════════════════════════ */

.section--related {
    padding: 3rem 0;
    background: var(--bg-alt, #f5f7fa);
}

.related-articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.article-card {
    background: white;
    border-radius: var(--radius, 12px);
    overflow: hidden;
    border: 1px solid var(--border, #e5e7eb);
    transition: box-shadow 0.15s;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.article-card__image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-card__content {
    padding: 1.25rem;
}

.article-card__category {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--blue, #1a56db);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.article-card__title {
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    text-align: left;
}

.article-card__title a {
    color: var(--text, #1f2937);
    text-decoration: none;
}

.article-card__title a:hover {
    color: var(--blue, #1a56db);
    text-decoration: none;
}

.article-card__excerpt {
    font-size: 0.9rem;
    color: var(--text-light, #6b7280);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    text-align: left;
    max-width: none;
}

.article-card__meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #999;
}

/* ═══════════════════════════════════
   ARTICLES GRID (index page)
   ═══════════════════════════════════ */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.article-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.article-filter {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 100px;
    text-decoration: none;
    color: var(--text-light, #6b7280);
    font-size: 0.9rem;
    transition: all 0.15s;
}

.article-filter:hover {
    border-color: var(--blue, #1a56db);
    color: var(--blue, #1a56db);
    text-decoration: none;
}

.article-filter.active {
    background: var(--blue, #1a56db);
    color: white;
    border-color: var(--blue, #1a56db);
}

/* ═══════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════ */

.section--breadcrumbs {
    padding: 1rem 0 0;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.breadcrumbs li::after {
    content: '\2192';
    margin: 0 0.5rem;
    color: #999;
}

.breadcrumbs li:last-child::after {
    content: '';
}

.breadcrumbs a {
    color: var(--blue, #1a56db);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    color: var(--text-light, #6b7280);
}

/* ═══════════════════════════════════
   CONTAINER NARROW
   ═══════════════════════════════════ */

.container--narrow {
    max-width: 720px;
}

.text-center {
    text-align: center;
}

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */

@media (max-width: 768px) {
    .article__body table {
        font-size: 0.85rem;
    }

    .article__body th, .article__body td {
        padding: 0.5rem 0.6rem;
    }

    .cta-block {
        padding: 2rem 1.25rem;
    }
}

@media (max-width: 640px) {
    .site-header__nav {
        gap: 8px;
    }

    .site-header__nav a {
        font-size: 13px;
    }

    .article__title {
        font-size: 1.5rem;
    }

    .article__header {
        margin-bottom: 1.5rem;
    }

    .article {
        padding: 1rem 0 2rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .related-articles {
        grid-template-columns: 1fr;
    }

    .article-cta-inline {
        padding: 1rem;
    }

    .article-checklist {
        padding: 1rem;
    }

    .faq-item__question {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .faq-item__answer {
        padding: 0.75rem 1rem;
    }
}
