/* =========================================================================
   Шаблон «Статья блога» (template/template-blog-post.php), по макету 02.10.2026, внедрено 05.10.2026.
   Все правила начинаются с .vv-…, остальной сайт они не задевают.
   Цвета, шрифт, радиусы, кнопки и бейджи — из темы (assets/style.css).
   ========================================================================= */

.vv-article,
.vv-related {
    --vv-blue: #1d70b5;                 /* .text-viki-blue-deep */
    --vv-blue-dark: #2562ae;
    --vv-cyan: #00a7d3;
    --vv-grad: linear-gradient(57.88deg, #00a7d3 35.87%, #2562ae 96.72%); /* .btn-primary, открытый вопрос FAQ */
    --vv-tint: #edf7fa;                 /* .text-bg-viki-blue — фон карточек */
    --vv-text: #4f4f4f;                 /* цвет текста сайта */
    --vv-ink: #263238;
    --vv-muted: #6b7a85;
    --vv-line: #e0e0e0;
    --vv-radius: 8px;
    --vv-header: 148px;                 /* высота липкой шапки сайта; article.js уточняет по факту */
}

@media (max-width: 991.98px) {
    .vv-article {
        --vv-header: 122px;
    }
}

/* ---------- Первый экран: тема, H1, лид, автор и мета, обложка ---------- */

.vv-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto auto auto 1fr;
    grid-template-areas:
        ".      cover"
        "tag    cover"
        "title  cover"
        "lead   cover"
        "byline cover"
        ".      cover";
    column-gap: 40px;
    row-gap: 16px;
    padding: 24px 24px 24px 40px;
    background: var(--vv-tint);
    border-radius: var(--vv-radius);
    overflow: hidden;
}

.vv-hero__tag {
    grid-area: tag;
    justify-self: start;
}

.vv-hero__title {
    grid-area: title;
    margin: 0;
    font-size: 40px;
    line-height: 1.15;
}

/* длинный H1 (больше 40 символов) — мельче, чтобы обложка оставалась на первом экране */
.vv-hero__title--long {
    font-size: 32px;
}

.vv-hero__lead {
    grid-area: lead;
    margin: 0;
    font-size: 18px;
    line-height: 1.55;
    color: #37474f;
}

.vv-hero__byline {
    grid-area: byline;
}

.vv-hero__cover {
    grid-area: cover;
    position: relative;
    min-height: 340px;
    margin: 0;
    border-radius: var(--vv-radius);
    overflow: hidden;
    background: #d7e9f2;
}

.vv-hero__cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vv-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff;
    color: var(--vv-blue);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(29, 112, 181, .14);
    transition: box-shadow .2s;
}

.vv-tag:hover {
    color: var(--vv-blue-dark);
    box-shadow: 0 3px 10px rgba(29, 112, 181, .22);
}

/* автор и мета */
.vv-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    padding-top: 16px;
    border-top: 1px solid rgba(29, 112, 181, .14);
}

.vv-byline__author {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.vv-byline__author img {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px #fff;
}

.vv-byline__name {
    display: block;
    font-weight: 700;
    line-height: 1.25;
    color: var(--vv-blue);
}

.vv-byline__author:hover .vv-byline__name {
    text-decoration: underline;
}

.vv-byline__role {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    color: var(--vv-muted);
}

.vv-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: var(--vv-muted);
}

.vv-meta li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.vv-meta i {
    font-size: 15px;
    color: var(--vv-cyan);
}

@media (max-width: 991.98px) {
    .vv-hero {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-template-areas:
            "tag"
            "title"
            "cover"
            "lead"
            "byline";
        row-gap: 14px;
        padding: 20px;
    }

    .vv-hero__cover {
        min-height: 0;
        aspect-ratio: 4 / 3;
        max-height: 420px;
    }
}

@media (max-width: 575.98px) {
    .vv-hero {
        padding: 16px;
    }

    .vv-hero__title {
        font-size: 28px;
        line-height: 1.2;
    }

    .vv-hero__lead {
        font-size: 16px;
    }

    .vv-byline {
        gap: 12px 20px;
    }
}

/* ---------- Текст и содержание ---------- */

.vv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas:
        "content toc"
        "author  toc";
    column-gap: 56px;
    align-items: start;
    margin-top: 40px;
}

.vv-layout > .vv-content {
    grid-area: content;
    min-width: 0;
    max-width: 760px;
}

