﻿/* wwwroot\css\HomePage\shelf.css */
/* Layout-only styles for shelf containers, scrolling, and grids */

:root {
    --header-to-content-spacing: 20px; /* Space between header and books */
    --card-gap: 47px; /* Space between book cards (both shelf and grid) */
}

/* canonical see-more style used by top and bottom links */
/* Used for All Books and Categories */
.see-more-link {
    font-size: 0.95rem;
    color: #004dac; /* high contrast for dark backgrounds */
    text-decoration: none;
    font-weight: 600;
}

    /* hover */
    .see-more-link:hover {
        text-decoration: underline;
    }

/* All Books / Categories headers */
/* Ensure the page headings ('All Books' h2 and 'Categories' h1) are the same size
   and stand out on dark backgrounds. Also style category table headers. */

.shelf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--header-to-content-spacing);
    margin-bottom: 5px;
}

    .shelf-header h2 {
        font-size: 1.2rem;
        font-weight: 400;
        color: #004dac; /* high contrast for dark backgrounds */
        margin: -10px 0;
    }

    /* Prevent header text from clipping in flex layout */
    .shelf-header h2 {
        flex: 1 1 auto;
        min-width: 0;
    }

        /* If the All Books heading uses the allbooks-header / all-books-header class
          make sure it overrides the generic .shelf-header h2 rule (higher specificity). */
        .shelf-header h2.allbooks-header,
        .shelf-header h2.all-books-header {
            font-size: 1.80rem;
            font-weight: 700;
            color: #ffffff;
            margin: 0;
            padding: 8px 12px;
            text-shadow: 0 3px 8px rgba(0,0,0,0.7);
            border-left: 6px solid #b07a3f;
            padding-left: 14px;
        }


    /* Position the category jump select to the right of the header */
    .shelf-header .category-jump {
        /* Position dropdown relative to the heading. Change --category-jump-offset to adjust spacing. */
        --category-jump-offset: 12px; /* default small gap; edit this value to move dropdown */
        /* allow the jump control to shrink on narrow screens so the header can use remaining space */
        margin-left: var(--category-jump-offset);
        min-width: 0; /* allow smaller widths (overrides previous fixed 220px)
                         inline styles can still set a preferred width */
        flex: 0 0 auto;
    }

        .shelf-header .category-jump select.form-select {
            height: 34px;
            padding: 4px 8px;
            font-size: 0.95rem;
        }

/* visual state for top toggle when expanded */
.js-shelf-expand.expanded {
    background: #b07a3f;
    color: #fff;
    border-radius: 6px;
    padding: 0 8px;
}


/* Ensure All Books header styles are available when hero.css isn't loaded.
   Accept both hyphenated and non-hyphenated class names used in markup. */
.book-shelf-section {
    background: none !important;
}

.shelf-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px; /* Space between category sections */
    margin-top: 0px;
}

.all-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 115px);
    column-gap: var(--card-gap); /* horizontal spacing between cards */
    row-gap: 32px; /* vertical spacing between rows (includes title space) */
    margin: 0 21px;
}

    /* Ensure titles show in grids */
    .all-books-grid .book-title {
        display: -webkit-box !important;
    }


.shelf-scroll {
    display: flex;
    column-gap: var(--card-gap);
    overflow-x: auto;
    scroll-behavior: smooth;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .shelf-scroll::-webkit-scrollbar {
        display: none;
    }

.shelf-arrow {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #333;
}

/* ============================
   EXPANDED GRID LAYOUT
   Standardized for All Books and Categories
   ============================ */

/* Container for inline expanded grid (categories) */
.js-shelf-full,
    #allBooksExpanded {
    margin-top: 5px; /* Match spacing when shelf is collapsed */
}
