/* ================================================
   Стили для раздела "Книги" - современная верстка
   ================================================ */

.wJournalsBooksWidget {
    margin: 40px 0;
}

.wJournalsBooksWidget .section_offset h3 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.wJournalsBooksWidget .section_offset h3:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 2px;
}

.books-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
}

.book-card {
    flex: 0 1 calc(20% - 16px);
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9, #9b59b6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover::before {
    opacity: 1;
}

.book-image {
    position: relative;
    overflow: hidden;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.book-image img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.book-card:hover .book-image img {
    transform: scale(1.05);
}

.book-info {
    padding: 20px 16px;
    text-align: center;
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    line-height: 1.4;
    display: block;
    transition: color 0.3s ease;
}

.book-title:hover {
    color: #3498db;
    text-decoration: none;
}

.book-number {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .book-card {
        flex: 0 1 calc(25% - 15px);
    }
}

@media (max-width: 968px) {
    .books-grid {
        gap: 15px;
    }
    
    .book-card {
        flex: 0 1 calc(33.333% - 10px);
        min-width: 180px;
    }
    
    .book-image {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .books-grid {
        gap: 12px;
    }
    
    .book-card {
        flex: 0 1 calc(50% - 6px);
        min-width: 160px;
    }
    
    .book-image {
        height: 180px;
    }
    
    .wJournalsBooksWidget .section_offset h3 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .book-card {
        flex: 0 1 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .books-grid {
        flex-direction: column;
        align-items: center;
    }
}

/* Анимация появления */
.book-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.book-card:nth-child(1) { animation-delay: 0.1s; }
.book-card:nth-child(2) { animation-delay: 0.2s; }
.book-card:nth-child(3) { animation-delay: 0.3s; }
.book-card:nth-child(4) { animation-delay: 0.4s; }
.book-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Скрываем старые стили для книг */
.wJournalsBooksWidget .post_col5,
.wJournalsBooksWidget .post_edition {
    display: none !important;
}
