/*
Theme Name: i-Maths New
Design system for the i-Maths redesign.
*/

/* ---------- Design tokens ---------- */
:root {
    --im-primary: #2676e8;
    --im-primary-hover: #155fc8;
    --im-primary-soft: #eaf3ff;
    --im-navy: #172b4d;
    --im-text: #26364b;
    --im-muted: #718096;
    --im-border: #e4eaf2;
    --im-bg: #f5f8fc;
    --im-surface: #ffffff;
    --im-surface-soft: #f8faff;
    --im-success: #16865b;
    --im-radius: 16px;
    --im-radius-sm: 10px;
    --im-shadow: 0 5px 20px rgba(28, 55, 90, .055);
    --im-container: 1200px;
}

/* ---------- Reset and base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--im-bg);
    color: var(--im-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--im-primary);
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

a:hover {
    color: var(--im-primary-hover);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(var(--im-container), calc(100% - 48px));
    margin-inline: auto;
}

.site-main {
    min-height: 68vh;
    padding: 30px 0 64px;
}

/* ---------- Header ---------- */
.site-header {
    position: relative;
    z-index: 20;
    background: var(--im-surface);
    border-bottom: 1px solid var(--im-border);
}

.header-inner {
    width: min(var(--im-container), calc(100% - 48px));
    min-height: 78px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    color: var(--im-navy);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1;
}

.site-logo:hover {
    color: var(--im-navy);
}

.logo-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--im-primary);
    color: #fff;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo-text {
    color: var(--im-navy);
}

.header-search {
    display: flex;
    width: min(440px, 48%);
    height: 46px;
    overflow: hidden;
    align-items: center;
    border: 1px solid var(--im-border);
    border-radius: 12px;
    background: var(--im-bg);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.header-search:focus-within {
    border-color: #9bc3fa;
    box-shadow: 0 0 0 3px rgba(38, 118, 232, .10);
}

.header-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 16px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--im-text);
    font-size: 14px;
}

.header-search input::placeholder {
    color: #98a5b6;
}

.header-search button {
    display: grid;
    width: 50px;
    height: 100%;
    flex: 0 0 50px;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--im-primary);
    font-size: 25px;
}

.header-search button:hover {
    background: var(--im-primary-soft);
}

.mobile-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 1px solid var(--im-border);
    border-radius: 10px;
    background: var(--im-surface);
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 4px 0;
    border-radius: 2px;
    background: var(--im-navy);
}

/* ---------- Page headings and breadcrumbs ---------- */
.page-heading {
    margin: 0 0 22px;
    color: var(--im-navy);
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -.6px;
}

.page-description {
    margin: 0 0 24px;
    color: var(--im-muted);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 18px;
    color: var(--im-muted);
    font-size: 13px;
}

.breadcrumbs a {
    color: var(--im-muted);
}

.breadcrumbs a:hover {
    color: var(--im-primary);
}

.breadcrumbs .separator {
    color: #aab5c3;
}

/* ---------- General content surfaces ---------- */
.content-card,
.page-card,
.task-content,
.category-section,
.sidebar-widget {
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    background: var(--im-surface);
    box-shadow: var(--im-shadow);
}

.content-card {
    margin-bottom: 18px;
    padding: 24px;
}

.content-card h1,
.content-card h2 {
    margin: 0 0 12px;
    color: var(--im-navy);
    font-size: 22px;
    line-height: 1.35;
}

.content-card h1 a,
.content-card h2 a {
    color: inherit;
}

.content-card h1 a:hover,
.content-card h2 a:hover {
    color: var(--im-primary);
}

/* ---------- Category and textbook cards ---------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.category-card,
.task-card,
.textbook-card {
    min-width: 0;
    padding: 19px 20px;
    border: 1px solid var(--im-border);
    border-radius: 14px;
    background: var(--im-surface);
    box-shadow: 0 3px 13px rgba(28, 55, 90, .035);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.category-card:hover,
.task-card:hover,
.textbook-card:hover {
    transform: translateY(-2px);
    border-color: #b9d5fb;
    box-shadow: 0 8px 22px rgba(28, 75, 135, .08);
}

.category-card a,
.task-card a,
.textbook-card a {
    color: var(--im-navy);
    font-weight: 650;
}

.category-card a:hover,
.task-card a:hover,
.textbook-card a:hover {
    color: var(--im-primary);
}

.category-card-title,
.task-card-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.45;
}

.category-card-description {
    margin: 7px 0 0;
    color: var(--im-muted);
    font-size: 13px;
    line-height: 1.5;
}

.task-card {
    display: flex;
    align-items: center;
    gap: 13px;
}

.task-number {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--im-primary-soft);
    color: var(--im-primary);
    font-size: 14px;
    font-weight: 750;
}

/* ---------- Single task page ---------- */
.single-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
    gap: 24px;
}

