/* ==========================================================================
   Book Display Styles
   ========================================================================== */
   .books-container {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    padding: 0.5em;
    width: 100%;
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
}

.books-container:last-of-type {
    margin-bottom: 50px !important;
}

.books-container a {
    text-decoration: none;
    color: var(--text-color);
    width: 100%;
}

.book {
    display: flex;
    flex-direction: row;
    gap: 1em;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    padding: 0.75em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    align-items: flex-start;
    cursor: pointer;
    min-height: 60px;
    position: relative;
}

.book img {
    width: 70px;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

.book-content {
    flex-grow: 1;
    overflow: hidden;
}

.book-title {
    margin: 0;
    font-size: var(--base-font-size);
    font-weight: bold;
}

.book-header {
    display: flex;
    align-items: baseline;
    gap: 1em;
}

.book-date {
    font-size: calc(var(--base-font-size) * 0.8);
    color: var(--text-color-secondary, #666);
    font-weight: normal;
    font-family: 'Roboto', sans-serif;
    margin-left: 0.5em;
}

.preview {
    margin: 0;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: calc(var(--base-font-size) * 0.9);
    color: var(--text-color-secondary, #666);
    line-height: 1.3em; /* Control line height for better readability */
    max-height: 2.6em; /* Fallback for browsers that don't support line-clamp */
}

.full-description {
    display: none;
    margin: 0.5em 0 0 0;
    line-height: 1.4;
    font-size: calc(var(--base-font-size) * 0.95);
}

/* Expanded state */
.book.expanded {
    min-height: 100px;
}

.book.expanded::after {
    content: 'Πατήστε εδώ για ανάγνωση →';
    position: static;              /* prevent overlap */
    display: block;                /* render below content */
    text-align: right;             /* keep hint aligned to the right on wide screens */
    margin-top: 0.5em;             /* spacing from the expanded text */
    font-size: calc(var(--base-font-size) * 0.8);
    color: var(--text-color-secondary, #666);
    font-style: italic;
}
/* English override (desktop/wide) */
html[lang="en"] .book.expanded::after {
    content: 'Click to read →';
}

.book.expanded img {
    width: 120px;
}

.book.expanded .preview {
    display: none;
}

.book.expanded .full-description {
    display: block;
}

/* Hover effects */
.book:hover {
    box-shadow: 0 4px 8px var(--shadow-color);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .book.expanded {
        flex-direction: column;
        align-items: center;
    }

    .book.expanded img {
        width: 120px;
        margin-bottom: 0.5em;
    }

    .book.expanded .book-content {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .book.expanded::after {
        content: 'Πατήστε εδώ για ανάγνωση ↓';
        position: static;
        display: block;
        text-align: center;
        margin-top: 1em;
    }
    /* English override (mobile) */
    html[lang="en"] .book.expanded::after {
        content: 'Tap to read ↓';
    }
}

/* 2-column layout for wider screens */
@media (min-width: 900px) {
    .books-container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1em;
    }

    .books-container a {
        width: calc(50% - 0.5em); /* Half width minus half the gap */
    }

    .book.expanded {
        height: 100%;
    }
}
