/* ============================================ */
/*         Jasper Academy — Home Sections       */
/* ============================================ */

/* Slider banner */
.jasper-slider img {
    display: block;
    width: 100%;
    height: auto;
}

/* Banner blocks (4 tiles) */
.jasper-banners-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}
.jasper-banner {
    display: block;
    overflow: hidden;
}
.jasper-banner-img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}
.jasper-banner:hover .jasper-banner-img {
    transform: scale(1.03);
}

/* Course cards carousel */
.jasper-courses {
    padding: 2.5rem 1rem;
    background: #f7f7f6;
}
.jasper-courses-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.jasper-courses-title {
    font-family: var(--headerFont);
    color: var(--navy);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    margin: 0 0 1.5rem;
}
.jasper-courses-carousel { position: relative; }
.jasper-courses-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding: 0.25rem 0.25rem 0.75rem;
}
.jasper-courses-track::-webkit-scrollbar { height: 8px; }
.jasper-courses-track::-webkit-scrollbar-thumb { background: rgba(87,144,52,.4); border-radius: 4px; }
.jasper-course-card {
    flex: 0 0 300px;
    scroll-snap-align: start;
}
.jasper-course-card-inner {
    position: relative;
    display: block;
    background-size: cover;
    background-position: center;
    aspect-ratio: 387 / 480;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
}
.jasper-course-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.jasper-course-card:hover .jasper-course-card-overlay { opacity: 1; }
.jasper-course-card-name {
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.35;
    margin: 0 0 0.5rem;
}
.jasper-course-card-link {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    font-size: 0.9rem;
}
.jasper-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(87,144,52,.85);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jasper-carousel-prev { left: 0.25rem; }
.jasper-carousel-next { right: 0.25rem; }

