/* ================================================================
   FLYDEE — ARTICLE STYLES (v10)
   Бренд-дизайн «brutalist editorial»: жирные обводки, твёрдые
   тени, тёплая палитра. Унифицирует все материалы блога FlyDee.

   Зависит от переменных, объявленных в blog.css (--ink, --primary,
   --bg-warm, --yellow, --shadow-hard, --radius, …). Шрифты Onest /
   Unbounded подгружаются через blog.css. Никакого нового JS.

   Класс-маппинг (старая разметка → новая визуальность):
     .article-header        → hero-блок c радиальными градиентами
     .article-title         → крупный заголовок Unbounded
     .article-meta          → пилюли с датой/временем чтения
     .table-of-contents     → карточка-оглавление со счётчиками
     .ai-summary-block      → callout (tip)
     .info-box              → callout (info)
     .warning-box           → callout (warn)
     .help-box              → callout (danger)
     .stats-grid/.stat-box  → жёсткие карточки со статистикой
     .faq-section/.faq-item → раскрытые карточки FAQ
     .author-bio            → авторский блок
     .related-articles      → секция «Читайте также»
     .article-conclusion    → инверсный takeaways-блок
================================================================ */

/* Brand tokens — duplicated here so article pages don't depend
   on .blog-page scoping in blog.css. */
:root {
    --bg: #FFF7EE;
    --bg-warm: #FFE9D6;
    --ink: #1B1B3A;
    --ink-2: #4A4A6B;
    --ink-3: #8A8AA3;
    --primary: #FF5A1F;
    --primary-dark: #E84A12;
    --yellow: #FFC700;
    --green: #4FB930;
    --red: #FF5A5A;
    --shadow-hard: 0 6px 0 var(--ink);
    --shadow-hard-sm: 0 4px 0 var(--ink);
    --radius: 22px;
    --radius-lg: 32px;
    --radius-sm: 14px;
}

html { scroll-behavior: smooth; }

/* ====== READING PROGRESS BAR ====== */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: var(--primary);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ====== CONTAINER ====== */
.article-container {
    background: white;
    color: var(--ink);
    font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.article-container .container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ====== HERO ====== */
.article-header {
    position: relative;
    padding: 120px 0 70px;
    background: var(--bg);
    color: var(--ink);
    border-bottom: 2px solid var(--ink);
    overflow: hidden;
}
.article-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(800px 500px at 85% 20%, var(--bg-warm), transparent 60%),
        radial-gradient(700px 400px at 5% 80%, #FFE0CC, transparent 65%);
    z-index: 0;
    pointer-events: none;
}
.article-header > .container { position: relative; z-index: 1; max-width: 860px; }

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-3);
    margin-bottom: 22px;
    font-weight: 600;
}
.breadcrumbs a {
    color: var(--ink-2);
    text-decoration: none;
    border-bottom: 1.5px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.breadcrumbs a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.breadcrumbs span { color: var(--ink-3); opacity: 0.6; }

/* Title */
.article-title {
    font-family: 'Unbounded', 'Onest', sans-serif;
    font-weight: 700;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0 0 22px;
    text-wrap: balance;
    max-width: 900px;
}

/* Meta row */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    align-items: center;
    padding-top: 22px;
    margin-top: 8px;
    border-top: 2px dashed rgba(27,27,58,0.18);
    font-size: 14px;
}
.article-meta span,
.article-meta .article-date,
.article-meta .article-read-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
    font-weight: 600;
}
.article-meta .article-date::before { content: '📅'; }
.article-meta .article-read-time::before { content: '⏱'; }
.article-meta .article-category {
    background: white;
    border: 2px solid var(--ink);
    border-radius: 100px;
    padding: 7px 16px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink);
    box-shadow: var(--shadow-hard-sm);
}

/* ====== CONTENT ====== */
.article-content {
    padding: 70px 0 60px;
    background: white;
}
.article-content > .container { max-width: 1100px; }

