/* ==========================================================================
   ШАБЛОН СТАТЬИ — article-page.css
   Подключается только при is_page_template('page-article.php')
   ========================================================================== */

/* ==========================================================================
   CSS ПЕРЕМЕННЫЕ — мобильные шрифты (меняй здесь)
   ========================================================================== */
:root {
    /* Заголовок статьи */
    --art-title-size-mob:       22px;

    /* Вступительный блок */
    --art-meta-label-size-mob:  9px;
    --art-meta-value-size-mob:  12px;
    --art-anons-size-mob:       13px;

    /* Содержание */
    --art-toc-title-size-mob:   15px;
    --art-toc-item-size-mob:    13px;

    /* Текстовый блок */
    --art-content-size-mob:     15px;
    --art-h2-size-mob:          20px;
    --art-h3-size-mob:          17px;
    --art-h4-size-mob:          15px;

    /* FAQ */
    --art-faq-title-size-mob:   20px;
    --art-faq-q-size-mob:       14px;
    --art-faq-a-size-mob:       13px;

    /* Панель автора */
    --art-author-name-size-mob: 15px;
    --art-author-role-size-mob: 12px;
    --art-editorial-size-mob:   12px;
    --art-views-size-mob:       12px;
    --art-rating-size-mob:      11px;
    --art-stars-size-mob:       28px;
}


.article-page .container {
    max-width: 1400px !important;
}

@media (max-width: 1440px) {
    .article-page .container {
        max-width: 1400px !important;
    }
}

/* ── Хлебные крошки ──────────────────────────────────────────────────────── */
.article-breadcrumbs {
    padding-top: 20px;
    width: 100%;
}

.article-breadcrumbs .zb-breadcrumbs {
    flex-wrap: wrap !important;
    white-space: normal !important;
    overflow: visible !important;
    width: 100%;
}

.article-breadcrumbs .zb-breadcrumbs .zb-item,
.article-breadcrumbs .zb-breadcrumbs .zb-sep {
    white-space: nowrap;
}

.article-title {
    font-family: var(--font-body);
    font-size: 36px;
    font-weight: 700;
    color: var(--color-black);
    line-height: 1.25;
    margin: 16px 0 24px;
}

/* ── Начальный блок ─────────────────────────────────────────────────────── */
.article-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 40px;
    align-items: start;
}

/* Левая часть */
.article-intro__left { display: flex; flex-direction: column; gap: 0; }

.article-intro__photo img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

/* Мета-блок */
.article-intro__meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #1a1a1a;
    border-radius: 0;
}

.article-intro__meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-right: 1px solid #333;
    text-align: center;
    gap: 3px;
}
.article-intro__meta-item:last-child { border-right: none; }

.article-intro__meta-label {
    font-family: var(--font-body);
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.article-intro__meta-value {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

/* Анонс */
.article-intro__anons {
    position: relative;
    background: #fafafa;
    border: 1px solid #efefef;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px 20px 18px 52px;
    font-family: var(--font-body);
    font-size: 15px;
    font-style: italic;
    line-height: 1.7;
    color: #444;
}
.article-intro__anons::before {
    content: '\201C';
    position: absolute;
    top: 6px;
    left: 14px;
    font-size: 56px;
    font-family: Georgia, serif;
    color: var(--color-accent);
    line-height: 1;
    font-style: normal;
}

/* Правая часть — содержание */
.article-intro__toc { height: 100%; }

.article-toc {
    border: 1px solid #efefef;
    border-radius: 8px;
    padding: 24px 28px;
    background: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,.05);
    height: 100%;
    box-sizing: border-box;
}

.article-toc__title {
    font-family: var(--font-body);
    font-size: 23px;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    text-align: center;
}

/* Трек-линия слева */
.article-toc__list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 12px;
}

