
/* AuthorCMS: card styles */
/* Стили карточек книг на главной странице */

.book-info h3 {
    color: #2C3E50 !important;
    font-size: 1.5rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    -webkit-text-stroke: none !important;
}

[data-theme="dark"] .book-info h3 {
    color: #6b8cae !important;
}

.book-card.has-price-display .book-info h3 {
    margin-bottom: 0.6rem !important;
}

.book-series-label {
    color: #3498DB !important;
    font-size: 0.9rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

[data-theme="dark"] .book-series-label {
    color: #3c9cdc !important;
}

.book-series-title {
    color: #3498DB !important;
    font-size: 0.9rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

[data-theme="dark"] .book-series-title {
    color: #3c9cdc !important;
}

.book-series-position-label {
    color: #3498DB !important;
    font-size: 0.9rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

[data-theme="dark"] .book-series-position-label {
    color: #3c9cdc !important;
}

.book-series-position-number {
    color: #3498DB !important;
    font-size: 0.9rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

[data-theme="dark"] .book-series-position-number {
    color: #3c9cdc !important;
}

.book-genre {
    color: #387735 !important;
    font-size: 0.8rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

[data-theme="dark"] .book-genre {
    color: #64b860 !important;
}

.book-work-info {
    margin-top: 0.1rem !important;
    margin-bottom: 0.5rem;
}

.book-work-form {
    color: #3E495B !important;
    font-size: 0.9rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 700 !important;
}

[data-theme="dark"] .book-work-form {
    color: #7787a2 !important;
}

.book-work-volume {
    color: #2C3E50 !important;
    font-size: 0.9rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

[data-theme="dark"] .book-work-volume {
    color: #6b8cae !important;
}

.book-description {
    color: #333333 !important;
    font-size: 0.85rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
    margin-bottom: 0.5rem !important;
}

.book-description * {
    color: #333333 !important;
    font-size: 0.85rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

.book-description strong,
.book-description b {
    font-weight: bold !important;
    color: #333333 !important;
}

.book-description em,
.book-description i {
    font-style: italic !important;
    color: #333333 !important;
}

.book-description u {
    text-decoration: underline !important;
    color: #333333 !important;
}

.book-description del,
.book-description s,
.book-description strike {
    text-decoration: line-through !important;
    color: #333333 !important;
}

.book-description span[style*="font-size"] {
    color: #333333 !important;
    font-size: 0.85rem !important;
    font-family: Arial, sans-serif !important;
}

[data-theme="dark"] .book-description,
[data-theme="dark"] .book-description *,
[data-theme="dark"] .book-description strong,
[data-theme="dark"] .book-description b,
[data-theme="dark"] .book-description em,
[data-theme="dark"] .book-description i,
[data-theme="dark"] .book-description u,
[data-theme="dark"] .book-description del,
[data-theme="dark"] .book-description s,
[data-theme="dark"] .book-description strike,
[data-theme="dark"] .book-description span[style*="font-size"] {
    color: #8c8c8c !important;
}

.book-description .show-full-text,
.book-description .collapse-text {
    color: #3498db !important;
}

[data-theme="dark"] .book-description .show-full-text,
[data-theme="dark"] .book-description .collapse-text {
    color: #3c9cdc !important;
}

.book-card {
    position: relative !important;
}

.book-actions {
    position: absolute !important;
    right: 15px !important;
    bottom: 15px !important;
}

.book-actions .btn-secondary {
    background-color: #95A5A6 !important;
    color: #FFFFFF !important;
    font-size: 1rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

[data-theme="dark"] .book-actions .btn-secondary {
    background-color: #778485 !important;
}

.book-actions .btn-primary {
    background-color: #3498DB !important;
    color: #FFFFFF !important;
    font-size: 1rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

[data-theme="dark"] .book-actions .btn-primary {
    background-color: #2a7aaf !important;
}

@media (max-width: 768px) {
    .book-actions .btn-secondary {
        font-size: 0.84rem !important;
    }
    .book-actions .btn-primary {
        font-size: 0.84rem !important;
    }
}

@media (max-width: 480px) {
    .book-actions .btn-secondary {
        font-size: 0.8rem !important;
    }
    .book-actions .btn-primary {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 768px) {
    .book-actions {
        position: static !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin-top: 1rem !important;
        margin-bottom: 10px !important;
        padding: 0 1rem !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
    }
    .book-info {
        padding-bottom: 0 !important;
    }
}

.book-meta h1 {
    color: #2C3E50 !important;
    font-size: 1.5rem !important;
    font-family: Arial, sans-serif !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    -webkit-text-stroke: none !important;
}

[data-theme="dark"] .book-meta h1 {
    color: #6b8cae !important;
}

.book-meta.has-price-display h1 {
    margin-bottom: 0.6rem !important;
}

.book-work-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.publication-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.92em;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.publication-status.is-in-progress {
    color: #2d9cdb;
}

.publication-status.is-completed {
    color: #27ae60;
}

.publication-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95em;
    line-height: 1;
    width: 1em;
    height: 1em;
    flex: 0 0 1em;
    vertical-align: middle;
}

.publication-status.is-in-progress .publication-status-icon {
    position: relative;
    overflow: hidden;
    text-indent: -9999px;
    white-space: nowrap;
    transform: translateY(-0.02em) rotate(45deg);
    transform-origin: 50% 50%;
}

.publication-status.is-in-progress .publication-status-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    display: block;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 5 9l7 13 7-13-7-7Zm0 5.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5Zm-1.65 5L8.9 18h6.2l-1.45-5.75L12 13.8l-1.65-1.55Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 5 9l7 13 7-13-7-7Zm0 5.25a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5Zm-1.65 5L8.9 18h6.2l-1.45-5.75L12 13.8l-1.65-1.55Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 768px) {
    .publication-status.is-in-progress .publication-status-icon {
        transform: translateY(-0.02em) rotate(45deg);
        transform-origin: 50% 50%;
    }
}

.series-publication-status {
    display: inline-flex;
    margin-top: 0.35rem;
}

.series-meta .series-publication-status,
.cycle-info .series-publication-status {
    margin-bottom: 0.2rem;
}

@media (max-width: 768px) {
    /*
     * Размер текста сюда не входит — он теперь считается в generateCardCSS() как
     * авторский card_button_size/card_read_button_size с понижающим коэффициентом
     * (см. там же). Фиксированное значение здесь конфликтовало по специфичности с
     * индивидуальными per-book правилами и не давало одинаковый результат для книг
     * с общими и с индивидуальными настройками кнопок.
     */
    .book-card .book-actions .btn,
    .book-card .book-actions .btn-primary,
    .book-card .book-actions .btn-secondary,
    .book-card .book-actions button,
    .book-card .book-actions a,
    .book-card .book-action-group button,
    .book-card .book-action-group a,
    .book-card .book-download-btn {
        padding: 9px 12px !important;
        line-height: 1.18 !important;
        min-height: 38px !important;
        height: auto !important;
        max-height: none !important;
    }

    .book-actions {
        gap: 0.45rem !important;
        margin-top: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .book-card .book-actions .btn,
    .book-card .book-actions .btn-primary,
    .book-card .book-actions .btn-secondary,
    .book-card .book-actions button,
    .book-card .book-actions a,
    .book-card .book-action-group button,
    .book-card .book-action-group a,
    .book-card .book-download-btn {
        padding: 8px 10px !important;
        min-height: 36px !important;
    }
}


/* AuthorCMS: cover styles */
/* 3D эффект обложек - настройки из админки */
.book-cover img {
    box-shadow: 
        2px 2px 0 0.1px rgba(180, 180, 180, 0.50),
        4px 4px 0 0.1px rgba(180, 180, 180, 0.45),
        6px 6px 0 0.1px rgba(180, 180, 180, 0.40),
        8px 8px 0 0.1px rgba(180, 180, 180, 0.35),
        10px 10px 0 0.1px rgba(180, 180, 180, 0.30),
        3px 2px 0 0.1px rgba(180, 180, 180, 0.50),
        6px 4px 0 0.1px rgba(180, 180, 180, 0.45),
        9px 6px 0 0.1px rgba(180, 180, 180, 0.40),
        12px 8px 0 0.1px rgba(180, 180, 180, 0.35),
        15px 10px 0 0.1px rgba(180, 180, 180, 0.30) !important;
    border-radius: 0 5px 5px 0 !important;
    position: relative;
}

/* Корешок книги - вертикальная линия слева */
.book-cover::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    bottom: 0;
    width: 2.5px;
    background: rgba(128, 128, 128, 0.5);
    z-index: 2;
    pointer-events: none;
    transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
    transform-style: preserve-3d;
}

.book-card:hover .book-cover img {
    box-shadow: 
        2px 2px 0 0.1px rgba(180, 180, 180, 0.50),
        4px 4px 0 0.1px rgba(180, 180, 180, 0.45),
        6px 6px 0 0.1px rgba(180, 180, 180, 0.40),
        8px 8px 0 0.1px rgba(180, 180, 180, 0.35),
        10px 10px 0 0.1px rgba(180, 180, 180, 0.30),
        3px 2px 0 0.1px rgba(180, 180, 180, 0.50),
        6px 4px 0 0.1px rgba(180, 180, 180, 0.45),
        9px 6px 0 0.1px rgba(180, 180, 180, 0.40),
        12px 8px 0 0.1px rgba(180, 180, 180, 0.35),
        15px 10px 0 0.1px rgba(180, 180, 180, 0.30),
        20px 20px 40px rgba(0,0,0,0.3) !important;
}

.book-cover-content-badges,
.book-mini-cover {
    pointer-events: none;
}

.book-cover-content-badges {
    position: absolute;
    inset: 0;
    z-index: 4;
    transform-origin: center center;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.book-cover .book-cover-content-badge,
.book-mini-cover .book-cover-content-badge,
.book-cover-content-badge {
    position: absolute;
    bottom: 8px;
    opacity: 0.55;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
    transition: none !important;
}

.book-cover .book-cover-content-badge--adult,
.book-mini-cover .book-cover-content-badge--adult,
.book-cover-content-badge--adult {
    right: 8px;
    width: 21.6% !important;
    max-width: 46px !important;
    min-width: 27px !important;
}

.book-cover .book-cover-content-badge--lexic,
.book-mini-cover .book-cover-content-badge--lexic,
.book-cover-content-badge--lexic {
    left: 8px;
    width: 35.2% !important;
    max-width: 70px !important;
    min-width: 46px !important;
}

.book-card:hover .book-cover-content-badges,
.book-header .book-cover-wrapper:hover .book-cover-content-badges {
    transform: rotateY(-15deg) rotateX(5deg) scale(1.05) !important;
}

.book-card:hover .book-cover .book-cover-content-badge,
.book-header .book-cover-wrapper:hover .book-cover .book-cover-content-badge,
.book-header .book-cover:hover .book-cover-content-badge {
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
}

.book-mini-cover {
    position: relative;
    display: block;
}

.book-mini-cover .book-cover-content-badge {
    bottom: 10px;
}

/* Корешок поворачивается вместе с обложкой при наведении */
.book-card:hover .book-cover::before {
    transform: rotateY(-15deg) rotateX(5deg) scale(1.05);
    top: 3px;
    bottom: 3px;
}

/* Для страницы книги: обложка и корешок поворачиваются при наведении */
/* Используем hover на .book-cover-wrapper, аналогично .book-card:hover в карточках */
.book-header .book-cover-wrapper:hover .book-cover img,
.book-header .book-cover-wrapper:hover .book-cover-large {
    box-shadow: 
        2px 2px 0 0.1px rgba(180, 180, 180, 0.50),
        4px 4px 0 0.1px rgba(180, 180, 180, 0.45),
        6px 6px 0 0.1px rgba(180, 180, 180, 0.40),
        8px 8px 0 0.1px rgba(180, 180, 180, 0.35),
        10px 10px 0 0.1px rgba(180, 180, 180, 0.30),
        3px 2px 0 0.1px rgba(180, 180, 180, 0.50),
        6px 4px 0 0.1px rgba(180, 180, 180, 0.45),
        9px 6px 0 0.1px rgba(180, 180, 180, 0.40),
        12px 8px 0 0.1px rgba(180, 180, 180, 0.35),
        15px 10px 0 0.1px rgba(180, 180, 180, 0.30),
        20px 20px 40px rgba(0,0,0,0.3) !important;
    transform: rotateY(-15deg) rotateX(5deg) scale(1.05) !important;
}

/* Корешок поворачивается вместе с обложкой при наведении на странице книги */
/* Используем тот же селектор, что и для обложки, чтобы гарантировать синхронность */
.book-header .book-cover-wrapper:hover .book-cover::before {
    transform: rotateY(-15deg) rotateX(5deg) scale(1.05) !important;
    top: 3px !important;
    bottom: 3px !important;
}

/* Дополнительное правило для корешка при hover на сам .book-cover (на случай, если wrapper не срабатывает) */
.book-header .book-cover:hover::before {
    transform: rotateY(-15deg) rotateX(5deg) scale(1.05) !important;
    top: 3px !important;
    bottom: 3px !important;
}

/* Отключаем 3D эффект корешка в мобильной версии и уменьшаем его снизу */
@media (max-width: 768px) {
    .book-cover::before {
        bottom: 3px !important;
    }
    
    .book-card:hover .book-cover::before {
        transform: none !important;
        top: 0 !important;
        bottom: 3px !important;
    }
    
    /* Отключаем 3D эффект обложки и корешка на странице книги в мобильной версии */
    .book-header .book-cover-wrapper:hover .book-cover img,
    .book-header .book-cover-wrapper:hover .book-cover-large {
        transform: none !important;
    }
    
    .book-header .book-cover-wrapper:hover .book-cover::before,
    .book-header .book-cover:hover::before {
        transform: none !important;
        top: 0 !important;
        bottom: 3px !important;
    }

    .book-card:hover .book-cover-content-badges,
    .book-header .book-cover-wrapper:hover .book-cover-content-badges {
        transform: none !important;
    }
    
    /* Позиционирование счетчиков для мобильной версии */
    .book-counters-mobile {
        justify-content: center !important;margin-top: 10px !important;gap: 10px !important;    }
    
    /* Отключаем стили позиционирования для счетчиков на странице книги в мобильной версии */
    .book-header .book-likes,
    .book-header .book-comments,
    .book-header .book-library {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
    }
    
    /* Отключаем hover эффекты для счетчиков на странице книги в мобильной версии */
    .book-header .book-cover-wrapper > .book-likes:hover,
    .book-header .book-cover-wrapper > .book-comments:hover,
    .book-header .book-cover-wrapper > .book-library:hover,
    .book-header .book-likes:hover,
    .book-header .book-comments:hover,
    .book-header .book-library:hover {
        transform: none !important;
    }
}


.book-cover-wrapper {
    margin-left: 10px;
    margin-top: 12px;
    padding-bottom: 70px;
}

/* Для страницы книги обложка больше (210px вместо 189px) */
.book-header .book-cover-wrapper {
    width: 210px;
    padding-bottom: 70px;
}

.book-header .book-cover {
    width: 210px;
    height: 300px;
}


.book-header .book-cover-wrapper > .book-likes {
    top: 325px;
    left: 35px;
    transform: translateX(-50%);
    transform-origin: center center;
}

.book-header .book-cover-wrapper > .book-comments {
    top: 325px;
    left: 110px;
    transform: translateX(-50%);
    transform-origin: center center;
}

.book-header .book-cover-wrapper > .book-library {
    top: 325px;
    left: 185px;
    transform: translateX(-50%);
    transform-origin: center center;
}

.book-header .book-cover-wrapper.book-counter-set--two > .book-likes {
    left: 72.5px;
}

.book-header .book-cover-wrapper.book-counter-set--two > .book-comments {
    left: 147.5px;
}

.book-header .book-cover-wrapper > .book-likes:hover,
.book-header .book-cover-wrapper > .book-comments:hover,
.book-header .book-cover-wrapper > .book-library:hover {
    transform: translateX(-50%) scale(1.05) !important;
}

.book-info {
    margin-left: 25px;
}

.book-cover-wrapper > .book-likes {
    top: 295px;
    left: 25px;
    transform: translateX(-50%);
    transform-origin: center center;
}

.book-cover-wrapper > .book-comments {
    top: 295px;
    left: 100px;
    transform: translateX(-50%);
    transform-origin: center center;
}

.book-cover-wrapper > .book-library {
    top: 295px;
    left: 175px;
    transform: translateX(-50%);
    transform-origin: center center;
}

.book-cover-wrapper.book-counter-set--two > .book-likes {
    left: 62.5px;
}

.book-cover-wrapper.book-counter-set--two > .book-comments {
    left: 137.5px;
}

.book-cover-wrapper > .book-likes:hover,
.book-cover-wrapper > .book-comments:hover,
.book-cover-wrapper > .book-library:hover {
    transform: translateX(-50%) scale(1.05) !important;
}
