/* Books Container */
.books-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Single Book Layout - Force display */
.single-book .single-book-wrapper,
.single.single-book .single-book-wrapper {
    display: flex !important;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    align-items: flex-start;
}

/* Book Main Title (H1) */
.book-main-title {
    font-size: 2.5em !important;
    font-weight: 700 !important;
    margin-bottom: 30px !important;
    line-height: 1.2 !important;
    color: #1a1a1a !important;
    margin-top: 0;
}

.single-book .single-book-content,
.single.single-book .single-book-content {
    flex: 1 !important;
    min-width: 0;
}

/* Book Description Styles */
.book-description {
    background: white;
    padding: 40px !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-radius: 2px;
    margin-bottom: 30px !important;
}

.book-opening {
    font-size: 1.15em !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    margin-bottom: 28px !important;
    padding-left: 20px !important;
    border-left: 4px solid #d4a574 !important;
    line-height: 1.7 !important;
}

.book-main-text {
    margin-bottom: 20px !important;
    text-align: justify;
}

.book-main-text p {
    margin-bottom: 16px !important;
    line-height: 1.8 !important;
}

.book-separator {
    text-align: center !important;
    margin: 35px 0 !important;
    color: #999 !important;
    font-size: 1.2em !important;
    letter-spacing: 8px !important;
}

.book-comparison {
    font-style: italic !important;
    color: #555 !important;
    margin: 30px 0 !important;
    padding: 20px !important;
    background: #fafafa !important;
    border-radius: 2px;
    font-size: 0.98em !important;
}

.book-tagline {
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin-top: 30px !important;
    padding-top: 25px !important;
    border-top: 1px solid #e0e0e0 !important;
    font-size: 1.05em !important;
    text-align: center !important;
    font-style: italic !important;
}

.book-title-emphasized {
    font-weight: 700;
    font-style: italic;
}

/* Book Links Section */
.book-links-section {
    background: white !important;
    padding: 30px 40px !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-radius: 2px;
    margin-bottom: 30px !important;
}

.book-links-section h3 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    font-size: 1.3em !important;
}

/* SEO Description Section */
.book-seo-section {
    background: white !important;
    padding: 30px 40px !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-radius: 2px;
    margin-bottom: 30px !important;
    line-height: 1.8 !important;
}

.book-seo-section p {
    font-size: 1.1em;
    color: #333 !important;
}

/* YouTube Video Section */
.book-youtube-section {
    background: white !important;
    padding: 30px 40px !important;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-radius: 2px;
    margin-bottom: 30px !important;
}

.book-youtube-section h3 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    font-size: 1.3em !important;
}

.book-youtube-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 4px;
}

