@media (min-width: 768px) {
    .gallery--book {
        padding-bottom: 3rem;
    }
}

.book-template {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.book-template * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.book-desktop {
    display: block;
}

.book-mobile {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.book-template__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.book-template__btn {
    min-width: 3rem;
}

.book-template__status {
    font-weight: 600;
    color: #1f2937;
}

.book-view {
    margin: 0 auto;
    background: #fdfdfd;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    direction: rtl;
}

.book-view--stacked {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    direction: rtl;
}

.book-page {
    width: 100%;
    height: 100%;
    padding: 1.25rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.book-page__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #475569;
    pointer-events: none;
}

.book-page__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
    text-align: right;
}

.book-page__single-media {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    flex: 1;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
    aspect-ratio: 3 / 4;
}

.book-page__media {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.book-page__media img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
}

.book-page__video iframe {
    width: 100%;
    height: 220px;
    border: none;
    border-radius: 12px;
    background: #000;
}

.book-template__hint {
    text-align: center;
    color: #4b5563;
    font-size: 0.85rem;
}

.book-template__hint--alert {
    color: #b91c1c;
}

.book-page--empty {
    background: #f5f5f5;
}

.book-view--stacked .book-page {
    width: 100%;
    height: auto;
}

.book-mobile__media {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.15);
    background: #f3f4f6;
}

.book-mobile__media img,
.book-mobile__media iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-mobile__media iframe {
    border: none;
    background: #000;
}

.book-mobile__tap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.book-mobile__tap--prev {
    left: 0;
}

.book-mobile__tap--next {
    right: 0;
}

.book-mobile__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #475569;
}

.book-mobile__description {
    margin: 0.35rem 0 0;
    line-height: 1.7;
    color: #1f2937;
}

.book-mobile__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.book-mobile__status {
    font-weight: 600;
    color: #0f172a;
}

@media (max-width: 767px) {
    .book-desktop {
        display: none;
    }

    .book-mobile {
        display: flex;
    }

    .book-template__controls {
        display: none;
    }

    .book-view {
        box-shadow: none;
        border-radius: 0;
        background: transparent;
    }

    .book-view--stacked .book-page {
        padding: 1rem;
        border-radius: 18px;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
        background: #fff;
    }

    .book-page__media img {
        height: auto;
        max-height: 200px;
    }
}