.article-toc__item {
    margin-bottom: 4px;
    line-height: 1.4;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

/* Нумерация в красных кружках */
.article-toc__item::before {
    content: counter(toc-counter);
    counter-increment: toc-counter;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: var(--color-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    font-family: var(--font-body);
}

.article-toc__list {
    counter-reset: toc-counter;
}

.article-toc__item a {
    font-family: var(--font-body);
    font-size: 21px;
    font-weight: 700;
    color: #222;
    transition: color .2s;
    padding-bottom: 1px;
}
.article-toc__item a:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.article-toc__item--h3 {
    padding-left: 14px;
}
.article-toc__item--h3::before {
    background: #ddd;
    color: #666;
    font-size: 10px;
}

/* Таблицы — обёртка для горизонтального скролла (всегда) */
.article-content .table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 28px 0;
}
.article-content .table-scroll-wrap table {
    margin: 0;
    min-width: 500px;
}

/* ── Текстовый блок ─────────────────────────────────────────────────────── */
.article-content {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.9;
    color: #1a1a1a;
    margin-bottom: 48px;
    background: #fff;
    border: 1px solid #efefef;
    border-radius: 8px;
    padding: 36px 44px;
    box-shadow: 0 2px 16px rgba(0,0,0,.05);
}

.article-content h2 {
    font-size: 30px;
    font-weight: 700;
    margin: 44px 0 16px;
    border-left: 6px solid var(--color-accent);
    padding-left: 16px;
    letter-spacing: -.2px;
    scroll-margin-top: 20px;
    line-height: 1.25;
}
.article-content h2:first-child { margin-top: 0; }

.article-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 12px;
    scroll-margin-top: 20px;
    letter-spacing: -.1px;
}

.article-content h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 8px;
    color: #333;
}

.article-content p {
    margin: 0 0 18px;
}

.article-content a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.article-content a:hover {
    border-bottom-color: var(--color-accent);
}

.article-content ul,
.article-content ol {
    margin: 0 0 18px 0;
    padding: 0 0 0 24px;
}
.article-content li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.article-content blockquote {
    border-left: 6px solid var(--color-accent);
    margin: 32px 0;
    padding: 18px 24px;
    background: #f6f6f6;
    border-radius: 0 6px 6px 0;
    font-style: italic;
    font-size: 17px;
    color: #444;
    line-height: 1.75;
}
.article-content blockquote cite {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #888;
    font-style: normal;
    letter-spacing: .3px;
}

.article-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 28px 0;
    font-size: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

