/* A single container for both journals and books */


.journal-item, .book-item { width: 300px; }
.journal-image img, .book-image img { width: 100%; height: auto; }

#books-container,
#journals-container,
#mixed-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

#mixed-container { display: flex; flex-wrap: wrap; gap: 2em; }
#mixed-container .btn { width: fit-content; }


/* Common item styles for both journals and books */
.journal-item,
.book-item {
    display: flex;
    flex-direction: row;
    background: #f8faff;
    border-radius: 12px;
    padding: 15px;
    flex: 1 1 45%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.covers-only .book-item,
.covers-only .journal-item {
    flex: 0 0 auto;     /* or flex: 0 0 150px, if you prefer a fixed width */
    width: auto;
    max-width: 200px;   /* optional, so you don’t get ginormous images */
    margin-right: 0; 
}

/* Image column (journal vs. book) */
.journal-image,
.book-image {
    flex: 0 0 150px;
    margin-right: 20px;
}

.covers-only .journal-image, 
.covers-only .book-image {
    margin-right: 0;
}

.journal-image img,
.book-image img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #10137d;
}

/* Content column (journal vs. book) */
.journal-content,
.book-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.journal-content h3,
.book-content h3 {
    margin-top: 0;
    color: #10137d;
}

.journal-content h3 a,
.book-content h3 a {
    text-decoration: none;
    color: inherit;
}

.journal-content p,
.book-content p {
    font-size: 0.95em;
    flex-grow: 1;
}

/* Links lists (journal vs. book) */
.journal-links,
.book-links {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.journal-links li,
.book-links li {
    margin-bottom: 5px;
    font-size: 0.95em;
}

.journal-links a,
.book-links a {
    text-decoration: none;
    color: #10137d;
}

.journal-links a:hover,
.book-links a:hover {
    text-decoration: underline;
}

/* Buttons */
.journal-link-btn {
    max-width: 250px;
}
.book-link-btn {
    max-width: 160px;
}

.book-content:empty,
.journal-content:empty {
    display: none;
}

.covers-only .book-item,
.covers-only .journal-item {
    background: transparent;
    box-shadow: none;
    padding: 5px; /* or 0, whatever looks best */
}


/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .journal-item,
    .book-item {
        flex-direction: column;
        flex: 1 1 100%;
    }
    .journal-image,
    .book-image {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        text-align: center;
    }
}