/* Prose body */
.article-body {
    font-family: 'Onest', sans-serif;
    font-size: 18px;
    line-height: 1.72;
    color: var(--ink);
    max-width: 760px;
    margin: 0 auto;
}
.article-body section { margin: 0 0 2.4em; }
.article-body > * + * { margin-top: 1.1em; }

/* Headings */
.article-body h2 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 3.2vw, 32px);
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 2em 0 0.7em;
    scroll-margin-top: 90px;
    position: relative;
    padding-bottom: 14px;
}
.article-body h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 56px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}
.article-body section > h2:first-child,
.article-body > h2:first-child { margin-top: 0.4em; }

.article-body h3 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: clamp(19px, 2.4vw, 23px);
    line-height: 1.22;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 1.6em 0 0.5em;
    scroll-margin-top: 90px;
}
.article-body h4 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--ink);
    margin: 1.3em 0 0.4em;
}

/* Paragraphs */
.article-body p {
    color: var(--ink-2);
    text-wrap: pretty;
    margin: 0 0 1.05em;
}
.article-body p strong { color: var(--ink); font-weight: 700; }
.article-body p em     { font-style: italic; }

/* Links */
.article-body a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    background-image: linear-gradient(transparent 60%, rgba(255, 199, 0, 0.55) 60%);
    background-size: 100% 100%;
    transition: background-image 0.15s;
}
.article-body a:hover {
    background-image: linear-gradient(transparent 0%, rgba(255, 199, 0, 0.55) 0%);
}

/* Lists */
.article-body > ul,
.article-body > ol,
.article-body section > ul,
.article-body section > ol {
    padding: 0;
    margin: 1.1em 0;
    list-style: none;
}
.article-body > ul li,
.article-body section > ul li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 10px;
    color: var(--ink-2);
}
.article-body > ul li::before,
.article-body section > ul li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--ink);
}
.article-body > ol,
.article-body section > ol { counter-reset: list; }
.article-body > ol > li,
.article-body section > ol > li {
    counter-increment: list;
    position: relative;
    padding-left: 48px;
    margin-bottom: 12px;
    color: var(--ink-2);
}
.article-body > ol > li::before,
.article-body section > ol > li::before {
    content: counter(list);
    position: absolute;
    left: 0;
    top: 1px;
    width: 30px;
    height: 30px;
    background: var(--ink);
    color: white;
    border-radius: 50%;
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 12px;
    display: grid;
    place-items: center;
    border: 2px solid var(--ink);
    box-shadow: 0 2px 0 rgba(0,0,0,0.18);
}
.article-body li > strong:first-child { color: var(--ink); }

/* Blockquote */
.article-body blockquote {
    background: var(--bg-warm);
    border: 2px solid var(--ink);
    border-left: 8px solid var(--primary);
    border-radius: var(--radius);
    padding: 26px 30px;
    margin: 1.6em 0;
    font-family: 'Unbounded', sans-serif;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.42;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-hard-sm);
    color: var(--ink);
}
.article-body blockquote p { color: var(--ink); margin: 0; }
.article-body blockquote cite {
    display: block;
    margin-top: 12px;
    font-family: 'Onest', sans-serif;
    font-style: normal;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* HR */
.article-body hr {
    border: none;
    height: 2px;
    background: var(--ink);
    margin: 2.4em auto;
    width: 80px;
    position: relative;
}
.article-body hr::before,
.article-body hr::after {
    content: '';
    position: absolute;
    top: -3px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    border: 1.5px solid var(--ink);
}
.article-body hr::before { left: -16px; }
.article-body hr::after  { right: -16px; }

/* ====== TABLES ======
   Используем !important на ключевых свойствах, потому что в старой
   разметке остались inline style="..." (фиолетовый дизайн) и они
   ломают вёрстку. Заодно добавляем .table-wrap для горизонтального
   скролла на узких вьюпортах.
*/
.table-wrap,
.article-body .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.6em 0;
    border-radius: var(--radius);
    /* Тонкая тень-индикатор, что есть скролл */
    background:
        linear-gradient(to right, white 30%, rgba(255,255,255,0)),
        linear-gradient(to right, rgba(255,255,255,0), white 70%) 100% 0,
        radial-gradient(farthest-side at 0 50%, rgba(27,27,58,0.12), rgba(0,0,0,0)),
        radial-gradient(farthest-side at 100% 50%, rgba(27,27,58,0.12), rgba(0,0,0,0)) 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
}

