/* ============================================================
   media.css — стили для /media/ и /glossary/
   Наследует CSS-переменные из styles.css.
   НЕ смешивать со styles.css и webapp.css.
   ============================================================ */

/* ----------------------------------------------------------
   Общая обёртка страниц
---------------------------------------------------------- */
.media-page {
    padding: 100px 0 80px;
    min-height: 60vh;
}

.media-page .container {
    max-width: var(--container-max, 1120px);
    margin: 0 auto;
    padding: 0 24px;
}

/* ----------------------------------------------------------
   Заголовок хаба + поиск
---------------------------------------------------------- */
.media-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.media-header__title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text, #050A32);
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    max-width: 55%;
}

.media-search {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 0 0 260px;
    background: #F1F5F9;
    border-radius: var(--radius-sm, 8px);
    overflow: hidden;
    border: 1.5px solid #E5E7EB;
    transition: border-color .2s;
}
.media-search:focus-within { border-color: var(--primary, #4EA0D2); }

.media-search__input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    font-size: 15px;
    color: var(--text, #050A32);
    outline: none;
    font-family: inherit;
}
.media-search__input::placeholder { color: #9CA3AF; }

.media-search__btn {
    background: none;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-secondary, #747986);
    display: flex;
    align-items: center;
}
.media-search__btn:hover { color: var(--primary, #4EA0D2); }

.media-search-result {
    color: var(--text-secondary, #747986);
    font-size: 14px;
    margin: -12px 0 20px;
}

/* ----------------------------------------------------------
   Фильтры категорий
---------------------------------------------------------- */
.media-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.media-filter {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #747986);
    background: #F1F5F9;
    border: 1.5px solid transparent;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.media-filter:hover {
    background: #EFF6FF;
    color: var(--primary, #4EA0D2);
}
.media-filter--active {
    background: var(--primary, #4EA0D2);
    color: #fff;
    border-color: var(--primary, #4EA0D2);
}

.media-filters--letters .media-filter {
    padding: 6px 12px;
    min-width: 36px;
    text-align: center;
}

/* ----------------------------------------------------------
   Фильтры по тегам на хабе
----------------------------------------------------------- */
.media-tag-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: -16px;
    margin-bottom: 28px;
    padding-top: 16px;
    border-top: 1px solid #eaecef;
}
.media-tag-filter {
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
    color: var(--text-secondary, #747986);
    background: #F1F5F9;
    border-radius: 4px;
    padding: 3px 10px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.media-tag-filter:hover {
    background: #e2e8f0;
    color: var(--primary);
    text-decoration: none;
}
.media-tag-filter--active {
    background: #e2e8f0;
    color: var(--primary);
    font-weight: 600;
}
.media-collapse-btn {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    background: none;
    border: none;
    padding: 6px 4px;
    min-height: 36px;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0.8;
    vertical-align: middle;
}
.media-collapse-btn:hover { opacity: 1; text-decoration: underline; }

/* ----------------------------------------------------------
   Теги категорий на карточках
---------------------------------------------------------- */
.media-tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    white-space: nowrap;
    background: #EFF6FF;
    color: var(--primary, #4EA0D2);
}
/* Цвета по категориям */
.media-tag--audit        { background: #EFF6FF; color: #4EA0D2; }  /* blue    */
.media-tag--seo-errors   { background: #FEF2F2; color: #DC2626; }  /* red     */
.media-tag--technical    { background: #F0FDF4; color: #16A34A; }  /* green   */
.media-tag--speed        { background: #FFF7ED; color: #EA580C; }  /* orange  */
.media-tag--indexing     { background: #F5F3FF; color: #7C3AED; }  /* purple  */
.media-tag--onpage       { background: #EEF2FF; color: #4338CA; }  /* indigo  */
.media-tag--ux           { background: #FDF4FF; color: #A21CAF; }  /* pink    */
.media-tag--content      { background: #F0FDFA; color: #0D9488; }  /* teal    */
.media-tag--tools        { background: #FFFBEB; color: #B45309; }  /* amber   */
.media-tag--cms          { background: #E0F2FE; color: #0284C7; }
.media-tag--analytics    { background: #ECFEFF; color: #0891B2; }  /* cyan    */
.media-tag--advertising  { background: #FFF1F2; color: #BE123C; }  /* crimson */

/* ----------------------------------------------------------
   Hero-блок
---------------------------------------------------------- */
.media-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: var(--radius, 12px);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04));
    margin-bottom: 40px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s;
}
.media-hero:hover { box-shadow: var(--shadow-card-hover, 0 2px 8px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06)); }

.media-hero__image {
    aspect-ratio: 3/2;
    overflow: hidden;
}
.media-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.media-hero:hover .media-hero__image img { transform: scale(1.03); }

.media-hero__body {
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.media-hero__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text, #050A32);
    margin: 0;
    line-height: 1.35;
}

.media-hero__desc {
    font-size: 15px;
    color: var(--text-secondary, #747986);
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-hero__meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #9CA3AF;
}

/* ----------------------------------------------------------
   Сетка карточек
---------------------------------------------------------- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

/* Base: каждая карточка занимает 2 колонки (3 в ряд на десктопе) */
.media-card { grid-column: span 2; }

/* ---- Паттерн 3-3-2 и orphan-логика — только десктоп ---- */
@media (min-width: 901px) {

    /* Каждый 3-й ряд (позиции 7,8 в цикле из 8): 2 широкие карточки */
    .media-card:nth-child(8n+7),
    .media-card:nth-child(8n)   { grid-column: span 3; }

    /* Orphan: 2 карточки одни в 3-ряду (total mod8=2 или mod8=5) → по span 3 */
    .media-grid:has(.media-card:nth-child(8n+2):last-child) .media-card:nth-last-child(-n+2),
    .media-grid:has(.media-card:nth-child(8n+5):last-child) .media-card:nth-last-child(-n+2) {
        grid-column: span 3;
    }

    /* Orphan: 1 карточка одна → hero полная ширина
       - mod8=1 или mod8=4: одна в 3-ряду (span 2, нужно span 6)
       - mod8=7: одна в 2-ряду (уже span 3 от nth-child, нужно span 6)  */
    .media-grid:has(.media-card:nth-child(8n+1):last-child):not(:has(.media-card:only-child)) .media-card:last-child,
    .media-grid:has(.media-card:nth-child(8n+4):last-child):not(:has(.media-card:only-child)) .media-card:last-child,
    .media-grid:has(.media-card:nth-child(8n+7):last-child):not(:has(.media-card:only-child)) .media-card:last-child {
        grid-column: span 6;
        flex-direction: row;
    }
    .media-grid:has(.media-card:nth-child(8n+1):last-child):not(:has(.media-card:only-child)) .media-card:last-child .media-card__image,
    .media-grid:has(.media-card:nth-child(8n+4):last-child):not(:has(.media-card:only-child)) .media-card:last-child .media-card__image,
    .media-grid:has(.media-card:nth-child(8n+7):last-child):not(:has(.media-card:only-child)) .media-card:last-child .media-card__image {
        width: 50%;
        flex-shrink: 0;
        aspect-ratio: unset;
    }
    .media-grid:has(.media-card:nth-child(8n+1):last-child):not(:has(.media-card:only-child)) .media-card:last-child .media-card__body,
    .media-grid:has(.media-card:nth-child(8n+4):last-child):not(:has(.media-card:only-child)) .media-card:last-child .media-card__body,
    .media-grid:has(.media-card:nth-child(8n+7):last-child):not(:has(.media-card:only-child)) .media-card:last-child .media-card__body {
        padding: 36px 40px;
        justify-content: center;
    }

}

.media-card {
    background: #fff;
    border-radius: var(--radius, 12px);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,.08));
    transition: box-shadow .2s, transform .15s;
}
.media-card:hover {
    box-shadow: var(--shadow-card-hover, 0 2px 8px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06));
    transform: translateY(-2px);
}

.media-card__image {
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #F1F5F9;
}
.media-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.media-card:hover .media-card__image img { transform: scale(1.04); }
.media-card__image--placeholder { background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); }

.media-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.media-card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text, #050A32);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-card__desc {
    font-size: 14px;
    color: var(--text-secondary, #747986);
    margin: 0;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.media-card__meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #9CA3AF;
    margin-top: auto;
}

.media-empty {
    text-align: center;
    padding: 60px 0;
    color: var(--text-secondary, #747986);
}

/* ── Load More ─────────────────────────────────────────────────────────── */
.media-loadmore {
    display: flex;
    justify-content: center;
    margin: 40px 0 8px;
}
.media-loadmore__btn {
    padding: 12px 40px;
    background: #fff;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.media-loadmore__btn:hover:not(:disabled) {
    border-color: var(--primary, #4EA0D2);
    color: var(--primary, #4EA0D2);
    background: #F0F9FF;
}
.media-loadmore__btn:disabled {
    opacity: .55;
    cursor: default;
}

/* ----------------------------------------------------------
   CTA-блок (_cta_audit.html)
---------------------------------------------------------- */
.cta-audit {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-radius: var(--radius, 12px);
    padding: 32px 40px;
    margin: 48px 0 0;
}

.cta-audit__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cta-audit__icon { flex-shrink: 0; }

.cta-audit__text {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cta-audit__text strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--text, #050A32);
}
.cta-audit__text span {
    font-size: 14px;
    color: var(--text-secondary, #747986);
}

.cta-audit__btn {
    display: inline-block;
    padding: 13px 28px;
    background: var(--primary, #4EA0D2);
    color: #fff;
    border-radius: var(--radius-sm, 8px);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, transform .1s;
    box-shadow: var(--shadow-btn, 0 2px 8px rgba(78,160,210,.25));
}
/* Двойной класс — перебивает и a:hover, и .post-content a при любом контексте */
.cta-audit .cta-audit__btn,
.cta-audit .cta-audit__btn:hover,
.cta-audit .cta-audit__btn:visited,
.cta-audit .cta-audit__btn:active {
    color: #fff;
    text-decoration: none;
}
.cta-audit .cta-audit__btn:hover {
    background: var(--primary-hover, #4B95C3);
    transform: translateY(-1px);
}

/* Серединный CTA — компактнее, вписывается в поток статьи */
.cta-audit--inline {
    margin: 40px 0;
    padding: 24px 32px;
}
.cta-audit--inline .cta-audit__text strong { font-size: 16px; }

/* ----------------------------------------------------------
   Страница статьи — layout
---------------------------------------------------------- */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 48px;
    align-items: start;
    margin-top: 24px;
}

.media-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary, #747986);
    margin-bottom: 24px;
    min-width: 0;
}
.media-breadcrumb a {
    color: var(--primary, #4EA0D2);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.media-breadcrumb a:hover { text-decoration: underline; }
.media-breadcrumb > span {
    flex-shrink: 0;
    white-space: nowrap;
}
.media-breadcrumb > span:last-child {
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Статья */
.post-article { min-width: 0; }

.post-title {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text, #050A32);
    margin: 12px 0 20px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #9CA3AF;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.post-meta__author a {
    color: var(--primary, #4EA0D2);
    text-decoration: none;
    font-weight: 500;
}
.post-meta__author a:hover { text-decoration: underline; }

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}
.post-tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary, #747986);
    background: #F1F5F9;
    border-radius: 4px;
    padding: 3px 10px;
    text-decoration: none;
    transition: background 0.15s;
}
.post-tag:hover {
    background: #e2e8f0;
    color: var(--primary, #4EA0D2);
    text-decoration: none;
}

.post-share {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.post-share__label { font-size: 13px; color: #9CA3AF; }
.post-share__btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: #F1F5F9;
    color: var(--text-secondary, #747986);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.post-share__btn:hover { background: #EFF6FF; color: var(--primary, #4EA0D2); }

/* Обложка */
.post-cover {
    border-radius: var(--radius, 12px);
    overflow: hidden;
    margin-bottom: 36px;
    aspect-ratio: 3/2;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* E-E-A-T блок доверия */
.post-trust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.post-trust__verified {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #0369A1;
}
.post-trust__verified svg { flex-shrink: 0; }
.post-trust__dates {
    font-size: 12px;
    color: #64748B;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.post-trust__dates span { white-space: nowrap; }

/* Контент статьи */
.post-content {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text, #050A32);
    margin-bottom: 40px;
}
.post-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 40px 0 16px;
    color: var(--text, #050A32);
    line-height: 1.3;
    scroll-margin-top: 84px;
    position: relative;
}
.heading-anchor {
    position: absolute;
    left: -1.4em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 400;
    color: #9CA3AF;
    text-decoration: none;
    opacity: 0;
    transition: opacity .15s;
    padding: 0 .3em;
    user-select: none;
}
.post-content h2:hover .heading-anchor { opacity: 1; }
.post-content h3 {
    font-size: 19px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--text, #050A32);
}
.post-content p { margin: 0 0 18px; }

/* ── FAQ аккордеон ── */
.post-faq {
    margin: 4px 0 32px;
    border: 1.5px solid #E5E7EB;
    border-radius: var(--radius, 12px);
    overflow: hidden;
}
.faq-item { border-bottom: 1px solid #E5E7EB; }
.faq-item:last-child { border-bottom: none; }
.faq-q {
    width: 100%;
    background: none;
    border: none;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--text, #050A32);
    text-align: left;
    line-height: 1.45;
    transition: background .15s, color .15s;
}
.faq-q:hover { background: #F8FAFC; }
.faq-q[aria-expanded="true"] {
    color: var(--primary, #4EA0D2);
    background: #F0F9FF;
}
.faq-chevron {
    flex-shrink: 0;
    color: #9CA3AF;
    transition: transform .25s, color .15s;
}
.faq-q[aria-expanded="true"] .faq-chevron {
    transform: rotate(180deg);
    color: var(--primary, #4EA0D2);
}
.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
    padding: 0 20px;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-secondary, #747986);
}
.faq-a--open {
    max-height: 800px;
    padding: 2px 20px 18px;
}
.faq-a p { margin: 0 0 10px; }
.faq-a p:last-child { margin-bottom: 0; }

/* ── Unordered list: цветная точка ── */
.post-content ul {
    list-style: none;
    margin: 0 0 20px;
    padding-left: 0;
}
.post-content ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    line-height: 1.7;
}
.post-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .6em;
    width: 7px;
    height: 7px;
    background: var(--primary, #4EA0D2);
    border-radius: 50%;
}

/* ── Ordered list: синий кружок с цифрой ── */
.post-content ol {
    list-style: none;
    margin: 0 0 20px;
    padding-left: 0;
    counter-reset: post-ol;
}
.post-content ol li {
    position: relative;
    padding-left: 36px;
    margin-bottom: 12px;
    line-height: 1.7;
    counter-increment: post-ol;
}
.post-content ol li::before {
    content: counter(post-ol);
    position: absolute;
    left: 0;
    top: 3px;
    width: 22px;
    height: 22px;
    background: var(--primary, #4EA0D2);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

/* ── Вложенные списки ── */
.post-content ul ul,
.post-content ol ul {
    margin: 8px 0 4px;
}
.post-content ul ul li::before {
    width: 5px;
    height: 5px;
    background: transparent;
    border: 1.5px solid var(--primary, #4EA0D2);
    top: .65em;
}
.post-content ol ol {
    counter-reset: post-ol-nested;
    margin: 8px 0 4px;
}
.post-content ol ol li {
    counter-increment: post-ol-nested;
}
.post-content ol ol li::before {
    content: counter(post-ol-nested);
    background: #EFF6FF;
    color: var(--primary, #4EA0D2);
    font-size: 11px;
}
.post-content a { color: var(--primary, #4EA0D2); }
.post-content a:hover { text-decoration: none; }
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm, 8px);
    margin: 24px 0;
    display: block;
}
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}
.post-content th, .post-content td {
    text-align: left;
    padding: 10px 14px;
    border: 1px solid #E5E7EB;
}
.post-content th { background: #F8FAFC; font-weight: 600; }
.post-content blockquote {
    border-left: 3px solid var(--primary, #4EA0D2);
    padding: 12px 20px;
    background: #F8FAFC;
    margin: 24px 0;
    border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
    color: var(--text-secondary, #747986);
}
.post-content code {
    background: #F1F5F9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-family: monospace;
}
.post-content pre {
    background: #F1F5F9;
    padding: 16px 20px;
    border-radius: var(--radius-sm, 8px);
    overflow-x: auto;
    margin: 24px 0;
}
.post-content pre code { background: none; padding: 0; }

/* Экспертный блок — совет редакции Analito */
.expert-tip {
    background: #FFFBEB;
    border-left: 4px solid #F59E0B;
    border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
    padding: 18px 24px;
    margin: 28px 0;
}
.expert-tip strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #B45309;
    margin-bottom: 8px;
}
.expert-tip p {
    margin: 0;
    font-size: 16px;
    color: var(--text, #050A32);
    line-height: 1.65;
}

/* Блок «Реальный кейс» */
.case-block {
    background: #ECFDF5;
    border-left: 4px solid #10B981;
    border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
    padding: 18px 24px;
    margin: 28px 0;
}
.case-block strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #065F46;
    margin-bottom: 8px;
}
.case-block p {
    margin: 0;
    font-size: 16px;
    color: var(--text, #050A32);
    line-height: 1.65;
}

/* CTA blocks inside articles */
.post-cta {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 16px 20px;
    border-radius: 0 6px 6px 0;
    margin: 28px 0;
}
.post-cta p {
    margin: 0;
    line-height: 1.5;
}
.post-cta a {
    color: #0ea5e9;
    font-weight: 600;
}
.post-cta a:hover {
    text-decoration: underline;
}

/* Инлайн-изображения статьи */
.post-inline-img {
    border-radius: var(--radius, 12px);
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* Лайк */
.post-like {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}
.post-like__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 1.5px solid #E5E7EB;
    border-radius: 24px;
    background: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary, #747986);
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.post-like__btn:hover { border-color: var(--primary, #4EA0D2); color: var(--primary, #4EA0D2); }
.post-like__btn--active { border-color: #DC2626; color: #DC2626; }

/* ----------------------------------------------------------
   Sidebar — оглавление
---------------------------------------------------------- */
.post-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.post-toc {
    background: #F8FAFC;
    border-radius: var(--radius, 12px);
    padding: 20px;
}
.post-toc--desktop {
    overflow-y: auto;
    flex-shrink: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #E5E7EB transparent;
}
.post-toc--desktop::-webkit-scrollbar { width: 4px; }
.post-toc--desktop::-webkit-scrollbar-track { background: transparent; }
.post-toc--desktop::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 2px; }
.post-toc__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary, #747986);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 12px;
}
.post-toc__link {
    display: block;
    font-size: 14px;
    color: var(--text-secondary, #747986);
    text-decoration: none;
    padding: 5px 0 5px 10px;
    border-bottom: 1px solid #E5E7EB;
    border-left: 3px solid transparent;
    line-height: 1.4;
    transition: color .15s, border-color .15s;
    margin-left: -3px;
}
.post-toc__link:last-child { border-bottom: none; }
.post-toc__link:hover { color: var(--primary, #4EA0D2); }
.post-toc__link--active {
    color: var(--primary, #4EA0D2);
    font-weight: 600;
    border-left-color: var(--primary, #4EA0D2);
}

.post-toc--mobile {
    display: none;
    margin-bottom: 28px;
    padding: 0;
    background: none;
}
.post-toc__details {
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: var(--radius, 12px);
    overflow: hidden;
}
.post-toc__details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    padding: 14px 16px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text, #050A32);
    user-select: none;
}
.post-toc__details summary::-webkit-details-marker { display: none; }
.post-toc__details summary::after {
    content: '';
    display: inline-block;
    width: 18px; height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239CA3AF'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform .2s;
    flex-shrink: 0;
}
.post-toc__details[open] summary::after {
    transform: rotate(180deg);
}
.post-toc__details[open] summary {
    border-bottom: 1px solid #E5E7EB;
}
.post-toc__details .post-toc__title { display: none; }
.post-toc__details #tocMobileInner {
    padding: 8px 0 4px;
}
.post-toc__details .post-toc__link {
    padding: 10px 16px;
    border-bottom: 1px solid #F3F4F6;
    border-left: none;
    margin-left: 0;
    font-size: 14px;
}
.post-toc__details .post-toc__link:last-child { border-bottom: none; }

/* Похожие статьи */
.post-related { margin-top: 60px; }
.post-related__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text, #050A32);
}

/* ----------------------------------------------------------
   Блок подписки на соцсети
---------------------------------------------------------- */
.post-follow {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 28px 0;
    flex-wrap: wrap;
}
.post-follow__text {
    flex: 1;
    min-width: 160px;
    font-size: 14px;
    color: #0C4A6E;
    font-weight: 500;
    line-height: 1.4;
}
.post-follow__text span {
    display: block;
    font-size: 12px;
    color: #0369A1;
    font-weight: 400;
    margin-top: 2px;
}
.post-follow__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.post-follow__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s;
}
.post-follow__btn:hover { opacity: .85; }
.post-follow__btn--tg { background: #4EA0D3; color: #fff; }
.post-follow__btn--vk { background: #0077FF; color: #fff; }

/* Компактный блок подписки в сайдбаре */
.sidebar-follow {
    margin-top: 20px;
    padding: 8px 20px;
}
.sidebar-follow__title {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}
.sidebar-follow__btns { display: flex; flex-direction: column; gap: 6px; }
.sidebar-follow__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 7px;
    text-decoration: none;
    transition: opacity .15s;
}
.sidebar-follow__btn:hover { opacity: .85; color: #fff; }
.sidebar-follow__btn--tg { background: #4EA0D3; color: #fff; }
.sidebar-follow__btn--vk { background: #0077FF; color: #fff; }

/* Перелинковка между Медиа и Новостями */
.media-crosslink {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-card, 0 1px 3px rgba(0, 0, 0, .08));
    transition: box-shadow .2s, transform .15s;
}
.media-crosslink:hover {
    box-shadow: var(--shadow-card-hover, 0 2px 8px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06));
    transform: translateY(-1px);
}
.media-crosslink__icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}
.media-crosslink__body { flex: 1; min-width: 0; }
.media-crosslink__label {
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.media-crosslink__title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-top: 2px;
}
.media-crosslink__arrow {
    color: var(--primary, #4EA0D2);
    font-size: 18px;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   Страница автора
---------------------------------------------------------- */
.author-card {
    display: flex;
    gap: 32px;
    background: #fff;
    border-radius: var(--radius, 12px);
    padding: 40px;
    box-shadow: var(--shadow-card);
    margin-bottom: 48px;
    align-items: flex-start;
}
.author-card__avatar { flex-shrink: 0; }
.author-card__name {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text, #050A32);
}
.author-card__bio {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary, #747986);
    margin: 0 0 16px;
}
.author-card__stats {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: #9CA3AF;
    flex-wrap: wrap;
}
.author-card__stats strong { color: var(--text, #050A32); }

/* Хаб авторов /authors/ */
.authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin: 32px 0 48px;
}
.author-hub-card {
    display: flex;
    gap: 20px;
    padding: 28px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s, border-color 0.18s;
}
.author-hub-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-color: #93c5fd;
}
.author-hub-card__avatar { flex-shrink: 0; }
.author-hub-card__name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text, #050A32);
}
.author-hub-card__bio {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 12px;
}
.author-hub-card__posts {
    font-size: 13px;
    font-weight: 600;
    color: #4EA0D2;
}

.author-posts-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text, #050A32);
}

/* ----------------------------------------------------------
   Словарик
---------------------------------------------------------- */
.glossary-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 48px;
}
.glossary-item {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 14px 20px;
    border-radius: var(--radius-sm, 8px);
    text-decoration: none;
    transition: background .15s;
}
.glossary-item:hover { background: #F8FAFC; }
.glossary-item__term {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary, #4EA0D2);
    min-width: 200px;
    flex-shrink: 0;
}
.glossary-item__desc {
    font-size: 14px;
    color: var(--text-secondary, #747986);
    line-height: 1.5;
}
.glossary-sidebar-nav .post-toc__title { margin-bottom: 12px; }

.glossary-related-terms {
    margin: 32px 0;
    padding: 20px 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.glossary-related-terms__title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px;
}
.glossary-related-terms__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.glossary-related-terms__item {
    display: inline-block;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 14px;
    color: #1e40af;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.glossary-related-terms__item:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.glossary-related-post {
    background: #F8FAFC;
    border-radius: var(--radius, 12px);
    padding: 20px;
    margin: 32px 0;
}
.glossary-related-post__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary, #747986);
    margin: 0 0 12px;
}
.glossary-related-post__link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text, #050A32);
    font-weight: 500;
    font-size: 15px;
}
.glossary-related-post__link img {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}
.glossary-related-post__link:hover { color: var(--primary, #4EA0D2); }

/* ----------------------------------------------------------
   Адаптив
---------------------------------------------------------- */
@media (max-width: 900px) {
    .media-hero { grid-template-columns: 1fr; }
    .media-hero__body { padding: 24px; }

    .media-grid { grid-template-columns: repeat(2, 1fr); }

    .post-layout { grid-template-columns: 1fr; }
    .post-sidebar { display: none; }
    .post-toc--mobile { display: block; }
    .post-title { font-size: 26px; }
}

@media (max-width: 600px) {
    .media-tag-filters { margin-top: -12px; padding-top: 12px; gap: 8px; }
    .media-header { flex-direction: column; align-items: flex-start; }
    .media-header__title { max-width: 100%; font-size: 26px; }
    .media-search { flex: none; width: 100%; }
    .media-grid { grid-template-columns: 1fr; }
    .media-card { grid-column: span 1; }
    .media-hero__body { padding: 20px; }
    .media-hero__title { font-size: 20px; }

    .post-title { font-size: 22px; }
    .post-content { font-size: 16px; }
    .cta-audit { padding: 24px 20px; }
    .cta-audit__btn { width: 100%; text-align: center; }

    .author-card { flex-direction: column; padding: 24px; }
    .glossary-item { flex-direction: column; gap: 4px; }
    .glossary-item__term { min-width: auto; }
}
