/* =====================================================
   ARTICLES.CSS — стили раздела статей
   Подключать: <link rel="stylesheet" href="/css/articles.css?v=1">
   ===================================================== */

/* ── Общая обёртка ─────────────────────────────────── */
.ar-wrap { max-width: 1100px; margin: 0 auto; padding: 40px 20px; }

/* ── Хлебные крошки ────────────────────────────────── */
.ar-breadcrumb {
    display: flex; gap: 6px; align-items: center;
    font-size: 0.78rem; color: var(--muted);
    margin-bottom: 28px; flex-wrap: wrap;
}
.ar-breadcrumb a { color: var(--muted); text-decoration: none; }
.ar-breadcrumb a:hover { color: var(--accent); }
.ar-breadcrumb span { opacity: .4; }

/* ── Заголовок страницы ────────────────────────────── */
.ar-page-header { margin-bottom: 28px; }
.ar-page-title {
    font-family: var(--font-display);
    font-size: 1.8rem; font-weight: 900;
    letter-spacing: -0.03em; color: var(--text);
    margin-bottom: 6px;
}
.ar-page-sub { font-size: 0.88rem; color: var(--muted); }

/* ── Поиск во всю ширину ───────────────────────────── */
.ar-search-full { margin-bottom: 20px; }
.ar-search-full__wrap {
    position: relative;
    display: flex; align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .2s;
}
.ar-search-full__wrap:focus-within { border-color: var(--accent); }
.ar-search-full__icon {
    position: absolute; left: 16px;
    color: var(--muted); width: 16px; height: 16px;
    pointer-events: none; flex-shrink: 0;
}
.ar-search-full__input {
    flex: 1;
    padding: 13px 16px 13px 44px;
    border: none; outline: none;
    font-size: 0.95rem;
    font-family: var(--font-body);
    background: transparent;
    color: var(--text);
}
.ar-search-full__clear {
    padding: 0 12px;
    color: var(--muted); text-decoration: none;
    font-size: 0.85rem; line-height: 1;
    flex-shrink: 0;
}
.ar-search-full__clear:hover { color: var(--accent); }
.ar-search-full__btn {
    padding: 13px 24px;
    background: var(--accent); color: #fff;
    border: none; cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700; font-size: 0.88rem;
    transition: opacity .2s; flex-shrink: 0;
}
.ar-search-full__btn:hover { opacity: .88; }

/* ── Фильтры-таблетки ──────────────────────────────── */
.ar-filters {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 28px;
}
.ar-filter {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 0.82rem; font-weight: 600;
    color: var(--text2); text-decoration: none;
    background: var(--surface);
    transition: all .15s;
}
.ar-filter:hover { border-color: var(--accent); color: var(--accent); }
.ar-filter.is-active {
    background: var(--accent); border-color: var(--accent);
    color: #fff;
}
.ar-filter.is-active .ar-filter__count { background: rgba(255,255,255,.25); color: #fff; }
.ar-filter__dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.ar-filter__count {
    font-size: 0.72rem; font-weight: 700;
    background: var(--bg2); color: var(--muted);
    padding: 1px 6px; border-radius: 8px;
}

/* ── Старый поиск (оставляем для совместимости) ────── */
.ar-search {
    display: flex; gap: 10px; align-items: center;
    margin-bottom: 32px;
}
.ar-search__wrap {
    flex: 1; position: relative; max-width: 420px;
}
.ar-search__input {
    width: 100%; padding: 10px 16px 10px 38px;
    border: 1.5px solid var(--border); border-radius: 12px;
    font-size: 0.88rem; font-family: var(--font-body);
    background: var(--surface); color: var(--text);
    transition: border-color .2s;
}
.ar-search__input:focus { outline: none; border-color: var(--accent); }
.ar-search__icon {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted); width: 15px; height: 15px;
    pointer-events: none;
}
.ar-search__clear {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted); text-decoration: none;
    line-height: 1; font-size: 0.8rem;
}
.ar-search__clear:hover { color: var(--accent); }

