.pagination .prev {
    color: rgb(255 255 255 / 0%);
}
.pagination .prev:hover {
    color: rgb(255 255 255 / 0%);
}

.pagination .next {
    color: rgb(255 255 255 / 0%);
}
.pagination .next:hover {
    color: rgb(255 255 255 / 0%);
}

/* ==========================================================================
   Single Article — Blog Post Header
   ========================================================================== */

/* Tags/pills at top */
.single-article > .container > .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.single-article > .container > .tags li a {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--color-border);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
    font-family: var(--font-sans);
}

.single-article > .container > .tags li a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Meta line */
.single-article .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.single-article .meta .params {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 18px;
    color: var(--color-text-light);
}

.single-article .meta .params li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    white-space: nowrap; /* keep each meta item on one line — the whole list wraps instead */
}

/* Invisible forced line-break inside the flex-wrap row — sits between the two
   date items and the stats items so dates always end up on row 1, stats on row 2.
   `flex-basis: 100%` pushes everything after it onto the next row. */
.single-article .meta .params .params__break {
    flex-basis: 100%;
    height: 0;
    padding: 0;
    margin: 0;
    gap: 0;
}
.single-article .meta .params .params__break::before {
    display: none;
}

.single-article .meta .params li::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
    flex-shrink: 0;
}

.single-article .meta .params li.date::before {
    background-image: url('../img/clock2.svg');
}

.single-article .meta .params li.date-updated::before {
    background-image: url('../img/clock2.svg');
}

.single-article .meta .params li.date-updated {
    color: var(--color-primary);
    font-weight: 500;
}

.single-article .meta .params li.views::before {
    background-image: url('../img/eye2.svg');
}

.single-article .meta .params li.reading-time::before {
    background-image: url('../img/clock2.svg');
}

.single-article .meta .params li.comments::before {
    background-image: url('../img/comment2.svg');
}

.single-article .meta .like {
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg) url('../img/bookmark-blue.svg') center/18px no-repeat;
    cursor: pointer;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.single-article .meta .like:hover {
    border-color: var(--color-primary);
}

.single-article .meta .like.active {
    background-image: url('../img/bookmark-active.svg');
    border-color: var(--color-primary);
}

/* Title */
.single-article .header {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 40px;
    color: var(--color-text);
}

/* Intro text */
.single-article .article-intro {
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text-light);
    margin: 0 0 30px;
}

/* Featured image */
.single-article .article-image {
    margin: 0 0 60px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.single-article .article-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content area font */
.blog-article.single-article .article-content {
    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-text);
}

/* ==========================================================================
   12-Column Grid Layout — Desktop (>= 992px)
   ========================================================================== */
