/* ============================================================================
   Logic Gym feature page — bookshelf, filters, cover cards, level ladder.
   Page-scoped: loaded via _page_css_ = ['features', 'logic-gym'].
   The rotating main-shelf tile lives in books/bookshelf.css (loaded site-wide).
   ============================================================================ */

/* ---- Hero: fanned stack of covers ------------------------------------------ */
.lg-fan {
    position: relative;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lg-fan .lg-fan-cover {
    position: absolute;
    width: 190px;
    aspect-ratio: 600 / 880;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(5, 43, 69, 0.22);
    transition: transform .35s ease, box-shadow .35s ease;
    background: #FAF8F4;
}
.lg-fan .lg-fan-cover:nth-child(1) { transform: translateX(-150px) rotate(-13deg) scale(.9);  z-index: 1; }
.lg-fan .lg-fan-cover:nth-child(2) { transform: translateX(-76px)  rotate(-6deg)  scale(.96); z-index: 2; }
.lg-fan .lg-fan-cover:nth-child(3) { transform: translateX(0)      rotate(0deg)   scale(1.04); z-index: 4; }
.lg-fan .lg-fan-cover:nth-child(4) { transform: translateX(76px)   rotate(6deg)   scale(.96); z-index: 2; }
.lg-fan .lg-fan-cover:nth-child(5) { transform: translateX(150px)  rotate(13deg)  scale(.9);  z-index: 1; }
.lg-fan:hover .lg-fan-cover:nth-child(1) { transform: translateX(-186px) rotate(-15deg) scale(.92); }
.lg-fan:hover .lg-fan-cover:nth-child(5) { transform: translateX(186px)  rotate(15deg)  scale(.92); }
@media (max-width: 949px) {
    .lg-fan { height: 300px; }
    .lg-fan .lg-fan-cover { width: 150px; }
}

/* ---- Filter controls ------------------------------------------------------- */
.lg-filters {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 880px;
    margin: 0 auto 2.5rem;
}
.lg-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.lg-filter-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-right: 4px;
    min-width: 74px;
    text-align: right;
}
.lg-filter-btn {
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #475569;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.lg-filter-btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.lg-filter-btn .lg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-filter-btn.active {
    color: #fff;
    border-color: transparent;
    background: var(--lg-btn-accent, #0D6BAA);
    box-shadow: 0 4px 12px rgba(13, 107, 170, 0.28);
}
.lg-filter-btn.active .lg-dot { background: #fff !important; }

/* ---- Cover grid ------------------------------------------------------------ */
.lg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 34px 26px;
    max-width: 1180px;
    margin: 0 auto;
}
.lg-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform .3s ease;
}
.lg-card.is-hidden { display: none; }
.lg-card-cover {
    position: relative;
    aspect-ratio: 600 / 880;
    border-radius: 9px;
    overflow: hidden;
    background: #FAF8F4;
    box-shadow:
        0 1px 2px rgba(5, 43, 69, .18),
        0 10px 24px rgba(5, 43, 69, .16);
    /* faint spine to read as a real book */
    border-left: 5px solid rgba(0, 0, 0, .14);
    transition: transform .3s ease, box-shadow .3s ease;
}
.lg-card:hover .lg-card-cover {
    transform: translateY(-6px);
    box-shadow:
        0 2px 4px rgba(5, 43, 69, .2),
        0 18px 36px rgba(5, 43, 69, .26);
}
.lg-card-meta {
    margin-top: 12px;
    text-align: center;
}
.lg-card-meta .lg-card-lang { font-size: 14px; font-weight: 700; color: #0f172a; }
.lg-card-meta .lg-card-level { font-size: 12.5px; color: #64748b; }

/* ---- Level ladder ---------------------------------------------------------- */
.lg-ladder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    max-width: 1180px;
    margin: 0 auto;
    counter-reset: lg-rung;
}
.lg-rung {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 22px 20px 20px;
    border: 1px solid #eef2f7;
    border-top: 4px solid var(--lg-rung-accent, #0D6BAA);
    box-shadow: 0 6px 18px rgba(5, 43, 69, .06);
}
.lg-rung-num {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--lg-rung-accent, #0D6BAA);
}
.lg-rung-title { font-size: 18px; font-weight: 700; color: #0f172a; margin: 2px 0 8px; }
.lg-rung-blurb { font-size: 13px; line-height: 1.5; color: #64748b; margin-bottom: 12px; }
.lg-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-chip {
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 3px 10px;
}

/* ---- "+ more languages" placeholder card ----------------------------------- */
.lg-more-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 600 / 880;
    border-radius: 9px;
    border: 2px dashed #cbd5e1;
    color: #94a3b8;
    text-align: center;
    padding: 16px;
    background: #f8fafc;
}
.lg-more-card i { font-size: 26px; margin-bottom: 10px; }
.lg-more-card span { font-size: 13px; font-weight: 600; line-height: 1.4; }