.single-main {
    min-width: 0;
}

.single-sidebar {
    min-width: 0;
}

.task-content {
    padding: clamp(20px, 3vw, 32px);
}

.task-content > :first-child {
    margin-top: 0;
}

.task-content h1,
.task-content h2,
.task-content h3 {
    color: var(--im-navy);
    line-height: 1.35;
}

.task-content h1 {
    margin: 0 0 22px;
    font-size: clamp(25px, 3vw, 32px);
}

.task-content h2 {
    margin: 28px 0 14px;
    font-size: 22px;
}

.task-content p {
    margin: 0 0 16px;
}

.task-content img {
    height: auto;
    border-radius: 8px;
}

.task-content table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}

.task-content th,
.task-content td {
    padding: 10px 12px;
    border: 1px solid var(--im-border);
    text-align: left;
}

.task-content th {
    background: var(--im-surface-soft);
}

.task-navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0;
}

.task-navigation a,
.button-primary {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border: 1px solid #cfe1fb;
    border-radius: 10px;
    background: var(--im-primary-soft);
    color: var(--im-primary);
    font-size: 14px;
    font-weight: 650;
}

.task-navigation a:hover,
.button-primary:hover {
    border-color: var(--im-primary);
    background: var(--im-primary);
    color: #fff;
}

/* ---------- Sidebar ---------- */
.sidebar-widget {
    margin-bottom: 18px;
    padding: 19px;
}

.sidebar-widget-title {
    margin: 0 0 12px;
    color: var(--im-navy);
    font-size: 17px;
    font-weight: 700;
}

/* ---------- Pagination ---------- */
.pagination,
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 26px;
}

.page-numbers {
    display: inline-flex;
    min-width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--im-border);
    border-radius: 9px;
    background: var(--im-surface);
    color: var(--im-text);
    font-size: 14px;
}

.page-numbers.current,
.page-numbers:hover {
    border-color: var(--im-primary);
    background: var(--im-primary);
    color: #fff;
}

/* ---------- Search and empty states ---------- */
.search-result {
    margin-bottom: 14px;
    padding: 20px;
    border: 1px solid var(--im-border);
    border-radius: 13px;
    background: var(--im-surface);
}

.search-result h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.search-result p {
    margin: 0;
    color: var(--im-muted);
    font-size: 14px;
}

/* ---------- Footer ---------- */
.site-footer {
    padding: 26px 0;
    border-top: 1px solid var(--im-border);
    background: var(--im-surface);
    color: var(--im-muted);
    font-size: 13px;
}

.site-footer p {
    margin: 0;
}

/* ---------- WordPress content helpers ---------- */
.aligncenter {
    display: block;
    margin-right: auto;
    margin-left: auto;
}

.alignleft {
    float: left;
    margin: 0 18px 12px 0;
}

