/* My books: feature rows and book pages. Builds on site.css (book covers) and blog.css (prose). */

.books-page { display: flex; flex-direction: column; gap: clamp(2.5rem, 7vw, 4.5rem); }

.books-empty {
    padding: clamp(1.75rem, 5vw, 3rem);
    border-radius: var(--radius-xl);
    background: var(--surface-2);
    text-align: center;
    color: var(--muted);
}

.book-status {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 600;
}

.book-status--published { background: var(--lime); color: var(--ink); }
.book-status--coming-soon { background: var(--ink); color: var(--ink-inverse); }
.book-status--writing { background: var(--surface-2); color: var(--ink); }

/* ---------- Index: one feature row per book ---------- */

.book-features {
    display: flex;
    flex-direction: column;
    gap: clamp(3.5rem, 9vw, 6rem);
    max-width: 62rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.book-feature {
    display: grid;
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 4.5rem);
}

.book-feature:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); }
.book-feature:nth-child(even) .book-feature__cover { order: 2; }

.book-feature__cover { display: block; transition: transform 300ms var(--ease-out); }
.book-feature__cover:hover { transform: translateY(-6px) rotate(-1deg); }
.book-feature__cover .book-cover__title { font-size: clamp(1.4rem, 3vw, 2.1rem); }
.book-feature__cover .book-cover__author { font-size: 0.85rem; }

.book-feature__text { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.book-feature__title { font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl)); line-height: 0.88; }
.book-feature__title a:hover { color: var(--accent); }
.book-feature__subtitle { font-size: var(--text-md); font-weight: 300; letter-spacing: -0.01em; line-height: 1.4; color: var(--muted); }
.book-feature__blurb { line-height: 1.6; }
.book-feature__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }

/* ---------- Book page ---------- */

.book-detail { display: flex; flex-direction: column; gap: clamp(3rem, 8vw, 5rem); max-width: 62rem; padding-top: clamp(2.5rem, 7vw, 4.5rem); }
.book-detail .post-back { align-self: flex-start; margin-bottom: clamp(-3rem, -5vw, -1.5rem); }

.book-hero {
    display: grid;
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    align-items: start;
    gap: clamp(2rem, 6vw, 4.5rem);
}

.book-hero__cover .book-cover__title { font-size: clamp(1.5rem, 3.2vw, 2.3rem); }
.book-hero__cover .book-cover__author { font-size: 0.9rem; }

.book-hero__text { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
.book-hero__title { font-size: clamp(2.5rem, 7vw, 5rem); line-height: 0.88; overflow-wrap: anywhere; }
.book-hero__subtitle { font-size: var(--text-md); font-weight: 300; letter-spacing: -0.01em; line-height: 1.4; color: var(--muted); }
.book-hero__author { font-weight: 600; }
.book-hero__sample { font-size: 0.9rem; font-weight: 600; }
.book-hero__sample:hover { color: var(--accent); }

.book-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 1rem 2rem;
    width: 100%;
    margin: 0.5rem 0 0;
    padding: 1.25rem 0;
    border-top: 1px solid var(--surface-2);
    border-bottom: 1px solid var(--surface-2);
}

.book-facts dt { font-size: var(--text-sm); color: var(--muted); }
.book-facts dd { margin: 0.2rem 0 0; font-weight: 600; overflow-wrap: break-word; }

.book-buy { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.5rem; }
.book-buy__label { font-size: var(--text-sm); font-weight: 600; color: var(--muted); }
.book-buy__links { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.book-block { display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; max-width: 46rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.book-block__title { font-size: var(--text-2xl); line-height: 0.9; }
.book-block .prose { width: 100%; }

.book-excerpt {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: var(--radius-xl);
    background: #fffdf7;
    box-shadow: 0 0 0 1px rgba(15, 12, 21, 0.06);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
}

.praise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.praise-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    border-radius: var(--radius-xl);
    background: var(--surface-2);
}

.praise-card__quote { margin: 0; font-size: var(--text-md); font-weight: 300; letter-spacing: -0.01em; line-height: 1.45; }
.praise-card__by { font-size: var(--text-sm); font-weight: 600; color: var(--muted); }

.book-related { display: flex; flex-direction: column; gap: 1rem; width: 100%; }

.book-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    transition: background-color 200ms ease-out;
}

.book-link:hover { background: #ebe9e9; }

.book-link__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--lime);
}

.book-link__icon svg { width: 1.1rem; height: 1.1rem; }
.book-link__kicker { display: block; font-size: var(--text-sm); color: var(--muted); }
.book-link__title { display: block; font-weight: 600; line-height: 1.3; }

.book-others {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.book-others__link { display: flex; flex-direction: column; gap: 0.25rem; }
.book-others__link .book-cover { margin-bottom: 0.6rem; transition: transform 300ms var(--ease-out); }
.book-others__link:hover .book-cover { transform: translateY(-4px) rotate(-1deg); }
.book-others__title { font-size: 0.95rem; font-weight: 600; line-height: 1.25; }
.book-others__link:hover .book-others__title { color: var(--accent); }
.book-others__status { font-size: var(--text-sm); color: var(--muted); }

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
    .book-feature,
    .book-feature:nth-child(even),
    .book-hero { grid-template-columns: 1fr; }
    .book-feature:nth-child(even) .book-feature__cover { order: 0; }
    .book-feature__cover,
    .book-hero__cover { width: min(70%, 16rem); }
}