@media (min-width: 992px) {

    /* --- Reset old padding-right hack from cr-theme.css --- */
    article.blog-article.single-article {
        padding-right: 0;
    }

    /* --- Main 12-column grid on container --- */
    .blog-article.single-article > .container {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        column-gap: var(--grid-gap);
    }

    /* Default: all direct children — 8 center columns (symmetric padding 2 cols on each side) */
    .blog-article.single-article > .container > * {
        grid-column: 3 / 11;
    }

    /* Article-content must span full 12 cols so its subgrid has all 12 tracks available */
    .blog-article.single-article > .container > .article-content {
        grid-column: 1 / -1;
    }

    /* Override legacy width:60% from cr-theme.css — let grid-column control width */
    .blog-article.single-article > .container > .article-footer,
    .blog-article.single-article > .container > .article-comments {
        width: auto;
    }

    /* Title: 8 center columns */
    .blog-article.single-article > .container > .header {
        grid-column: 3 / 11;
    }

    /* --- Article credits: author + expert block --- */
    .blog-article.single-article > .container > .article-credits {
        grid-column: 3 / 11;
    }

    /* --- Reset old image overflow hack --- */
    .blog-article.single-article .article-image {
        max-width: 100%;
    }

    /* --- Content area: subgrid for 12-column layout --- */
    .blog-article.single-article > .container > .article-content {
        display: grid;
        grid-template-columns: subgrid;
    }

    /* Default content children: 8 center columns */
    .blog-article.single-article .article-content > * {
        grid-column: 3 / 11;
    }

    /* TOC: 5 center columns (legacy .article-toc class, kept for compatibility) */
    .blog-article.single-article .article-content > .article-toc {
        grid-column: 4 / 9;
    }

    /* Article TOC inline block — same 8-column center band as body text */
    .blog-article.single-article .article-content > .cr-toc--inline {
        grid-column: 3 / 11;
    }

    /* Course table: 10 center columns */
    .blog-article.single-article .article-content > .course-table {
        grid-column: 2 / 12;
    }

    /* Sidebar course card: positioned in right margin, out of flow */
    .blog-article.single-article .article-content > .course-side-card-anchor {
        grid-column: 1 / -1;
        min-height: 0;
        height: 0;
        overflow: visible;
        position: relative;
        margin-bottom: 0;
    }
    /* Safety: if two cards follow each other, prevent overlap */
    .blog-article.single-article .article-content > .course-side-card-anchor + .course-side-card-anchor {
        margin-top: 420px;
    }
    .course-side-card-anchor > .course-side-card {
        position: absolute;
        top: 0;
        right: 0;
        width: calc(4 * (100% / 12) - 10px);
    }

    /* Full-width elements: 12 columns */
    .blog-article.single-article .article-content > .article-quote,
    .blog-article.single-article .article-content > .cta-start,
    .blog-article.single-article .article-content > .article-important-note,
    .blog-article.single-article .article-content > .article-products,
    .blog-article.single-article .article-content > .full-width {
        grid-column: 1 / -1;
        margin-right: 0;
    }

    /* --- Callout wrapper: subgrid → 7 cols content + 1 col gap + 4 cols footnote --- */
    .blog-article.single-article .article-content > .has-footnote {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: subgrid;
        position: static;
    }

    /* Content inside callout wrapper: 8 center columns (matches article body) */
    .blog-article.single-article .article-content .has-footnote > *:not(.article-footnote) {
        grid-column: 3 / 11;
    }

    /* Footnote block: 4 columns right (cols 9–12) */
    .blog-article.single-article .article-content .has-footnote > .article-footnote {
        grid-column: 9 / 13;
        position: static;
        width: auto;
        right: auto;
        top: auto;
        margin: 0;
    }
}

/* ==========================================================================
   Responsive — Tablet & Mobile
   ========================================================================== */
