/* Books Page Styles
 *
 * Page-specific layout only. Build on the tokens and shared classes in
 * global.css (.container, .section, .button, ...) and write mobile-first
 * min-width queries at 48rem / 64rem.
 */

/* Small screens: ~22-24px side gutters (the shared container is 16px) */
.book-feature__inner,
.book-description__inner,
.authors__inner {
    padding-inline: max(var(--container-pad), 1.375rem);
}

/* ---------- Featured book ---------- */

/* Cover above the purchase link on phones; side by side from tablet up */
.book-feature__inner {
    display: grid;
    justify-items: center;
    gap: var(--space-xl);
}

/* Whole cover, natural proportions, never cropped */
.book-feature__cover {
    width: 100%;
    max-width: 23.75rem;
    box-shadow: var(--shadow-md);
}

.book-feature__buy {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    min-height: 2.75rem;
    color: var(--color-accent);
    font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
}

.book-feature__buy:hover {
    color: var(--color-accent-hover);
}

.book-feature__arrow {
    flex: none;
    width: 3rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    transition: transform var(--duration-fast) var(--ease-out);
}

.book-feature__buy:hover .book-feature__arrow,
.book-feature__buy:focus-visible .book-feature__arrow {
    transform: translateX(0.25rem);
}

@media (min-width: 48rem) {
    .book-feature__inner {
        grid-template-columns: auto auto;
        justify-content: center;
        align-items: center;
        column-gap: clamp(var(--space-2xl), 2rem + 4vw, 7rem);
    }

    .book-feature__cover {
        width: clamp(16rem, 32vw, 23.75rem);
    }
}

/* ---------- Book description ---------- */

/* Very pale blue-gray panel (slightly deeper inside a dark page) */
.book-description {
    --color-surface: var(--palette-mist);
}

:root[data-theme="dark"] .book-description {
    --color-surface: var(--palette-mist-deep);
}

.book-description__inner {
    max-width: calc(51.25rem + 2 * max(var(--container-pad), 1.375rem));
}

.book-description__text {
    font-size: clamp(var(--font-size-base), 0.95rem + 0.35vw, 1.25rem);
    line-height: 1.75;
}

/* ---------- About the authors ---------- */

.authors__inner {
    max-width: calc(60rem + 2 * max(var(--container-pad), 1.375rem));
}

/* Portrait above the text on phones */
.author {
    display: grid;
    gap: var(--space-lg);
}

.author + .author {
    margin-top: var(--space-3xl);
}

.author__photo {
    width: 100%;
    max-width: 22rem;
    margin-inline: auto;
    border-radius: var(--radius-md);
}

.author__body {
    min-width: 0;
}

.author__name {
    margin-bottom: var(--space-md);
}

/* Two columns from tablet up, text vertically centered beside the photo.
   Both rows share the same photo column so the portraits match in size. */
@media (min-width: 48rem) {
    .author {
        grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
        grid-template-areas: "photo body";
        align-items: center;
        column-gap: clamp(var(--space-xl), 1rem + 4vw, 5rem);
    }

    .author--image-right {
        grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
        grid-template-areas: "body photo";
    }

    .author__photo {
        grid-area: photo;
        max-width: none;
    }

    .author__body {
        grid-area: body;
    }
}