.article-body table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 2px solid var(--ink) !important;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 1.6em 0;
    font-family: 'Onest', sans-serif !important;
    font-size: 15px !important;
    line-height: 1.5;
    box-shadow: var(--shadow-hard-sm);
    background: white !important;
    table-layout: auto;
}
.article-body .table-wrap > table {
    margin: 0;
    min-width: 520px; /* гарантируем читаемость на мобиле через скролл */
}
.article-body table thead {
    background: var(--ink) !important;
    color: white !important;
}
.article-body table thead tr {
    background: transparent !important;
}
.article-body table th {
    font-family: 'Unbounded', sans-serif !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    padding: 16px 20px !important;
    text-align: left !important;
    color: white !important;
    border: none !important;
    border-bottom: 2px solid var(--ink) !important;
    border-radius: 0 !important;
    background: transparent !important;
    vertical-align: middle;
    line-height: 1.3;
}
.article-body table td {
    padding: 14px 20px !important;
    border: none !important;
    border-bottom: 1.5px solid #F0F0F5 !important;
    color: var(--ink-2) !important;
    background: transparent !important;
    vertical-align: top;
    line-height: 1.5;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.article-body table tr {
    background: transparent !important;
}
.article-body table tbody tr:nth-child(even) {
    background: rgba(255, 231, 176, 0.22) !important;
}
.article-body table tr:last-child td {
    border-bottom: none !important;
}
.article-body table td strong,
.article-body table th strong {
    color: var(--ink) !important;
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
}
/* Подсветим первый столбец (часто там «Симптом», «Метод» и т.п.) */
.article-body table td:first-child {
    color: var(--ink) !important;
    font-weight: 600;
}

/* Images inside prose */
.article-body img {
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard-sm);
    width: 100%;
    height: auto;
    display: block;
    margin: 1.4em 0;
}