.vv-layout > .vv-author {
    grid-area: author;
    max-width: 760px;
}

.vv-layout > .vv-toc {
    grid-area: toc;
    position: sticky;
    top: calc(var(--vv-header) + 24px);
    max-height: calc(100vh - var(--vv-header) - 48px);
    overflow: auto;
}

@media (max-width: 1199.98px) {
    .vv-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
        column-gap: 40px;
    }
}

@media (max-width: 991.98px) {
    .vv-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "toc"
            "content"
            "author";
        margin-top: 24px;
    }

    .vv-layout > .vv-toc {
        position: static;
        max-height: none;
        margin-bottom: 24px;
    }
}

/* содержание: справа и «липкое» на компьютере, сворачивается на телефоне */
.vv-toc {
    padding: 18px 20px;
    background: var(--vv-tint);
    border-radius: var(--vv-radius);
}

.vv-toc__title {
    display: block;
    list-style: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--vv-muted);
    cursor: default;
}

.vv-toc__title::-webkit-details-marker {
    display: none;
}

.vv-toc ol {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: vv-toc;
}

.vv-toc li {
    counter-increment: vv-toc;
}

.vv-toc a {
    display: flex;
    gap: 10px;
    padding: 6px 0 6px 12px;
    border-left: 2px solid transparent;
    font-size: 15px;
    line-height: 1.35;
    color: var(--vv-blue);
    text-decoration: none;
}

.vv-toc a::before {
    content: counter(vv-toc);
    min-width: 1ch;
    font-weight: 700;
    color: var(--vv-cyan);
}

.vv-toc a:hover {
    text-decoration: underline;
}

.vv-toc a.is-active {
    border-left-color: var(--vv-cyan);
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .vv-toc {
        padding: 14px 16px;
    }

    .vv-toc__title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 14px;
        color: var(--vv-blue);
        cursor: pointer;
    }

    .vv-toc__title::after {
        content: "";
        width: 17px;
        height: 16px;
        background: url(/wp-content/themes/viki-vet/assets/arrow_down.svg) center / contain no-repeat;
        transition: transform .2s;
    }

    .vv-toc[open] .vv-toc__title::after {
        transform: rotate(180deg);
    }
}

/* типографика текста статьи (то, что выводит the_content) */
.vv-content {
    font-size: 17px;
    line-height: 1.7;
    color: var(--vv-text);
}

.vv-content > :first-child {
    margin-top: 0;
}

.vv-content p {
    margin: 0 0 1em;
}

.vv-content h2,
.vv-content h3 {
    scroll-margin-top: calc(var(--vv-header) + 16px);
}

.vv-content h2 {
    margin: 1.7em 0 .6em;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--vv-blue);
}

.vv-content h3 {
    margin: 1.4em 0 .5em;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--vv-ink);
}

.vv-content a {
    color: var(--vv-blue);
    text-decoration: underline;
    text-decoration-color: rgba(29, 112, 181, .35);
    text-underline-offset: 3px;
}

.vv-content a:hover {
    text-decoration-color: currentColor;
}

.vv-content strong,
.vv-content b {
    color: #37474f;
}

/* маркированные и нумерованные списки */
.vv-content ul,
.vv-content ol {
    margin: 0 0 1.2em;
    padding: 0;
    list-style: none;
}

.vv-content li {
    position: relative;
    margin: 0 0 .55em;
}

.vv-content li > p {
    margin: 0;
}

.vv-content ul > li {
    padding-left: 28px;
}

.vv-content ul > li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: .62em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vv-grad);
}

.vv-content li ul,
.vv-content li ol {
    margin: .55em 0 0;
}

.vv-content ul ul > li::before {
    background: transparent;
    border: 2px solid var(--vv-cyan);
}

.vv-content ol {
    counter-reset: vv-ol;
}

.vv-content ol > li {
    min-height: 30px;
    padding-left: 44px;
    counter-increment: vv-ol;
}

.vv-content ol > li::before {
    content: counter(vv-ol);
    position: absolute;
    left: 0;
    top: -.05em;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--vv-tint);
    font-size: 15px;
    font-weight: 700;
    line-height: 30px;
    text-align: center;
    color: var(--vv-blue);
}

/* таблицы */
.vv-table {
    margin: 1.6em 0;
}

.vv-table figcaption {
    margin-bottom: .6em;
    font-weight: 700;
    color: var(--vv-ink);
}

