/* ===== Страница статьи блога (SEO) =====
   Опирается на переменные из style.css (:root).
   Стиль не трогает навигацию и общий хедер. */
/* === TOC (Accordion) — общие переменные === */
:root {
    --toc-bg: #111215;
    --toc-fg: #e8eaf0;
    --toc-accent: #00e6ff;
    --toc-border: rgba(255, 255, 255, 0.12);
    --toc-chip: rgba(255, 255, 255, 0.06);
    --toc-chip-active: rgba(0, 230, 255, 0.12);
}

/* Контейнер TOC */
.toc {
    position: sticky;
    display: flex;
    flex-direction: column;
    align-items: center;
    top: 60px; /* подстрой под высоту хедера */
    z-index: 20;
    background: var(--toc-bg);
    border: 1px solid var(--toc-border);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25),
        inset 0 0 0 2px rgba(255, 255, 255, 0.03);
}

/* Кнопка-аккордеон */
.toc__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    color: var(--toc-fg);
    border: 0;
    border-radius: 14px;
    font-size: 1rem;
    text-align: start;
    cursor: pointer;
    outline: none;
}
.toc__toggle:hover,
.toc__toggle:focus {
    box-shadow: 0 0 10px rgba(0, 230, 255, 0.25);
}
.toc__caret {
    transition: transform 0.2s ease;
}
.toc__toggle[aria-expanded="true"] .toc__caret {
    transform: rotate(180deg);
}

/* Панель с пунктами (анимация высоты) */
.toc__panel {
    overflow: hidden;
    transition: grid-template-rows 0.25s ease, opacity 0.2s ease;
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    padding-inline: 16px;
}
.toc__panel.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    padding-bottom: 12px;
}
.toc__panel > * {
    min-height: 0; /* для grid-анимации */
}

/* Список ссылок */
.toc__list {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 10px 0 0 0;
    padding: 0;
}

.toc__item {
    flex: 0 0 auto;
}
.toc__link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--toc-chip);
    color: var(--toc-fg);
    text-decoration: none;
    font-size: 0.92rem;
    line-height: 1;
    border: 1px solid var(--toc-border);
    transition: transform 0.15s ease, background-color 0.15s ease,
        border-color 0.15s ease, color 0.15s ease;
    outline: none;
}
.toc__link:hover,
.toc__link:focus {
    border-color: var(--toc-accent);
    background: var(--toc-chip-active);
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(0, 230, 255, 0.25);
}
.toc__link.is-active {
    color: var(--toc-accent);
    background: var(--toc-chip-active);
    border-color: var(--toc-accent);
    box-shadow: 0 0 12px rgba(0, 230, 255, 0.35);
}

/* Плавный скролл и компенсация фикс-хедера */
html:has(body) {
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
    html:has(body) {
        scroll-behavior: auto;
    }
}
h2[id],
h3[id],
section[id] {
    scroll-margin-top: 96px;
}

h3 {
    color: var(--color-text);
    font-size: 1.5rem;
    margin: 1rem 0 1rem 0;
}

/* ---------- Хедер статьи ---------- */
.page-article {
    background: var(--color-primary); /* чистый светлый фон */
    position: relative;
    z-index: 15;
    padding: 2rem;
}