/* ====== TABLE OF CONTENTS ====== */
.table-of-contents {
    background: var(--bg-warm);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard-sm);
    padding: 26px 28px;
    margin: 0 0 36px;
}
.table-of-contents h2 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ink);
}
.table-of-contents h2::after { content: none; }
.table-of-contents ul {
    list-style: none;
    counter-reset: toc;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.table-of-contents li {
    counter-increment: toc;
    position: relative;
    padding-left: 30px;
    line-height: 1.35;
    margin: 0;
    color: var(--ink-2);
    background: none;
}
.table-of-contents li::before {
    content: counter(toc, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 1px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 12px;
    color: var(--primary);
    width: auto; height: auto; background: none; border: none; box-shadow: none;
    border-radius: 0;
    display: inline;
}
.table-of-contents a {
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    background: none;
    transition: color 0.15s;
}
.table-of-contents a:hover { color: var(--ink); background: none; }

/* ====== CALLOUTS (info / warning / help) ======
   Используем grid 2-кол: иконка ::before в [1/1], всё содержимое
   принудительно идёт во вторую колонку и стекируется вниз.
*/
.info-box,
.warning-box,
.help-box {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 18px;
    row-gap: 0;
    align-items: start;
    background: white;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin: 1.6em 0;
    box-shadow: var(--shadow-hard-sm);
    color: var(--ink);
}
.info-box::before,
.warning-box::before,
.help-box::before {
    grid-column: 1;
    grid-row: 1;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: 2px solid var(--ink);
    display: grid;
    place-items: center;
    font-size: 28px;
    box-shadow: 0 3px 0 var(--ink);
    background: white;
    line-height: 1;
}
/* Всё содержимое callout-а — в правую колонку, в один поток.
   Псевдоэлемент ::before занимает строку 1 столбца 1 явно выше,
   реальные дети все принудительно идут в колонку 2.
*/
.info-box > *,
.warning-box > *,
.help-box > * {
    grid-column: 2;
    min-width: 0;
}
.info-box::before    { content: 'ℹ️'; background: #D5E5FF; }
.warning-box::before { content: '⚠️'; background: var(--yellow); }
.help-box::before    { content: '🆘'; background: #FFD3D3; }

.info-box    { background: #EAF1FF; }
.warning-box { background: #FFF6E0; }
.help-box    { background: #FFECEC; }

/* Inner typography for callouts */
.info-box > *,
.warning-box > *,
.help-box > * { min-width: 0; }
.info-box h3,
.warning-box h3,
.help-box h3 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 8px;
    padding: 0;
}
.info-box h3::after,
.warning-box h3::after,
.help-box h3::after { content: none; }
.info-box p,
.warning-box p,
.help-box p { color: var(--ink-2); font-size: 15px; line-height: 1.55; margin: 0 0 8px; }
.info-box p:last-child,
.warning-box p:last-child,
.help-box p:last-child { margin-bottom: 0; }

.info-box ul,
.warning-box ul,
.help-box ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.info-box ul li,
.warning-box ul li,
.help-box ul li {
    position: relative;
    padding-left: 24px;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}
.info-box ul li::before,
.warning-box ul li::before,
.help-box ul li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 9px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 1.5px solid var(--ink);
}
.info-box ul li strong,
.warning-box ul li strong,
.help-box ul li strong { color: var(--ink); }

/* AI Summary Block — purple/tip variant, single column */
.ai-summary-block {
    background: #F2EBFF;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 1.6em 0;
    box-shadow: var(--shadow-hard-sm);
    color: var(--ink);
}
.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.ai-summary-header h3 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 16px;
    margin: 0;
    color: var(--ink);
    padding: 0;
}
.ai-summary-header h3::after { content: none; }
.ai-summary-block .ai-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 2px solid var(--ink);
    background: #E5D5FF;
    display: grid;
    place-items: center;
    font-size: 20px;
    box-shadow: 0 2px 0 var(--ink);
    flex-shrink: 0;
}
.ai-summary-content p { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin: 0 0 10px; }
.ai-summary-content p:last-child { margin-bottom: 0; }

/* ====== STATS GRID ====== */
.statistics-section { margin: 1.8em 0; padding: 0; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 1.4em 0;
}
.stat-box {
    background: var(--bg);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-hard-sm);
    text-align: left;
}
.stat-box .stat-number {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 36px;
    line-height: 1.05;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.stat-box p {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    margin: 0;
    line-height: 1.4;
}
/* Rhythmic accent colors */
.stat-box:nth-child(3n+2) { background: var(--yellow); }
.stat-box:nth-child(3n+2) .stat-number { color: var(--ink); }
.stat-box:nth-child(3n+3) { background: var(--ink); }
.stat-box:nth-child(3n+3) .stat-number { color: var(--yellow); }
.stat-box:nth-child(3n+3) p { color: rgba(255,255,255,0.78); }

/* ====== ARTICLE CONCLUSION (takeaways) ====== */
.article-conclusion {
    background: var(--ink);
    color: white;
    border: 2px solid var(--ink);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    margin: 2.4em 0;
    box-shadow: var(--shadow-hard);
    position: relative;
    overflow: hidden;
}
.article-conclusion::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.18;
}
.article-conclusion h2,
.article-conclusion h3 {
    font-family: 'Unbounded', sans-serif;
    color: white;
    font-size: clamp(20px, 2.6vw, 24px);
    margin: 0 0 16px;
    padding: 0;
    position: relative;
}
.article-conclusion h2::after,
.article-conclusion h3::after { content: none; }
.article-conclusion p {
    color: rgba(255,255,255,0.92);
    font-size: 16px;
    line-height: 1.55;
    margin: 0 0 12px;
    position: relative;
}
.article-conclusion p:last-child { margin-bottom: 0; }
.article-conclusion strong { color: white; }
.article-conclusion a {
    color: var(--yellow);
    background-image: linear-gradient(transparent 60%, rgba(255, 199, 0, 0.25) 60%);
}
.article-conclusion ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}
.article-conclusion ul li {
    position: relative;
    padding-left: 32px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255,255,255,0.92);
}
.article-conclusion ul li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.article-conclusion ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 1px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--green);
    color: white;
    text-align: center;
    line-height: 22px;
    font-weight: 700;
    font-size: 12px;
    border: 1.5px solid var(--ink);
}

