/* ULAB Digital Library - Wooden Shelf Style */

:root {
    --ulab-wood-dark: #5d4037;
    --ulab-wood-light: #8d6e63;
    --ulab-shadow: rgba(0,0,0,0.3);
    --ulab-book-height: 260px;
    --ulab-shelf-height: 20px;
    --ulab-shelf-gap: 0px;
}

/* Full-bleed portal + hero identique aux autres pages (about.css · uab-hero) */
#univga-ulab-portal {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
    background:
        radial-gradient(ellipse 70% 40% at 10% 20%, rgba(245, 176, 66, .08), transparent 55%),
        radial-gradient(ellipse 60% 45% at 90% 80%, rgba(22, 58, 138, .07), transparent 55%),
        linear-gradient(180deg, #eef1f8 0%, #f7f8fc 36%, #fff 100%);
}

body:has(#univga-ulab-portal) .title_single_area,
body:has(#univga-ulab-portal) .breadcrumb,
body:has(#univga-ulab-portal) .post-meta { display: none !important; }

#univga-ulab-portal .uab-hero {
    padding: 100px 24px 120px;
}
#univga-ulab-portal .uab-hero__inner {
    max-width: 1100px;
}
#univga-ulab-portal .uab-hero__title {
    white-space: normal;
    font-size: clamp(1.35rem, 4vw, 3.1rem);
}
#univga-ulab-portal .uab-hero__sub {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    #univga-ulab-portal .uab-hero { padding: 88px 18px 100px; }
}

.ulab-library-container {
    width: 100%;
    position: relative;
    padding: 40px 30px 80px;
    background: transparent;
    font-family: 'Segoe UI', sans-serif;
    box-sizing: border-box;
}

#univga-ulab-portal .ulab-library-container {
    width: 100%;
    left: auto;
    right: auto;
    margin-left: 0;
    margin-right: 0;
}

.ulab-shelf-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Books align left */
    align-items: flex-end;
    padding: 0 40px 0; /* Padding for books on shelf */
    margin-bottom: var(--ulab-shelf-gap);
    position: relative;
    min-height: var(--ulab-book-height);
    background: linear-gradient(180deg, #6A3E22, #8C5733, #A46A3C, #C58655, #D8A26F);
    /* The Shelf Board */
    border-bottom: var(--ulab-shelf-height) solid #795548;
    box-shadow: 0 15px 20px -10px var(--ulab-shadow);
    
    /* Spacing for wrapped books */
    row-gap: 20px;
    gap: 20px 15px; /* Reduced horizontal gap to 15px */
}

/* Top Shelf Board */
.ulab-shelf-top-board {
    width: 100%;
    height: var(--ulab-shelf-height);
    background: #795548;
    position: relative;
    z-index: 5;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
}
.ulab-shelf-top-board::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        #5d4037,
        #5d4037 10px,
        #4e342e 10px,
        #4e342e 20px
    );
    opacity: 0.8;
}

/* Wood Texture for Shelf */
.ulab-shelf-row::after {
    content: '';
    position: absolute;
    bottom: calc(var(--ulab-shelf-height) * -1);
    left: 0;
    width: 100%;
    height: var(--ulab-shelf-height);
    background: repeating-linear-gradient(
        90deg,
        #5d4037,
        #5d4037 10px,
        #4e342e 10px,
        #4e342e 20px
    );
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    z-index: 1;
}

/* Shelf Back Shadow (Depth) */
.ulab-shelf-row::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.2));
    z-index: 0;
}

/* Book Item */
.ulab-book-item {
    position: relative;
    width: 170px;
    height: var(--ulab-book-height);
    margin-right: 0;
    margin-top: 0; /* Removed huge top margin */
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 2;
    transform-origin: bottom center;
}

.ulab-book-item:hover {
    transform: scale(1.05) translateY(-5px);
    z-index: 10;
}

/* Book Spine/Cover */
.ulab-book-cover {
    width: 100%;
    height: 100%;
    background-color: #333;
    border-radius: 2px 4px 4px 2px;
    box-shadow: 
        -2px 0 5px rgba(0,0,0,0.2), /* Spine shadow */
        5px 5px 10px rgba(0,0,0,0.3); /* Drop shadow */
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.ulab-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fallback Title if no image */
.ulab-book-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 1px 2px black;
}

/* Book Spine Effect (Left side highlight) */
.ulab-book-cover::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 10px;
    background: linear-gradient(to right, rgba(255,255,255,0.2), transparent);
    z-index: 3;
}

/* Admin Bar / Search Header */
.ulab-header {
    text-align: center;
    margin-bottom: 50px;
}
.ulab-header h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
}
.ulab-search-bar {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
}
.ulab-search-input {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 30px 0 0 30px;
    font-size: 1.1em;
    outline: none;
}
.ulab-search-btn {
    padding: 15px 30px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    font-weight: bold;
}

/* Smart Reader Modal */
.ulab-reader-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.ulab-reader-content {
    width: 90%;
    height: 90%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.ulab-reader-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ulab-reader-title {
    font-weight: bold;
    font-size: 1.2em;
    color: #333;
}

.ulab-reader-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}
.ulab-reader-close:hover { color: #e74c3c; }

#ulab-viewer-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
    background: #fff;
}

/* Pagination */
#ulab-pagination {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 30px;
}

.ulab-page-btn {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 15px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.ulab-page-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.ulab-page-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

