.book-cover {
    display: block;
    width: 160px;
    height: 230px;
    border-radius: 5px;
    object-fit: cover;
    box-shadow: 2px 7px 18px var(--shadow-strong);
    flex-shrink: 0;
}

.book-cover--large {
    width: 264px;
    height: 378px;
}

.book-cover--text {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 18px;
    gap: 1rem;
    background: var(--sage);
    border: 1px solid var(--line-strong);
    color: var(--green);
    font-size: 1.1rem;
}

.book-cover--text small {
    font-size: .75rem;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(215px,1fr));
    gap: 28px 24px;
    margin: 1.5rem 0;
    align-items: start;
}

.book-card {
    --book-jacket: var(--green);
    --book-lettering: var(--spine-light);
    display: block;
    min-width: 0;
    color: var(--ink);
    border-radius: 4px 10px 6px 4px;
}

.book-card:nth-child(3n+2) { --book-jacket: var(--primary-hover); }
.book-card:nth-child(3n) { --book-jacket: var(--ink); }
.book-card:hover { color: var(--ink); }

.book-card-visual {
    position: relative;
    aspect-ratio: 264 / 378;
    perspective: 900px;
    isolation: isolate;
    user-select: none;
}

.book-card-visual::before {
    content: '';
    position: absolute;
    inset: 5px 0 3px 5px;
    border: 1px solid var(--line);
    border-radius: 2px 8px 8px 2px;
    background: repeating-linear-gradient(to bottom, var(--surface) 0 2px, var(--line) 2px 3px);
    box-shadow: 3px 6px 12px var(--shadow);
}

.book-card-cover {
    position: absolute;
    inset: 0 6px 0 0;
    transform-origin: left center;
    transform: rotateY(0deg);
}

.book-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 3px 8px 8px 3px;
    background: linear-gradient(to right, var(--shadow-strong), transparent 3%, var(--shadow) 4%, transparent 7%);
    box-shadow: inset 1px 0 0 color-mix(in srgb, var(--surface-white) 25%, transparent);
    pointer-events: none;
}

.book-card-cover .book-cover {
    width: 100%;
    height: 100%;
    border-radius: 3px 8px 8px 3px;
    box-shadow: 2px 5px 10px var(--shadow-strong);
}

.book-card-cover .book-cover--text {
    padding: 48px 24px 30px;
    gap: 18px;
    border: 0;
    background: var(--book-jacket);
    color: var(--book-lettering);
    box-shadow: inset 0 0 0 1px var(--shadow), inset 0 0 0 12px var(--book-jacket), inset 0 0 0 13px color-mix(in srgb, var(--book-lettering) 30%, var(--book-jacket)), 2px 5px 10px var(--shadow-strong);
    font-size: clamp(.95rem, 1.5vw, 1.3rem);
    line-height: 1.4;
}

.book-card-cover .book-cover--text small { color: inherit; opacity: .8; font-size: .7rem; }

.book-card-status {
    position: absolute;
    z-index: 1;
    top: 10px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 2px 6px var(--shadow);
    font-size: .7rem;
    line-height: 1;
    white-space: nowrap;
}

.book-card-status[data-status=read] { background: var(--sage); color: var(--green); }
.book-card-status[data-status=reading] { background: var(--peach); }
.book-card-details { padding: 14px 4px 0; }
.book-card-kind { display: block; color: var(--muted); font-size: .65rem; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; }

.book-card h2, .book-card p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.book-card h2 {
    font-size: 1.15rem;
    line-height: 1.2;
    margin: 6px 0;
}

.book-card p {
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.4;
    margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .book-card-cover { transition: transform .32s cubic-bezier(.2,.7,.25,1); }
    .book-card:focus-visible .book-card-cover { transform: rotateY(-14deg); }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .book-card:hover .book-card-cover { transform: rotateY(-14deg); }
}

.book-list__row {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px;
    margin-bottom: 12px;
}

.book-list__row>.badge {
    margin-left: auto;
}

.book-list__row .book-cover {
    width: 65px;
    height: 92px;
    font-size: .65rem;
    padding: 5px;
}

.book-list__row .book-cover small {
    display: none;
}

