/* Library Specific Styles */
/* START NEW QUOTE STYLE */
.interstitial-quote {
    font-family: var(--font-family-body); /* Body font for readability */
    font-style: italic;
    font-size: 0.9em; /* Small text as requested */
    text-align: center;
    margin: 60px auto;
    max-width: 700px;
    color: var(--color-primary);
    opacity: 0.8; /* Slightly subdued */
}
/* END NEW QUOTE STYLE */

/* START LIBRARY LAYOUT STYLES */
.layout-controls {
    text-align: center;
    margin-bottom: 40px;
}

.layout-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--color-primary);
    padding: 8px 15px;
    margin: 0 5px;
    cursor: pointer;
    font-family: var(--font-family-body);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}
.layout-button:hover, .layout-button.active {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

/* Default Layout */
.library-default .book-item {
    display: flex;
    align-items: flex-start;
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}
.library-default .book-item:hover {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}
[data-theme="light"] .library-default .book-item:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.library-default .book-thumbnail {
    width: 100px;
    height: 150px;
    object-fit: cover;
    margin-right: 20px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.library-default .book-info {
    flex-grow: 1;
}

.library-default .book-title {
    font-family: var(--font-family-header);
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.library-default .book-author {
    font-size: 0.9em;
    margin-bottom: 10px;
    opacity: 0.8;
}

.library-default .book-description {
    font-size: 0.9em;
    margin-bottom: 10px;
}

.library-default .book-meta {
    font-size: 0.8em;
    opacity: 0.7;
}

.library-default .book-purchase-link {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 0.8em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}
.library-default .book-purchase-link:hover {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

/* Comfortable Layout (Grid) */
.library-comfortable {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.library-comfortable .book-item {
    border: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}
.library-comfortable .book-item:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}
[data-theme="light"] .library-comfortable .book-item:hover {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.library-comfortable .book-thumbnail {
    width: 150px;
    height: 225px;
    object-fit: cover;
    margin: 0 auto 15px auto;
    border: 1px solid var(--border-color);
}

.library-comfortable .book-title {
    font-family: var(--font-family-header);
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.library-comfortable .book-author {
    font-size: 0.95em;
    margin-bottom: 10px;
    opacity: 0.8;
}

.library-comfortable .book-description {
    font-size: 0.9em;
    margin-bottom: 15px;
    flex-grow: 1;
}

.library-comfortable .book-details-box {
    border: 1px solid var(--border-color);
    padding: 10px;
    margin-top: auto; /* Pushes box to bottom */
    font-size: 0.85em;
    text-align: left;
}

.library-comfortable .book-details-box p {
    margin: 5px 0;
}

.library-comfortable .book-purchase-link {
    display: block; /* Make it a block for better click area */
    margin-top: 10px;
    padding: 8px 15px;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 0.9em;
    text-transform: uppercase;
    text-align: center;
    transition: all 0.3s ease;
}
.library-comfortable .book-purchase-link:hover {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

/* Compact Layout */
.library-compact .book-item {
    border-bottom: 1px dashed var(--border-color);
    padding: 10px 0;
    margin-bottom: 5px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}
.library-compact .book-item:last-child {
    border-bottom: none;
}
.library-compact .book-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .library-compact .book-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.library-compact .book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-right: 10px; /* Space for toggle icon */
}

.library-compact .book-title {
    font-family: var(--font-family-header);
    font-size: 1.1em;
    margin: 0;
    text-transform: uppercase;
}

.library-compact .book-author {
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 10px;
}

.library-compact .expand-toggle {
    font-size: 1.2em;
    line-height: 1;
    transition: transform 0.2s ease;
}
.library-compact .expand-toggle.expanded {
    transform: rotate(90deg);
}

.library-compact .book-full-description {
    display: none; /* Hidden by default */
    margin-top: 10px;
    padding-left: 15px;
    font-size: 0.85em;
    opacity: 0.9;
}

.library-compact .book-purchase-link {
    display: inline-block;
    margin-top: 10px;
    margin-left: 15px;
    padding: 3px 8px;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 0.75em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}
.library-compact .book-purchase-link:hover {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}
/* END LIBRARY LAYOUT STYLES */

/* Responsive Design - Consistent with Société il Noir homepage */
@media (max-width: 768px) {
    /* START RESPONSIVE LIBRARY LAYOUTS */
    .library-default .book-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .library-default .book-thumbnail {
        margin-right: 0;
        margin-bottom: 15px;
    }
    .library-comfortable {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
    /* END RESPONSIVE LIBRARY LAYOUTS */
    /* START LAYOUT BUTTONS RESPONSIVE HIDE/SHOW */
    .layout-button[data-layout="default"] {
        display: none; /* Hide default button on small screens */
    }
}

/* Landscape/Portrait adaptation (subtle changes) - Consistent with Société il Noir homepage */
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* Adjustments for very narrow landscape views (e.g., small phones held sideways) */
    .library-comfortable {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media screen and (orientation: portrait) and (max-width: 500px) {
    /* Specific adjustments for smaller portrait views */
    .library-comfortable {
        gap: 15px;
    }
    .book-item {
        padding: 15px;
    }
}
