/* ==========================================================================
   ALL BOOKS PAGE STYLESHEET (Exact Match to User Uploaded Design Mockup)
   Mufti Abdul Rehman Munir — Luxury Editorial Book Catalog
   ========================================================================== */

/* --- Container & General Utilities --- */
.books-container {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Accent Divider with Diamond Symbol --- */
.accent-divider-diamond {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1.5rem;
}

.accent-divider-diamond .line {
    width: 50px;
    height: 1px;
    background: var(--color-border-gold);
}

.accent-divider-diamond .diamond {
    font-size: 0.65rem;
    color: var(--color-gold-accent);
    line-height: 1;
}

/* ==========================================================================
   1. HERO SECTION (Exact Reference Mockup Layout)
   ========================================================================== */
.books-hero-section {
    position: relative;
    padding-top: 130px;
    padding-bottom: clamp(3rem, 5vw, 4.5rem);
    min-height: 520px;
    background-color: #F8F5EE;
    background-image: url('../images/muftiabdulrehman-books-hero-background-1.webp');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* Soft gradient overlay on left for razor-sharp typography readability across all screens */
.books-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(248, 245, 238, 0.98) 0%, rgba(248, 245, 238, 0.94) 42%, rgba(248, 245, 238, 0.6) 65%, rgba(248, 245, 238, 0.05) 100%);
    pointer-events: none;
    z-index: 1;
}

@media (max-width: 900px) {
    .books-hero-section {
        background-position: center right;
        min-height: auto;
        padding-top: 120px;
    }
    .books-hero-section::before {
        background: rgba(248, 245, 238, 0.92);
    }
}

.books-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    width: 100%;
}

.books-hero-left {
    max-width: 580px;
}

.books-hero-eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-gold-accent);
    margin-bottom: 0.5rem;
    display: block;
}

.books-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 6vw, 4.75rem);
    font-weight: 500;
    line-height: 1.05;
    color: var(--color-text-title);
    margin: 0;
    letter-spacing: -0.015em;
}

.books-hero-desc {
    font-size: clamp(1rem, 1.5vw, 1.12rem);
    line-height: 1.7;
    color: #555046;
    margin-bottom: 2rem;
}

.books-hero-stats {
    display: flex;
    align-items: center;
    gap: clamp(1.25rem, 2.5vw, 2.25rem);
    padding-top: 1.5rem;
    border-top: 1px solid rgba(197, 160, 89, 0.35);
}

.books-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.books-stat-num {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 600;
    line-height: 1;
    color: var(--color-text-title);
}

.books-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7A7265;
}

.books-stat-sep {
    width: 1px;
    height: 38px;
    background: rgba(197, 160, 89, 0.4);
}

/* ==========================================================================
   2. TOOLBAR: CATEGORY FILTER PILLS & SEARCH BAR
   ========================================================================== */

.books-toolbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.books-filter-pills-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.book-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1.15rem;
    background: #FFFFFF;
    border: 1px solid #DCD5C9;
    border-radius: 20px;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #555046;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.book-pill-btn:hover {
    border-color: #1C201C;
    color: #1C201C;
}

.book-pill-btn.active {
    background: #1C201C;
    border-color: #1C201C;
    color: #FFFFFF;
}

.book-pill-count {
    opacity: 0.75;
    font-size: 0.75rem;
}

.books-search-wrapper {
    position: relative;
    min-width: 240px;
}

@media (max-width: 600px) {
    .books-search-wrapper {
        width: 100%;
    }
}

.books-search-input {
    width: 100%;
    height: 42px;
    padding: 0 1rem 0 2.4rem;
    background: #FFFFFF;
    border: 1px solid #DCD5C9;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: #1C201C;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.books-search-input:focus {
    outline: none;
    border-color: var(--color-gold-accent);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.12);
}

.books-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: #8C8477;
    pointer-events: none;
}

