/* ============================================================
   BLOG DETAIL / NEWS ARTICLE — тёмная тема MPS ADS
   ============================================================ */
:root {
    --a-p:        #58a7ff;
    --a-pd:       #3d86ff;
    --a-grad:     linear-gradient(135deg, #3d86ff, #7a5cff);

    --a-bg:       #0a0e1a;
    --a-surface:  #111726;
    --a-alt:      #161d30;
    --a-code-bg:  #060a14;

    --a-t9:       #eef2fb;
    --a-t7:       #c4cce0;
    --a-t5:       #8a93ac;
    --a-t3:       #5a6378;

    --a-bdr:      rgba(125, 150, 210, .14);
    --a-sh1:      0 1px 3px rgba(0,0,0,.4);
    --a-sh2:      0 8px 24px rgba(0,0,0,.45);
    --a-sh3:      0 18px 48px rgba(0,0,0,.55);

    --a-warn:     #f5a623;
    --a-ok:       #34d399;

    --a-r8: 8px; --a-r12: 12px; --a-r16: 16px;
    --a-r20: 20px; --a-r24: 24px; --a-rfull: 9999px;
    --a-tr: .25s ease;
}

/* ---------- HERO ---------- */
.article-hero {
    padding: 120px 0 32px;
    background: var(--a-bg);
    position: relative;
    overflow: hidden;
}
.article-hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 60% 80% at 90% 20%, rgba(88,167,255,.10) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 10% 80%, rgba(122,92,255,.08) 0%, transparent 60%);
}
.article-hero-inner {
    position: relative; z-index: 1;
    max-width: 1000px; margin: 0 auto; min-width: 0;
    padding: 0 24px; box-sizing: border-box;
    text-align: left;
}
.article-hero-inner .breadcrumbs,
.article-hero-inner .article-h1,
.article-hero-inner .article-lead,
.article-hero-inner .article-author,
.article-hero-inner .article-meta-bar {
    text-align: left;
    justify-content: flex-start;
}

/* ---------- BREADCRUMBS ---------- */
.breadcrumbs {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: .8125rem; color: var(--a-t5); margin-bottom: 22px; min-width: 0;
}
.breadcrumbs a { color: var(--a-t5); transition: color var(--a-tr); }
.breadcrumbs a:hover { color: var(--a-p); }
.breadcrumbs .sep { color: var(--a-t3); }
.breadcrumbs .current {
    color: var(--a-t9); font-weight: 600;
    overflow-wrap: anywhere; word-break: break-word;
}

/* ---------- TITLE / LEAD ---------- */
.article-h1 {
    font-size: clamp(1.9rem, 4vw, 2.85rem);
    font-weight: 900; color: var(--a-t9);
    letter-spacing: -.035em; line-height: 1.15; margin-bottom: 22px;
    overflow-wrap: anywhere; word-break: break-word;
}
.article-lead {
    font-size: 1.1875rem; color: var(--a-t5); line-height: 1.65;
    margin-bottom: 24px; overflow-wrap: anywhere;
}

/* ---------- AUTHOR ---------- */
.article-author { display: flex; align-items: center; gap: 14px; margin: 0 0 24px; }
.author-ava {
    width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--a-grad); color: #fff; font-weight: 700; font-size: .95rem;
}
.author-ava img { width: 100%; height: 100%; object-fit: cover; }
.author-info { display: flex; flex-direction: column; line-height: 1.3; }
.author-info b { color: var(--a-t9); font-size: .95rem; }
.author-info span { color: var(--a-t5); font-size: .8rem; }