/* Full-width banner */
.jasper-full-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* Promo cards (colored CTA tiles) */
.jasper-promo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.jasper-promo-card {
    padding: 2rem 1.5rem;
    color: #fff;
}
.jasper-promo-title {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #fff;
}
.jasper-promo-title-2 {
    font-size: 1.1rem;
    margin: 0 0 1rem;
    text-transform: uppercase;
    color: #fff;
}
.jasper-promo-text {
    margin: 0 0 1rem;
    color: #fff;
}
.jasper-promo-list {
    margin: 0 0 1rem;
    padding-left: 1rem;
    color: #fff;
}
.jasper-promo-list li {
    margin: 0.35rem 0;
    font-size: 0.95rem;
}
.jasper-promo-btn {
    display: inline-block;
    background: #fff;
    color: #333;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
    .jasper-banners-grid { grid-template-columns: repeat(2, 1fr); }
    .jasper-promo-grid   { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .jasper-banners-grid,
    .jasper-promo-grid { grid-template-columns: 1fr; }
    .jasper-course-card { flex: 0 0 78vw; }
}

/* Breadcrumb */
.jasper-crumb {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.jasper-crumb a { color: #579034; text-decoration: none; }
.jasper-crumb a:hover { text-decoration: underline; }
.jasper-crumb-sep { color: #aaa; }
.jasper-crumb-current { color: #444; font-weight: 600; }

/* Course single */
.jasper-course-single { padding: 3rem 1rem; }
.jasper-course-single-inner { max-width: 1100px; margin: 0 auto; }
.jasper-course-single-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}
.jasper-course-single-media {
    flex: 0 0 340px;
    max-width: 340px;
}
.jasper-course-single-media img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.jasper-course-single-info { flex: 1 1 auto; min-width: 0; }
.jasper-course-single-title {
    font-family: var(--headerFont);
    color: var(--navy);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin: 0 0 0.75rem;
    line-height: 1.25;
}
.jasper-course-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.jasper-course-code,
.jasper-course-credit,
.jasper-course-cat {
    display: inline-block;
    background: #579034;
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.85rem;
}
.jasper-course-credit { background: #8ec63f; }
.jasper-course-cat { background: #3a6b22; text-decoration: none; }
.jasper-course-cat:hover { background: #579034; }
.jasper-course-single-content { color: #333; font-size: 1.02rem; line-height: 1.7; }
.jasper-course-single-content p { margin: 0 0 1rem; }
.jasper-course-single-back {
    display: inline-block;
    margin-top: 1.5rem;
    color: #579034;
    font-weight: 600;
    text-decoration: none;
}
.jasper-course-single-back:hover { text-decoration: underline; }

/* Related courses */
.jasper-course-related {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}
.jasper-course-related-title {
    font-family: var(--headerFont);
    color: var(--navy);
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    margin: 0 0 1.25rem;
}

@media (max-width: 860px) {
    .jasper-course-single-layout { flex-direction: column; }
    .jasper-course-single-media { flex: 1 1 auto; max-width: 420px; }
}

/* Course archive (category) */
.jasper-course-archive { padding: 3rem 1rem; }
.jasper-course-archive-inner { max-width: 1200px; margin: 0 auto; }
.jasper-course-archive-title {
    font-family: var(--headerFont);
    color: var(--navy);
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    margin: 0 0 0.5rem;
}
.jasper-course-archive-desc { color: #666; margin: 0 0 1.5rem; }
.jasper-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}
.jasper-course-grid-card a { display: block; text-decoration: none; }
.jasper-course-grid-thumb {
    display: block;
    aspect-ratio: 387 / 480;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}
.jasper-course-grid-name {
    display: block;
    margin-top: 0.6rem;
    color: #2c2c2c;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
}
@media (max-width: 560px) {
    .jasper-course-grid { grid-template-columns: 1fr; }
}

/* Course archive layout + sidebar (right-hand category list with counts) */
.jasper-course-archive-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.jasper-course-archive-main { flex: 1 1 auto; min-width: 0; }
.jasper-course-sidebar {
    flex: 0 0 280px;
    max-width: 280px;
}
.jasper-sidebar-box {
    background: #f4f7f0;
    border: 1px solid #e3ead8;
    border-radius: 10px;
    padding: 1.25rem 1rem;
}
.jasper-sidebar-title {
    font-family: var(--headerFont);
    color: var(--navy);
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem;
    border-bottom: 2px solid #8ec63f;
    padding-bottom: 0.5rem;
}
.jasper-sidebar-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    border-bottom: 2px solid #8ec63f;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.4rem 0.6rem;
    font-family: var(--headerFont);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.05em;
    cursor: pointer;
    text-align: left;
}
.jasper-sidebar-toggle .jasper-sidebar-count { color: #8a9a77; font-weight: 600; }
.jasper-sidebar-chevron { transition: transform .2s ease; flex: 0 0 auto; }
.jasper-sidebar-toggle[aria-expanded="true"] .jasper-sidebar-chevron {
    transform: rotate(180deg);
}
.jasper-sidebar-list { list-style: none; margin: 0; padding: 0; }
.jasper-sidebar-list li { margin: 0; }
.jasper-sidebar-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0.4rem;
    color: #2c2c2c;
    text-decoration: none;
    border-bottom: 1px solid #edf1e6;
    font-size: 0.92rem;
}
.jasper-sidebar-list a:hover { color: #579034; }
.jasper-sidebar-list a.active { color: #579034; font-weight: 700; }
.jasper-sidebar-count { color: #8a9a77; font-weight: 600; white-space: nowrap; }

@media (max-width: 900px) {
    .jasper-course-archive-layout { flex-direction: column; }
    .jasper-course-sidebar { flex: 1 1 auto; max-width: none; }
}

/* Generic page */
.jasper-page { padding: 3rem 1rem; }
.jasper-page-inner { max-width: 1000px; margin: 0 auto; }
.jasper-page-title {
    font-family: var(--headerFont);
    color: var(--navy);
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    margin: 0 0 1.5rem;
}
.jasper-page-content { color: #333; font-size: 1rem; line-height: 1.8; }
.jasper-page-content img { max-width: 100%; height: auto; }
.jasper-page-content h3 {
    color: var(--navy);
    margin-top: 1.5rem;
    font-size: 1.25rem;
}
.jasper-page-content h4 {
    color: #2c2c2c;
    margin-top: 1rem;
    font-size: 1.05rem;
}