/* ====== FAQ (нативный <details>/<summary>) ======
   Раскрывающиеся карточки без единой строчки JS. summary — кликабельный
   заголовок-вопрос, ответ скрыт по умолчанию. При [open] — плавно
   разворачивается, иконка «+» поворачивается в «×».
*/
.faq-section {
    margin: 2em 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.faq-section > h2 {
    margin-bottom: 4px;
    flex-basis: 100%;
}

/* Базовая карточка (работает и как <div>, и как <details>) */
.faq-item {
    background: white;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hard-sm);
    transition: transform 0.12s, box-shadow 0.12s;
    overflow: hidden;
}
.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hard);
}
details.faq-item {
    padding: 0;
}
details.faq-item[open] {
    background: var(--bg);
}

/* SUMMARY — кликабельный вопрос с круглой иконкой «?» слева и «+» справа */
.faq-item > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    color: var(--ink);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::marker { content: ''; }

/* Иконка «?» слева */
.faq-item > summary::before {
    content: '?';
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: 2px solid var(--ink);
    display: grid;
    place-items: center;
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
}

/* Иконка «+» справа, поворачивается в «×» при open */
.faq-item > summary::after {
    content: '+';
    margin-left: auto;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    color: var(--ink);
    border: 2px solid var(--ink);
    display: grid;
    place-items: center;
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 2px 0 var(--ink);
    transition: transform 0.25s ease, background 0.2s, color 0.2s;
}
.faq-item[open] > summary::after {
    transform: rotate(45deg);
    background: var(--ink);
    color: white;
}

/* Ответ */
.faq-item > .faq-answer,
.faq-item > p,
.faq-item > ul,
.faq-item > ol {
    padding: 0 24px 22px 68px;
    margin: 0;
    animation: faqReveal 0.2s ease-out;
}
.faq-item > .faq-answer > * { margin: 0 0 10px; }
.faq-item > .faq-answer > *:last-child { margin-bottom: 0; }
.faq-item .faq-answer p,
.faq-item > p {
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.6;
}
.faq-item .faq-answer ul,
.faq-item .faq-answer ol {
    padding-left: 22px;
    margin: 8px 0;
}
.faq-item .faq-answer ul li,
.faq-item .faq-answer ol li {
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 6px;
    padding-left: 4px;
    position: static;
}
.faq-item .faq-answer ul li::before,
.faq-item .faq-answer ol li::before { content: none; }
.faq-item .faq-answer strong { color: var(--ink); }

/* Лёгкая анимация раскрытия */
@keyframes faqReveal {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Старый статичный вариант на h3+p — оставляем поддержку
   (для случаев, где разметка не была сконвертирована) */
.faq-item:not(details) > h3 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    color: var(--ink);
    margin: 0 0 10px;
    padding: 20px 24px 0 62px;
    position: relative;
}
.faq-item:not(details) > h3::before {
    content: '?';
    position: absolute;
    left: 24px;
    top: 20px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: 2px solid var(--ink);
    display: grid;
    place-items: center;
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 14px;
}
.faq-item:not(details) > h3::after { content: none; }
.faq-item:not(details) > p {
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    padding: 10px 24px 22px 62px;
}