.vv-table__scroll {
    overflow-x: auto;
    border: 1px solid var(--vv-line);
    border-radius: var(--vv-radius);
    -webkit-overflow-scrolling: touch;
}

.vv-content table {
    width: 100%;
    min-width: 520px;
    margin: 0;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.45;
}

.vv-content th {
    padding: 12px 16px;
    background: var(--vv-tint);
    border-bottom: 1px solid var(--vv-line);
    font-weight: 700;
    text-align: left;
    vertical-align: bottom;
    color: var(--vv-blue);
}

.vv-content td {
    padding: 12px 16px;
    border-top: 1px solid var(--vv-line);
    vertical-align: top;
}

.vv-content tbody tr:first-child td {
    border-top: 0;
}

.vv-content tbody tr:nth-child(even) td {
    background: #f9fbfc;
}

.vv-table__note {
    margin: .6em 0 0 !important;
    font-size: 14px;
    line-height: 1.5;
    color: var(--vv-muted);
}

/* на телефоне строки таблицы — карточки; подписи колонок ставит article.js (data-label) */
@media (max-width: 575.98px) {
    .vv-content table.vv-table--stack {
        min-width: 0;
    }

    .vv-table--stack thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .vv-table--stack,
    .vv-table--stack tbody,
    .vv-table--stack tr,
    .vv-table--stack td {
        display: block;
        width: 100%;
    }

    .vv-table--stack tr {
        padding: 12px 16px;
        border-top: 1px solid var(--vv-line);
    }

    .vv-table--stack tbody tr:first-child {
        border-top: 0;
    }

    .vv-table--stack tbody tr:nth-child(even) {
        background: #f9fbfc;
    }

    .vv-content .vv-table--stack td {
        padding: 2px 0;
        border: 0;
        background: none;
    }

    .vv-table--stack td:first-child {
        font-weight: 700;
        color: var(--vv-ink);
    }

    .vv-table--stack td + td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--vv-muted);
    }
}

/* цитата из редактора = блок «Важно» */
.vv-content blockquote {
    position: relative;
    margin: 1.4em 0;
    padding: 18px 22px 18px 64px;
    background: var(--vv-tint);
    border-radius: var(--vv-radius);
    color: #37474f;
}

.vv-content blockquote::before {
    content: "!";
    position: absolute;
    left: 20px;
    top: 19px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--vv-grad);
    font-weight: 700;
    line-height: 28px;
    text-align: center;
    color: #fff;
}

.vv-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ---------- CTA в тексте (шорткод [vv_cta]) ---------- */

.vv-cta {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px 32px;
    margin: 2em 0;
    padding: 28px 32px;
    border-radius: var(--vv-radius);
    background: var(--vv-grad);
    box-shadow: 0 12px 24px -14px rgba(37, 98, 174, .7);
    color: #fff;
    overflow: hidden;
}

.vv-cta__title {
    margin: 0 0 6px !important;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

.vv-cta__text {
    margin: 0 !important;
    font-size: 16px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .92);
}

.vv-cta__actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 230px;
}

.vv-cta__btn,
.vv-cta__btn:hover,
.vv-cta__btn:focus {
    background: #fff;
    color: var(--vv-blue);
    font-weight: 700;
    box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .35);
}

.vv-cta__phones {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 15px;
    line-height: 1.5;
}

.vv-cta__phones a {
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
}

.vv-cta__phones a:hover {
    text-decoration: underline !important;
}

.vv-cta__phones i {
    margin-right: 6px;
    font-size: 13px;
    opacity: .8;
}

.vv-cta__phones small {
    margin-left: 4px;
    font-size: 13px;
    font-weight: 400;
    opacity: .8;
}

.vv-cta__paw {
    position: absolute;
    right: 210px;
    bottom: -18px;
    width: 110px;
    opacity: .12;
    transform: rotate(-24deg);
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .vv-cta {
        grid-template-columns: minmax(0, 1fr);
        padding: 24px 20px;
    }

    .vv-cta__actions {
        min-width: 0;
    }

    .vv-cta__paw {
        right: -12px;
        bottom: -22px;
    }
}

/* ---------- Блок автора ---------- */

.vv-author {
    margin-top: 40px;
}

.vv-author__card {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 24px;
    background: var(--vv-tint);
    border-radius: var(--vv-radius);
}

.vv-author__photo {
    flex: none;
}

.vv-author__photo img {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.vv-author__body {
    min-width: 0;
}

.vv-author__label {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--vv-muted);
}

