
/* BOOK STYLES *
 * These are styles for page which displays a grid of our books.
 */
.book-grid-container {
            display: grid;
            /* UPDATED: Changed to prevent items from stretching.
               'auto-fill' creates columns of a fixed 200px width.
               This makes items have a consistent maximum size. */
            grid-template-columns: repeat(auto-fill, 250px);
            gap: 2rem; /* The space between grid items */
            max-width: 1200px;
            margin: auto;
            /* NEW: Aligns the grid items to the left of the container
               when they don't fill the entire row. */
            justify-content: flex-start;
        }

        .book-item {
            background-color: #ffffff;
            border-radius: 0.75rem; /* Rounded corners */
            overflow: hidden; /* Ensures the image corner rounding works */
            box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            
            /* Using flexbox to structure the content inside the card.
               This helps ensure all cards have the same height and content aligns properly. */
            display: flex;
            flex-direction: column;
        }

        .book-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.08);
        }

        .book-cover-container {
            /* This container creates a consistent aspect ratio for the image area.
               The 'padding-top' trick (75% = 4:3 ratio) reserves vertical space. 
               Here we use 150% for a common book cover ratio (2:3). */
            width: 100%;
            padding-top: 150%; /* Aspect Ratio 2:3 (width:height) */
            position: relative; /* Necessary for positioning the image inside */
            background-color: white; /* Placeholder color */
        }

        .book-cover-container img {
            /* This is the key to handling different image sizes.
               'object-fit: cover' makes the image fill the container without stretching.
               It will crop the image to fit, maintaining its aspect ratio. */
            object-fit: cover;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
					  padding: 10%;
        }

        .book-info {
            padding: 0rem 1.25rem;
            /* 'flex-grow: 1' makes this section expand to fill available space,
               pushing the buttons to the bottom. This ensures all cards have the
               same height regardless of title or author text length. */
            flex-grow: 1; 
            display: flex;
            flex-direction: column;
        }

        .book-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: #1a202c;
            margin: 0 0 0.25rem 0;
        }

        .book-author {
            font-size: 0.9rem;
            color: #4a5568;
            margin: 0;
            flex-grow: 1; /* Pushes buttons down even if there's extra space */
        }
        
        .book-links {
            padding: 0 1.25rem 1.25rem 1.25rem;
            display: flex;
            gap: 0.75rem; /* Space between buttons */
        }

        .book-button {
            display: inline-block;
            text-align: center;
            padding: 0.6rem 1rem;
            border-radius: 0.5rem;
            text-decoration: none !important;
            font-weight: 500;
            font-size: 0.9rem;
            transition: background-color 0.2s ease, color 0.2s ease;
            flex-grow: 1; /* Makes both buttons take up equal space */
        }

        .info-button {
            background-color: #e2e8f0;
            color: #2d3748;
						text-decoration: none;
        }

        .info-button:hover {
            background-color: #cbd5e0;
        }

        .buy-button {
            background-color: #2563eb;
            color: #ffffff;
					  text-decoration: none;
        }

        .buy-button:hover {
            background-color: #1d4ed8;
        }
        .disabled-buy-button {
            background-color: #e2e8f0;
            color: #aaa;
            transition: none;
					text-decoration: none;
        }

        .disabled-buy-button:hover {
            background-color: #e2e8f0;
					color: #aaa;
					cursor: not-allowed;
        }
/* END BOOK STYLES */