@media (max-width: 768px) {
    .single-article .header {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .single-article .meta .params {
        flex-wrap: wrap;
        gap: 12px;
        font-size: 14px;
    }

    .single-article .meta .params li {
        font-size: 14px;
    }
}

/* ==========================================================================
   Course Categories Section — homepage "Направления курсов" block
   Overrides for template-matching design
   ========================================================================== */

/* Section background: white, clean look */
.course-categories-section {
    background: var(--color-bg, #fff);
    padding: 80px 0 90px;
    margin-top: 80px;
}

/* Remove heavy decorative SVG wave */
.course-categories-section:before {
    content: none;
}

/* Header: no negative margin, clean alignment */
.course-categories-section .section-header {
    margin-top: 0;
    font-family: var(--font-heading, 'Inter Tight', Arial, sans-serif);
    color: var(--color-text, #272B37);
}

.course-categories-section .section-intro {
    color: var(--color-text-light, #5A5E6A);
    margin-bottom: 40px;
}

/* Grid: 4 columns on desktop, proper gaps */
.course-categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: 0;
}

/* Card: white, soft border, clean padding */
.course-categories .item {
    width: auto;
    margin: 0;
    padding: 24px 24px 28px;
    background: var(--color-bg, #fff);
    border: 1px solid var(--color-border, #E4E9F2);
    border-radius: var(--radius-lg, 15px);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 220px;
}

/* Card hover */
@media (min-width: 992px) {
    .course-categories .item:not(.more):hover {
        border-color: var(--color-primary, #7324FF);
        box-shadow: 0 0 0 2px var(--color-primary, #7324FF) inset;
    }
}

/* Title with icon */
.course-categories .title {
    display: flex;
    align-items: center;
    height: auto;
    min-height: 56px;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-heading, 'Inter Tight', Arial, sans-serif);
    padding-left: 68px;
    position: relative;
    color: var(--color-text, #272B37);
    text-decoration: none;
    line-height: 1.3;
}

.course-categories .title:hover {
    color: var(--color-primary, #7324FF);
}

/* Icon sizing */
.course-categories .icon {
    width: 56px;
    height: 56px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 12px;
    object-fit: contain;
}

/* Subcategory list */
.course-categories ul {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 20px;
    padding: 0;
    list-style: none;
}

.course-categories li {
    padding-left: 16px;
    position: relative;
    margin-bottom: 8px;
}

.course-categories li:before {
    content: "";
    width: 5px;
    height: 5px;
    background: var(--color-primary, #7324FF);
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0.6em;
}

.course-categories li a {
    color: var(--color-text, #272B37);
    text-decoration: none;
    transition: color 0.15s;
}

.course-categories li a:hover {
    color: var(--color-primary, #7324FF);
}

.course-categories li .sub-count {
    color: var(--color-text-muted, #8A8F9E);
    font-size: 12px;
}

/* Bottom area: count + arrow — always pinned to bottom */
.course-categories .total {
    padding: 16px 70px 0 0;
    border-top: 1px dashed var(--color-border, #E4E9F2);
    margin-top: auto;
    padding-top: 16px;
    font-size: 13px;
    color: var(--color-text-light, #5A5E6A);
}

.course-categories .total .number {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text, #272B37);
    display: block;
    line-height: 1.2;
}

/* Arrow button */
.course-categories .show-more {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg, 15px);
    position: absolute;
    right: 24px;
    bottom: 28px;
    background-color: var(--color-primary, #7324FF);
    background-image: url("../img/arrow-white.svg");
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-size: 16px auto;
    padding: 0;
    transition: background-color 0.2s;
}

.course-categories .show-more:hover {
    background-color: var(--color-primary-dark, #5a10e0);
}

/* "More" item: total courses + button */
.course-categories .item.more {
    max-width: none;
    width: auto;
    background: none;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 24px;
}

.course-categories .more .total {
    width: auto;
    padding: 0;
    border: 0;
    text-align: center;
    font-size: 18px;
    color: var(--color-text-light, #5A5E6A);
    margin: 0 0 24px;
}

.course-categories .more .total .number {
    font-size: 56px;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
}

.course-categories .more .button {
    margin: 0 auto;
}

/* ---- Responsive: Course Categories ---- */
@media (max-width: 1399px) {
    .course-categories {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1199px) {
    .course-categories-section {
        margin-top: 60px;
        padding: 60px 0 70px;
    }
    .course-categories {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 991px) {
    .course-categories-section {
        margin-top: 40px;
        padding: 50px 0 60px;
    }
    .course-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .course-categories-section {
        padding: 40px 0 50px;
        margin-top: 30px;
    }
    .course-categories .title {
        min-height: 48px;
        padding-left: 58px;
        font-size: 16px;
    }
    .course-categories .icon {
        width: 48px;
        height: 48px;
    }
    .course-categories .total {
        padding-right: 60px;
    }
    .course-categories .show-more {
        width: 46px;
        height: 46px;
        bottom: 24px;
        right: 20px;
    }
}

@media (max-width: 575px) {
    .course-categories-section {
        padding: 30px 0 40px;
    }
    .course-categories {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .course-categories .item.more {
        margin-top: 10px;
    }
    .course-categories .more .total .number {
        font-size: 42px;
    }
}

/* ==========================================================================
   Article TOC (Table of Contents)
   ========================================================================== */

/* Scroll margin on H2 so anchor-jumps don't hide under the fixed site header */
.article-content h2 {
    scroll-margin-top: 120px;
    position: relative;
}

/* Inline copy-link icon inside each H2 — visible on hover of the H2.
   Click copies deep-link URL to clipboard (handled in article-toc.js). */
.cr-heading-anchor {
    position: relative;
    display: inline-block;
    margin-left: 0.35em;
    padding: 2px;
    color: #D0D5DD;
    text-decoration: none !important;
    line-height: 0;
    vertical-align: middle;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background-color 0.15s;
}
.cr-heading-anchor__icon {
    display: inline-block;
    vertical-align: middle;
}
.article-content h2:hover .cr-heading-anchor,
.cr-heading-anchor:focus {
    opacity: 1;
}
.cr-heading-anchor:hover {
    color: var(--color-primary, #7324FF);
    background: rgba(115, 36, 255, 0.08);
}
.cr-heading-anchor.is-copied {
    opacity: 1;
    color: #12B76A;
    background: rgba(18, 183, 106, 0.1);
}
.cr-heading-anchor__toast {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translate(6px, -50%);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    color: #fff;
    background: #12B76A;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
.cr-heading-anchor.is-copied .cr-heading-anchor__toast {
    opacity: 1;
}
/* Keep last word of H2 + anchor glued together — avoids the icon wrapping alone
   onto a new line and leaving an ugly gap next to the last word. */
.cr-heading-anchor-wrap {
    white-space: nowrap;
}

/* ===========================
   Inline TOC — collapsible block at the top of the article body
   =========================== */
.cr-toc--inline {
    background: linear-gradient(135deg, #F7F5FF 0%, #FCF9FF 100%);
    border: 1px solid #E8E1FA;
    border-radius: 16px;
    padding: 24px 28px;
    margin: 0 0 40px;
    box-shadow: 0 4px 24px rgba(115, 36, 255, 0.04);
}
.cr-toc--inline .cr-toc__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading, 'Inter Tight', Arial, sans-serif);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-primary, #7324FF);
    margin: 0 0 16px;
}
.cr-toc--inline .cr-toc__title-icon {
    flex-shrink: 0;
}
.cr-toc--inline .cr-toc__list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cr-toc--inline .cr-toc__item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0;
}
.cr-toc--inline .cr-toc__item::marker,
.cr-toc--inline .cr-toc__item::before {
    content: none !important;
    display: none !important;
}
.cr-toc--inline .cr-toc__link {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--color-text, #272B37);
    text-decoration: none;
    line-height: 1.45;
    font-size: 16px;
    transition: background-color 0.15s, color 0.15s, transform 0.15s;
}
.cr-toc--inline .cr-toc__link:hover {
    background: rgba(115, 36, 255, 0.06);
    color: var(--color-primary, #7324FF);
    transform: translateX(2px);
}
.cr-toc--inline .cr-toc__link.is-active {
    background: rgba(115, 36, 255, 0.1);
    color: var(--color-primary, #7324FF);
    font-weight: 600;
}
.cr-toc--inline .cr-toc__num {
    flex-shrink: 0;
    min-width: 1.8em;
    font-family: var(--font-heading, 'Inter Tight', Arial, sans-serif);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 14px;
    color: var(--color-primary, #7324FF);
    opacity: 0.7;
}
.cr-toc--inline .cr-toc__link.is-active .cr-toc__num,
.cr-toc--inline .cr-toc__link:hover .cr-toc__num {
    opacity: 1;
}
.cr-toc--inline .cr-toc__text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Collapsed state: only first 3 items visible. */
.cr-toc--inline.is-collapsed .cr-toc__item:nth-child(n+4) {
    display: none;
}

/* Expand/collapse toggle button */
.cr-toc--inline .cr-toc__expand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--color-primary, #7324FF);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}
.cr-toc--inline .cr-toc__expand:hover {
    background: rgba(115, 36, 255, 0.08);
    border-color: rgba(115, 36, 255, 0.18);
}
.cr-toc--inline .cr-toc__expand-arrow {
    transition: transform 0.2s;
}
.cr-toc--inline:not(.is-collapsed) .cr-toc__expand-arrow {
    transform: rotate(180deg);
}

/* Mobile tightening */
@media (max-width: 767px) {
    .cr-toc--inline {
        padding: 18px 18px;
        border-radius: 12px;
        margin-bottom: 28px;
    }
    .cr-toc--inline .cr-toc__title {
        font-size: 12px;
        margin-bottom: 12px;
    }
    .cr-toc--inline .cr-toc__link {
        font-size: 15px;
        padding: 9px 10px;
        gap: 10px;
    }
}

/* ===========================
   Floating left-rail actions (desktop only) — TOC + Like + Share.
   Block stays hidden until the user scrolls past the article .meta line,
   then pins under the header and stays visible while scrolling.
   =========================== */
.cr-toc-actions {
    position: fixed;
    top: 120px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s;
}
.cr-toc-actions.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
/* Hidden once "Рекомендуем прочитать" block becomes ≥10% visible — user has left the article body. */
.cr-toc-actions.is-hidden-by-related {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-8px) !important;
}
/* Shared responsive width for all three action buttons (TOC / Save / Share) — shrinks to fit the left gutter of the centered content */
.cr-toc-actions__btn {
    width: clamp(48px, calc((100vw - 960px) / 2 - 40px), 380px);
}

.cr-toc-float {
    position: relative;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E4E9F2;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(17, 24, 39, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s, width 0.15s;
}
.cr-toc-float.is-open {
    box-shadow: 0 10px 36px rgba(115, 36, 255, 0.12);
    border-color: rgba(115, 36, 255, 0.28);
}
.cr-toc-float__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 14px 14px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--color-primary, #7324FF);
    -webkit-appearance: none;
            appearance: none;
    transition: background-color 0.15s;
}
.cr-toc-float__toggle:hover {
    background: rgba(115, 36, 255, 0.04);
}
.cr-toc-float__toggle-icon {
    display: inline-flex;
    flex-shrink: 0;
}
.cr-toc-float__toggle-label {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cr-toc-float__toggle-arrow {
    display: inline-flex;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.cr-toc-float.is-open .cr-toc-float__toggle-arrow {
    transform: rotate(180deg);
}
.cr-toc-float__panel {
    border-top: 1px solid #EEF1F6;
    padding: 8px 8px 10px;
    overflow-y: auto;
    flex: 1 1 auto;
    animation: cr-toc-float-slide 0.2s ease-out;
}
@keyframes cr-toc-float-slide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cr-toc-float__panel .cr-toc__list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0;
}
.cr-toc-float__panel .cr-toc__item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0;
}
.cr-toc-float__panel .cr-toc__item::marker,
.cr-toc-float__panel .cr-toc__item::before {
    content: none !important;
    display: none !important;
}
.cr-toc-float__panel .cr-toc__link {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--color-text, #272B37);
    text-decoration: none;
    font-size: 13.5px;
    line-height: 1.4;
    transition: background-color 0.15s, color 0.15s;
}
.cr-toc-float__panel .cr-toc__link:hover {
    background: rgba(115, 36, 255, 0.06);
    color: var(--color-primary, #7324FF);
}
.cr-toc-float__panel .cr-toc__link.is-active {
    background: rgba(115, 36, 255, 0.1);
    color: var(--color-primary, #7324FF);
    font-weight: 600;
}
.cr-toc-float__panel .cr-toc__num {
    flex-shrink: 0;
    min-width: 1.6em;
    font-family: var(--font-heading, 'Inter Tight', Arial, sans-serif);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 12px;
    color: var(--color-primary, #7324FF);
    opacity: 0.7;
}
.cr-toc-float__panel .cr-toc__link.is-active .cr-toc__num,
.cr-toc-float__panel .cr-toc__link:hover .cr-toc__num {
    opacity: 1;
}
.cr-toc-float__panel .cr-toc__text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Like + Share buttons — labeled, width inherited from .cr-toc-actions__btn */
.cr-toc-actions .like,
.cr-toc-share {
    position: relative;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 14px 0 16px;
    background: #FFFFFF;
    border: 1px solid #E4E9F2;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    text-align: left;
    color: var(--color-primary, #7324FF);
    box-shadow: 0 6px 24px rgba(17, 24, 39, 0.06);
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.1s, color 0.2s, width 0.15s;
    -webkit-appearance: none;
            appearance: none;
}
.cr-toc-actions .like:hover,
.cr-toc-share:hover {
    box-shadow: 0 10px 28px rgba(115, 36, 255, 0.12);
    border-color: rgba(115, 36, 255, 0.28);
}
.cr-toc-actions .like:active,
.cr-toc-share:active {
    transform: scale(0.96);
}

/* Like icon via ::before, keeps bookmark color identity */
.cr-toc-actions .like::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background: url('../img/bookmark-blue.svg') center/contain no-repeat;
}
.cr-toc-actions .like.active {
    border-color: var(--color-primary, #7324FF);
}
.cr-toc-actions .like.active::before {
    background-image: url('../img/bookmark-active.svg');
}

/* Share icon sits inside button as SVG, stroke via currentColor */
.cr-toc-share__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Shared label for all action buttons — uppercase purple, matches TOC label */
.cr-toc-actions__label {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cr-toc-share__toast {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 8px 14px;
    background: #272B37;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.cr-toc-share.is-copied .cr-toc-share__toast {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mid-width viewports (<1500px, ≥1300px): TOC toggle collapses to icon-only,
   panel opens as a floating overlay to the right of the button. */
@media (max-width: 1499.98px) {
    /* All three action buttons collapse to icon-only 48×48 */
    .cr-toc-actions__btn {
        width: 48px;
    }
    .cr-toc-float {
        overflow: visible;
    }
    .cr-toc-float__toggle {
        justify-content: center;
        padding: 14px 0;
        gap: 0;
    }
    .cr-toc-float__toggle-label,
    .cr-toc-float__toggle-arrow {
        display: none;
    }
    .cr-toc-float.is-open .cr-toc-float__toggle {
        background: rgba(115, 36, 255, 0.08);
    }
    .cr-toc-float__panel {
        position: absolute;
        top: 0;
        left: calc(100% + 10px);
        width: 280px;
        max-height: calc(100vh - 140px);
        background: #FFFFFF;
        border: 1px solid #E4E9F2;
        border-radius: 14px;
        box-shadow: 0 10px 36px rgba(17, 24, 39, 0.12);
        padding: 10px 8px;
        overflow-y: auto;
        margin: 0;
    }
    /* Revert like/share to icon-only square (width handled by .cr-toc-actions__btn above) */
    .cr-toc-actions .like,
    .cr-toc-share {
        padding: 0;
        justify-content: center;
        gap: 0;
    }
    .cr-toc-actions__label {
        display: none;
    }
}

/* Hide whole actions rail on narrow viewports — inline TOC is enough */
@media (max-width: 1299px) {
    .cr-toc-actions {
        display: none;
    }
}

/* Disable CSS smooth-scroll — article-toc.js owns the anchor-scroll animation.
   Without this, WP core / plugin CSS with `scroll-behavior: smooth` races our
   rAF updates and produces overshoot + snap-back. */
html, body {
    scroll-behavior: auto !important;
}

/* Course table = direct conversions, must always be clickable. Rail is faded
   out by IntersectionObserver (article-toc.js) when the table enters viewport.
   z-index + soft white halo are a safety net for transition frames. */
.course-table {
    position: relative;
    z-index: 100;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.9),
        0 8px 28px rgba(17, 24, 39, 0.08);
    border-radius: 16px;
}
.cr-toc-actions.is-hidden-by-table {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-8px) !important;
}
