/* tpl-blog-single.css — blog post template v1.0 */

/* ===== READING PROGRESS BAR ===== */
.bs-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    z-index: 9999;
    transition: width .1s linear;
    pointer-events: none;
}

/* ===== BREADCRUMB ===== */
.bs-breadcrumb {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 12px 40px;
    font-size: 13px;
    color: #8b949e;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bs-breadcrumb a { color: #8b949e; text-decoration: none; }
.bs-breadcrumb a:hover { color: #e6edf3; }
.bs-breadcrumb__sep { opacity: .4; }

/* ===== LAYOUT ===== */
.bs-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 40px 80px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 56px;
    align-items: start;
}

/* ===== ARTICLE ===== */
.bs-article {}

/* Hero */
.bs-hero { margin-bottom: 36px; }
.bs-hero__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #8b949e;
    flex-wrap: wrap;
}
.bs-hero__cat {
    background: rgba(37,99,235,.15);
    color: #3b82f6;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    text-decoration: none;
}
.bs-hero__cat:hover { background: rgba(37,99,235,.25); color: #3b82f6; text-decoration: none; }
.bs-hero__date,
.bs-hero__read {
    display: flex;
    align-items: center;
    gap: 5px;
}
.bs-hero__title {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
    color: #e6edf3;
    margin: 0 0 18px;
    letter-spacing: -.75px;
}
.bs-hero__excerpt {
    font-size: 17px;
    color: #8b949e;
    line-height: 1.7;
    margin: 0 0 24px;
}
.bs-hero__cover {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
}
.bs-hero__cover img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}
.bs-hero__cover-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #1a3a5c 0%, #0d1117 100%);
    border: 1px solid #30363d;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    opacity: .3;
}