/* Mobile */
@media (max-width: 600px) {
    .faq-item > summary {
        padding: 16px 18px;
        gap: 12px;
        font-size: 16px;
    }
    .faq-item > summary::before { width: 26px; height: 26px; font-size: 13px; }
    .faq-item > summary::after  { width: 26px; height: 26px; font-size: 18px; }
    .faq-item > .faq-answer { padding: 0 18px 18px 56px; }
}

/* ====== AUTHOR BIO ====== */
.author-bio {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 22px;
    align-items: center;
    background: var(--bg-warm);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 2em 0;
    box-shadow: var(--shadow-hard-sm);
}
.author-bio .author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--ink);
    background: white;
    object-fit: cover;
    box-shadow: 0 3px 0 var(--ink);
    padding: 6px;
}
.author-bio .author-info h3 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--ink);
    margin: 0 0 6px;
    padding: 0;
}
.author-bio .author-info h3::after { content: none; }
.author-bio .author-info p {
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.55;
    margin: 0;
}
@media (max-width: 600px) {
    .author-bio { grid-template-columns: 1fr; text-align: center; }
    .author-bio .author-avatar { margin: 0 auto; }
}

/* ====== RELATED ARTICLES ====== */
.related-articles {
    margin: 3em 0 1em;
    padding-top: 36px;
    border-top: 2px dashed rgba(27,27,58,0.18);
}
.related-articles > h2,
.related-articles > h3 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: clamp(22px, 3vw, 30px);
    margin: 0 0 22px;
    padding: 0;
    color: var(--ink);
}
.related-articles > h2::after,
.related-articles > h3::after { content: none; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
@media (max-width: 900px) { .related-grid { grid-template-columns: 1fr; } }
.related-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow-hard-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hard); }
.related-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border: none;
    border-bottom: 2px solid var(--ink);
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}
.related-card h3 {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
    color: var(--ink);
    margin: 0;
    padding: 18px 20px;
}
.related-card h3::after { content: none; }

/* ====== SECURITY BADGE (lightweight pill) ====== */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-warm);
    border: 2px solid var(--ink);
    border-radius: 100px;
    padding: 8px 16px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: var(--ink);
    box-shadow: 0 2px 0 var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 8px 0;
}

/* ====== INTERNAL CTA BUTTON ======
   Кнопка-ссылка внутри статьи и внутри callout-боксов. !important
   нужен, чтобы перебить .article-body a (жёлтый highlight на
   ссылках) — иначе кнопка получает прозрачный жёлтый фон.
*/
.cta-button,
a.cta-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px !important;
    font-family: 'Unbounded', sans-serif !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    border-radius: 100px !important;
    border: 2px solid var(--ink) !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    box-shadow: var(--shadow-hard-sm);
    background-image: none !important;
    margin-top: 14px;
    max-width: 100%;
    white-space: nowrap;
    color: var(--ink);
}
.cta-button.primary,
a.cta-button.primary {
    background: var(--primary) !important;
    color: white !important;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hard);
}
/* Когда CTA — единственная кнопка в конце callout, добавим зазор сверху
   и не даём гриду растянуть кнопку на всю ширину колонки. */
.info-box .cta-button,
.warning-box .cta-button,
.help-box .cta-button,
.ai-summary-block .cta-button,
.article-conclusion .cta-button {
    margin-top: 16px;
    justify-self: start;
    align-self: start;
    width: max-content;
    max-width: 100%;
}
/* Кнопка в финальном takeaways-блоке (тёмный фон) */
.article-conclusion .cta-button {
    border-color: white !important;
    background: var(--primary) !important;
    color: white !important;
    margin-top: 18px;
    box-shadow: 0 4px 0 rgba(255,255,255,0.18);
}
.article-conclusion .cta-button:hover {
    box-shadow: 0 6px 0 rgba(255,255,255,0.25);
}
@media (max-width: 480px) {
    .cta-button,
    a.cta-button {
        white-space: normal;
        text-align: center;
    }
}

