/* ============================================================
   Chitalnik Reading Room ribbon
   ------------------------------------------------------------
   Показва вида на достъпното съдържание върху корицата:
   откъс от книгата или пълна книга.
   ============================================================ */

.cover-wrap,
.book-detail .cover-card.section-cover {
    position: relative;
}

.book-reading-ribbon {
    position: absolute;
    top: 0;
    right: clamp(8px, 5%, 18px);
    z-index: 8;
    display: flex;
    width: clamp(62px, 35%, 88px);
    min-height: 76px;
    padding: 10px 7px 20px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    overflow: hidden;
    color: #fff;
    text-align: center;
    text-decoration: none;
    /* Solid themed fallback first - required by older Android WebViews. */
    background-color: var(--primary, #d99200);
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, .13), transparent 26%, transparent 74%, rgba(0, 0, 0, .13)),
        linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .10));
    border: 1px solid rgba(42, 28, 12, .48);
    border-top: 0;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, .35),
        0 6px 13px rgba(0, 0, 0, .24);
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 13px), 0 100%);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 13px), 0 100%);
    pointer-events: none;
    transition: transform .18s ease;
}

.book-reading-ribbon::before {
    content: "";
    position: absolute;
    inset: 4px 4px 7px;
    z-index: 0;
    border: 1px solid rgba(255, 255, 255, .58);
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 11px), 0 100%);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 11px), 0 100%);
    pointer-events: none;
}

.book-reading-ribbon::after {
    content: "";
    position: absolute;
    top: 0;
    left: 14%;
    width: 22%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .18), transparent);
    transform: skewX(-7deg);
    pointer-events: none;
}

.book-reading-ribbon__eyebrow,
.book-reading-ribbon__label,
.book-reading-ribbon__ornament {
    position: relative;
    z-index: 1;
}

.book-reading-ribbon__eyebrow {
    font-size: .45rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .08em;
    opacity: .92;
}

.book-reading-ribbon__ornament {
    font-size: .48rem;
    line-height: 1;
    opacity: .78;
}

.book-reading-ribbon__label {
    max-width: 100%;
    font-size: .60rem;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: .025em;
    text-wrap: balance;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .48);
}

.book-reading-ribbon--full_book {
    min-height: 86px;
}

.book-detail .cover-card.section-cover .book-reading-ribbon {
    top: 8px;
    right: 18px;
    min-height: 94px;
    padding-top: 13px;
}


@media (max-width: 520px) {
    .book-reading-ribbon {
        right: 8px;
        width: 72px;
        min-height: 76px;
        padding: 9px 6px 19px;
    }

    .book-detail .cover-card.section-cover .book-reading-ribbon {
        top: 8px;
        right: 16px;
        min-height: 88px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cover-wrap:hover .book-reading-ribbon {
        transform: translateY(2px);
    }
}
