/* ==========================================================
   BOOKSHELF PAGE
   ========================================================== */

.bookshelf-page {
    background: var(--color-bg);
}

.bookshelf-header {
    max-width: var(--content-width);

    margin-bottom: var(--space-2xl);
}

.bookshelf-kicker {
    margin: 0 0 var(--space-xs);

    color: var(--color-accent);

    font-size: .85rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .08em;
}

.bookshelf-header h1 {
    margin: 0;

    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1;
}

.bookshelf-intro {
    max-width: 56ch;

    margin:
        var(--space-md)
        0
        0;

    color: var(--color-muted);

    font-size: 1.05rem;
    line-height: 1.7;
}

.bookshelf-empty {
    padding: var(--space-2xl);

    background: var(--color-surface);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-soft);
}


/* ==========================================================
   GRID
   ========================================================== */

.bookshelf-list {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(190px, 1fr)
        );

    gap: var(--space-xl);

    list-style: none;

    padding: 0;
    margin: 0;
    margin-bottom: var(--space-2xl);
}

.bookshelf-item {
    min-width: 0;
}

.product-archive__count {
    margin-bottom: var(--space-lg);
}

.pagination {
    margin-top: 0;
}


/* ==========================================================
   CARD
   ========================================================== */

.bookshelf-card {
    display: flex;
    flex-direction: column;

    min-height: 100%;

    background: var(--color-surface);

    border-radius: var(--radius-lg);

    overflow: visible;

    box-shadow: var(--shadow-soft);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.bookshelf-card:hover {
    transform: translateY(-4px);

    box-shadow: var(--shadow-cover);
}


/* ==========================================================
   COVER
   ========================================================== */

.bookshelf-cover {
    aspect-ratio: 2 / 3;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: .75rem;
}

.bookshelf-cover img {
    display: block;

    width: auto;
    height: 100%;

    max-width: 80%;

    object-fit: contain;
}

.cover-placeholder {
    width: 100%;
    height: 100%;

    background:
        linear-gradient(
            135deg,
            #f3f4f6,
            #e5e7eb
        );
}

.bookshelf-cover-link {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
}


/* ==========================================================
   META
   ========================================================== */

.bookshelf-meta {
    display: flex;
    flex-direction: column;

    gap: var(--space-xs);

    padding:
        var(--space-md)
        var(--space-md)
        0;
}

.bookshelf-title {
    margin: 0;

    color: var(--color-text);

    font-family: var(--font-body);
    font-size: .98rem;
    font-weight: 800;
    line-height: 1.35;

    overflow-wrap: anywhere;
}

.bookshelf-subtitle,
.bookshelf-author {
    margin: 0;

    color: var(--color-muted);

    font-size: .9rem;
    line-height: 1.45;
}

.bookshelf-subtitle {
    overflow-wrap: anywhere;
}

.bookshelf-title-link {
    color: inherit;

    text-decoration: none;
}

.bookshelf-title-link:hover {
    color: var(--color-accent);
}


/* ==========================================================
   ACTIONS
   ========================================================== */

.bookshelf-actions {
    display: flex;
    flex-direction: column;

    gap: var(--space-xs);

    margin-top: auto;

    padding: var(--space-md);
}

.bookshelf-action-label {
    margin: 0;

    color: var(--color-muted);

    font-size: .78rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .06em;
}

.bookshelf-actions button {
    appearance: none;

    border: 0;

    border-radius: var(--radius-md);

    padding:
        .8rem
        1rem;

    font-weight: 700;

    cursor: pointer;

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.bookshelf-actions button:hover {
    transform: translateY(-1px);
}

.bookshelf-actions button:disabled {
    opacity: .6;

    cursor: wait;
}

.js-move-shelf {
    background: var(--color-accent);

    color: #fff;
}

.js-remove-from-shelf {
    background: #f3f4f6;

    color: #111827;
}


/* ==========================================================
   HIGHLIGHT
   ========================================================== */

.bookshelf-item.is-highlighted
.bookshelf-card {
    animation:
        bookshelf-highlight
        2s ease;
}

@keyframes bookshelf-highlight {

    0% {
        transform: scale(1);
        box-shadow: var(--shadow-soft);
    }

    25% {
        transform: scale(1.03);
        box-shadow:
            0 0 0 4px rgba(200, 90, 122, .25),
            var(--shadow-cover);
    }

    100% {
        transform: scale(1);
        box-shadow: var(--shadow-soft);
    }
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 640px) {

    .bookshelf-list {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: var(--space-md);
    }

    .bookshelf-header {
        margin-bottom: var(--space-xl);
    }

    .bookshelf-actions button {
        font-size: .875rem;
    }
}