.book-list__row h2 {
    font-size: 1.4rem;
}

.book-detail {
    max-width: 1020px;
    margin: 30px auto 60px;
    padding: 0 0 30px;
}

.book-hero {
    display: grid;
    grid-template-columns: 280px minmax(0,1fr);
    gap: 38px;
    padding: 0 42px 35px;
}

.book-hero h1 {
    font-size: clamp(2rem,3.6vw,3.6rem);
    margin: 20px 0 10px;
}

.author-line {
    font-size: 1.6rem;
}

.author-line a {
    text-decoration: underline;
    text-underline-offset: .2em;
}

.book-hero .button--large {
    margin: 22px 0 10px;
}

.book-actions {
    margin-top: 20px;
}

.book-actions details {
    position: relative;
}

.book-actions details>form {
    position: absolute;
    top: 58px;
    left: 0;
    z-index: 3;
    width: 320px;
    box-shadow: 0 8px 24px var(--shadow-strong);
}

.book-detail>.tabs {
    justify-content: flex-start;
    gap: 50px;
}

.book-tab {
    padding: 30px 42px;
}

.book-tab h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.prose {
    font-size: 1.3rem;
    line-height: 1.6;
}

.book-metadata {
    margin-top: 28px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.book-metadata dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    font-size: 1rem;
}

.book-metadata dd {
    margin: 0;
}

.chapter-list {
    list-style: none;
    padding: 12px 20px;
}

.chapter-list li {
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}

.chapter-list li:last-child {
    border: 0;
}

.chapter-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.mini-book {
    display: flex;
    gap: 18px;
    padding: 10px 0;
}

.mini-book .book-cover {
    width: 80px;
    height: 115px;
}

.mini-book h3 {
    font-size: 1.15rem;
}

.mini-book p {
    font-size: .95rem;
}

@media(max-width:760px) {
    .book-detail {
        margin: 18px auto;
        padding: 0 16px;
    }
    .book-hero {
        padding: 0 0 24px;
        grid-template-columns: 100px 1fr;
        gap: 16px;
    }
    .book-hero>.book-cover {
        width: 100px;
        height: 148px;
    }
    .book-hero h1 {
        font-size: 1.8rem;
        margin: 10px 0;
    }
    .book-hero .availability {
        font-size: .8rem;
    }
    .author-line {
        font-size: 1.1rem;
    }
    .book-hero .button--large {
        font-size: 1rem;
        padding: .8rem;
        min-height: 48px;
        margin: 10px 0;
    }
    .book-hero .book-actions,.book-hero .post-actions {
        margin-left: -116px;
    }
    .book-tab {
        padding: 24px 0;
    }
    .book-detail>.tabs {
        gap: 12px;
    }
    .book-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 24px 16px;
    }
    .book-card-cover .book-cover--text { padding: 40px 18px 24px; gap: 10px; font-size: .95rem; }
    .book-card-cover .book-cover--text small { font-size: .6rem; }
    .book-card-status { top: 8px; right: 12px; gap: 4px; padding: 5px 7px; font-size: .65rem; }
    .book-card-details { padding: 12px 2px 0; }
    .book-card h2 { font-size: 1rem; }
    .book-card p { font-size: .78rem; }
    .book-list__row {
        flex-wrap: wrap;
        gap: 12px;
    }
    .book-list__row>div {
        flex: 1;
    }
    .book-list__row>.badge {
        margin-left: 77px;
    }
}

.book-cover--text>span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.mini-book .book-cover--text {
    padding: 8px;
    font-size: .68rem;
    line-height: 1.25;
}

.mini-book .book-cover--text small {
    display: none;
}

.book-cover--text {
    overflow: hidden;
}

.book-cover--remote { position: relative; overflow: hidden; }
.book-cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; z-index: 1; }
.book-cover-image.is-ready { opacity: 1; }
.book-cover .book-cover-credit { position: absolute; z-index: 2; bottom: 5px; right: 5px; max-width: calc(100% - 10px); padding: 2px 5px; border-radius: 3px; font: 600 .6rem/1.4 sans-serif; color: var(--ink); background: var(--surface); opacity: .92; }