/* Скругление через ячейки, а не overflow:hidden на таблице */
.article-content table tr:first-child th:first-child { border-top-left-radius: 8px; }
.article-content table tr:first-child th:last-child  { border-top-right-radius: 8px; }
.article-content table tr:last-child  td:first-child { border-bottom-left-radius: 8px; }
.article-content table tr:last-child  td:last-child  { border-bottom-right-radius: 8px; }
.article-content table th {
    background: #1a1a1a;
    color: #fff;
    font-weight: 700;
    padding: 13px 16px;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.article-content table td {
    padding: 11px 16px;
    border-bottom: 1px solid #efefef;
    color: #333;
    vertical-align: top;
}
.article-content table tr:last-child td { border-bottom: none; }
.article-content table tr:nth-child(even) td { background: #fafafa; }
.article-content table tr:hover td { background: #f4f4f4; transition: background .15s; }

.article-content figure { margin: 28px 0; }
.article-content figure img {
    max-width: 100%;
    border-radius: 6px;
    display: block;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.article-content figcaption {
    font-size: 13px;
    color: var(--color-muted);
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

@media (max-width: 991px) {
    .article-content {
        padding: 20px 18px;
        font-size: 16px;
    }
    .article-content h2 { font-size: 24px; }
    .article-content h3 { font-size: 19px; }
}

/* ── FAQ ─────────────────────────────────────────────────────────────────── */
.article-faq { margin-bottom: 48px; }

.article-faq__title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    border-left: 4px solid var(--color-accent);
    padding-left: 14px;
}

.article-faq__item {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.article-faq__q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    background: #fafafa;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-black);
    gap: 12px;
    transition: background .2s;
}
.article-faq__q:hover { background: #f0f0f0; }
.article-faq__q[aria-expanded="true"] { background: #fff; }

.article-faq__icon {
    flex-shrink: 0;
    transition: transform .3s ease;
    color: var(--color-accent);
}
.article-faq__q[aria-expanded="true"] .article-faq__icon { transform: rotate(180deg); }

.article-faq__a {
    padding: 16px 20px;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}
.article-faq__a p { margin: 0 0 10px; }
.article-faq__a p:last-child { margin-bottom: 0; }

/* ── Панель автора ──────────────────────────────────────────────────────── */
.article-author-panel {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 60px;
    overflow: hidden;
}

.article-author-panel > div {
    padding: 20px;
    border-right: 1px solid #ddd;
}
.article-author-panel > div:last-child { border-right: none; }

/* Блок автора */
.aap-label {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 12px;
}

.aap-author-info { display: flex; align-items: center; gap: 14px; }

.aap-avatar img,
.aap-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.aap-author-text { display: flex; flex-direction: column; gap: 4px; }

.aap-author-name {
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 700;
    color: var(--color-accent);
}
.aap-author-name:hover { text-decoration: underline; }

.aap-author-role {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-muted);
    font-style: italic;
}

/* Средняя часть */
.article-author-panel__middle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
}

.aap-editorial {
    font-family: var(--font-body);
    font-size: 14px;
    color: #444;
    line-height: 1.4;
}

.aap-error-report {
    font-family: var(--font-body);
    font-size: 14px;
    color: #444;
    text-align: center;
    line-height: 1.4;
}
.aap-error-report a {
    color: #444;
    text-decoration: none;
}
.aap-error-report a:hover {
    text-decoration: underline;
}

.aap-views {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 14px;
    color: #555;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 3px;
    width: fit-content;
}
.aap-views svg { color: var(--color-accent); flex-shrink: 0; }

/* Рейтинг */
.article-author-panel__rating {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aap-rating-label {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-black);
    text-align: center;
}

.aap-stars {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.aap-star {
    background: none;
    border: none;
    font-size: 28px;
    color: #ddd;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color .15s, transform .15s;
}
.aap-star:hover,
.aap-star.is-hover { color: #f4a21e; transform: scale(1.15); }
.aap-star.is-filled { color: #f4a21e; }
.aap-star.is-voted  { cursor: default; }

.aap-rating-info {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-muted);
    text-align: center;
    line-height: 1.4;
}

.aap-share {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    justify-content: center;
}

.aap-share-label {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-muted);
}

.aap-share-link {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: opacity .2s;
}
.aap-share-link:hover { opacity: .7; }

/* ── Читайте также ──────────────────────────────────────────────────────── */
.article-also { margin-bottom: 60px; }

.article-also__title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    border-left: 4px solid var(--color-accent);
    padding-left: 14px;
}

.article-also__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.zart-also-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.zart-also-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.zart-also-card__img {
    height: 160px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.zart-also-card__body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.zart-also-card__cat {
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.zart-also-card__title {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-black);
    line-height: 1.4;
}

.zart-also-card__date {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--color-muted);
    margin-top: auto;
}

.article-also__more {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.zart-also-more-btn {
    font-family: var(--font-heading);
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-muted);
    background: transparent;
    border: 2px solid #ddd;
    padding: 12px 40px;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.zart-also-more-btn:hover:not(:disabled) {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.zart-also-more-btn:disabled { opacity: .5; cursor: default; }

@media (max-width: 991px) {
    .article-also__grid { grid-template-columns: repeat(2, 1fr); }
    .zart-also-card__img { height: 130px; }
}

@media (max-width: 560px) {
    .article-also__grid { grid-template-columns: 1fr; }
}
@media (max-width: 991px) {

    .article-title { font-size: 26px; }

    .article-intro {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .article-author-panel {
        grid-template-columns: 1fr;
    }
    .article-author-panel > div {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    .article-author-panel > div:last-child { border-bottom: none; }

    .article-content h2 { font-size: 22px; }
    .article-content h3 { font-size: 18px; }

    .article-intro__meta { grid-template-columns: repeat(3, 1fr); }
}