/* ── Лейаут: сайдбар + основной ───────────────────── */
.ar-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 800px) { .ar-layout { grid-template-columns: 1fr; } }

/* ── Сайдбар ───────────────────────────────────────── */
.ar-sidebar {}
.ar-sb-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}
.ar-sb-title {
    font-family: var(--font-display);
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); margin: 0 0 14px;
}
.ar-cats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.ar-cat {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 10px;
    color: var(--text); text-decoration: none;
    font-size: 0.85rem; font-weight: 500;
    transition: background .15s, color .15s;
}
.ar-cat:hover { background: var(--bg2); color: var(--accent); }
.ar-cat.is-active {
    background: rgba(212,124,15,.08);
    color: var(--accent); font-weight: 700;
    border: 1px solid rgba(212,124,15,.2);
}
.ar-cat__dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0; background: var(--border);
}
.ar-cat__count {
    margin-left: auto;
    font-size: 0.72rem; color: var(--muted);
    background: var(--bg2);
    padding: 1px 7px; border-radius: 8px;
}
.ar-cat.is-active .ar-cat__count { background: rgba(212,124,15,.15); color: var(--accent); }

/* Енот в сайдбаре */
.ar-sb-raccoon {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 20px; text-align: center;
}
.ar-sb-raccoon img { width: 100px; margin-bottom: 10px; opacity: .9; }
.ar-sb-raccoon p { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }

/* ── Основная зона ─────────────────────────────────── */
.ar-main {}

.ar-search-info {
    font-size: 0.85rem; color: var(--muted);
    margin-bottom: 20px; padding: 10px 14px;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 10px;
}
.ar-search-info strong { color: var(--text); }

/* Пустое состояние */
.ar-empty {
    text-align: center; padding: 60px 20px;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 16px;
}
.ar-empty__icon { width: 40px; height: 40px; color: var(--muted); margin: 0 auto 14px; display: block; }
.ar-empty p { color: var(--muted); margin-bottom: 20px; font-size: 0.9rem; }

/* Сетка карточек */
.ar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

/* ── Карточка статьи ───────────────────────────────── */
.ar-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    display: flex; flex-direction: column;
}
.ar-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px var(--shadow);
    border-color: rgba(212,124,15,.25);
}
.ar-card__cover {
    aspect-ratio: 16/9; overflow: hidden;
    background: var(--bg2);
    display: flex; align-items: center; justify-content: center;
}
.ar-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.ar-card:hover .ar-card__cover img { transform: scale(1.04); }
.ar-card__cover-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
}
.ar-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.ar-card__meta {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px; flex-wrap: wrap;
}
.ar-card__cat {
    font-size: 0.7rem; font-weight: 700;
    padding: 2px 8px; border-radius: 8px;
    background: rgba(212,124,15,.1); color: var(--accent);
    text-decoration: none;
}
.ar-card__date { font-size: 0.72rem; color: var(--muted); }
.ar-card__title {
    font-family: var(--font-display);
    font-size: 0.95rem; font-weight: 700;
    color: var(--text); line-height: 1.3;
    margin-bottom: 8px;
}
.ar-card__excerpt {
    font-size: 0.82rem; color: var(--muted);
    line-height: 1.55; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}
.ar-card__footer {
    display: flex; align-items: center; gap: 10px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem; color: var(--muted);
}
.ar-card__footer-item { display: flex; align-items: center; gap: 4px; }