/* ---------- META BAR (категория · дата · чтение · просмотры · шеринг) ---------- */
.article-meta-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 18px 0; margin-top: 4px;
    border-top: 1px solid var(--a-bdr); border-bottom: 1px solid var(--a-bdr);
}
.article-meta-bar .ntag {
    font-size: .72rem; font-weight: 700; padding: 4px 12px;
    border-radius: var(--a-rfull); text-transform: uppercase; letter-spacing: .04em;
    line-height: 1;
}
.meta-stat {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: .85rem; color: var(--a-t5);
}
.meta-stat i { color: var(--a-p); }
.meta-dot { color: var(--a-t3); font-weight: 700; }
.meta-share { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--a-alt); border: 1px solid var(--a-bdr); color: var(--a-t7);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; cursor: pointer; transition: all var(--a-tr);
    text-decoration: none; flex-shrink: 0;
}
.share-btn:hover { background: var(--a-p); color: #fff; border-color: var(--a-p); transform: translateY(-2px); }

/* ---------- COVER ---------- */
.article-cover {
    max-width: 1100px; margin: 32px auto 0; padding: 0 24px; box-sizing: border-box;
}
.article-cover-inner {
    height: clamp(260px, 42vw, 460px);
    border-radius: var(--a-r24); overflow: hidden;
    position: relative; box-shadow: var(--a-sh3);
}
.article-cover-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- ARTICLE BODY + TOC ---------- */
.article-wrap { padding: 48px 0 88px; background: var(--a-bg); }
.article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 56px; align-items: start;
    max-width: 1120px; margin: 0 auto; padding: 0 24px; box-sizing: border-box;
}
.article-body { min-width: 0; max-width: 100%; font-size: 1.0625rem; color: var(--a-t7); line-height: 1.8; }
.article-body > * + * { margin-top: 22px; }

.article-toc { position: sticky; top: 100px; min-width: 0; }
.article-toc.is-empty { display: none; }
.toc-inner { border-left: 2px solid var(--a-bdr); padding-left: 20px; }
.toc-title {
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--a-t5); margin-bottom: 16px;
}
.toc-list { display: flex; flex-direction: column; gap: 4px; }
.toc-list a {
    font-size: .875rem; line-height: 1.45; color: var(--a-t5);
    padding: 6px 0; transition: color var(--a-tr); border: none; overflow-wrap: anywhere;
}
.toc-list a.toc-h3 { padding-left: 14px; font-size: .8125rem; }
.toc-list a:hover { color: var(--a-t7); }
.toc-list a.is-active { color: var(--a-p); font-weight: 600; }

.article-body h2 {
    font-size: 1.7rem; font-weight: 800; color: var(--a-t9);
    letter-spacing: -.02em; line-height: 1.3;
    margin-top: 44px; margin-bottom: 14px; overflow-wrap: anywhere; scroll-margin-top: 90px;
}
.article-body h3 {
    font-size: 1.3rem; font-weight: 700; color: var(--a-t9);
    line-height: 1.4; margin-top: 32px; margin-bottom: 10px; overflow-wrap: anywhere; scroll-margin-top: 90px;
}
.article-body p { color: var(--a-t7); }
.article-body a {
    color: var(--a-p); font-weight: 600;
    border-bottom: 1px solid rgba(88,167,255,.35); transition: all var(--a-tr); word-break: break-word;
}
.article-body a:hover { color: var(--a-pd); border-bottom-color: var(--a-pd); }
.article-body ul, .article-body ol { padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body li::marker { color: var(--a-p); }
.article-body img {
    max-width: 100%; height: auto; display: block;
    border-radius: var(--a-r16); margin: 12px 0; box-shadow: var(--a-sh2);
}
.article-body blockquote {
    border-left: 4px solid var(--a-p);
    background: linear-gradient(135deg, rgba(88,167,255,.07), rgba(122,92,255,.07));
    padding: 20px 24px; border-radius: 0 var(--a-r16) var(--a-r16) 0;
    font-size: 1.0625rem; color: var(--a-t9); font-style: italic; margin: 24px 0;
}
.article-body blockquote p { color: var(--a-t9); margin: 0; }
.article-body code {
    background: var(--a-alt); border: 1px solid var(--a-bdr);
    padding: 2px 7px; border-radius: 6px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: .9em; color: var(--a-p); word-break: break-word;
}
.article-body pre {
    background: var(--a-code-bg); color: #e2e8f0;
    padding: 18px 22px; border-radius: var(--a-r12);
    overflow-x: auto; max-width: 100%; font-size: .875rem; line-height: 1.65; border: 1px solid var(--a-bdr);
}
.article-body pre code { background: none; border: none; color: inherit; padding: 0; word-break: normal; white-space: pre; }
.article-body hr { border: none; height: 1px; background: var(--a-bdr); margin: 36px 0; }

/* ---------- TABLES ---------- */
.article-body .table-wrap {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin: 28px 0; border: 1px solid var(--a-bdr); border-radius: var(--a-r16);
    padding: 4px; background: var(--a-surface); box-shadow: var(--a-sh1); position: relative;
}
.article-body table {
    width: 100%; min-width: 620px; border-collapse: collapse;
    border: 1px solid var(--a-bdr); border-radius: var(--a-r12); overflow: hidden; table-layout: auto;
}
.article-body thead { background: var(--a-alt); }
.article-body th, .article-body td {
    padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--a-bdr);
    font-size: .925rem; line-height: 1.45; vertical-align: top;
    word-break: break-word; hyphens: auto; color: var(--a-t7);
}
.article-body th { font-weight: 700; color: var(--a-t9); position: sticky; top: 0; z-index: 10; background: var(--a-alt); }
.article-body tr:last-child td { border-bottom: none; }
.article-body .table-wrap::after {
    content: '→ листайте'; position: absolute; bottom: 8px; right: 12px;
    font-size: .75rem; color: var(--a-t5);
    background: rgba(17,23,38,.95); padding: 3px 10px; border-radius: 9999px;
    box-shadow: 0 2px 6px rgba(0,0,0,.3); pointer-events: none; display: none;
}

