/* BOOKS SHELF — cover + details rows on a dark canvas */

.books_shelf {
    --books-accent: #be8e59;
    --books-accent-hover: #957149;
    --books-ink: #151515;
    --books-muted: #989898;
    width: 100vw;
    padding: 72px 5vw 88px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    position: relative;
    background: #151515;
    overflow: hidden;
}

.books_shelf::before,
.books_shelf::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(190, 142, 89, 0.16);
    transform: rotate(45deg);
    pointer-events: none;
    z-index: 0;
}

.books_shelf::before {
    width: 240px;
    height: 240px;
    top: 56px;
    right: 7%;
}

.books_shelf::after {
    width: 160px;
    height: 160px;
    bottom: 72px;
    left: 4%;
}

@media screen and (max-width: 1080px) {
    .books_shelf::before {
        width: 170px;
        height: 170px;
        top: 40px;
        right: 4%;
    }

    .books_shelf::after {
        width: 120px;
        height: 120px;
        bottom: 48px;
        left: 2%;
    }
}

@media screen and (max-width: 767px) {
    .books_shelf::before {
        width: 120px;
        height: 120px;
        top: 28px;
        right: -28px;
    }

    .books_shelf::after {
        width: 88px;
        height: 88px;
        bottom: 28px;
        left: -20px;
    }
}

@media screen and (max-width: 1080px) {
    .books_shelf {
        padding: 56px 40px 72px;
    }
}

@media screen and (max-width: 767px) {
    .books_shelf {
        padding: 48px 24px 60px;
    }
}

@media screen and (max-width: 560px) {
    .books_shelf {
        padding: 40px 20px 52px;
    }
}

@media screen and (max-width: 440px) {
    .books_shelf {
        padding: 32px 16px 44px;
    }
}

.books_shelf_inner {
    width: min(1240px, calc(100% - 10%));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

@media screen and (max-width: 1080px) {
    .books_shelf_inner {
        width: min(1240px, calc(100% - 80px));
    }
}

@media screen and (max-width: 767px) {
    .books_shelf_inner {
        width: calc(100% - 48px);
    }
}

@media screen and (max-width: 560px) {
    .books_shelf_inner {
        width: calc(100% - 40px);
    }
}

@media screen and (max-width: 440px) {
    .books_shelf_inner {
        width: calc(100% - 32px);
    }
}

.books_empty {
    margin: 0;
    color: var(--books-muted);
    font-family: "Lato", sans-serif;
    text-align: center;
}

.books_list {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

@media screen and (max-width: 767px) {
    .books_list {
        gap: 24px;
    }
}

.books_item {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    padding: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: translateY(36px);
    transition:
        opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.75s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.3s ease,
        background 0.3s ease;
    transition-delay: calc(var(--book-i, 0) * 0.08s);
}

.books_item_reverse {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
}

.books_item_reverse .books_cover {
    order: 2;
}

.books_item_reverse .books_copy {
    order: 1;
}

@media screen and (max-width: 1200px) {
    .books_item {
        gap: 36px;
        padding: 24px;
    }
}

@media screen and (max-width: 1080px) {
    .books_item {
        grid-template-columns: minmax(160px, 230px) minmax(0, 1fr);
        gap: 28px;
    }

    .books_item_reverse {
        grid-template-columns: minmax(0, 1fr) minmax(160px, 230px);
    }
}

@media screen and (max-width: 767px) {
    .books_item,
    .books_item.books_item_reverse {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 20px;
    }

    .books_item_reverse .books_cover,
    .books_item_reverse .books_copy {
        order: 0;
    }
}

@media screen and (max-width: 440px) {
    .books_item {
        padding: 16px;
    }
}

[data-books-reveal] .books_item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.books_item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(190, 142, 89, 0.35);
}

.books_cover {
    perspective: 900px;
}

.books_cover_stage {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    transform: rotateY(-14deg) translateZ(0);
    transform-origin: left center;
    border-radius: 4px 10px 10px 4px;
    overflow: hidden;
    background: #1c1c1c;
    box-shadow:
        18px 22px 40px rgba(0, 0, 0, 0.38),
        inset -10px 0 16px rgba(0, 0, 0, 0.18);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.books_item:hover .books_cover_stage {
    transform: rotateY(-4deg) translateY(-8px);
}

.books_item_reverse .books_cover_stage {
    transform: rotateY(14deg);
    transform-origin: right center;
    border-radius: 10px 4px 4px 10px;
}

.books_item_reverse:hover .books_cover_stage {
    transform: rotateY(4deg) translateY(-8px);
}

@media screen and (max-width: 767px) {
    .books_cover_stage,
    .books_item_reverse .books_cover_stage {
        max-width: 240px;
        margin: 0 auto;
        transform: rotateY(-8deg);
        transform-origin: left center;
    }

    .books_item:hover .books_cover_stage,
    .books_item_reverse:hover .books_cover_stage {
        transform: rotateY(-2deg) translateY(-6px);
    }
}

@media screen and (max-width: 440px) {
    .books_cover_stage,
    .books_item_reverse .books_cover_stage {
        max-width: 200px;
    }
}

.books_cover_stage img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.books_cover_spine {
    position: absolute;
    top: 0;
    left: 0;
    width: 14px;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(190, 142, 89, 0.35) 45%, rgba(0, 0, 0, 0.15));
    z-index: 2;
    pointer-events: none;
}

.books_item_reverse .books_cover_spine {
    left: auto;
    right: 0;
    background: linear-gradient(-90deg, rgba(0, 0, 0, 0.45), rgba(190, 142, 89, 0.35) 45%, rgba(0, 0, 0, 0.15));
}

.books_cover_shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.18) 48%, transparent 58%);
    transform: translateX(-120%);
    pointer-events: none;
    z-index: 3;
}