.alignright {
    float: right;
    margin: 0 0 12px 18px;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text,
.gallery-caption {
    color: var(--im-muted);
    font-size: 13px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .single-layout {
        grid-template-columns: minmax(0, 1fr) 240px;
        gap: 18px;
    }

    .header-inner {
        gap: 22px;
    }
}

@media (max-width: 700px) {
    .container,
    .header-inner {
        width: calc(100% - 30px);
    }

    .header-inner {
        min-height: 68px;
        gap: 12px;
    }

    .site-logo {
        gap: 4px;
        font-size: 24px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 22px;
    }

    .header-search {
        width: auto;
        min-width: 0;
        height: 40px;
        flex: 1 1 auto;
    }

    .header-search input {
        padding: 0 10px;
        font-size: 13px;
    }

    .header-search button {
        width: 38px;
        flex-basis: 38px;
    }

    .mobile-menu-toggle {
        display: block;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        padding: 9px;
    }

    .site-main {
        padding: 20px 0 42px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .category-card,
    .task-card,
    .textbook-card {
        padding: 16px;
    }

    .single-layout {
        grid-template-columns: 1fr;
    }

    .task-content {
        padding: 19px;
    }

    .content-card {
        padding: 18px;
    }

    .task-navigation {
        flex-direction: column;
    }

    .task-navigation a {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .container,
    .header-inner {
        width: calc(100% - 22px);
    }

    .site-logo {
        font-size: 21px;
    }

    .logo-icon {
        width: 29px;
        height: 29px;
        font-size: 20px;
    }

    .header-search input {
        font-size: 12px;
    }
}

/* ---------- Homepage ---------- */
.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: center;
    gap: 26px;
    min-height: 270px;
    margin: 0 0 26px;
    padding: 28px 42px;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(112deg, #edf5ff 0%, #f5f9ff 58%, #eaf3ff 100%);
}
.home-hero-art {
    position: relative;
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: center;
    color: #1d5fa9;
}
.home-hero-book {
    display: grid;
    width: 150px;
    height: 112px;
    place-items: center;
    border: 3px solid #1d5fa9;
    border-radius: 16px 22px 18px 12px;
    background: linear-gradient(145deg, #fff, #dcecff);
    box-shadow: 0 13px 0 -5px #c7def8, 0 25px 0 -10px #fff;
    font-family: Georgia, serif;
    font-size: 58px;
    font-weight: 700;
    transform: rotate(-7deg);
}
.home-hero-pencil {
    position: absolute;
    top: 18px;
    right: 32px;
    font-size: 82px;
    line-height: 1;
    transform: rotate(13deg);
}
.home-hero-orbit {
    position: absolute;
    top: 2px;
    left: 26px;
    font-family: Georgia, serif;
    font-size: 42px;
    font-style: italic;
}
.home-hero-content { min-width: 0; }
.home-hero h1 {
    margin: 0 0 5px;
    color: #111d36;
    font-size: clamp(30px, 3.5vw, 48px);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -.035em;
}
.home-hero-lead {
    margin: 0 0 20px;
    color: #53627a;
    font-size: 19px;
}
.home-search {
    display: flex;
    height: 56px;
    align-items: center;
    overflow: hidden;
    border: 1px solid #9dbce4;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(24, 68, 120, .04);
}
.home-search-icon {
    padding: 0 14px 3px 18px;
    color: #8393aa;
    font-size: 31px;
    line-height: 1;
}
.home-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    color: var(--im-text);
    font-size: 17px;
}
.home-search input::placeholder { color: #8a96a8; }
.home-search button {
    align-self: stretch;
    min-width: 132px;
    padding: 0 24px;
    border: 0;
    background: #2167bd;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}
.home-search button:hover { background: #1556a5; }
.home-search-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    color: #52627a;
    font-size: 14px;
}
.home-search-examples a {
    padding: 5px 13px;
    border-radius: 9px;
    background: #dceaff;
    color: #174f91;
    font-weight: 600;
}
.home-section { margin: 0 0 28px; }
.home-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 15px;
}
.home-section-heading h2 {
    margin: 0;
    color: #111d36;
    font-size: 29px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.025em;
}
.home-subject-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}
.home-subject-card,
.home-popular-card {
    display: flex;
    min-width: 0;
    min-height: 82px;
    align-items: center;
    gap: 13px;
    padding: 12px 15px;
    border: 1px solid #dce3ed;
    border-radius: 13px;
    background: #fff;
    color: var(--im-navy);
    box-shadow: 0 2px 8px rgba(28, 55, 90, .025);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.home-subject-card:hover,
.home-popular-card:hover {
    transform: translateY(-2px);
    border-color: #a9c9f3;
    box-shadow: 0 7px 18px rgba(28, 75, 135, .08);
    color: var(--im-primary);
}
.home-subject-icon,
.home-popular-icon {
    display: grid;
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    place-items: center;
    border-radius: 13px;
    background: #eaf3ff;
    color: #1e5d9f;
    font-family: Georgia, serif;
    font-size: 31px;
    font-weight: 600;
}
.home-subject-copy,
.home-popular-copy {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
}
.home-subject-copy strong,
.home-popular-copy strong {
    overflow-wrap: anywhere;
    color: #101a30;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.3;
}
.home-subject-copy small,
.home-popular-copy small {
    margin-top: 3px;
    color: #68768b;
    font-size: 13px;
    line-height: 1.35;
}
.home-card-arrow {
    flex: 0 0 auto;
    color: #1e5d9f;
    font-size: 30px;
    line-height: 1;
}
.home-popular-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
}
.home-popular-card { min-height: 98px; }
.home-popular-icon {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
    font-size: 34px;
}
.home-popular-copy strong { font-size: 15px; }
.home-empty-popular {
    padding: 18px 22px;
    border: 1px dashed #cbd8e8;
    border-radius: 13px;
    background: #fff;
    color: #68768b;
}
.home-empty-popular p { margin: 0; }
.home-about {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 8px 0 0;
    padding: 19px 25px;
    border-radius: 22px;
    background: linear-gradient(110deg, #edf5ff, #f5f9ff);
}
.home-about-avatar {
    display: grid;
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    place-items: center;
    border-radius: 50%;
    background: #d9eaff;
    color: #1b5a9c;
    font-size: 25px;
    font-weight: 800;
}
.home-about-divider {
    width: 1px;
    height: 58px;
    flex: 0 0 1px;
    background: #9db9dc;
}
.home-about-copy { flex: 1 1 auto; }
.home-about-copy strong {
    color: #111d36;
    font-size: 17px;
    font-weight: 750;
}
.home-about-copy p {
    margin: 3px 0 0;
    color: #65748a;
    font-size: 14px;
}
.home-about-button {
    display: inline-flex;
    min-height: 43px;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border: 1px solid #3679c5;
    border-radius: 11px;
    color: #1d5fa9;
    font-weight: 650;
}
.home-about-button:hover { background: #fff; }

@media (max-width: 1050px) {
    .home-subject-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-hero { grid-template-columns: 200px minmax(0, 1fr); padding-inline: 28px; }
}
@media (max-width: 760px) {
    .home-hero {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 24px 20px;
    }
    .home-hero-art { display: none; }
    .home-hero h1 { font-size: 30px; }
    .home-hero-lead { font-size: 16px; }
    .home-search { height: 50px; }
    .home-search button { min-width: 88px; padding-inline: 13px; font-size: 15px; }
    .home-search input { font-size: 14px; }
    .home-search-icon { padding-inline: 12px; }
    .home-section-heading h2 { font-size: 24px; }
    .home-subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .home-subject-card { min-height: 75px; gap: 9px; padding: 9px; }
    .home-subject-icon { width: 48px; height: 48px; flex-basis: 48px; font-size: 25px; }
    .home-subject-copy strong { font-size: 14px; }
    .home-subject-copy small { font-size: 11px; }
    .home-popular-grid { grid-template-columns: 1fr; }
    .home-about { flex-wrap: wrap; gap: 12px; padding: 17px; }
    .home-about-avatar { width: 58px; height: 58px; flex-basis: 58px; }
    .home-about-divider { display: none; }
    .home-about-copy { flex-basis: calc(100% - 75px); }
    .home-about-copy strong { font-size: 15px; }
    .home-about-button { margin-left: 70px; }
}
@media (max-width: 420px) {
    .home-subject-grid { grid-template-columns: 1fr; }
    .home-search-examples { font-size: 12px; }
}


/* Homepage about block with the original welcome text */
.home-about {
    align-items: flex-start;
    padding: 25px 30px;
}
.home-about-avatar {
    margin-top: 34px;
}
.home-about-copy h2 {
    margin: 2px 0 10px;
    color: #111d36;
    font-size: 27px;
    line-height: 1.25;
}
.home-about-eyebrow {
    color: #2167bd;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.home-about-copy p {
    margin: 0 0 10px;
    color: #53627a;
    font-size: 15px;
    line-height: 1.65;
}
@media (max-width: 760px) {
    .home-about {
        align-items: flex-start;
        padding: 18px;
    }
    .home-about-avatar { margin-top: 0; }
    .home-about-copy { flex-basis: 100%; }
    .home-about-copy h2 { font-size: 23px; }
}


/* Popular textbook categories */
.home-popular-card {
    min-height: 104px;
    padding: 13px 16px;
}
.home-popular-cover {
    display: flex;
    width: 68px;
    height: 78px;
    flex: 0 0 68px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e1e8f2;
    border-radius: 9px;
    background: #f3f7fc;
}
.home-popular-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.home-popular-copy strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.home-popular-copy small {
    margin-top: 5px;
}
@media (max-width: 760px) {
    .home-popular-card { min-height: 90px; }
    .home-popular-cover { width: 58px; height: 68px; flex-basis: 58px; }
}


/* Popular textbooks: spacious two-column showcase */
.home-popular-heading {
    align-items: flex-end;
    margin-bottom: 18px;
}
.home-popular-heading p {
    margin: 7px 0 0;
    color: #718096;
    font-size: 15px;
    line-height: 1.45;
}
.home-popular-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.home-popular-card {
    min-height: 196px;
    gap: 22px;
    padding: 17px 20px;
    border-radius: 16px;
}
.home-popular-cover {
    width: 122px;
    height: 162px;
    flex: 0 0 122px;
    border: 0;
    border-radius: 5px;
    background: #f1f5fa;
    box-shadow: 0 4px 12px rgba(20, 42, 75, .15);
}
.home-popular-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.home-popular-icon {
    width: 122px;
    height: 162px;
    flex: 0 0 122px;
    border-radius: 8px;
    font-size: 48px;
}
.home-popular-copy {
    align-self: center;
    gap: 10px;
}
.home-popular-copy strong {
    display: -webkit-box;
    overflow: hidden;
    color: #14213b;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.38;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}
.home-popular-copy small {
    margin-top: 0;
    color: #718096;
    font-size: 15px;
}
.home-popular-card .home-card-arrow {
    margin-left: auto;
    font-size: 34px;
}
.home-popular-card-hidden {
    display: none;
}
.home-popular-grid.is-expanded .home-popular-card-hidden {
    display: flex;
}
.home-popular-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}
.home-popular-more {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 24px;
    border: 1px solid #b9d2ef;
    border-radius: 12px;
    background: #fff;
    color: #205f9f;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.home-popular-more:hover {
    transform: translateY(-1px);
    border-color: #6fa6e5;
    background: #f5f9ff;
}
.home-popular-more span {
    font-size: 19px;
    line-height: 1;
}
@media (max-width: 900px) {
    .home-popular-grid { gap: 12px; }
    .home-popular-card { gap: 15px; padding: 14px; }
    .home-popular-cover,
    .home-popular-icon {
        width: 100px;
        height: 138px;
        flex-basis: 100px;
    }
    .home-popular-copy strong { font-size: 16px; }
}
@media (max-width: 620px) {
    .home-popular-grid { grid-template-columns: 1fr; }
    .home-popular-card { min-height: 154px; }
    .home-popular-cover,
    .home-popular-icon {
        width: 92px;
        height: 124px;
        flex-basis: 92px;
    }
    .home-popular-copy strong {
        font-size: 15px;
        -webkit-line-clamp: 4;
    }
    .home-popular-heading p { font-size: 13px; }
}


/* Category textbook catalogue cards */
.category-children .cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.category-book-card {
    display: flex;
    min-height: 220px;
    align-items: center;
    gap: 22px;
    padding: 18px;
    overflow: hidden;
}
.category-book-cover {
    display: flex;
    width: 132px;
    height: 184px;
    flex: 0 0 132px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 7px;
    background: #f1f6fc;
    box-shadow: 0 4px 14px rgba(20, 42, 75, .13);
}
.category-book-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.category-book-info {
    min-width: 0;
}
.category-book-info .category-card-title {
    margin: 0 0 10px;
    line-height: 1.4;
}
.category-book-info .category-card-title a {
    color: #172642;
    text-decoration: none;
}
.category-book-info .category-card-title a:hover {
    color: #246bb5;
}
.category-book-info .category-card-description {
    color: #718096;
    font-size: 14px;
    line-height: 1.55;
}
@media (max-width: 760px) {
    .category-children .cards-grid {
        grid-template-columns: 1fr;
    }
    .category-book-card {
        min-height: 174px;
        gap: 16px;
        padding: 14px;
    }
    .category-book-cover {
        width: 104px;
        height: 146px;
        flex-basis: 104px;
    }
}
