/*
 * Public site: books — the card in the list of Books and the head of a book page. The cover keeps its own proportions
 * (3:4); the status is the pill of marks.css, the buttons are the ordinary ones of components/button.css.
 */

.app-grid--books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-bcover {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

/* The card: the cover on the left, the text on the right; the title is the link (grid.css .app-cardlink), stretched over the whole card. */
.app-bcard {
    position: relative;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: border-color var(--transition);
}

.app-bcard:hover {
    border-color: var(--border-3);
}

.app-bcard:has(.app-cardlink:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.app-bcard__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: var(--space-1);
    min-width: 0;
}

.app-bcard__title {
    font-size: var(--fs-card);
    font-weight: var(--fw-semibold);
    letter-spacing: -0.01em;
    line-height: var(--lh-tight);
}

/* The line is kept when the subtitle is empty: the cards of a row keep one skeleton (core.md §4.5). */
.app-bcard__sub {
    min-height: calc(1em * var(--lh-text));
    color: var(--text-2);
    font-size: var(--fs-site-read);
    line-height: var(--lh-text);
}

/* The head of a book page: the cover and, beside it, the title, the subtitle, the status and the reading time. */
.app-bookhead {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-5);
    margin-bottom: var(--space-4);
}

.app-bookhead__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    min-width: 0;
}

.app-bookhead .app-article__title {
    margin: 0;
}

.app-bookhead .app-article__lead,
.app-bookhead .app-article__meta {
    margin: 0;
}

.app-bookactions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.app-outcomes {
    margin: 0 0 var(--space-5);
    padding-left: var(--space-5);
    list-style: disc;
    color: var(--text-2);
    line-height: 1.7;
}

.app-outcomes li + li {
    margin-top: var(--space-0);
}

@container (max-width: 719px) {
    .app-grid--books {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-bcard {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: var(--space-3);
        padding: var(--space-3);
    }

    .app-bookhead {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: var(--space-3);
    }
}
