/*
 * Designed 3D book cover (home v2 books carousel, books pages, admin preview).
 * Every length is N * --u; the parent sets --u (116u x 146u book).
 * Wrap in .hv2-bk-fluid to size the book to its container instead.
 */

.hv2-bk-fluid {
    container-type: inline-size;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: radial-gradient(70% 60% at 50% 45%, #F7FAFE 0%, #E8F0FA 100%);
}

.hv2-bk-fluid > .hv2-bk-book {
    --u: calc(var(--bk-fill, 64) * 1cqw / 116);
}

.hv2-bk-book {
    position: relative;
    display: flex;
    flex-shrink: 0;
    width: calc(116 * var(--u));
    height: calc(146 * var(--u));
    color: inherit;
    text-decoration: none;
    filter: drop-shadow(0 calc(7 * var(--u)) calc(6 * var(--u)) rgba(28, 62, 116, .16));
    transition: transform .3s ease, filter .3s ease;
}

.hv2-bk-book .hv2-bk-book__side {
    flex: 0 0 calc(12 * var(--u));
    height: 100%;
    clip-path: polygon(0 1.4%, 100% 0, 100% 100%, 0 98.6%);
    background: linear-gradient(90deg, #ADB9CF 0%, #C6CFDE 30%, #DCE2EC 100%);
}

.hv2-bk-book--blue .hv2-bk-book__side {
    background: linear-gradient(90deg, #1A365F 0%, #24426E 45%, #294E84 100%);
}

.hv2-bk-book--black .hv2-bk-book__side {
    background: linear-gradient(90deg, #07090D 0%, #11151D 45%, #1C212B 100%);
}

.hv2-bk-book .hv2-bk-book__front {
    position: relative;
    flex: 1 1 auto;
    overflow: hidden;
    border-radius: 0 calc(1.5 * var(--u)) calc(1.5 * var(--u)) 0;
    background: linear-gradient(165deg, #FFFFFF 0%, #F4F7FC 55%, #EEF3FB 100%);
}

.hv2-bk-book--blue .hv2-bk-book__front {
    background: linear-gradient(165deg, #4B79BE 0%, #2E61A8 35%, #22569E 100%);
}

.hv2-bk-book--black .hv2-bk-book__front {
    background: linear-gradient(165deg, #343B49 0%, #1C212B 40%, #12151C 100%);
}

.hv2-bk-book .hv2-bk-book__front::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 2;
    width: calc(3 * var(--u));
    background: linear-gradient(90deg, rgba(20, 40, 80, .12), rgba(20, 40, 80, 0));
    pointer-events: none;
}

[dir="rtl"] .hv2-bk-book .hv2-bk-book__side {
    clip-path: polygon(0 0, 100% 1.4%, 100% 98.6%, 0 100%);
    background: linear-gradient(270deg, #ADB9CF 0%, #C6CFDE 30%, #DCE2EC 100%);
}

[dir="rtl"] .hv2-bk-book--blue .hv2-bk-book__side {
    background: linear-gradient(270deg, #1A365F 0%, #24426E 45%, #294E84 100%);
}

[dir="rtl"] .hv2-bk-book--black .hv2-bk-book__side {
    background: linear-gradient(270deg, #07090D 0%, #11151D 45%, #1C212B 100%);
}

[dir="rtl"] .hv2-bk-book .hv2-bk-book__front {
    border-radius: calc(1.5 * var(--u)) 0 0 calc(1.5 * var(--u));
}

[dir="rtl"] .hv2-bk-book .hv2-bk-book__front::before {
    inset: 0 0 0 auto;
    background: linear-gradient(270deg, rgba(20, 40, 80, .12), rgba(20, 40, 80, 0));
}

.hv2-bk-book .hv2-bk-book__img {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.hv2-bk-book .hv2-bk-cover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: calc(11 * var(--u)) calc(8 * var(--u)) 0 calc(15 * var(--u));
    box-sizing: border-box;
    font-family: "Fira Sans", Inter, Cairo, Tajawal, system-ui, sans-serif;
    text-align: start;
}

.hv2-bk-book .hv2-bk-cover__brand,
.hv2-bk-book .hv2-bk-cover__series,
.hv2-bk-book .hv2-bk-cover__subject,
.hv2-bk-book .hv2-bk-cover__year {
    position: relative;
    z-index: 1;
}

.hv2-bk-book [hidden] {
    display: none !important;
}

.hv2-bk-book .hv2-bk-cover__wave {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: calc(70 * var(--u));
}

.hv2-bk-book .hv2-bk-cover__wave-1 { fill: #E2EDFB; }
.hv2-bk-book .hv2-bk-cover__wave-2 { fill: #B9D4F5; }
.hv2-bk-book .hv2-bk-cover__wave-3 { fill: #7FAFEA; }

.hv2-bk-book--blue .hv2-bk-cover__wave-1 { fill: rgba(70, 128, 208, .5); }
.hv2-bk-book--blue .hv2-bk-cover__wave-2 { fill: rgba(82, 146, 226, .55); }
.hv2-bk-book--blue .hv2-bk-cover__wave-3 { fill: rgba(100, 164, 238, .7); }

.hv2-bk-book--black .hv2-bk-cover__wave-1 { fill: rgba(62, 104, 172, .28); }
.hv2-bk-book--black .hv2-bk-cover__wave-2 { fill: rgba(66, 118, 196, .42); }
.hv2-bk-book--black .hv2-bk-cover__wave-3 { fill: rgba(82, 142, 224, .62); }

[dir="rtl"] .hv2-bk-book .hv2-bk-cover__wave {
    transform: scaleX(-1);
}

.hv2-bk-book .hv2-bk-cover__illus {
    position: absolute;
    right: calc(4 * var(--u));
    bottom: calc(13 * var(--u));
    width: calc(54 * var(--u));
    height: calc(54 * var(--u));
    color: #7EA7DC;
}

[dir="rtl"] .hv2-bk-book .hv2-bk-cover__illus {
    right: auto;
    left: calc(4 * var(--u));
}

.hv2-bk-book--blue .hv2-bk-cover__illus {
    color: rgba(220, 234, 255, .85);
}

.hv2-bk-book--black .hv2-bk-cover__illus {
    color: rgba(170, 200, 240, .8);
}

.hv2-bk-book .hv2-bk-cover__brand {
    display: inline-flex;
    align-items: center;
    height: calc(25 * var(--u));
    margin-top: calc(-5 * var(--u));
    box-sizing: border-box;
}

.hv2-bk-book .hv2-bk-cover__brand img {
    display: block;
    width: auto;
    height: 100%;
    max-width: none;
}
.hv2-bk-book .hv2-bk-cover__series {
    margin-top: calc(6 * var(--u));
    color: #2F5C9A;
    font-size: calc(11.5 * var(--u));
    font-weight: 600;
    line-height: 1;
}

.hv2-bk-book .hv2-bk-cover__subject {
    display: -webkit-box;
    overflow: hidden;
    max-width: 100%;
    color: #1E3A6E;
    font-size: calc(13.5 * var(--u));
    font-weight: 600;
    line-height: 1.05;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
}

.hv2-bk-book .hv2-bk-cover__series[hidden] + .hv2-bk-cover__subject {
    margin-top: calc(6 * var(--u));
}

.hv2-bk-book .hv2-bk-cover__year {
    display: flex;
    flex-direction: column;
    margin-top: calc(4 * var(--u));
    color: #7A86A2;
    font-size: calc(5 * var(--u));
    font-weight: 500;
    line-height: calc(7 * var(--u));
}

.hv2-bk-book .hv2-bk-cover__year span:first-child {
    font-weight: 700;
}

.hv2-bk-book--blue .hv2-bk-cover__subject,
.hv2-bk-book--black .hv2-bk-cover__subject {
    color: #fff;
}

.hv2-bk-book--blue .hv2-bk-cover__series {
    color: #C4D9F6;
}

.hv2-bk-book--black .hv2-bk-cover__series {
    color: #8FB4EA;
}

.hv2-bk-book--blue .hv2-bk-cover__year {
    color: rgba(226, 237, 252, .85);
}

.hv2-bk-book--black .hv2-bk-cover__year {
    color: rgba(206, 218, 236, .8);
}

.hv2-bk-book--soon .hv2-bk-book__front {
    filter: grayscale(.35) brightness(.96);
}

.hv2-bk-book .hv2-bk-book__soon {
    position: absolute;
    top: calc(8 * var(--u));
    right: calc(-6 * var(--u));
    z-index: 5;
    display: inline-flex;
    align-items: center;
    height: calc(14 * var(--u));
    padding: 0 calc(7 * var(--u));
    border-radius: calc(7 * var(--u));
    background: #E53935;
    box-shadow: 0 calc(3 * var(--u)) calc(6 * var(--u)) rgba(229, 57, 53, .35);
    color: #fff;
    font-family: "Fira Sans", Inter, Cairo, Tajawal, system-ui, sans-serif;
    font-size: calc(6 * var(--u));
    font-weight: 700;
    line-height: 1;
    letter-spacing: .02em;
    white-space: nowrap;
    pointer-events: none;
}

[dir="rtl"] .hv2-bk-book .hv2-bk-book__soon {
    right: auto;
    left: calc(-6 * var(--u));
}

.hv2-bk__link--soon,
.book-card--soon {
    cursor: default;
}