/* ====== KEY TAKEAWAY (legacy) ====== */
.key-takeaway {
    background: #E8FAEB;
    border: 2px solid var(--ink);
    border-left: 8px solid var(--green);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 1.4em 0;
    box-shadow: var(--shadow-hard-sm);
    color: var(--ink);
    font-weight: 500;
}
.key-takeaway strong { color: var(--ink); }

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
    .article-header { padding: 100px 0 50px; }
    .article-content { padding: 50px 0 40px; }
    .article-body { font-size: 17px; }
    .info-box, .warning-box, .help-box {
        grid-template-columns: 48px minmax(0, 1fr);
        column-gap: 14px;
        padding: 18px 20px;
    }
    .info-box::before, .warning-box::before, .help-box::before {
        width: 44px;
        height: 44px;
        font-size: 22px;
        border-radius: 12px;
    }
    .article-conclusion { padding: 28px 24px; border-radius: var(--radius); }
}

@media (max-width: 640px) {
    .article-container .container { padding: 0 16px; }
    .article-header { padding: 90px 0 36px; }
    .article-content { padding: 36px 0 28px; }
    .article-title { font-size: clamp(26px, 7vw, 34px); margin-bottom: 16px; }
    .article-lede { font-size: 17px; }
    .article-meta { gap: 8px 14px; padding-top: 16px; font-size: 13px; }
    .article-meta .article-category { padding: 6px 12px; font-size: 10px; }
    .article-body { font-size: 16.5px; line-height: 1.68; }
    .article-body h2 { font-size: 22px; margin-top: 1.6em; padding-bottom: 10px; }
    .article-body h2::after { width: 44px; height: 3px; }
    .article-body h3 { font-size: 19px; margin-top: 1.4em; }
    .article-body p { margin-bottom: 0.9em; }
    .article-body section { margin-bottom: 1.8em; }

    /* TOC: компактнее */
    .table-of-contents { padding: 18px 18px; margin-bottom: 24px; }
    .table-of-contents h2 { font-size: 11px; margin-bottom: 10px; padding-bottom: 8px; }
    .table-of-contents li { padding-left: 28px; }
    .table-of-contents a { font-size: 14.5px; }

    /* Callouts: ещё компактнее, иконка меньше */
    .info-box, .warning-box, .help-box {
        grid-template-columns: 40px minmax(0, 1fr);
        column-gap: 12px;
        padding: 16px 16px;
        margin: 1.3em 0;
    }
    .info-box::before, .warning-box::before, .help-box::before {
        width: 38px; height: 38px;
        font-size: 18px;
        border-radius: 10px;
        box-shadow: 0 2px 0 var(--ink);
    }
    .info-box h3, .warning-box h3, .help-box h3 { font-size: 15px; }
    .info-box p, .warning-box p, .help-box p { font-size: 14.5px; }
    .info-box ul li, .warning-box ul li, .help-box ul li { font-size: 14.5px; }

    /* AI summary: меньше padding */
    .ai-summary-block { padding: 18px 18px; }
    .ai-summary-header { margin-bottom: 10px; gap: 10px; }
    .ai-summary-block .ai-icon { width: 32px; height: 32px; font-size: 16px; border-radius: 10px; }
    .ai-summary-header h3 { font-size: 15px; }
    .ai-summary-content p { font-size: 14.5px; }

    /* Stats: акцентная палитра 1:1, padding меньше */
    .stat-box { padding: 18px 20px; }
    .stat-box .stat-number { font-size: 30px; }

    /* Takeaways */
    .article-conclusion { padding: 24px 20px; margin: 1.8em 0; }
    .article-conclusion h2, .article-conclusion h3 { font-size: 20px; margin-bottom: 12px; }
    .article-conclusion p { font-size: 15px; }
    .article-conclusion ul li { font-size: 15px; padding-left: 28px; }
    .article-conclusion::before { width: 140px; height: 140px; top: -40px; right: -40px; }

    /* Blockquote: убираем декоративный padding-left */
    .article-body blockquote {
        padding: 20px 22px;
        font-size: 17px;
    }
    .article-body blockquote::before { display: none; }
    .article-body blockquote p, .article-body blockquote cite { padding-left: 0; }

    /* FAQ: компактнее */
    .faq-item > summary {
        padding: 14px 16px;
        gap: 10px;
        font-size: 15px;
    }
    .faq-item > summary::before { width: 24px; height: 24px; font-size: 12px; border-width: 1.5px; }
    .faq-item > summary::after  { width: 24px; height: 24px; font-size: 16px; border-width: 1.5px; box-shadow: 0 1px 0 var(--ink); }
    .faq-item > .faq-answer { padding: 0 16px 16px 50px; font-size: 14.5px; }
    .faq-item:not(details) > h3 { font-size: 15px; padding: 16px 16px 0 50px; }
    .faq-item:not(details) > h3::before { left: 16px; top: 16px; width: 24px; height: 24px; font-size: 12px; }
    .faq-item:not(details) > p { padding: 8px 16px 16px 50px; font-size: 14.5px; }

    /* Author bio */
    .author-bio { padding: 18px 20px; gap: 16px; }
    .author-bio .author-avatar { width: 64px; height: 64px; }
    .author-bio .author-info h3 { font-size: 16px; }
    .author-bio .author-info p { font-size: 13.5px; }

    /* Lists in prose */
    .article-body > ul li,
    .article-body section > ul li { padding-left: 28px; margin-bottom: 8px; }
    .article-body > ul li::before,
    .article-body section > ul li::before { width: 10px; height: 10px; top: 9px; }
    .article-body > ol > li,
    .article-body section > ol > li { padding-left: 42px; }
    .article-body > ol > li::before,
    .article-body section > ol > li::before { width: 26px; height: 26px; font-size: 11px; }

    /* Related */
    .related-articles { margin: 2em 0 0.5em; padding-top: 24px; }
    .related-articles > h2, .related-articles > h3 { font-size: 22px; margin-bottom: 16px; }

    /* Reading progress bar */
    .reading-progress-bar { height: 3px; }
}

