/* =============================================
   /books — featured book + card grid (NAS-408)
   Uses the site tokens from site.css, so it follows light/dark mode.
   ============================================= */

.books-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 96px;
    color: var(--text-primary);
}

/* ── Hero ── */
.books-hero {
    max-width: 720px;
    margin: 0 auto 56px;
    text-align: center;
}

.books-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--eyp-sub-color);
    margin-bottom: 14px;
}

.books-hero h1 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.books-hero-desc {
    font-size: clamp(15px, 1.8vw, 17px);
    line-height: 1.75;
    color: var(--text-muted);
    margin: 0;
}

/* ── Cover ── */
.books-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-card);
}

.books-cover img {
    object-fit: cover;
}

.books-cover-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 16px;
    background: linear-gradient(160deg, rgba(30,180,255,0.18), rgba(74,222,128,0.12));
}

.books-cover-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.books-cover--featured .books-cover-title {
    font-size: 1.4rem;
}

.books-cover-author {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Featured ── */
.books-featured {
    display: grid;
    grid-template-columns: minmax(200px, 320px) 1fr;
    gap: 48px;
    align-items: center;
    padding: 40px;
    margin-bottom: 72px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
}

.books-badge {
    display: inline-block;
    padding: 4px 12px;
    margin-bottom: 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--eyp-sub-color);
    background: var(--eyp-pill-bg);
    border: 1px solid var(--eyp-pill-border);
}

.books-featured-title {
    font-family: 'Sora', sans-serif;
    font-size: clamp(26px, 3.2vw, 36px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.books-subtitle {
    color: var(--text-muted);
    margin-bottom: 6px;
}

.books-author {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.books-featured-desc {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 28px;
    white-space: pre-line;
}

/* ── Grid ── */
/* ── Empty / unavailable list ── */
.books-notice {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 24px;
    text-align: center;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
}

.books-grid-title {
    font-family: 'Sora', sans-serif;
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.books-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px;
}

.books-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.books-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.books-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-top: 16px;
}

.books-card-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.books-card .books-author {
    margin-bottom: 10px;
}

.books-card-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* ── Buy button ── */
.books-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    background: #00803f; /* 5.0:1 with white; --green2 is only 3.3:1 */
    transition: background var(--transition);
}

.books-buy:hover,
.books-buy:focus-visible {
    color: #ffffff;
    background: #006b34;
}

.books-buy:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 3px;
}

.books-buy--featured {
    align-self: flex-start;
}

.books-buy--grid {
    margin-top: auto;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.92rem;
}

/* Light mode: the site's #009944 green is under 4.5:1 for 12px labels. */
body.light-mode .books-eyebrow,
body.light-mode .books-badge {
    color: #006b34;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .books-main {
        padding: 32px 16px 72px;
    }

    .books-featured {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 24px;
        margin-bottom: 56px;
    }

    .books-featured .books-cover {
        max-width: 240px;
        margin: 0 auto;
    }

    .books-buy--featured {
        align-self: stretch;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .books-card {
        padding: 10px;
    }

    .books-buy--grid {
        gap: 6px;
        padding: 9px 8px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .books-card-desc {
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .books-card,
    .books-buy {
        transition: none;
    }

    .books-card:hover {
        transform: none;
    }
}
