/* Lean index page — purposefully summary-led. */
:root {
    --home-max: 1180px;
    --home-radius: 16px;
    --home-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    --home-text: var(--foundation-stone, #172033);
    --home-muted: var(--lions-mane, #5e6675);
    --home-gold: var(--judicial-gold, #d4af37);
    --home-blue: var(--living-water, #00a8d6);
    --home-orange: var(--dawn-orange, #ff6b35);
    --home-dark: var(--midnight-blue, #191970);
}

.home-shell {
    width: min(var(--home-max), calc(100% - 40px));
    margin: 0 auto;
}

.home-hero {
    min-height: 560px;
    display: flex;
    align-items: center;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(25,25,112,.94), rgba(75,0,130,.84)),
        url("../images/refuge-hero.jpg") center/cover no-repeat;
    border-bottom: 4px solid var(--home-gold);
}

.home-hero__inner {
    text-align: center;
    padding: 86px 0 78px;
    max-width: 930px;
}

.home-eyebrow,
.home-kicker {
    display: inline-block;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--home-orange);
    margin-bottom: 12px;
}

.home-kicker--light { color: #ffe7a3; }

.home-hero h1 {
    margin: 0 auto 20px;
    max-width: 850px;
    color: #fff;
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    line-height: 1.05;
    letter-spacing: -.03em;
}

.home-hero__lead {
    max-width: 760px;
    margin: 0 auto;
    color: rgba(255,255,255,.9);
    font-size: clamp(1rem, 1.7vw, 1.22rem);
    line-height: 1.7;
}

.home-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 22px;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 800;
    border: 1px solid transparent;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.home-btn:hover { transform: translateY(-2px); }
.home-btn--primary { background: linear-gradient(135deg, var(--home-orange), var(--home-gold)); color: #fff; box-shadow: 0 10px 24px rgba(255,107,53,.22); }
.home-btn--ghost { border-color: rgba(255,255,255,.55); color: #fff; background: rgba(255,255,255,.07); }
.home-btn--quiet { color: #fff; background: rgba(255,255,255,.12); }
.home-btn--compact { background: var(--home-dark); color: #fff; min-height: 42px; padding: 10px 18px; }
.home-btn--light { background: #fff; color: var(--home-dark); }
.home-btn--outline-light { border-color: rgba(255,255,255,.7); color: #fff; background: transparent; }

.home-section { padding: 72px 0; background: #fff; }
.home-section--soft { background: linear-gradient(180deg, #f8fafc, #fff); }
.home-section--accent { background: linear-gradient(135deg, rgba(0,191,255,.06), rgba(212,175,55,.08)); }

.home-section__heading { max-width: 820px; margin: 0 auto 32px; text-align: center; }
.home-section__heading--split { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 30px; text-align: left; }
.home-section__heading h2,
.home-feature-row h2,
.home-closing h2 {
    margin: 0 0 12px;
    color: var(--home-text);
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    line-height: 1.15;
}
.home-section__heading p,
.home-feature-row p { margin: 0; color: var(--home-muted); line-height: 1.7; font-size: 1.03rem; }

.home-summary-grid { display: grid; gap: 22px; }
.home-summary-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-summary-card { padding: 25px; border: 1px solid #e5e7eb; border-radius: var(--home-radius); box-shadow: var(--home-shadow); background: #fff; }
.home-summary-card__icon { display: block; font-size: 1.8rem; margin-bottom: 12px; }
.home-summary-card h3 { margin: 0 0 8px; color: var(--home-text); font-size: 1.12rem; }
.home-summary-card p { margin: 0; color: var(--home-muted); line-height: 1.6; font-size: .94rem; }

.home-section__footer { text-align: center; margin-top: 28px; }
.home-text-link { color: var(--home-dark); font-weight: 800; text-decoration: none; border-bottom: 2px solid rgba(212,175,55,.5); padding-bottom: 3px; }
.home-text-link:hover { color: var(--home-orange); }

.home-book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.home-book-card { overflow: hidden; display: flex; flex-direction: column; height: 100%; border-radius: var(--home-radius); border: 1px solid #e5e7eb; background: #fff; box-shadow: var(--home-shadow); }
/*
 * Cover height is calculated row-by-row by home-library-grid.js.
 * The tallest natural cover in each row sets the common cover height for that row.
 * object-fit: contain guarantees that no book cover is cropped.
 */
.home-book-card__cover { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; background: #102d45; overflow: hidden; }
.home-book-card__cover img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; transition: opacity .2s ease; }
.home-book-card:hover .home-book-card__cover img { opacity: .97; }
.home-book-card__badge { position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(15,23,42,.88); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .08em; box-shadow: 0 3px 10px rgba(0,0,0,.16); }
.home-book-card__body { display: flex; flex-direction: column; flex: 1; padding: 16px 17px 17px; border-top: 1px solid #e5e7eb; }
.home-book-card__body h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.home-book-card__body h3 a { color: var(--home-text); text-decoration: none; }
.home-book-card__meta { display: flex; gap: 14px; margin-top: 11px; color: var(--home-muted); font-size: .8rem; }

.home-empty-state { padding: 36px; border-radius: var(--home-radius); border: 1px dashed #cbd5e1; text-align: center; color: var(--home-muted); }
.home-empty-state strong, .home-empty-state span { display: block; }
.home-empty-state strong { color: var(--home-text); margin-bottom: 4px; }

.home-feature-row { display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: center; gap: 70px; }
.home-section--accent .home-feature-row { grid-template-columns: 220px minmax(0, 1fr); }
.home-feature-row__content { max-width: 760px; }
.home-feature-row__symbol { width: 190px; height: 190px; display: grid; place-items: center; margin: auto; border-radius: 50%; background: linear-gradient(135deg, rgba(0,191,255,.12), rgba(212,175,55,.16)); font-size: 4.8rem; }
.home-feature-row .home-text-link { display: inline-block; margin-top: 18px; }

.home-closing { padding: 62px 0; background: linear-gradient(120deg, var(--home-dark), #4b0082); color: #fff; }
.home-closing__inner { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 40px; }
.home-closing h2 { color: #fff; max-width: 760px; }
.home-closing p { color: rgba(255,255,255,.82); margin: 0; line-height: 1.6; }
.home-closing .home-actions { margin-top: 0; }

@media (max-width: 900px) {
    .home-summary-grid--3,
    .home-book-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .home-feature-row,
    .home-section--accent .home-feature-row { grid-template-columns: 1fr; gap: 28px; text-align: center; }
    .home-feature-row__symbol { order: -1; width: 135px; height: 135px; font-size: 3.5rem; }
    .home-section__heading--split { align-items: flex-start; }
    .home-closing__inner { grid-template-columns: 1fr; text-align: center; }
}

@media (max-width: 640px) {
    .home-shell { width: min(100% - 28px, var(--home-max)); }
    .home-hero { min-height: 500px; }
    .home-hero__inner { padding: 66px 0 58px; }
    .home-section { padding: 52px 0; }
    .home-summary-grid--3,
    .home-book-grid { grid-template-columns: 1fr; }
    .home-section__heading--split { display: block; text-align: center; }
    .home-section__heading--split .home-btn { margin-top: 18px; }
    .home-actions { flex-direction: column; align-items: stretch; }
    .home-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
