/*--------------------------------------------------------------
# Reading Sticky Dropdown
--------------------------------------------------------------*/

.cs-reading-sticky-dropdown {
    --reading-sticky-dropdown-top: 50px;
    --reading-sticky-dropdown-left: 50%;
    --reading-sticky-dropdown-width: min(680px, calc(100vw - 32px));
    position: fixed;
    top: var(--reading-sticky-dropdown-top);
    left: var(--reading-sticky-dropdown-left);
    z-index: 99998;
    width: var(--reading-sticky-dropdown-width);
    max-width: calc(100vw - 24px);
    color: var(--dark-text);
    pointer-events: none;
}

.cs-reading-sticky {
    display: none;
}

.cs-reading-sticky.is-dropdown-docked {
    --reading-progress: 0;
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    pointer-events: none;
}

.cs-reading-sticky__shell {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: clamp(7px, 0.9vw, 10px);
    width: 100%;
    min-width: 0;
    max-height: 0;
    padding: 0 clamp(10px, 1.4vw, 14px);
    overflow: hidden;
    border: 1px solid transparent;
    border-top: 0;
    border-radius: 0 0 14px 14px;
    background: color-mix(in srgb, var(--bg-primary) 98%, var(--brand) 2%);
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
        max-height 0.24s ease,
        padding 0.24s ease,
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.24s ease,
        border-color 0.24s ease,
        box-shadow 0.24s ease;
}

.cs-reading-sticky.is-visible .cs-reading-sticky__shell {
    min-height: 42px;
    max-height: 58px;
    padding: 5px clamp(9px, 1.2vw, 12px) 6px;
    border-color: color-mix(in srgb, var(--brand) 10%, var(--border));
    box-shadow: 0 12px 24px -18px rgba(12, 20, 36, 0.22);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    margin-top: 3px;
}

.cs-reading-sticky__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cs-reading-sticky__default {
    display: flex;
    align-items: center;
    gap: clamp(7px, 0.9vw, 9px);
    min-width: 0;
}

.cs-reading-sticky__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cs-reading-sticky__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: clamp(5px, 0.8vw, 7px);
    min-width: 0;
}

.cs-reading-sticky__review-logo-wrap,
.cs-reading-sticky__project-logo-wrap,
.cs-reading-sticky__profile-logo-wrap,
.cs-reading-sticky__icon-wrap {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-primary);
    box-shadow: var(--circle-shadow);
}

.cs-reading-sticky__profile-logo-wrap {
    border-radius: 999px;
    background: #fff;
}

.cs-reading-sticky__profile-logo {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-reading-sticky__profile-logo-wrap--product .cs-reading-sticky__profile-logo,
.cs-reading-sticky__profile-logo-wrap--company .cs-reading-sticky__profile-logo {
    padding: 3px;
    object-fit: contain;
}

.cs-reading-sticky__review-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cs-reading-sticky__review-logo-wrap--icon {
    padding: 6px;
}

.cs-reading-sticky__review-logo-wrap--icon i,
.cs-reading-sticky__review-logo-wrap--icon .cs-vertical-icon,
.cs-reading-sticky__review-logo-wrap--icon img,
.cs-reading-sticky__review-logo-wrap--icon svg {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 100%;
    object-fit: contain;
}

.cs-reading-sticky__review-logo-wrap--icon i,
.cs-reading-sticky__icon-wrap i {
    display: inline-grid;
    place-items: center;
    color: var(--brand);
    font-size: 14px;
}

.cs-reading-sticky__context,
.cs-reading-sticky__review-text,
.cs-reading-sticky__project-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--brand);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cs-reading-sticky__context i,
.cs-reading-sticky__review-text i,
.cs-reading-sticky__project-text i {
    font-size: 11px;
}