/* ---------- CALLOUTS ---------- */
.callout {
    display: flex; gap: 14px; border-radius: var(--a-r16);
    padding: 18px 22px; border: 1px solid; margin: 24px 0; max-width: 100%;
}
.callout > div { min-width: 0; flex: 1; }
.callout i { font-size: 1.25rem; flex-shrink: 0; margin-top: 2px; }
.callout-info    { background: rgba(88,167,255,.08); border-color: rgba(88,167,255,.25); color: var(--a-t7); }
.callout-info    i { color: var(--a-p); }
.callout-warn    { background: rgba(245,166,35,.08); border-color: rgba(245,166,35,.25); color: var(--a-t7); }
.callout-warn    i { color: var(--a-warn); }
.callout-success { background: rgba(52,211,153,.08); border-color: rgba(52,211,153,.25); color: var(--a-t7); }
.callout-success i { color: var(--a-ok); }

/* ---------- TAGS ---------- */
.article-tags {
    margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--a-bdr);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.article-tags .tags-label {
    font-size: .8125rem; font-weight: 700; color: var(--a-t5);
    text-transform: uppercase; letter-spacing: .05em;
}
.post-tag {
    font-size: .8125rem; color: var(--a-p);
    background: rgba(88,167,255,.08); border: 1px solid rgba(88,167,255,.2);
    padding: 4px 12px; border-radius: var(--a-rfull); transition: all var(--a-tr);
}