.books_item:hover .books_cover_shine {
    animation: booksShine 1.1s ease forwards;
}

@keyframes booksShine {
    to {
        transform: translateX(120%);
    }
}

.books_copy {
    min-width: 0;
}

.books_genre {
    margin: 0 0 10px;
    color: var(--books-accent);
    font-family: "Montserrat", "Lato", sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.books_title {
    margin: 0 0 12px;
    color: #ffffff;
    font-family: "Montserrat", "Lato", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.books_title_accent {
    color: var(--books-accent);
}

@media screen and (max-width: 1080px) {
    .books_title {
        font-size: 1.7rem;
    }
}

@media screen and (max-width: 767px) {
    .books_title {
        font-size: 1.45rem;
        text-align: center;
    }

    .books_copy {
        text-align: center;
    }
}

@media screen and (max-width: 440px) {
    .books_title {
        font-size: 1.24rem;
    }
}

.books_author {
    margin: 0 0 14px;
    color: #f3f4f6;
    font-family: "Lato", sans-serif;
    font-size: 1rem;
}

.books_meta_label {
    display: inline-block;
    margin-right: 8px;
    color: var(--books-muted);
    font-family: "Montserrat", "Lato", sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.books_price {
    margin: 0 0 16px;
    color: var(--books-accent);
    font-family: "Montserrat", "Lato", sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

@media screen and (max-width: 440px) {
    .books_price {
        font-size: 1.22rem;
    }
}

.books_description {
    margin: 0 0 20px;
    color: #cfcfcf;
    font-family: "Lato", sans-serif;
    font-size: 1rem;
    line-height: 1.7;
}

.books_chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

@media screen and (max-width: 767px) {
    .books_chips {
        justify-content: center;
    }
}

.books_chips li {
    padding: 6px 12px;
    border: 1px solid rgba(190, 142, 89, 0.4);
    color: var(--books-accent);
    font-family: "Montserrat", "Lato", sans-serif;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.books_chip_date {
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: var(--books-muted) !important;
}

.books_buy,
.books_buy:visited {
    min-height: 50px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-sizing: border-box;
    border: 1px solid var(--books-accent);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--books-accent) 0%, #d8ad79 52%, var(--books-accent) 100%);
    color: #ffffff;
    font-family: "Montserrat", "Lato", sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(190, 142, 89, 0.18);
    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

@media screen and (max-width: 560px) {
    .books_buy,
    .books_buy:visited {
        min-height: 46px;
        padding: 0 20px;
        font-size: 0.7rem;
    }
}

.books_buy:hover,
.books_buy:focus-visible {
    border-color: var(--books-accent-hover);
    background: linear-gradient(135deg, var(--books-accent-hover) 0%, var(--books-accent) 52%, var(--books-accent-hover) 100%);
    box-shadow: 0 14px 34px rgba(190, 142, 89, 0.28);
    transform: translateY(-2px);
    outline: none;
}

.books_buy_arrow {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.books_buy:hover .books_buy_arrow,
.books_buy:focus-visible .books_buy_arrow {
    transform: translateX(4px);
}

.books_buy_icon,
.books_buy .mc-svg {
    width: 16px;
    height: 16px;
    display: block;
    color: #ffffff;
    stroke: currentColor;
}

@media (prefers-reduced-motion: reduce) {
    .books_item,
    .books_cover_stage,
    .books_cover_shine,
    .books_buy,
    .books_buy_arrow {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}