/* ── Пагинация ─────────────────────────────────────── */
.ar-pagination { margin-top: 8px; }
.ar-pagination nav { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ar-pagination span, .ar-pagination a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 0.82rem; color: var(--text); text-decoration: none;
    transition: all .15s;
}
.ar-pagination a:hover { border-color: var(--accent); color: var(--accent); }
.ar-pagination [aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Страница статьи (show) ────────────────────────── */
.ar-header { margin-bottom: 24px; }
.ar-meta {
    display: flex; gap: 8px; align-items: center;
    flex-wrap: wrap; margin-bottom: 10px;
}
.ar-cat-badge {
    font-size: 0.72rem; font-weight: 700;
    padding: 3px 10px; border-radius: 12px;
    background: rgba(212,124,15,.1); color: var(--accent);
    text-decoration: none;
}
.ar-date { font-size: 0.72rem; color: var(--muted); }
.ar-read-time { font-size: 0.72rem; color: var(--muted); }
.ar-views { font-size: 0.72rem; color: var(--muted); }
.ar-title {
    font-family: var(--font-display);
    font-size: 1.6rem; font-weight: 900;
    color: var(--text); margin: 0; line-height: 1.2;
    letter-spacing: -0.02em;
}

.ar-show-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 28px; align-items: start;
}
@media (max-width: 800px) { .ar-show-layout { grid-template-columns: 1fr; } }

/* Обложка */
.ar-cover {
    margin-bottom: 24px; border-radius: 16px;
    overflow: hidden; border: 1.5px solid var(--border);
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.ar-cover img { width: 100%; display: block; }

/* Лид */
.ar-lead {
    font-size: 1.05rem; color: var(--text2);
    line-height: 1.75; margin-bottom: 24px;
    padding-left: 16px;
    border-left: 3px solid rgba(212,124,15,.4);
}

/* Тело статьи */
.ar-body {
    font-size: 0.95rem; color: var(--text);
    line-height: 1.8; margin-bottom: 24px;
}
.ar-body h2 {
    font-family: var(--font-display);
    font-size: 1.15rem; font-weight: 700;
    color: var(--text); margin: 28px 0 12px;
    scroll-margin-top: 80px;
}
.ar-body h3 {
    font-family: var(--font-display);
    font-size: 0.95rem; font-weight: 700;
    color: var(--text); margin: 20px 0 10px;
    scroll-margin-top: 80px;
}
.ar-body p { margin-bottom: 14px; }
.ar-body ul, .ar-body ol { padding-left: 20px; margin-bottom: 14px; }
.ar-body li { margin-bottom: 6px; }
.ar-body img {
    max-width: 100%; border-radius: 12px;
    border: 1.5px solid var(--border);
    margin: 8px 0;
}
.ar-body blockquote {
    border-left: 3px solid rgba(212,124,15,.4);
    padding: 10px 16px; margin: 16px 0;
    background: rgba(212,124,15,.04);
    border-radius: 0 10px 10px 0;
    color: var(--text2); font-style: italic;
}
.ar-body code {
    background: var(--bg2); padding: 2px 6px;
    border-radius: 4px; font-size: 0.85em;
}

/* Блок (как ps-block) */
.ar-block {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 20px; margin-bottom: 16px;
}
.ar-block-title {
    font-family: var(--font-display);
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); margin: 0 0 14px;
}

/* Сайдбар статьи */
.ar-show-sidebar {}

