﻿/* Textbooks page (books.aspx / books_ar.aspx): programs shown as book covers on a shelf.
   Logical properties keep the spine on the binding side: right in Arabic (rtl), left in English. */

.books-page {
    --ink: #181d38;
    --paper: #f6f1e4;
    --foil: #d9b86c;
    --shelf: #e9e1d0;
    --muted: #5d6275;
    color: var(--ink);
    font-family: 'Readex Pro', 'Heebo', sans-serif;
}

.books-page .page-header h1 {
    font-family: 'Readex Pro', sans-serif;
    font-weight: 600;
}

.books-page .books-intro {
    max-width: 640px;
    margin: 0 auto 3rem;
    text-align: center;
}

.books-page .books-intro h2 {
    font-family: 'Readex Pro', sans-serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin-bottom: .75rem;
}

.books-page .books-intro p {
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0;
}

.books-page .books-help {
    display: flex;
    align-items: center;
    gap: .75rem;
    max-width: 640px;
    margin: 0 auto 3.5rem;
    padding: .9rem 1.2rem;
    background: #f0fbfc;
    border-inline-start: 4px solid #06BBCC;
    border-radius: 6px;
    color: var(--ink);
    line-height: 1.7;
}

.books-page .books-help i {
    color: #06BBCC;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Campus group */
.books-page .shelf {
    margin-bottom: 4rem;
}

.books-page .shelf-title {
    font-family: 'Readex Pro', sans-serif;
    font-weight: 600;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.75rem;
}

.books-page .shelf-title i {
    color: #06BBCC;
    font-size: 1.1rem;
}

.books-page .shelf-title small {
    font-family: inherit;
    font-weight: 400;
    font-size: .95rem;
    color: var(--muted);
}

.books-page .shelf-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2.25rem 1.75rem;
    padding: 0 1rem 1.6rem;
    position: relative;
}

/* The wooden ledge under each group */
.books-page .shelf-row::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 14px;
    background: var(--shelf);
    border-radius: 3px;
    box-shadow: 0 10px 18px -8px rgba(24, 29, 56, .35);
}

/* Book cover */
.books-page .book {
    --cover: #22305e;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    aspect-ratio: 3 / 4;
    padding: 1.4rem 1.3rem 1.2rem;
    padding-inline-start: 2.1rem;
    background: var(--cover);
    color: var(--paper);
    border-radius: 3px 8px 8px 3px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .15), 6px 10px 18px -6px rgba(24, 29, 56, .45);
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease;
}

[dir="rtl"] .books-page .book {
    border-radius: 8px 3px 3px 8px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .15), -6px 10px 18px -6px rgba(24, 29, 56, .45);
}

/* Spine */
.books-page .book::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: 16px;
    background: linear-gradient(to right, rgba(0, 0, 0, .35), rgba(0, 0, 0, .12) 70%, rgba(255, 255, 255, .12));
    border-start-start-radius: inherit;
    border-end-start-radius: inherit;
}

[dir="rtl"] .books-page .book::before {
    background: linear-gradient(to left, rgba(0, 0, 0, .35), rgba(0, 0, 0, .12) 70%, rgba(255, 255, 255, .12));
}

/* Foil-stamped frame */
.books-page .book::after {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    inset-inline-start: 26px;
    inset-inline-end: 10px;
    border: 1px solid rgba(217, 184, 108, .55);
    border-radius: 2px;
    pointer-events: none;
}

.books-page .book-icon {
    color: var(--foil);
    font-size: 2rem;
    margin-top: .4rem;
}

.books-page .book-title {
    font-family: 'Readex Pro', sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    line-height: 1.45;
    margin: auto 0 .35rem;
    color: var(--paper);
}

.books-page .book-campus {
    font-size: .9rem;
    opacity: .75;
}

.books-page .book-action {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.1rem;
    padding-top: .8rem;
    border-top: 1px solid rgba(217, 184, 108, .45);
    color: var(--foil);
    font-weight: 600;
    font-size: .95rem;
}

.books-page .book:hover,
.books-page .book:focus-visible {
    color: var(--paper);
    transform: translateY(-10px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, .15), 6px 22px 28px -8px rgba(24, 29, 56, .5);
}

.books-page .book:focus-visible {
    outline: 3px solid #06BBCC;
    outline-offset: 4px;
}

.books-page .book.is-engineering { --cover: #22305e; }
.books-page .book.is-cs { --cover: #0b6e78; }
.books-page .book.is-ba-en { --cover: #7a2e3a; }
.books-page .book.is-ba-ar { --cover: #2d5b46; }
.books-page .book.is-matrouh { --cover: #1e5f84; }

@media (max-width: 575.98px) {
    .books-page .shelf-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        padding: 0 .25rem 1.3rem;
    }

    .books-page .book {
        padding: 1rem .9rem .9rem;
        padding-inline-start: 1.6rem;
    }

    .books-page .book::after {
        inset-inline-start: 20px;
        top: 7px;
        bottom: 7px;
        inset-inline-end: 7px;
    }

    .books-page .book-icon { font-size: 1.5rem; }
    .books-page .book-title { font-size: 1.05rem; }
    .books-page .book-campus { font-size: .8rem; }
    .books-page .book-action { font-size: .85rem; margin-top: .7rem; padding-top: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
    .books-page .book { transition: none; }
    .books-page .book:hover,
    .books-page .book:focus-visible { transform: none; }
}