/* ==========================================================================
   3. FEATURED BOOK SHOWCASE CARD (Mockup Middle Showcase)
   ========================================================================== */
.featured-book-section {
    padding: 3.5rem 0 2rem;
}

.featured-book-card {
    background: #FAF7F2;
    border: 1px solid #E5DFD4;
    border-radius: 6px;
    padding: clamp(1.75rem, 3.5vw, 2.75rem);
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 3.5vw, 3rem);
    position: relative;
}

@media (max-width: 900px) {
    .featured-book-card {
        flex-direction: column;
        align-items: stretch;
    }
}

.featured-book-cover-wrap {
    flex-shrink: 0;
    width: 190px;
    margin: 0 auto;
}

.featured-book-cover-img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #DDD5C7;
    box-shadow: 0 14px 30px rgba(35, 43, 37, 0.14), 0 2px 6px rgba(0,0,0,0.06);
    display: block;
}

.featured-book-content {
    flex: 1;
}

.featured-book-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-gold-accent);
    margin-bottom: 0.4rem;
    display: block;
}

.featured-book-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 2.5vw, 2.1rem);
    font-weight: 400;
    color: var(--color-text-title);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.featured-book-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555046;
    margin-bottom: 1.5rem;
    max-width: 520px;
}

.featured-book-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.btn-read-now {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #1C201C;
    color: #FFFFFF;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.75rem 1.6rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-read-now:hover {
    background: var(--color-olive-accent);
    transform: translateY(-1px);
}

.btn-download-pdf-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid #C8C0B3;
    color: #222622;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-download-pdf-outline:hover {
    border-color: #1C201C;
    background: rgba(28, 32, 28, 0.04);
}

.featured-book-quote-block {
    max-width: 270px;
    border-left: 1px solid #E2D9CC;
    padding-left: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 900px) {
    .featured-book-quote-block {
        border-left: none;
        border-top: 1px solid #E2D9CC;
        padding-left: 0;
        padding-top: 1.5rem;
        max-width: 100%;
        text-align: center;
    }
}

.featured-book-quote-text {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.55;
    color: #6A6255;
    margin: 0;
}

/* ==========================================================================
   4. ALL BOOKS GRID SECTION (Mockup 4x3 Grid)
   ========================================================================== */
.all-books-collection-section {
    padding: 2.5rem 0 4.5rem;
}

.all-books-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 2.25rem;
    flex-wrap: wrap;
}

.all-books-title-group {
    max-width: 620px;
}

.all-books-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-gold-accent);
    margin-bottom: 0.35rem;
    display: block;
}

.all-books-heading {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.8vw, 2.75rem);
    font-weight: 400;
    color: var(--color-text-title);
    margin: 0 0 0.5rem;
    letter-spacing: -0.015em;
}

.all-books-subtext {
    font-size: 0.95rem;
    color: #6B6559;
    line-height: 1.6;
    margin: 0;
}

.all-books-sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #6E685C;
}

.all-books-sort-dropdown {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #6B6559;
    position: relative;
    z-index: 30;
}

.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 175px;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid #DCD5C9;
    background: #FFFFFF;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #1C201C;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select-trigger svg {
    transition: transform 0.25s ease;
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--color-gold-accent);
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.15);
}

.custom-select-wrapper.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid rgba(197, 160, 89, 0.35);
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    transition: all 0.2s ease;
    transform: translateY(-5px);
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-select-option {
    padding: 0.65rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: #4A4438;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.custom-select-option:hover {
    background: #F8F5EE;
    color: #1C201C;
}

.custom-select-option.selected {
    font-weight: 600;
    color: #1C201C;
    background: #F0EBE1;
}

/* 4-Column Grid with Strict Responsiveness */
.books-mockup-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 1100px) {
    .books-mockup-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 780px) {
    .books-mockup-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.15rem;
    }
}