/* TOC */
.ar-toc { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.ar-toc a {
    display: block; padding: 6px 10px;
    border-radius: 8px; color: var(--muted);
    text-decoration: none; font-size: 0.82rem;
    transition: background .15s, color .15s;
    border-left: 2px solid transparent;
}
.ar-toc a:hover { background: var(--bg2); color: var(--text); }
.ar-toc a.active { color: var(--accent); border-left-color: var(--accent); background: rgba(212,124,15,.05); }
.ar-toc--h3 { padding-left: 16px; font-size: 0.78rem; }

/* Поделиться */
.ar-share { display: flex; gap: 8px; flex-wrap: wrap; }
.ar-share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 10px;
    font-size: 0.82rem; font-weight: 600;
    text-decoration: none; cursor: pointer;
    border: 1.5px solid var(--border);
    background: none; font-family: var(--font-body);
    transition: all .2s;
}
.ar-share-btn--vk { background: #4680C2; border-color: #4680C2; color: #fff; }
.ar-share-btn--vk:hover { background: #3a70b0; }
.ar-share-btn--copy { color: var(--text2); }
.ar-share-btn--copy:hover { border-color: var(--accent); color: var(--accent); }

/* Похожие статьи */
.ar-related { display: flex; flex-direction: column; gap: 8px; }
.ar-related-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 10px;
    text-decoration: none; color: var(--text);
    border: 1.5px solid var(--border);
    transition: border-color .2s, background .15s;
    font-size: 0.82rem;
}
.ar-related-item:hover { border-color: var(--accent); background: rgba(212,124,15,.04); }
.ar-related-item img {
    width: 44px; height: 36px; border-radius: 6px;
    object-fit: cover; flex-shrink: 0;
}
.ar-related-item__ph {
    width: 44px; height: 36px; border-radius: 6px;
    background: var(--bg2); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}

@media (max-width: 900px) { .ar-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .ar-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .ar-grid { grid-template-columns: 1fr; } .ar-card { max-width: 100%; } }

.ar-share-btn--tg { background: #2AABEE; border-color: #2AABEE; color: #fff; }
.ar-share-btn--tg:hover { background: #1a9bde; }
.ar-share-btn { min-width: 42px; justify-content: center; }
.ar-body img { border: none; box-shadow: none; }

/* Навигация prev/next */
.ar-nav {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px; margin-bottom: 12px;
}
.ar-nav__item--next { text-align: right; }
.ar-nav__link {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s;
}
.ar-nav__link:hover { border-color: var(--accent); box-shadow: 0 4px 16px var(--shadow); }
.ar-nav__link--right { align-items: flex-end; }
.ar-nav__dir { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.ar-nav__title { font-size: 0.85rem; font-weight: 700; color: var(--text); line-height: 1.3; }
@media (max-width: 560px) { .ar-nav { grid-template-columns: 1fr; } .ar-nav__item--next { text-align: left; } .ar-nav__link--right { align-items: flex-start; } }

/* Убираем рамки с картинок в тексте */
.ar-body img { border: none !important; box-shadow: none !important; }

/* Навигация prev/next — отдельный блок */
.ar-nav {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px; margin-bottom: 12px;
}
.ar-nav__item--next { text-align: right; }
.ar-nav__link {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s;
}
.ar-nav__link:hover { border-color: var(--accent); box-shadow: 0 4px 16px var(--shadow); }
.ar-nav__link--right { align-items: flex-end; }
.ar-nav__dir { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.ar-nav__title { font-size: 0.85rem; font-weight: 700; color: var(--text); line-height: 1.3; }
@media (max-width: 560px) {
    .ar-nav { grid-template-columns: 1fr; }
    .ar-nav__item--next { text-align: left; }
    .ar-nav__link--right { align-items: flex-start; }
}

/* Блок внимания */
/* Блок внимания — чёрный стиль */
.ar-body .attention {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #1a1a2e;
    border: 2px solid #1a1a2e;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    color: #fff;
    font-weight: 600;
    line-height: 1.6;
}
.ar-body .attention::before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: #fff;
    color: #1a1a2e;
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 900;
    flex-shrink: 0;
}

/* ── Потренируйтесь: ребусы к уроку ───────────────── */
.ar-practice {
    margin: 32px 0 24px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(212,124,15,0.07) 0%, rgba(212,124,15,0.02) 100%);
    border: 1.5px solid rgba(212,124,15,0.22);
    border-radius: 18px;
}
.ar-practice__head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.ar-practice__title {
    font-family: var(--font-display);
    font-size: 1.15rem; font-weight: 700;
    color: var(--text); margin: 0 0 4px;
}
.ar-practice__sub { font-size: 0.88rem; color: var(--text2); margin: 0; }
.ar-practice__all {
    font-size: 0.85rem; font-weight: 700;
    color: var(--accent); text-decoration: none; white-space: nowrap;
}
.ar-practice__all:hover { text-decoration: underline; }
/* Три ребуса в один ряд; на телефоне — колонкой */
.ar-practice .pz-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) {
    .ar-practice { padding: 16px; margin: 24px -4px 20px; }
    .ar-practice .pz-grid { grid-template-columns: 1fr; }
}