.header--article {
    position: relative;
    padding: clamp(48px, 8vw, 88px) 0;
    background-size: cover;
    background-position: center;
    text-align: center;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

.header__container--blog {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header--article .hero__container {
    background: rgba(12, 18, 28, 0.36);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 16px;
    padding: clamp(16px, 3vw, 28px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
}

.header--article .hero__container-img img {
    width: clamp(90px, 12vw, 140px);
    height: auto;
    border-radius: 12px;
    display: block;
    margin: 0 auto 0.8rem auto;
}

.header--article .hero__title {
    margin: 0.3rem 0 0.6rem 0;
    font-weight: 800;
    font-size: clamp(24px, 4.6vw, 44px);
    line-height: 1.15;
    color: #fff;
}

.header--article .hero__title .accent {
    background: linear-gradient(90deg, var(--color-accent), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header--article .hero__subtitle {
    margin: 0 auto;
    max-width: 60ch;
    font-weight: 600;
    font-size: clamp(14px, 2.2vw, 18px);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
}

/* ---------- Тело статьи ---------- */
.blog-article {
    /* max-width: 1100px; */
    padding: clamp(16px, 3vw, 28px);
    background: var(--color-primary);
    border-radius: 16px;
    box-shadow: var(--box-neon-shadow);
    margin: 0 auto;
}

.article__content {
    display: flex;
    flex-direction: column;
    color: var(--color-text);
    line-height: 1.9;
    font-size: 1.08rem;
}
.article__image-wrapper {
    text-align: center;
    max-width: 100%;
}

.article__image-wrapper img {
    width: 70%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    margin: 1rem 0;
}
/* Первый абзац — чуть крупнее и с лёгким акцентом */
.article__content > p:first-of-type {
    font-size: 1.12rem;
    color: var(--color-black);
}

/* Заголовки внутри статьи */
.article__content h2 {
    margin: 1.6rem 0 0.6rem 0;
    font-size: clamp(20px, 3.2vw, 28px);
    font-weight: 800;
    color: var(--color-title-text);
    text-shadow: 0 0 6px rgba(84, 199, 253, 0.25);
}

/* Списки */
.article__content ul {
    list-style: none;
    padding: 0;
    margin: 0.6rem 0 1.2rem 0;
}

.article__content li {
    position: relative;
    padding-inline-start: 1.6em;
    margin: 0.4rem 0;
}

.article__content li::before {
    content: "✔";
    color: var(--color-accent);
    position: absolute;
    inset-inline-start: 0;
    line-height: 1;
}

/* Ссылки в тексте */
.article__content a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article__content a:hover {
    color: var(--color-link-hover);
}

/* Кнопки (например “Назад в блог”) внутри статьи */
.blog-article .button {
    gap: 0.4rem;
    align-items: center;
    margin-top: 1.4rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    background: var(--button-gradient-background);
    color: var(--color-white);
    box-shadow: var(--button-neon-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease,
        background-color 0.25s ease, color 0.25s ease;
}

.blog-article .button:hover {
    transform: translateY(-1px) scale(1.02);
    background-color: var(--color-button);
    color: var(--color-white);
}

/* Изображения в тексте (если появятся) */
.article__content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    margin: 1rem 0;
}

/* Цитаты (на будущее) */
.article__content blockquote {
    margin: 1.2rem 0;
    padding: 0.9rem 1rem;
    border-inline-start: 4px solid var(--color-accent);
    background: rgba(84, 199, 253, 0.08);
    border-radius: 10px;
    color: var(--color-black);
}

/* Таблицы (на будущее) */
.article__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(84, 199, 253, 0.15);
}
.article__content th,
.article__content td {
    border: 1px solid rgba(63, 63, 70, 0.2);
    padding: 0.6rem 0.8rem;
    text-align: start;
}
.article__content th {
    background: rgba(84, 199, 253, 0.12);
    color: var(--color-title-text);
}
.faq-section {
    margin-top: 3rem;
    background: var(--color-primary);
    border-radius: 12px;
    box-shadow: var(--box-neon-shadow);
    padding: 1.5rem;
}

.faq-title {
    text-align: center;
    color: var(--color-white) !important;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.faq-item {
    margin-top: 0.6rem;
    border-bottom: none;
}

.faq-question {
    width: 100%;
    text-align: right;
    color: var(--color-accent);
    font-size: 1rem;
    font-weight: 700;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: rgba(84, 199, 253, 0.1);
}

.faq-icon {
    color: var(--color-accent);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.faq-answer {
    display: none;
    padding: 0.8rem 1rem;
    color: var(--color-black);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 0 8px 8px;
    border-top: 1px solid var(--color-border);
}

.faq-item.active .faq-answer {
    display: block;
    animation: fadeIn 0.3s ease;
    min-height: fit-content;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
    .header--article {
        padding: 44px 0 54px 0;
    }
    .blog-article {
        margin: 1.2rem auto 2.2rem auto;
        padding: 1rem;
    }
    .article__content {
        font-size: 1.02rem;
        line-height: 1.85;
    }
}

@media (max-width: 600px) {
    .header--article .hero__container {
        padding: 14px;
    }
    .header--article .hero__subtitle {
        font-size: 0.98rem;
        padding: 0.45rem 0.6rem;
    }
    .article__content h2 {
        margin: 1.2rem 0 0.5rem 0;
    }
    .toc__link {
        font-size: 0.9rem;
        padding: 7px 10px;
    }
    .article__image-wrapper img {
        width: 100%;
        height: auto;
        border-radius: 12px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
        margin: 1rem 0;
    }
}
