/* ==========================================================================
   Suberoo — стили блога (неймспейс bl-)
   Тема (фон, шрифты, --font-mono, базовый цвет) наследуется из style.css.
   ========================================================================== */

:root {
    --bl-accent: #3b82f6;
    --bl-accent-2: #8b5cf6;
    --bl-text: #f1f5f9;
    --bl-muted: #b8c4d6;      /* вторичный текст (контраст AA на тёмном) */
    --bl-muted-2: #94a3b8;    /* третичный */
    --bl-card: rgba(255, 255, 255, 0.05);
    --bl-card-hover: rgba(255, 255, 255, 0.08);
    --bl-border: rgba(255, 255, 255, 0.10);
    --bl-radius: 16px;
    --bl-maxw: 1120px;
    --bl-read: 720px;         /* оптимальная ширина колонки чтения */
}

/* ---------- Каркас ---------- */
.bl-main {
    flex: 1 0 auto;
    width: 100%;
}
.bl-container {
    max-width: var(--bl-maxw);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ---------- Шапка ---------- */
.bl-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bl-border);
}
.bl-header-inner {
    max-width: var(--bl-maxw);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.bl-brand {
    font-size: 1.25rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, var(--bl-accent), var(--bl-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}
.bl-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bl-nav a {
    color: var(--bl-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 8px 14px;
    border-radius: 10px;
    transition: color .2s ease, background .2s ease;
}
.bl-nav a:hover { color: var(--bl-text); background: var(--bl-card); }
.bl-nav a[aria-current="page"] { color: #fff; background: linear-gradient(135deg, var(--bl-accent), #2563eb); }

/* ---------- Хлебные крошки ---------- */
.bl-breadcrumbs {
    padding: 18px 0 4px;
    font-size: 0.85rem;
    color: var(--bl-muted-2);
}
.bl-breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bl-breadcrumbs a { color: var(--bl-muted); text-decoration: none; }
.bl-breadcrumbs a:hover { color: var(--bl-text); text-decoration: underline; }
.bl-breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--bl-muted-2); }

/* ---------- Хиро ---------- */
.bl-hero { padding: 20px 0 8px; }
.bl-hero h1 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}
.bl-hero p {
    font-size: 1.08rem;
    line-height: 1.6;
    color: var(--bl-muted);
    max-width: 680px;
}

/* ---------- Фильтр по категориям ---------- */
.bl-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 22px 0 6px;
}
.bl-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--bl-border);
    background: var(--bl-card);
    color: var(--bl-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s ease;
}
.bl-chip:hover { color: var(--bl-text); border-color: rgba(96,165,250,.5); }
.bl-chip[aria-current="true"] { color: #fff; background: linear-gradient(135deg, var(--bl-accent), #2563eb); border-color: transparent; }

/* ---------- Общий вид карточек-статей ---------- */
.bl-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59,130,246,.28), rgba(139,92,246,.28));
}
.bl-thumb i { font-size: 2.4rem; color: rgba(255,255,255,.85); }
.bl-thumb.cat-guide   { background: linear-gradient(135deg, rgba(59,130,246,.30), rgba(37,99,235,.30)); }
.bl-thumb.cat-save    { background: linear-gradient(135deg, rgba(34,197,94,.28), rgba(16,185,129,.28)); }
.bl-thumb.cat-howto   { background: linear-gradient(135deg, rgba(139,92,246,.30), rgba(168,85,247,.30)); }
.bl-thumb.cat-review  { background: linear-gradient(135deg, rgba(236,72,153,.28), rgba(219,39,119,.28)); }
.bl-thumb.cat-data    { background: linear-gradient(135deg, rgba(245,158,11,.28), rgba(217,119,6,.28)); }

.bl-cat-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 8px;
}
.bl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--bl-muted-2);
    font-size: 0.82rem;
    margin-top: 12px;
}
.bl-meta .bl-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--bl-muted-2); }
.bl-meta time { font-variant-numeric: tabular-nums; }