/* Author card */
.bs-author {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    margin: 28px 0 32px;
}
.bs-author__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    font-family: 'Segoe UI', sans-serif;
}
.bs-author__name { font-weight: 600; font-size: 14px; color: #e6edf3; margin-bottom: 3px; }
.bs-author__role { font-size: 12px; color: #8b949e; }

/* Article content */
.bs-content { font-size: 15px; line-height: 1.85; color: #c9d1d9; }
.bs-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #e6edf3;
    margin: 40px 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #30363d;
    scroll-margin-top: 90px;
    letter-spacing: -.25px;
}
.bs-content h3 {
    font-size: 19px;
    font-weight: 600;
    color: #e6edf3;
    margin: 28px 0 10px;
    scroll-margin-top: 90px;
}
.bs-content p { margin-bottom: 18px; }
.bs-content ul, .bs-content ol { margin: 0 0 18px 26px; }
.bs-content li { margin-bottom: 8px; }
.bs-content strong { color: #e6edf3; }
.bs-content a { color: #3b82f6; }
.bs-content a:hover { color: #60a5fa; }
.bs-content blockquote {
    border-left: 4px solid #2563eb;
    margin: 28px 0;
    padding: 16px 22px;
    background: #161b22;
    border-radius: 0 8px 8px 0;
    font-size: 16px;
    font-style: italic;
    color: #8b949e;
}
.bs-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #30363d;
    font-size: 13px;
}
.bs-content th {
    background: #21262d;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.bs-content td { padding: 10px 14px; border-bottom: 1px solid #30363d; }
.bs-content tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.bs-content tr:last-child td { border-bottom: none; }

/* Callout boxes */
.bs-callout {
    border-radius: 10px;
    padding: 18px 22px;
    margin: 24px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.bs-callout--info { background: rgba(37,99,235,.07); border: 1px solid rgba(37,99,235,.2); }
.bs-callout--warning { background: rgba(245,158,11,.07); border: 1px solid rgba(245,158,11,.2); }
.bs-callout--tip { background: rgba(34,197,94,.07); border: 1px solid rgba(34,197,94,.2); }
.bs-callout__icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.bs-callout__text { font-size: 14px; line-height: 1.7; }
.bs-callout__text strong { display: block; font-size: 14px; margin-bottom: 4px; color: #e6edf3; }

/* Spec grid inside article */
.bs-spec-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 24px 0;
}
.bs-spec-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
}
.bs-spec-card__val { font-size: 26px; font-weight: 800; color: #3b82f6; margin-bottom: 4px; }
.bs-spec-card__label { font-size: 11px; color: #8b949e; }

/* Tags & Share */
.bs-tags { margin-top: 36px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bs-tags__label { font-size: 12px; color: #8b949e; }
.bs-tag {
    background: #21262d;
    border: 1px solid #30363d;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #8b949e;
    text-decoration: none;
}
.bs-tag:hover { border-color: #2563eb; color: #3b82f6; text-decoration: none; }
.bs-share {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding: 18px 20px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    flex-wrap: wrap;
}
.bs-share__label { font-size: 13px; font-weight: 600; color: #e6edf3; }

/* Related posts */
.bs-related { margin-top: 56px; }
.bs-related__title { font-size: 22px; font-weight: 700; margin-bottom: 24px; color: #e6edf3; }
.bs-related__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.bs-related-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .2s, transform .2s;
    text-decoration: none;
    display: block;
}
.bs-related-card:hover { border-color: #2563eb; transform: translateY(-3px); text-decoration: none; }
.bs-related-card__cover {
    height: 160px;
    overflow: hidden;
}
.bs-related-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.bs-related-card:hover .bs-related-card__cover img { transform: scale(1.04); }
.bs-related-card__cover-placeholder {
    height: 160px;
    background: linear-gradient(135deg, #1a3a5c 0%, #0d1117 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    opacity: .5;
}
.bs-related-card__body { padding: 16px; }
.bs-related-card__cat { font-size: 11px; color: #3b82f6; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.bs-related-card__title { font-size: 14px; font-weight: 600; color: #e6edf3; line-height: 1.4; margin-bottom: 6px; }
.bs-related-card__meta { font-size: 12px; color: #8b949e; }

/* ===== SIDEBAR ===== */
.bs-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* TOC */
.bs-toc {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
}
.bs-toc__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b949e;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bs-toc__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bs-toc__item a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: #8b949e;
    line-height: 1.4;
    text-decoration: none;
    transition: background .15s, color .15s;
    border-left: 2px solid transparent;
}
.bs-toc__item a:hover { background: #21262d; color: #e6edf3; text-decoration: none; }
.bs-toc__item--active a { background: rgba(37,99,235,.1); color: #3b82f6; border-left-color: #2563eb; }
.bs-toc__item--h3 a { padding-left: 22px; font-size: 12px; }
.bs-toc__progress {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #30363d;
    display: flex;
    align-items: center;
    gap: 10px;
}
.bs-toc__progress-bar { flex: 1; height: 3px; background: #21262d; border-radius: 2px; overflow: hidden; }
.bs-toc__progress-fill { height: 100%; background: #2563eb; border-radius: 2px; width: 0%; transition: width .3s; }
.bs-toc__progress-pct { font-size: 11px; color: #8b949e; white-space: nowrap; }

/* CTA card */
.bs-cta-card {
    background: linear-gradient(135deg, rgba(37,99,235,.15) 0%, rgba(37,99,235,.05) 100%);
    border: 1px solid rgba(37,99,235,.25);
    border-radius: 12px;
    padding: 22px;
}
.bs-cta-card__title { font-size: 15px; font-weight: 700; color: #e6edf3; margin-bottom: 8px; }
.bs-cta-card__text { font-size: 13px; color: #8b949e; margin-bottom: 18px; line-height: 1.6; }
.bs-cta-card__btn {
    display: block;
    width: 100%;
    padding: 11px;
    background: #2563eb;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: background .2s;
    text-decoration: none;
}
.bs-cta-card__btn:hover { background: #1d4ed8; text-decoration: none; color: #fff; }
.bs-cta-card__sub { font-size: 11px; color: #8b949e; text-align: center; margin-top: 8px; }

/* ===== ARTICLE CTA ===== */
.bs-article-cta {
    margin: 48px 0 36px;
    padding: 28px 32px;
    background: linear-gradient(135deg, rgba(37,99,235,.12) 0%, rgba(37,99,235,.04) 100%);
    border: 1px solid rgba(37,99,235,.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.bs-article-cta__text { flex: 1; min-width: 220px; }
.bs-article-cta__text h3 {
    font-size: 18px;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 6px;
}
.bs-article-cta__text p {
    font-size: 14px;
    color: #8b949e;
    margin: 0;
    line-height: 1.6;
}
.bs-article-cta__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ===== SHARE ===== */
.bs-share__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .2s, border-color .2s, color .2s;
}
.bs-share__btn--tg {
    background: rgba(40,168,234,.12);
    border-color: rgba(40,168,234,.25);
    color: #29a8ea;
}
.bs-share__btn--tg:hover { background: rgba(40,168,234,.22); color: #29a8ea; text-decoration: none; }
.bs-share__btn--vk {
    background: rgba(0,119,255,.12);
    border-color: rgba(0,119,255,.25);
    color: #4a76a8;
}
.bs-share__btn--vk:hover { background: rgba(0,119,255,.22); color: #4a76a8; text-decoration: none; }
.bs-share__btn--copy {
    background: #21262d;
    border-color: #30363d;
    color: #8b949e;
}
.bs-share__btn--copy:hover { border-color: #2563eb; color: #3b82f6; }

/* ===== RELATED SECTION ===== */
.bs-related-section {
    background: #0d1117;
    border-top: 1px solid #21262d;
    padding: 56px 0 72px;
}
.bs-related__title {
    font-size: 22px;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 28px;
}
.bs-related__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .bs-layout { grid-template-columns: 1fr; padding: 40px 20px; }
    .bs-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .bs-toc { flex: 1; min-width: 280px; }
    .bs-hero__title { font-size: 28px; }
    .bs-spec-grid { grid-template-columns: repeat(2, 1fr); }
    .bs-breadcrumb { padding: 10px 20px; }
    .bs-related__grid { grid-template-columns: repeat(2, 1fr); }
    .bs-article-cta { padding: 22px 24px; gap: 20px; }
}
@media (max-width: 640px) {
    .bs-hero__title { font-size: 22px; }
    .bs-spec-grid { grid-template-columns: 1fr; }
    .bs-related__grid { grid-template-columns: 1fr; }
    .bs-sidebar { flex-direction: column; }
    .bs-article-cta { flex-direction: column; align-items: flex-start; gap: 16px; }
    .bs-share { flex-wrap: wrap; gap: 8px; }
}