.vv-author__name {
    display: inline-block;
    margin: 0 0 2px;
    text-decoration: none;
}

.vv-author__name:hover {
    text-decoration: underline;
}

.vv-author__job {
    font-weight: 700;
    color: rgba(0, 0, 0, .75);
}

.vv-author__spec-label {
    margin: 12px 0 6px;
    font-weight: 300;
    color: rgba(0, 0, 0, .5);
}

.vv-author__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

@media (max-width: 575.98px) {
    .vv-author__card {
        flex-direction: column;
        gap: 14px;
        padding: 20px;
    }

    .vv-author__photo img {
        width: 96px;
        height: 96px;
    }
}

/* ---------- FAQ: разметка и стили как на главной, здесь только отступы ---------- */

.vv-faq {
    margin-top: 56px;
    scroll-margin-top: calc(var(--vv-header) + 16px);
}

/* ---------- Похожие материалы ---------- */

.vv-related {
    margin: 32px 0 40px;
}

.vv-related .btn {
    flex: none;
    white-space: nowrap;
}

/* лента: все остальные статьи блога; 3 карточки на компьютере, 2 на планшете, на телефоне одна и край следующей.
   Стрелки, полоса прокрутки и перетаскивание мышью — как у ленты сертификатов на страницах врачей */
.vv-related__track {
    display: flex;
    gap: 20px;
    margin: 10px -6px 0;
    padding: 6px 6px 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 6px;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.vv-related__track::-webkit-scrollbar {
    display: none;
}

.vv-related__track > .vv-card {
    flex: 0 0 calc((100% - 40px) / 3);
    scroll-snap-align: start;
}

.vv-related__nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 2px;
}

.vv-related__nav[hidden] {
    display: none;
}

.vv-related__btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #b9d3ea;
    border-radius: 4px;
    background: #fff;
    color: var(--vv-blue);
    cursor: pointer;
    transition: opacity .2s, background .2s;
}

.vv-related__btn:hover {
    background: var(--vv-tint);
}

.vv-related__btn:disabled {
    opacity: .35;
    cursor: default;
}

.vv-related__bar {
    position: relative;
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #dbe9f4;
    overflow: hidden;
}

.vv-related__bar span {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    border-radius: 2px;
    background: var(--vv-grad);
}

@media (hover: hover) and (pointer: fine) {
    .vv-related__track {
        cursor: grab;
    }
}

.vv-related__track.is-dragging {
    scroll-snap-type: none;
    scroll-behavior: auto;
    cursor: grabbing;
    user-select: none;
}

@media (max-width: 991.98px) {
    .vv-related__track > .vv-card {
        flex-basis: calc((100% - 20px) / 2);
    }
}

@media (max-width: 767.98px) {
    .vv-related__track {
        gap: 12px;
    }

    .vv-related__track > .vv-card {
        flex-basis: 82%;
    }
}

/* карточка статьи */
.vv-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: var(--vv-radius);
    overflow: hidden;
    text-decoration: none;
}

/* обложка; стрелка на её нижнем крае — как кнопка на фото в карточках блога на главной */
.vv-card__media {
    position: relative;
    display: block;
}

.vv-card__img {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #d7e9f2;
}

.vv-card__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.vv-card:hover .vv-card__img img {
    transform: scale(1.03);
}

.vv-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 26px 20px 20px; /* сверху больше: стрелка заходит на 20px ниже обложки */
}

.vv-card__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
}

.vv-card__text {
    display: -webkit-box;
    margin-bottom: 8px;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(0, 0, 0, .5);
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* дата публикации и время чтения над заголовком */
.vv-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--vv-muted);
}

.vv-card__meta > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.vv-card__meta i {
    font-size: 14px;
    color: var(--vv-cyan);
}

/* низ карточки: автор статьи — фото, имя и фамилия (без отчества), должность */
.vv-card__foot {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(29, 112, 181, .14);
}

.vv-card__author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.vv-card__author img {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px #fff;
}

.vv-card__author-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--vv-ink);
}

.vv-card__author-role {
    display: block;
    font-size: 12px;
    line-height: 1.3;
    color: var(--vv-muted);
}

.vv-card__arrow {
    position: absolute;
    right: 16px;
    bottom: -20px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 40px;
    padding: 0;
}

.vv-card__arrow img {
    width: 16px;
    height: 16px;
}
