/* =========================================================
   SIBF Books Listing — book-favourites.css
   Scope: .sibf-books-page only. No global selectors touched.
   Adds proper active, loading, and keyboard states for the real
   server-backed .sibf-book-favorite-button controls.
   ========================================================= */

/* ── Fix SVG stroke so it follows currentColor ─────────── */
/* style.css hard-codes stroke: #000 which breaks the white
   active state. Override here inside the page scope only.  */
.sibf-books-page .sibf-book-card {
    position: relative;
}

/* ── Catalogue control ─────────────────────────────────── */
.sibf-books-page .sibf-book-favorite-button {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b6b6b;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    transition: color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.sibf-book-favorite-button i {
    font-size: 1.1rem;
}

.sibf-books-page .sibf-book-favorite-button:hover:not(:disabled) {
    color: #F47836;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 14px rgba(244, 120, 54, 0.22);
}

.sibf-book-favorite-button:focus-visible {
    outline: 2px solid #F47836;
    outline-offset: 2px;
}

.sibf-book-favorite-button.is-favorite {
    background: #F47836;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(244, 120, 54, 0.35);
}

.sibf-book-favorite-button:disabled {
    cursor: wait;
    opacity: .65;
}

.sibf-books-favorite-error,
.sibf-book-favorite-error {
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid rgba(185, 58, 42, .22);
    border-radius: 10px;
    background: rgba(185, 58, 42, .07);
    color: #a73b2c;
    font-size: .88rem;
    font-weight: 600;
}

.sibf-book-details__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sibf-book-details .sibf-book-favorite-button--details {
    min-height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid #e7c4b2;
    border-radius: 999px;
    background: #fff;
    color: #b95626;
    font-weight: 700;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.sibf-book-details .sibf-book-favorite-button--details:hover:not(:disabled),
.sibf-book-details .sibf-book-favorite-button--details.is-favorite {
    border-color: #F47836;
    background: #F47836;
    color: #fff;
}

html[dir="rtl"] .sibf-books-page .sibf-book-favorite-button {
    right: auto;
    left: 24px;
}

@media (max-width: 480px) {
    .sibf-books-page .sibf-book-favorite-button {
        top: 22px;
        right: 22px;
    }

    html[dir="rtl"] .sibf-books-page .sibf-book-favorite-button {
        right: auto;
        left: 22px;
    }

    .sibf-book-details__title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .sibf-book-details .sibf-book-favorite-button--details {
        align-self: flex-start;
    }
}