/* ---------- Избранная статья ---------- */
.bl-featured {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 24px;
    align-items: center;
    background: var(--bl-card);
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius);
    padding: 22px;
    margin-top: 18px;
    transition: border-color .2s ease, transform .2s ease;
}
.bl-featured:hover { border-color: rgba(96,165,250,.4); }
.bl-featured .bl-thumb { aspect-ratio: 16 / 10; }
.bl-featured h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    line-height: 1.2;
    font-weight: 800;
    margin: 4px 0 10px;
}
.bl-featured h2 a { color: var(--bl-text); text-decoration: none; }
.bl-featured h2 a:hover { color: #93c5fd; }
.bl-featured p { color: var(--bl-muted); line-height: 1.6; font-size: 1rem; }

/* ---------- Сетка статей ---------- */
.bl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    padding: 28px 0 8px;
    list-style: none;
}
.bl-card {
    display: flex;
    flex-direction: column;
    background: var(--bl-card);
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius);
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.bl-card:hover {
    transform: translateY(-4px);
    border-color: rgba(96,165,250,.4);
    box-shadow: 0 12px 30px rgba(2, 6, 23, .45);
}
.bl-card .bl-thumb { border-radius: 0; aspect-ratio: 16 / 9; }
.bl-card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.bl-card h3 { font-size: 1.12rem; line-height: 1.3; font-weight: 700; margin-bottom: 8px; }
.bl-card h3 a { color: var(--bl-text); text-decoration: none; }
.bl-card h3 a:hover { color: #93c5fd; }
.bl-card p { color: var(--bl-muted); font-size: 0.92rem; line-height: 1.55; flex: 1; }

/* ---------- Пагинация ---------- */
.bl-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 30px 0 10px;
    list-style: none;
}
.bl-pagination a, .bl-pagination span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--bl-border);
    background: var(--bl-card);
    color: var(--bl-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 12px;
}
.bl-pagination a:hover { color: #fff; border-color: rgba(96,165,250,.5); }
.bl-pagination [aria-current="page"] { color: #fff; background: linear-gradient(135deg, var(--bl-accent), #2563eb); border-color: transparent; }
.bl-pagination .is-disabled { opacity: .4; pointer-events: none; }

/* ---------- CTA к инструменту ---------- */
.bl-cta {
    margin: 40px 0 10px;
    text-align: center;
    background: linear-gradient(135deg, rgba(59,130,246,.14), rgba(139,92,246,.14));
    border: 1px solid var(--bl-border);
    border-radius: 20px;
    padding: 36px 24px;
}
.bl-cta h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.bl-cta p { color: var(--bl-muted); max-width: 560px; margin: 0 auto 18px; line-height: 1.6; }
.bl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--bl-accent), #2563eb);
    box-shadow: 0 6px 18px rgba(59,130,246,.35);
    transition: transform .2s ease, box-shadow .2s ease;
}
.bl-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(59,130,246,.5); }

/* ==========================================================================
   Страница статьи
   ========================================================================== */
.bl-article { padding-bottom: 20px; }
.bl-article-header { max-width: var(--bl-read); margin: 0 auto; padding: 8px 0 6px; }
.bl-article-header h1 {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 8px 0 14px;
}
.bl-article-lead {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--bl-muted);
    max-width: var(--bl-read);
    margin: 0 auto 18px;
}
.bl-byline {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: var(--bl-read);
    margin: 0 auto 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--bl-border);
}
.bl-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--bl-accent), var(--bl-accent-2));
    color: #fff; font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.bl-byline-info { font-size: 0.9rem; line-height: 1.4; }
.bl-byline-info .bl-author-name { font-weight: 700; color: var(--bl-text); }
.bl-byline-info .bl-author-name a { color: inherit; text-decoration: none; }
.bl-byline-info .bl-author-name a:hover { text-decoration: underline; }
.bl-byline-info .bl-sub { color: var(--bl-muted-2); }

.bl-hero-img {
    max-width: var(--bl-maxw);
    margin: 0 auto 26px;
    border-radius: var(--bl-radius);
    overflow: hidden;
    aspect-ratio: 21 / 9;
}
.bl-hero-img .bl-thumb { aspect-ratio: 21 / 9; border-radius: 0; }
.bl-hero-img .bl-thumb i { font-size: 3.4rem; }

