/* --- Custom Book Author Archive Page Styles --- */

.book-author-archive-container {
    max-width: 1200px;
    margin: 40px auto 60px auto;
    padding: 0 20px;
    font-family: 'Poppins',sans-serif;
    color: #333;
}

/* Author Info Section */
.author-info-section {
    display: flex;
    flex-wrap: wrap; /* Allow columns to stack on smaller screens */
    gap: 40px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 60px;
    align-items: flex-start; /* Align content to the top */
}

.author-photo-column {
    flex: 0 0 300px; /* Fixed width for the photo column */
    max-width: 300px;
    box-sizing: border-box;
    display: flex;
    justify-content: center; /* Center photo if smaller than column */
    flex-shrink: 0; /* Prevent shrinking */
}

.author-photo-wrapper {
    width: 100%;
    height: auto; /* Allow height to be natural */
    max-width: 300px; /* Max width for the photo */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
}

.author-photo {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.author-description-column {
    flex: 1; /* Takes remaining space */
    box-sizing: border-box;
}

.author-name-title {
    font-size: 3.2em;
    color: #222;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.author-description {
    font-size: 1rem;
    color: #444;
    line-height: 1.7;
}

.author-description p {
    margin-bottom: 1em;
}

/* Books by Author Section */
.books-by-author-section {
    margin-top: 60px;
}

.books-by-author-section .section-title {
    font-size: 2.5em;
    color: #222;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
    line-height: 1.2;
}

.author-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Re-using shop page card size */
    gap: 40px;
}

/* Re-using some existing product card styles for consistency */
.author-books-grid .product-card { /* Assuming wc_get_template_part('content', 'product') outputs a .product-card */
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.author-books-grid .product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.author-books-grid .product-card .woocommerce-loop-product__link { /* Link wrapper for product */
    display: block;
    text-decoration: none;
    color: inherit;
}

.author-books-grid .product-card .woocommerce-loop-product__title {
    font-size: 1.3em;
    font-weight: 600;
    color: #222;
    margin: 15px 10px 10px;
    line-height: 1.3;
}

.author-books-grid .product-card .price {
    font-size: 1.1em;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 15px;
}

.author-books-grid .product-card .button { /* Add to cart button */
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto; /* Push button to bottom */
}

.author-books-grid .product-card .button:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

.no-books-found,
.no-author-found {
    text-align: center;
    font-size: 1.2em;
    color: #666;
    margin: 80px 0;
}


/* Responsive Adjustments */
@media (max-width: 900px) {
    .author-info-section {
        flex-direction: column; /* Stack columns */
        align-items: center;
        gap: 30px;
        padding: 30px;
    }
    .author-photo-column {
        flex: 0 0 auto;
        max-width: 250px; /* Slightly smaller photo on tablets */
    }
    .author-name-title {
        font-size: 2.5em;
        text-align: center;
    }
    .author-description-column {
        text-align: center;
    }
    .books-by-author-section .section-title {
        font-size: 2em;
        margin-bottom: 30px;
    }
    .author-books-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .book-author-archive-container {
        margin: 30px auto 40px auto;
        padding: 0 15px;
    }
    .author-info-section {
        padding: 20px;
        gap: 20px;
    }
    .author-photo-column {
        max-width: 200px; /* Smaller photo on mobile */
    }
    .author-name-title {
        font-size: 2em;
    }
    .author-description {
        font-size: 1em;
    }
    .books-by-author-section .section-title {
        font-size: 1.8em;
        margin-bottom: 25px;
    }
    .author-books-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
        gap: 25px;
    }
    .author-books-grid .product-card .woocommerce-loop-product__title {
        font-size: 1.2em;
    }
}