.cs-reading-sticky__label {
    color: var(--light-text);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cs-reading-sticky__project-logo {
    width: 100%;
    height: 100%;
    padding: 3px;
    background: #fff;
    object-fit: contain;
}

.cs-reading-sticky__title {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    color: var(--dark-text);
    font-family: "Arimo", Helvetica, sans-serif;
    font-size: clamp(11px, 10.16px + 0.263vw, 12px);
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-reading-sticky__alternative {
    min-width: 0;
}

.cs-reading-sticky__actions {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: clamp(5px, 0.8vw, 7px);
}

.cs-reading-sticky__actions,
.cs-reading-sticky__toc-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
}

.cs-reading-sticky__actions.is-visible,
.cs-reading-sticky__toc-toggle.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.cs-reading-sticky__share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 clamp(9px, 1.2vw, 11px);
    gap: 6px;
    border: none;
    background-color: transparent;
    color: var(--dark-text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.cs-reading-sticky__share i {
    color: var(--brand);
    font-size: 18px;
}

.cs-reading-sticky__share:hover {
    border-color: var(--brand);
    box-shadow: 0 8px 18px rgba(31, 147, 255, 0.12);
    color: var(--brand);
}

.cs-reading-sticky__profile-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 clamp(10px, 1.3vw, 12px);
    gap: 6px;
    border: 1px solid color-mix(in srgb, var(--brand) 88%, #0d6ed3);
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.cs-reading-sticky__profile-cta i {
    color: currentColor;
    font-size: 12px;
}

.cs-reading-sticky__profile-cta:hover {
    border-color: color-mix(in srgb, var(--brand) 82%, #fff);
    box-shadow: 0 8px 18px rgba(31, 147, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.cs-reading-sticky__share:focus-visible,
.cs-reading-sticky__profile-cta:focus-visible,
.cs-reading-sticky__toc-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.cs-reading-sticky__toc-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: var(--dark-text);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.cs-reading-sticky__toc-toggle.is-visible {
    display: inline-flex !important;
}

.cs-reading-sticky__toc-toggle i {
    color: var(--brand);
    font-size: 20px
}

.cs-reading-sticky__toc-toggle:hover {
    color: var(--brand);
    transform: translateY(-1px);
}

.cs-reading-sticky__share.is-copied {
    border-color: color-mix(in srgb, var(--green) 40%, var(--border));
    background-color: color-mix(in srgb, var(--green) 12%, var(--bg-primary));
    color: var(--green);
}

.cs-reading-sticky__share.is-copied i {
    color: var(--green);
}

.cs-reading-sticky__progress {
    position: fixed;
    top: var(--reading-sticky-dropdown-top, var(--header-height));
    left: var(--header-width, 0px);
    right: 0;
    z-index: 99997;
    width: auto;
    height: 3px;
    overflow: hidden;
    border-radius: 0;
    background: color-mix(in srgb, var(--border) 100%, transparent);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.cs-reading-sticky.is-progress-visible .cs-reading-sticky__progress {
    opacity: 1 !important;
    visibility: visible !important;
}

.cs-reading-sticky__progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--brand), #6ac7ff 60%, #b5ebff 100%);
    transform: scaleX(var(--reading-progress));
    transform-origin: 0 50%;
    transition: transform 0.15s linear;
    will-change: transform;
}

.cs-reading-sticky.is-alternative .cs-reading-sticky__default,
.cs-reading-sticky.is-alternative .cs-reading-sticky__actions,
.cs-reading-sticky.is-alternative .cs-reading-sticky__share {
    display: none !important;
}

@media (prefers-color-scheme: dark) {
    .cs-reading-sticky__shell {
        background: color-mix(in srgb, var(--bg-primary) 94%, var(--brand) 6%);
        box-shadow: none;
    }

    .cs-reading-sticky.is-visible .cs-reading-sticky__shell {
        border-color: color-mix(in srgb, var(--brand) 16%, var(--border));
        box-shadow: 0 14px 28px -18px rgba(2, 6, 23, 0.62);
    }

    .cs-reading-sticky__profile-logo-wrap {
        background: color-mix(in srgb, var(--bg-primary) 85%, #fff 15%);
    }

    .cs-reading-sticky__profile-cta {
        box-shadow: 0 8px 18px rgba(31, 147, 255, 0.12);
    }
}

:is(html[data-theme="dark"], body.dark) .cs-reading-sticky__shell {
    background: color-mix(in srgb, var(--bg-primary) 94%, var(--brand) 6%);
}

:is(html[data-theme="dark"], body.dark) .cs-reading-sticky.is-visible .cs-reading-sticky__shell {
    border-color: color-mix(in srgb, var(--brand) 16%, var(--border));
    box-shadow: 0 14px 28px -18px rgba(2, 6, 23, 0.62);
}

:is(html[data-theme="dark"], body.dark) .cs-reading-sticky__profile-logo-wrap {
    background: color-mix(in srgb, var(--bg-primary) 85%, #fff 15%);
}

:is(html[data-theme="dark"], body.dark) .cs-reading-sticky__profile-cta {
    box-shadow: 0 8px 18px rgba(31, 147, 255, 0.12);
}

@media (max-width: 980px) {
    .cs-reading-sticky__label {
        display: none;
    }
}

@media (max-width: 700px) {
    .cs-reading-sticky__share-text,
    .cs-reading-sticky__profile-cta span {
        display: none;
    }

    .cs-reading-sticky__share,
    .cs-reading-sticky__profile-cta {
        width: 34px;
        padding: 0;
    }
}

@media (max-width: 640px) {
    .cs-reading-sticky-dropdown {
        left: 0 !important;
        width: 100vw !important;
        max-width: none;
    }

    .cs-reading-sticky__shell {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 6px;
        border-radius: 0 0 12px 12px;
    }

    .cs-reading-sticky.is-visible .cs-reading-sticky__shell {
        min-height: 46px;
        max-height: 62px;
        padding: 6px 10px;
        margin-top: 0;
    }

    .cs-reading-sticky__review-logo-wrap,
    .cs-reading-sticky__project-logo-wrap,
    .cs-reading-sticky__profile-logo-wrap,
    .cs-reading-sticky__icon-wrap {
        flex-basis: 26px;
        width: 26px;
        height: 26px;
        border-radius: 8px;
    }

    .cs-reading-sticky__profile-logo-wrap {
        border-radius: 999px;
    }

    .cs-reading-sticky__default {
        gap: 7px;
    }

    .cs-reading-sticky__eyebrow {
        gap: 5px;
    }

    .cs-reading-sticky__context,
    .cs-reading-sticky__review-text,
    .cs-reading-sticky__project-text {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cs-reading-sticky__title {
        font-size: 11px;
    }

    .cs-reading-sticky__actions {
        gap: 5px;
    }

    .cs-reading-sticky__share,
    .cs-reading-sticky__profile-cta,
    .cs-reading-sticky__toc-toggle {
        width: 32px;
        min-width: 32px;
        height: 32px;
        min-height: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cs-reading-sticky__shell,
    .cs-reading-sticky__actions,
    .cs-reading-sticky__share,
    .cs-reading-sticky__profile-cta,
    .cs-reading-sticky__toc-toggle,
    .cs-reading-sticky__progress,
    .cs-reading-sticky__progress span {
        transition: none;
    }
}