/* ---------- CATEGORY TAG BADGE ---------- */
.ntag {
    font-size: .72rem; font-weight: 700; padding: 4px 11px;
    border-radius: var(--a-rfull); background: rgba(10,14,26,.7); color: #eef2fb;
}
.ntag-p   { color: #9fcaff; background: rgba(88,167,255,.12); }
.ntag-s   { color: #b7f5d4; background: rgba(52,211,153,.12); }
.ntag-w   { color: #ffd79a; background: rgba(245,166,35,.12); }
.ntag-sec { color: #c4cce0; background: rgba(125,150,210,.12); }

/* ---------- RELATED ---------- */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ncard-related {
    background: var(--a-surface); border: 1px solid var(--a-bdr); border-radius: var(--a-r16);
    overflow: hidden; display: flex; flex-direction: column;
    transition: all var(--a-tr); text-decoration: none; min-width: 0;
}
.ncard-related:hover { transform: translateY(-4px); box-shadow: var(--a-sh3); border-color: rgba(88,167,255,.3); }
.ncard-related-img { height: 140px; position: relative; display: flex; align-items: center; justify-content: center; }
.ncard-related-img img { width: 100%; height: 100%; object-fit: cover; }
.ncard-related-img .ntag { position: absolute; top: 12px; left: 12px; }
.ncard-ph { font-size: 2rem; color: rgba(255,255,255,.55); }
.ncard-related-img.ng1 { background: linear-gradient(135deg,#3d86ff,#7a5cff); }
.ncard-related-img.ng2 { background: linear-gradient(135deg,#7a5cff,#d65cff); }
.ncard-related-img.ng3 { background: linear-gradient(135deg,#00b8d4,#3d86ff); }
.ncard-related-img.ng4 { background: linear-gradient(135deg,#34d399,#00b8d4); }
.ncard-related-img.ng5 { background: linear-gradient(135deg,#f5a623,#ff6b6b); }
.ncard-related-img.ng6 { background: linear-gradient(135deg,#ff6b6b,#d65cff); }
.ncard-related-img.ng7 { background: linear-gradient(135deg,#5a6378,#111726); }
.ncard-related-img.ng8 { background: linear-gradient(135deg,#3d86ff,#00b8d4); }
.ncard-related-img.ng9 { background: linear-gradient(135deg,#7a5cff,#3d86ff); }
.ncard-related-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.ncard-related h3 {
    font-size: .9375rem; font-weight: 700; color: var(--a-t9); line-height: 1.45;
    overflow-wrap: anywhere; transition: color var(--a-tr);
}
.ncard-related:hover h3 { color: var(--a-p); }
.ncard-related-meta {
    margin-top: auto; padding-top: 6px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    font-size: .75rem; color: var(--a-t5);
}
.ncard-related-meta i { color: var(--a-p); }
.ncard-more { color: var(--a-p); font-weight: 600; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .article-grid { grid-template-columns: 1fr; gap: 0; max-width: 820px; }
    .article-toc { display: none; }
    .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .article-hero { padding: 100px 0 28px; }
    .article-h1 { font-size: 1.7rem; }
    .article-lead { font-size: 1rem; }
    .article-body { font-size: 1rem; }
    .article-body h2 { font-size: 1.4rem; }
    .article-body h3 { font-size: 1.15rem; }
    .article-body .table-wrap { margin: 24px -4px; border-radius: var(--a-r12); padding: 6px 4px; }
    .article-body table { min-width: 560px; font-size: .9rem; }
    .article-body th, .article-body td { padding: 11px 10px; font-size: .875rem; }
    .article-body .table-wrap::after { display: block; }
    .article-body pre { margin: 16px 0; border-radius: var(--a-r12); padding: 14px 16px; font-size: .8125rem; }
    .article-body img { margin: 16px 0; }
    .meta-share { margin-left: 0; width: 100%; margin-top: 8px; }
    .related-grid { grid-template-columns: 1fr; }
    .article-cover { padding: 0 16px; }
    .article-grid { padding: 0 16px; }
}
@media (max-width: 480px) {
    .callout { padding: 14px 16px; gap: 10px; }
    .article-body table { min-width: 520px; }
}
/* подсказка, что картинку можно увеличить */
.article-body img {
    cursor: zoom-in;
    transition: filter var(--a-tr);
}
.article-body img:hover {
    filter: brightness(1.04);
}

/* оверлей */
.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(5, 8, 16, .92);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.img-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.img-lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: var(--a-r16, 16px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    cursor: zoom-out;
    transform: scale(.96);
    transition: transform .25s ease;
}
.img-lightbox.is-open .img-lightbox-img {
    transform: scale(1);
}

.img-lightbox-close {
    position: absolute;
    top: 20px;
    right: 26px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--a-tr);
}
.img-lightbox-close:hover {
    background: rgba(255, 255, 255, .22);
}

@media (max-width: 768px) {
    .img-lightbox { padding: 16px; }
    .img-lightbox-close { top: 12px; right: 14px; }
}