/* Оглавление */
.bl-toc {
    max-width: var(--bl-read);
    margin: 0 auto 26px;
    background: var(--bl-card);
    border: 1px solid var(--bl-border);
    border-radius: 12px;
    padding: 18px 20px;
}
.bl-toc strong { display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: .4px; color: var(--bl-muted-2); margin-bottom: 10px; }
.bl-toc ol { margin-left: 18px; }
.bl-toc li { margin: 6px 0; }
.bl-toc a { color: #93c5fd; text-decoration: none; }
.bl-toc a:hover { text-decoration: underline; }

/* Текст статьи — читаемая колонка */
.bl-prose {
    max-width: var(--bl-read);
    margin: 0 auto;
    font-size: 1.08rem;
    line-height: 1.75;
    color: #e2e8f0;
}
.bl-prose h2 {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 40px 0 14px;
    scroll-margin-top: 80px;
}
.bl-prose h3 { font-size: 1.22rem; font-weight: 700; margin: 28px 0 10px; }
.bl-prose p { margin: 0 0 18px; }
.bl-prose ul, .bl-prose ol { margin: 0 0 18px 22px; }
.bl-prose li { margin: 8px 0; }
.bl-prose a { color: #93c5fd; text-decoration: underline; text-underline-offset: 2px; }
.bl-prose strong { color: #fff; }
.bl-prose blockquote {
    margin: 22px 0;
    padding: 14px 20px;
    border-left: 3px solid var(--bl-accent);
    background: var(--bl-card);
    border-radius: 0 10px 10px 0;
    color: var(--bl-muted);
    font-style: italic;
}
.bl-prose figure { margin: 24px 0; }
.bl-prose figure .bl-thumb { aspect-ratio: 16/9; border-radius: 12px; }
.bl-prose figcaption { text-align: center; color: var(--bl-muted-2); font-size: 0.85rem; margin-top: 8px; }
.bl-callout {
    margin: 24px 0;
    padding: 18px 20px;
    border: 1px solid rgba(96,165,250,.35);
    background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(139,92,246,.10));
    border-radius: 12px;
}
.bl-callout p:last-child { margin-bottom: 0; }

/* Блок автора (E-E-A-T) */
.bl-authorbox {
    max-width: var(--bl-read);
    margin: 40px auto 0;
    display: flex;
    gap: 16px;
    background: var(--bl-card);
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius);
    padding: 22px;
}
.bl-authorbox .bl-avatar { width: 60px; height: 60px; font-size: 1.3rem; }
.bl-authorbox h2 { font-size: 1.1rem; margin: 0 0 4px; font-weight: 700; }
.bl-authorbox p { color: var(--bl-muted); font-size: 0.92rem; line-height: 1.6; margin: 0 0 8px; }
.bl-authorbox a { color: #93c5fd; text-decoration: none; }
.bl-authorbox a:hover { text-decoration: underline; }

/* Похожие статьи */
.bl-related { max-width: var(--bl-maxw); margin: 46px auto 0; }
.bl-related h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 18px; }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
    .bl-grid { grid-template-columns: repeat(2, 1fr); }
    .bl-featured { grid-template-columns: 1fr; }
    .bl-featured .bl-thumb { order: -1; }
}
@media (max-width: 560px) {
    .bl-grid { grid-template-columns: 1fr; }
    .bl-nav a { padding: 8px 10px; font-size: 0.85rem; }
    .bl-prose { font-size: 1.02rem; }
}

/* Сброс протечки глобального h1 из style.css (nowrap + прозрачная градиентная заливка) */
.bl-hero h1,
.bl-article-header h1 {
    white-space: normal;
    overflow-wrap: break-word;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    color: var(--bl-text);
    -webkit-text-fill-color: currentColor;
    line-height: 1.18;
}


/* Реальные изображения в плашках-превью (градиент остаётся фолбэком под img) */
.bl-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}