/* ============================================================================
   Nifty Assignments feature page — hero cover row, "one problem three
   languages" panels, three-book shelf, topic-theme grid.
   Page-scoped: loaded via _page_css_ = ['features', 'nifty-assignments'].
   The rotating main-shelf tile lives in books/bookshelf.css (loaded site-wide).
   ============================================================================ */

/* ---- Shared cover box (matches the 680×1020 Swiss cover aspect) ----------- */
.na-cover {
    aspect-ratio: 680 / 1020;
    border-radius: 10px;
    overflow: hidden;
    background: #FFFFFF;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .18),
        0 14px 32px rgba(15, 23, 42, .18);
}
.na-cover .na-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- Hero: a short shelf of the three editions, lightly tilted ------------ */
.na-hero-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px 0;
}
.na-hero-row .na-cover {
    width: 30%;
    max-width: 210px;
    transition: transform .35s ease, box-shadow .35s ease;
}
.na-hero-row .na-cover:nth-child(1) { transform: rotate(-7deg) translateX(14px);  z-index: 1; }
.na-hero-row .na-cover:nth-child(2) { transform: translateY(-12px) scale(1.06);   z-index: 3; }
.na-hero-row .na-cover:nth-child(3) { transform: rotate(7deg)  translateX(-14px); z-index: 2; }
.na-hero-row:hover .na-cover:nth-child(1) { transform: rotate(-9deg) translateX(2px); }
.na-hero-row:hover .na-cover:nth-child(3) { transform: rotate(9deg)  translateX(-2px); }
@media (max-width: 949px) {
    .na-hero-row .na-cover { max-width: 150px; }
}
.na-hero-credit {
    margin-top: 22px;
    text-align: center;
    font-size: 12.5px;
    color: #94a3b8;
}
.na-hero-credit a { color: #64748b; text-decoration: underline; }
.na-hero-credit a:hover { color: #334155; }

/* ---- "One problem, three languages" code panels --------------------------- */
.na-poly {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1080px;
    margin: 0 auto;
}
@media (max-width: 949px) { .na-poly { grid-template-columns: 1fr; } }
.na-poly-card {
    background: #0f172a;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    border-top: 4px solid var(--na-accent, #2563EB);
}
.na-poly-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .04);
    color: #e2e8f0;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.na-poly-head i { color: var(--na-accent, #2563EB); }
.na-code {
    margin: 0;
    padding: 16px 18px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.65;
    color: #cbd5e1;
    white-space: pre;
    overflow-x: auto;
    tab-size: 2;
}
.na-code .k { color: #c084fc; }   /* keyword  */
.na-code .s { color: #fca5a5; }   /* string   */
.na-code .c { color: #64748b; font-style: italic; } /* comment */
.na-code .f { color: #7dd3fc; }   /* function */

/* ---- The three editions ---------------------------------------------------- */
.na-books {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    max-width: 980px;
    margin: 0 auto;
}
@media (max-width: 949px) { .na-books { grid-template-columns: 1fr; max-width: 340px; } }
.na-book { display: flex; flex-direction: column; }
.na-book .na-cover {
    transition: transform .3s ease, box-shadow .3s ease;
}
.na-book:hover .na-cover {
    transform: translateY(-6px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .22), 0 22px 44px rgba(15, 23, 42, .24);
}
.na-book-meta { margin-top: 16px; text-align: center; }
.na-book-lang { font-size: 18px; font-weight: 800; color: #0f172a; }
.na-book-count { font-size: 13px; color: #64748b; margin-top: 2px; }

/* ---- The three levels ------------------------------------------------------ */
.na-levels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    max-width: 1080px;
    margin: 0 auto;
}
@media (max-width: 949px) { .na-levels { grid-template-columns: 1fr; max-width: 520px; } }
.na-level {
    background: #fff;
    border: 1px solid #eef2f7;
    border-top: 4px solid var(--na-accent, #2563EB);
    border-radius: 14px;
    padding: 22px 22px 20px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
    display: flex;
    flex-direction: column;
}
.na-level-title { font-size: 17px; font-weight: 800; color: #0f172a; }
.na-level-meta { font-size: 13px; font-weight: 700; color: var(--na-accent, #2563EB); margin: 4px 0 12px; }
.na-level-blurb { font-size: 13.5px; line-height: 1.55; color: #64748b; margin-bottom: 14px; flex: 1; }
.na-level-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.na-level-chip {
    font-size: 11.5px; font-weight: 600; color: #475569;
    background: #f1f5f9; border-radius: 999px; padding: 3px 10px;
}

/* ---- Topic coverage chips -------------------------------------------------- */
.na-themes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}
.na-theme {
    background: #fff;
    border: 1px solid #eef2f7;
    border-left: 5px solid var(--na-accent, #2563EB);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}
.na-theme-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.na-theme-title i { color: var(--na-accent, #2563EB); }
.na-theme-examples { font-size: 13px; color: #64748b; line-height: 1.5; }