@media (max-width: 480px) {
    .books-mockup-grid {
        grid-template-columns: 1fr;
    }
}

/* Individual Book Card (White Card with Soft Cream Cover Box) */
.book-mockup-card {
    background: #FFFFFF;
    border: 1px solid rgba(197, 160, 89, 0.22);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(44, 38, 30, 0.04);
    position: relative;
}

.book-mockup-card:hover {
    border-color: rgba(197, 160, 89, 0.5);
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(44, 38, 30, 0.1);
}

@keyframes fadeZoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.book-mockup-card.show {
    display: flex;
    animation: fadeZoomIn 0.35s ease forwards;
}

.book-mockup-card.hide {
    display: none;
}

.book-card-square-frame {
    background: linear-gradient(180deg, #FAF7F2 0%, #F2ECE1 100%);
    border: 1px solid rgba(197, 160, 89, 0.18);
    border-radius: 6px;
    height: 225px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
}

.book-card-img {
    height: 185px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 2px 6px 6px 2px;
    box-shadow: -4px 8px 18px rgba(0, 0, 0, 0.16), 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s var(--ease-out-quart), box-shadow 0.4s var(--ease-out-quart);
}

.book-mockup-card:hover .book-card-img {
    transform: translateY(-5px) scale(1.03) rotate(-1deg);
    box-shadow: -7px 14px 24px rgba(0, 0, 0, 0.22), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.book-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-card-category-tag {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-olive-accent, #686438);
    margin-bottom: 0.45rem;
}

.book-card-title {
    font-family: var(--font-heading);
    font-size: 1.18rem;
    font-weight: 400;
    color: var(--color-text-title);
    line-height: 1.32;
    margin: 0 0 0.5rem;
    min-height: 3.2rem;
    display: flex;
    align-items: flex-start;
}

.book-card-desc {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--color-text-muted, #6B6559);
    line-height: 1.55;
    margin: 0 0 1.25rem;
    min-height: 3.6rem;
    flex: 1;
}

.book-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(197, 160, 89, 0.15);
    width: 100%;
}

/* Pagination Bar */
.books-pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3.5rem;
}

.page-num-btn {
    width: 38px;
    height: 38px;
    border-radius: 3px;
    border: 1px solid #DCD5C9;
    background: #FFFFFF;
    color: #4A4438;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-num-btn:hover {
    border-color: #1C201C;
    color: #1C201C;
}

.page-num-btn.active {
    background: #1C201C;
    border-color: #1C201C;
    color: #FFFFFF;
}

/* ==========================================================================
   5. BOTTOM CTA
   ========================================================================== */
.books-bottom-cta {
    background-color: #161816;
    background-image: linear-gradient(rgba(22, 24, 22, 0.88), rgba(22, 24, 22, 0.88)), url('../images/muftiabdulrehman-books-hero-background-1.webp');
    background-size: cover;
    background-position: center;
    padding: clamp(4rem, 8vw, 6rem) 0;
    color: #FFFFFF;
}

.cta-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
}

@media (max-width: 900px) {
    .cta-inner {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
}

.cta-content {
    max-width: 600px;
}

.cta-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-gold-accent);
    margin-bottom: 0.75rem;
    display: block;
}

.cta-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 500;
    margin: 0 0 1rem;
    line-height: 1.2;
}

.cta-desc {
    font-size: 1rem;
    color: #DCD5C9;
    line-height: 1.7;
    margin: 0;
}

.cta-action-col {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.btn-explore-books-white {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: #FFFFFF;
    color: #1C201C;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1.1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-explore-books-white:hover {
    background: var(--color-gold-accent);
    color: #FFFFFF;
}

/* ==========================================================================
   6. EXTRA RESPONSIVENESS (MOBILE TWEAKS)
   ========================================================================== */
@media (max-width: 600px) {
    .books-hero-title {
        font-size: clamp(2.5rem, 8vw, 3.2rem);
    }
}