.book-youtube-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Filters Section */
.books-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.book-filter {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.book-filter:hover,
.book-filter:focus {
    border-color: #0073aa;
    outline: none;
}

/* .books-grid è definito nel child theme (wp-content/themes/allisonlister/
   style.css). Il plugin non ridichiara qui il contenitore per evitare
   duplicazioni e conflitti di cascade: il tema vince per source order e
   avere due definizioni dello stesso componente in due fogli è il difetto
   di fondo che aveva già rotto il layout una volta. */

/* Book Card */
.book-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.book-cover {
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: #f0f0f0;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.book-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 20px;
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.4;
}

.book-excerpt {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
    flex: 1;
}

/* Book Links */
.book-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.book-link {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
}

.amazon-link {
    background: #FF9900;
    color: white;
}

.amazon-link:hover {
    background: #e68a00;
}

.kofi-link {
    background: #29ABE0;
    color: white;
}

.kofi-link:hover {
    background: #1a8fc4;
}

.audio-link {
    background: #8B5CF6;
    color: white;
}

.audio-link:hover {
    background: #7C3AED;
}

.youtube-link {
    background: #FF0000;
    color: white;
}

.youtube-link:hover {
    background: #cc0000;
}

.book-read-more {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    transition: background 0.3s;
}

.book-read-more:hover {
    background: #005a87;
}

/* Single Book Page */
.single-book .book-meta {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
}

.single-book .book-meta h3 {
    margin-top: 0;
}

.single-book .book-links {
    margin: 20px 0;
}

.single-book .book-youtube-video {
    margin: 30px 0;
}

.single-book .book-youtube-video iframe {
    width: 100% !important;
    max-width: 800px;
    height: 425px !important;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .books-filters {
        flex-direction: column;
    }

    /* .books-grid responsive gestito nel child theme. */

    .book-cover {
        height: 320px;
    }

    /* Single Book Responsive */
    .single-book .single-book-wrapper,
    .single.single-book .single-book-wrapper {
        flex-direction: column !important;
        gap: 30px;
    }


    .book-description {
        padding: 25px !important;
    }

    .book-links-section,
    .book-youtube-section {
        padding: 25px !important;
    }
}

@media (max-width: 480px) {
    /* .books-grid responsive gestito nel child theme. */

    .book-links {
        flex-direction: column;
    }

    .book-link {
        text-align: center;
    }


    .book-description {
        padding: 5px !important;
        border-left: none;
    }

    .book-main-text p {
        text-align: left;
    }

    .book-opening {
        font-size: 1.05em !important;
    }
}

/* ============================================
   SIMPLE GRID (NO FILTERS)
   ============================================ */
.books-simple-grid {
    padding: 20px 0;
}

.books-simple-grid .books-grid {
    margin-top: 0;
}

/* .books-grid-cols-N: varianti colonne gestite nel child theme. */

/* Special theme */
.single-book .mkdf-post-heading,
.single-book .mkdf-title-holder.mkdf-standard-type.mkdf-title-va-header-bottom,
.single-book .mkdf-post-info-top,
.single-book h2.entry-title.mkdf-post-title {
    display: none;
}

/* ============================================
   RATING STARS
   ============================================ */

/* Rating stars display */
.book-rating-display {
    margin: 15px 0;
}

.book-stars {
    display: inline-flex;
    gap: 4px;
    font-size: 20px;
    line-height: 1;
}

.book-stars .star {
    display: inline-block;
    transition: all 0.2s ease;
}

.book-stars .star.filled {
    color: #ffc107;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.book-stars .star.empty {
    color: #ddd;
}

/* Rating in book cards */
.book-card .book-rating-display {
    margin: 10px 0;
}

.book-card .book-stars {
    font-size: 18px;
}

/* Rating in single book page */
.single-book-content .book-rating-display {
    margin: 20px 0;
}

.single-book-content .book-stars {
    font-size: 24px;
}

/* Review Section */
.book-review-section {
    background: white !important;
    padding: 30px 40px !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    margin-bottom: 30px !important;
}

.book-review-section h3 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    font-size: 1.3em !important;
    color: #1a1a1a !important;
}

.book-review-text {
    line-height: 1.8 !important;
    color: #333 !important;
}

.book-review-text p {
    margin-bottom: 16px !important;
}

/* Responsive adjustments for ratings */
@media (max-width: 768px) {
    .single-book-content .book-stars {
        font-size: 20px;
    }

    .book-review-section {
        padding: 25px !important;
    }
}

@media (max-width: 480px) {
    .book-card .book-stars {
        font-size: 16px;
    }

    .single-book-content .book-stars {
        font-size: 18px;
    }

    .book-review-section {
        padding: 20px !important;
    }
}

/* ============================================
   RELATED BOOKS SECTION
   ============================================ */

.book-related-section {
    flex-basis: 100%;
    width: 100%;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid #e8e8e8;
}

.book-related-title {
    font-size: 1.3em !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin-top: 0 !important;
    margin-bottom: 25px !important;
    font-style: italic;
}

.book-related-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.book-related-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    background: #fafafa;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.book-related-item:hover {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transform: translateX(4px);
}

.book-related-image {
    flex: 0 0 60px;
    width: 60px;
    height: 80px;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.book-related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-related-info {
    flex: 1;
    min-width: 0;
}

.book-related-item-title {
    font-size: 0.95em !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 4px 0 !important;
    line-height: 1.3 !important;
}

.book-related-item:hover .book-related-item-title {
    color: #d4a574 !important;
}

.book-related-desc {
    font-size: 0.85em !important;
    color: #888 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

.book-related-more {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

.book-related-more-link {
    display: inline-block;
    font-size: 0.9em;
    font-weight: 600;
    color: #d4a574;
    text-decoration: none;
    transition: all 0.3s ease;
}

.book-related-more-link:hover {
    color: #b8895e;
    transform: translateX(4px);
}

/* Related Books Responsive */
@media (max-width: 768px) {
    .book-related-section {
        margin-top: 40px;
        padding-top: 30px;
    }

    .book-related-item {
        padding: 12px;
        gap: 14px;
    }

    .book-related-image {
        flex: 0 0 50px;
        width: 50px;
        height: 68px;
    }
}

@media (max-width: 480px) {
    .book-related-title {
        font-size: 1.15em !important;
    }

    .book-related-item {
        padding: 10px;
        gap: 12px;
    }

    .book-related-image {
        flex: 0 0 45px;
        width: 45px;
        height: 60px;
    }

    .book-related-item-title {
        font-size: 0.9em !important;
    }

    .book-related-desc {
        font-size: 0.8em !important;
    }
}