/* Очень узкие экраны (старые Android, iPhone SE) */
@media (max-width: 380px) {
    .article-container .container { padding: 0 14px; }
    .article-title { font-size: clamp(24px, 7vw, 30px); }
    .article-body { font-size: 16px; }
    .article-body h2 { font-size: 20px; }
    .article-body h3 { font-size: 18px; }
    .table-of-contents { padding: 14px 14px; }
    .info-box, .warning-box, .help-box { padding: 14px; }
    .article-conclusion { padding: 20px 16px; border-radius: var(--radius-sm); }
}

/* Защита от горизонтальной прокрутки на любых телефонах */
@media (max-width: 900px) {
    .article-body img,
    .article-body iframe,
    .article-body video { max-width: 100%; height: auto; }
    .article-body a,
    .article-body code { word-break: break-word; overflow-wrap: anywhere; }
    /* Картинки внутри related — без хака с aspect-ratio для безопасности */
    .related-card img { aspect-ratio: 16 / 9; }
}

/* ====== PRINT ====== */
@media print {
    .reading-progress-bar,
    .pill-nav-container,
    .related-articles,
    .footer { display: none !important; }
    .article-header { background: white !important; color: black !important; padding: 20px 0; border-bottom: 2px solid #000; }
    .article-header::before { display: none; }
    .article-title { color: black !important; }
    .article-body a { color: black; background: none; text-decoration: underline; }
}
