/* Opt-in homepage theme layer. "original" never adds this body class. */
.homepage-theme-decoration {
    display: none;
}

body.homepage-themed {
    overflow-x: clip;
    --color-primary: var(--hp-primary);
    --color-secondary: var(--hp-secondary);
    --color-heading: var(--hp-text);
    --color-body: var(--hp-text);
    --course-primary: var(--hp-primary);
    --course-primary-light: color-mix(in srgb, var(--hp-primary) 10%, var(--hp-surface));
    --course-text: var(--hp-text);
    --course-text-secondary: color-mix(in srgb, var(--hp-text) 75%, var(--hp-surface));
    --course-border: color-mix(in srgb, var(--hp-primary) 16%, var(--hp-surface));
    --course-radius: var(--hp-radius);
    --hp-border: color-mix(in srgb, var(--hp-primary) 18%, var(--hp-surface));
    --hp-muted: color-mix(in srgb, var(--hp-text) 76%, var(--hp-surface));
    --hp-hero-overlay: linear-gradient(90deg, color-mix(in srgb, var(--hp-hero-background) 80%, transparent), color-mix(in srgb, var(--hp-hero-background) 28%, transparent));
    background: var(--hp-background);
    color: var(--hp-text);
}

body.homepage-themed .rbt-header .rbt-header-wrapper,
body.homepage-themed .rbt-header .submenu,
body.homepage-themed .rbt-header .rbt-search-dropdown,
body.homepage-themed .rbt-header .rbt-user-menu-list-wrapper,
body.homepage-themed .popup-mobile-menu .inner-wrapper {
    background: var(--hp-surface);
    color: var(--hp-text);
}

body.homepage-themed .rbt-header .rbt-header-wrapper {
    border-bottom: 1px solid var(--hp-border);
    box-shadow: 0 4px 24px color-mix(in srgb, var(--hp-primary) 7%, transparent);
}

body.homepage-themed .rbt-header .mainmenu a,
body.homepage-themed .rbt-header .quick-access a,
body.homepage-themed .rbt-header .rbt-round-btn,
body.homepage-themed .popup-mobile-menu .mainmenu a {
    color: var(--hp-text);
}

body.homepage-themed .rbt-header .mainmenu a:hover,
body.homepage-themed .rbt-header .quick-access a:hover,
body.homepage-themed .popup-mobile-menu .mainmenu a:hover {
    color: var(--hp-primary);
}

body.homepage-themed .rbt-banner-1 {
    isolation: isolate;
    overflow: clip;
    background-color: var(--hp-hero-background);
    background-image:
        radial-gradient(ellipse at 80% 12%, color-mix(in srgb, var(--hp-secondary) 16%, transparent), transparent 48%),
        linear-gradient(135deg, var(--hp-hero-background) 40%, color-mix(in srgb, var(--hp-primary) 10%, var(--hp-hero-background)));
}

body.homepage-themed .rbt-banner-1 > .container-fluid {
    position: relative;
    z-index: 1;
}

body.homepage-themed [data-homepage-section] { scroll-margin-top: 96px; }

/* A signed margin moves the entire section and its surface in document flow.
   Contain the first child's margin so it cannot move the continuous canvas too. */
body.homepage-themed .homepage-content-flow { display: flow-root; }
body.homepage-themed [data-homepage-section-surface] { position: relative; }
body.homepage-themed [data-homepage-section-surface="hero"] {
    margin-top: var(--hp-space-hero-desktop-gap, 0px);
}
body.homepage-themed [data-homepage-section-surface="categories"] {
    margin-top: var(--hp-space-categories-desktop-gap, 0px);
}
body.homepage-themed [data-homepage-section-surface="latest-courses"] {
    margin-top: var(--hp-space-latest-courses-desktop-gap, 0px);
}
body.homepage-themed [data-homepage-section-surface="hotspot-categories"] {
    margin-top: var(--hp-space-hotspot-categories-desktop-gap, 0px);
}
body.homepage-themed [data-homepage-section-surface="learning-journey"] {
    margin-top: var(--hp-space-learning-journey-desktop-gap, 0px);
}
body.homepage-themed [data-homepage-section-surface="news"] {
    margin-top: var(--hp-space-news-desktop-gap, 0px);
}

/* Explicit section colors override the shared continuous canvas. Keep cards and
   the About Us backplate on their own surfaces, and keep text fully opaque. */
body.homepage-themed[data-homepage-section-colors~="hero"] [data-homepage-section-surface="hero"] {
    --hp-hero-background: var(--hp-section-hero-background);
    background-color: var(--hp-section-hero-background) !important;
}
body.homepage-themed[data-homepage-section-colors~="categories"] [data-homepage-section-surface="categories"] {
    background: var(--hp-section-categories-background) !important;
}
body.homepage-themed[data-homepage-section-colors~="latest-courses"] [data-homepage-section-surface="latest-courses"] {
    background: var(--hp-section-latest-courses-background) !important;
}
body.homepage-themed[data-homepage-section-colors~="hotspot-categories"] [data-homepage-section-surface="hotspot-categories"] {
    background: var(--hp-section-hotspot-categories-background) !important;
}
body.homepage-themed[data-homepage-section-colors~="learning-journey"] [data-homepage-section-surface="learning-journey"] {
    background: var(--hp-section-learning-journey-background) !important;
}
body.homepage-themed[data-homepage-section-colors~="learning-journey"] .homepage-journey-layout {
    background: transparent !important;
}
body.homepage-themed[data-homepage-section-colors~="news"] [data-homepage-section-surface="news"] {
    --news-on-primary: var(--hp-section-news-foreground);
    background: var(--hp-section-news-background) !important;
    color: var(--hp-section-news-foreground) !important;
}
body.homepage-themed[data-homepage-section-colors~="categories"] .homepage-course-categories-heading .title,
body.homepage-themed[data-homepage-section-colors~="categories"] .homepage-course-category-card,
body.homepage-themed[data-homepage-section-colors~="categories"] .homepage-course-category-hint,
body.homepage-themed[data-homepage-section-colors~="categories"] .homepage-course-category-status {
    color: var(--hp-section-categories-foreground);
}
body.homepage-themed[data-homepage-section-colors~="latest-courses"] .homepage-latest-courses-heading .title {
    color: var(--hp-section-latest-courses-foreground);
}
body.homepage-themed[data-homepage-section-colors~="hotspot-categories"] .homepage-hotspot-categories-heading .title,
body.homepage-themed[data-homepage-section-colors~="hotspot-categories"] .homepage-hotspot-category-status,
body.homepage-themed[data-homepage-section-colors~="hotspot-categories"] .homepage-hotspot-browse-link {
    color: var(--hp-section-hotspot-categories-foreground);
}
body.homepage-themed[data-homepage-section-colors~="hotspot-categories"] .homepage-hotspot-categories a:focus-visible,
body.homepage-themed[data-homepage-section-colors~="hotspot-categories"] .homepage-hotspot-categories button:focus-visible {
    outline-color: var(--hp-section-hotspot-categories-foreground);
}
body.homepage-themed[data-homepage-section-colors~="learning-journey"] .homepage-journey-caption {
    color: var(--hp-section-learning-journey-foreground);
}
body.homepage-themed[data-homepage-section-colors~="learning-journey"] .homepage-journey-track::before {
    border-color: color-mix(in srgb, var(--hp-section-learning-journey-foreground) 55%, transparent);
}

/* Override only the banner's legacy spacing utilities, leaving its content layout intact. */
body.homepage-themed .homepage-hero-spacing {
    padding-top: var(--hp-space-hero-desktop-top, 70px) !important;
    padding-bottom: var(--hp-space-hero-desktop-bottom, 120px) !important;
}

@media (max-width: 767px) {
    body.homepage-themed [data-homepage-section-surface="hero"] {
        margin-top: var(--hp-space-hero-mobile-gap, 0px);
    }
    body.homepage-themed [data-homepage-section-surface="categories"] {
        margin-top: var(--hp-space-categories-mobile-gap, 0px);
    }
    body.homepage-themed [data-homepage-section-surface="latest-courses"] {
        margin-top: var(--hp-space-latest-courses-mobile-gap, 0px);
    }
    body.homepage-themed [data-homepage-section-surface="hotspot-categories"] {
        margin-top: var(--hp-space-hotspot-categories-mobile-gap, 0px);
    }
    body.homepage-themed [data-homepage-section-surface="learning-journey"] {
        margin-top: var(--hp-space-learning-journey-mobile-gap, 0px);
    }
    body.homepage-themed [data-homepage-section-surface="news"] {
        margin-top: var(--hp-space-news-mobile-gap, 0px);
    }
    body.homepage-themed .homepage-hero-spacing {
        padding-top: var(--hp-space-hero-mobile-top, 70px) !important;
        padding-bottom: var(--hp-space-hero-mobile-bottom, 120px) !important;
    }
}

body.homepage-themed.homepage-hero-image .rbt-banner-1 {
    /* The tint is a background layer: hero text and course cards remain opaque. */
    background-image: var(--hp-hero-overlay), var(--hp-hero-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body.homepage-themed .rbt-banner-1::after {
    width: 110%;
    left: -5%;
    height: 46px;
    background: var(--hp-background);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    pointer-events: none;
}

body.homepage-themed .rbt-banner-1 .content .inner .title {
    color: var(--hp-hero-text) !important;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

body.homepage-themed .rbt-banner-1 .content .inner .description {
    color: var(--hp-hero-text);
    opacity: 1;
}

body.homepage-themed .rbt-banner-1 .content .inner .description strong {
    color: inherit;
}

body.homepage-themed .rbt-banner-1 .content .shape-wrapper {
    opacity: 0.82;
}

body.homepage-themed .rbt-btn.btn-gradient,
body.homepage-themed .homepage-about-section .about-cta {
    background: var(--hp-primary);
    color: var(--hp-on-primary);
    border-color: var(--hp-primary);
    border-radius: var(--hp-radius);
    box-shadow: 0 5px 18px color-mix(in srgb, var(--hp-primary) 22%, transparent);
}

body.homepage-themed .rbt-btn.btn-gradient:hover,
body.homepage-themed .homepage-about-section .about-cta:hover {
    background: var(--hp-primary);
    color: var(--hp-on-primary);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--hp-primary) 32%, transparent);
}

body.homepage-themed .homepage-course-categories {
    background: var(--hp-background);
}

body.homepage-themed .homepage-latest-courses {
    background: color-mix(in srgb, var(--hp-primary) 10%, var(--hp-background));
}

body.homepage-themed .homepage-latest-courses-heading .title {
    color: var(--hp-text);
}

body.homepage-themed .homepage-latest-courses-panel {
    background: var(--hp-surface);
    border-radius: var(--hp-radius);
}

body.homepage-themed .homepage-latest-course-grid .course-card-enhanced {
    background: var(--hp-surface) !important;
}

body.homepage-themed .homepage-latest-course-grid .course-card-enhanced:hover {
    border-color: var(--hp-primary) !important;
}

body.homepage-themed .homepage-latest-course-grid .course-view-btn,
body.homepage-themed .homepage-latest-course-grid .course-card-enhanced:hover .rbt-card-title a {
    color: var(--hp-text) !important;
}

body.homepage-themed .homepage-latest-course-grid .meta-chip:not(.registration-closed) {
    color: var(--hp-text);
}

body.homepage-themed .homepage-latest-course-status {
    color: var(--hp-muted);
}

body.homepage-themed .hp-news-card {
    background: var(--hp-surface);
    color: var(--hp-text);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius);
    box-shadow: 0 5px 20px color-mix(in srgb, var(--hp-primary) 6%, transparent);
}

body.homepage-themed .homepage-course-category-card {
    color: var(--hp-text);
    background: transparent;
    border: 0;
    box-shadow: none;
}

body.homepage-themed .homepage-course-category-card:hover {
    color: var(--hp-primary);
}

body.homepage-themed .homepage-course-category-image-frame {
    border-radius: min(var(--hp-radius), 12px);
    background: transparent;
}

body.homepage-themed .homepage-course-category-fallback {
    color: var(--hp-primary);
    background: color-mix(in srgb, var(--hp-primary) 8%, var(--hp-surface));
}

body.homepage-themed .homepage-course-categories .title,
body.homepage-themed .homepage-about-section .about-title-area h2,
body.homepage-themed .homepage-about-section .feature-item .fi-text,
body.homepage-themed .hp-news-title {
    color: var(--hp-text);
}

body.homepage-themed .homepage-course-category-status,
body.homepage-themed .homepage-course-category-hint,
body.homepage-themed .homepage-about-section .about-excerpt,
body.homepage-themed .hp-news-meta {
    color: var(--hp-muted);
}

body.homepage-themed .rbt-banner-1 .course-card-enhanced {
    background: var(--hp-surface) !important;
}

body.homepage-themed .rbt-banner-1 .course-card-enhanced:hover {
    border-color: var(--hp-primary) !important;
}

body.homepage-themed .rbt-banner-1 .course-view-btn:hover {
    color: var(--hp-text) !important;
}

body.homepage-themed .rbt-banner-1 .swiper-pagination-bullet {
    background: var(--hp-hero-text);
}

body.homepage-themed .rbt-banner-1 .swiper-pagination-bullet-active {
    background: var(--hp-primary);
}

body.homepage-themed .homepage-about-section {
    background: var(--hp-surface) !important;
    border-top: 1px solid var(--hp-border);
    border-bottom: 1px solid var(--hp-border);
}

body.homepage-themed .homepage-about-section .gradient-line {
    width: 72px;
    background: linear-gradient(90deg, var(--hp-primary), var(--hp-secondary));
}

body.homepage-themed .homepage-about-section .about-title-area h2 .dot {
    background: none;
    color: var(--hp-primary);
    -webkit-text-fill-color: var(--hp-primary);
}

body.homepage-themed .homepage-about-section .feature-item {
    border-color: var(--hp-border);
    border-radius: var(--hp-radius);
    background: var(--hp-background);
}

body.homepage-themed .homepage-about-section .feature-item:hover {
    border-color: var(--hp-primary);
    box-shadow: 0 5px 16px color-mix(in srgb, var(--hp-primary) 10%, transparent);
}

body.homepage-themed .homepage-course-category-card:focus-visible,
body.homepage-themed .homepage-course-category-grid:focus-visible {
    outline: 3px solid var(--hp-primary);
    outline-offset: 3px;
}

body.homepage-themed .homepage-about-section a:focus-visible {
    outline: 3px solid var(--hp-primary);
    outline-offset: 4px;
}

body.homepage-themed .rbt-rbt-blog-area.is-background-231 {
    background: var(--hp-hero-background) !important;
    color: var(--hp-hero-text);
}

body.homepage-themed .rbt-rbt-blog-area .news-toggle-tabs {
    background: color-mix(in srgb, var(--hp-hero-text) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--hp-hero-text) 16%, transparent);
}

body.homepage-themed .rbt-rbt-blog-area .news-toggle-btn,
body.homepage-themed .rbt-rbt-blog-area .is-color-99 {
    color: var(--hp-hero-text);
    border-color: color-mix(in srgb, var(--hp-hero-text) 40%, transparent);
}

/* Override the template's important white-text utility on both news links. */
body.homepage-themed .rbt-rbt-blog-area .rbt-btn.btn-border {
    color: var(--hp-hero-text) !important;
    background: transparent;
    border-color: var(--hp-hero-text);
}

body.homepage-themed .rbt-rbt-blog-area .rbt-btn.btn-border:hover,
body.homepage-themed .rbt-rbt-blog-area .rbt-btn.btn-border:focus-visible {
    color: var(--hp-on-primary) !important;
    background: var(--hp-primary);
    border-color: var(--hp-primary);
}

body.homepage-themed .rbt-rbt-blog-area .rbt-btn.btn-border:focus-visible {
    outline: 3px solid var(--hp-hero-text);
    outline-offset: 4px;
}

/* Keep the configured category tint, but use the card's readable text colour. */
body.homepage-themed .rbt-rbt-blog-area .hp-news-cat {
    color: var(--hp-text) !important;
    font-weight: 700;
}

body.homepage-themed .rbt-rbt-blog-area .news-toggle-btn.active {
    background: var(--hp-primary);
    color: var(--hp-on-primary);
    box-shadow: none;
}

body.homepage-themed .rbt-footer {
    background: var(--hp-surface) !important;
    color: var(--hp-text);
    border-top: 1px solid var(--hp-border);
}

body.homepage-themed .rbt-footer .ft-title,
body.homepage-themed .rbt-footer h6,
body.homepage-themed .rbt-footer .ft-link a,
body.homepage-themed .rbt-footer .description,
body.homepage-themed .rbt-footer .copyright-area p {
    color: var(--hp-text);
}

body.homepage-themed .rbt-footer .ft-link a:hover {
    color: var(--hp-primary);
}

/* CSS ornaments are decorative, do not intercept input, and never replace content. */
body.homepage-themed .homepage-theme-decoration {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

body.homepage-themed[data-homepage-decoration="none"] .homepage-theme-decoration {
    display: none;
}

body.homepage-themed .homepage-theme-decoration span {
    position: absolute;
    display: block;
}

body.homepage-themed[data-homepage-decoration="moon"] .homepage-theme-decoration span:first-child {
    width: clamp(120px, 19vw, 330px);
    aspect-ratio: 1;
    top: -7%;
    right: 9%;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--hp-secondary) 28%, white), var(--hp-secondary));
    box-shadow: 0 0 70px 28px color-mix(in srgb, var(--hp-secondary) 12%, transparent);
    opacity: 0.27;
}

body.homepage-themed[data-homepage-decoration="moon"] .homepage-theme-decoration span:nth-child(2),
body.homepage-themed[data-homepage-decoration="moon"] .homepage-theme-decoration span:nth-child(3) {
    width: 330px;
    height: 95px;
    top: 20%;
    right: 1%;
    border: 1px solid color-mix(in srgb, var(--hp-secondary) 35%, transparent);
    border-radius: 50%;
    transform: rotate(-18deg);
}

body.homepage-themed[data-homepage-decoration="moon"] .homepage-theme-decoration span:nth-child(3) {
    top: 25%;
    right: -2%;
    width: 390px;
}

body.homepage-themed[data-homepage-decoration="leaves"] .homepage-theme-decoration span {
    width: clamp(100px, 16vw, 260px);
    aspect-ratio: 0.55;
    top: -18%;
    right: 8%;
    border-radius: 90% 0 90% 0;
    background: color-mix(in srgb, var(--hp-primary) 13%, transparent);
    transform: rotate(32deg);
}

body.homepage-themed[data-homepage-decoration="leaves"] .homepage-theme-decoration span:nth-child(2) {
    top: 1%;
    right: -3%;
    transform: rotate(68deg);
    background: color-mix(in srgb, var(--hp-secondary) 15%, transparent);
}

body.homepage-themed[data-homepage-decoration="leaves"] .homepage-theme-decoration span:nth-child(3) {
    top: auto;
    bottom: -25%;
    left: -2%;
    transform: rotate(-42deg);
}

/* Warm sunrise and soft coastal hills, drawn without extra image requests. */
body.homepage-themed[data-homepage-decoration="sunshine"] .homepage-theme-decoration span:first-child {
    width: clamp(170px, 24vw, 390px);
    aspect-ratio: 1;
    top: -9%;
    right: 8%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, color-mix(in srgb, var(--hp-secondary) 44%, var(--hp-hero-background)), color-mix(in srgb, var(--hp-secondary) 20%, var(--hp-hero-background)));
    box-shadow: 0 0 0 25px color-mix(in srgb, var(--hp-secondary) 5%, transparent), 0 0 0 60px color-mix(in srgb, var(--hp-secondary) 3%, transparent);
}

body.homepage-themed[data-homepage-decoration="sunshine"] .homepage-theme-decoration span:nth-child(2),
body.homepage-themed[data-homepage-decoration="sunshine"] .homepage-theme-decoration span:nth-child(3) {
    width: 80%;
    height: 31%;
    bottom: -18%;
    left: -17%;
    border-radius: 50% 65% 0 0 / 90% 100% 0 0;
    transform: rotate(8deg);
    background: color-mix(in srgb, var(--hp-primary) 12%, var(--hp-hero-background));
}

body.homepage-themed[data-homepage-decoration="sunshine"] .homepage-theme-decoration span:nth-child(3) {
    left: auto;
    right: -23%;
    bottom: -14%;
    transform: rotate(-9deg);
    background: color-mix(in srgb, var(--hp-primary) 19%, var(--hp-hero-background));
}

body.homepage-themed[data-homepage-decoration="lantern"] .homepage-theme-decoration span {
    width: clamp(70px, 8vw, 140px);
    aspect-ratio: 0.83;
    top: 6%;
    right: 9%;
    border: 2px solid color-mix(in srgb, var(--hp-secondary) 50%, transparent);
    border-radius: 42%;
    background: repeating-linear-gradient(90deg, transparent 0 19%, color-mix(in srgb, var(--hp-secondary) 18%, transparent) 20% 21%), color-mix(in srgb, var(--hp-primary) 15%, transparent);
    opacity: 0.55;
}

body.homepage-themed[data-homepage-decoration="lantern"] .homepage-theme-decoration span::before {
    content: "";
    position: absolute;
    width: 1px;
    height: 140px;
    left: 50%;
    bottom: 100%;
    background: var(--hp-secondary);
}

body.homepage-themed[data-homepage-decoration="lantern"] .homepage-theme-decoration span::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 28px;
    left: calc(50% - 3px);
    top: 100%;
    border-top: 7px solid var(--hp-secondary);
    border-left: 2px solid var(--hp-secondary);
    border-right: 2px solid var(--hp-secondary);
}

body.homepage-themed[data-homepage-decoration="lantern"] .homepage-theme-decoration span:nth-child(2) {
    width: clamp(55px, 6vw, 100px);
    top: 2%;
    right: 22%;
}

body.homepage-themed[data-homepage-decoration="lantern"] .homepage-theme-decoration span:nth-child(3) {
    display: none;
}

@media (max-width: 767px) {
    body.homepage-themed .rbt-banner-1::after { height: 24px; }
    body.homepage-themed .homepage-theme-decoration { opacity: 0.6; }
    body.homepage-themed .rbt-banner-1 .content .inner .title { font-size: clamp(24px, 7vw, 30px); line-height: 1.5; }
}

/* Keep the complete menu compact on small desktop screens, preserving the shared font size. */
@media (min-width: 1200px) and (max-width: 1599px) {
    body.homepage-themed .rbt-header .logo img { max-width: 170px; }
    body.homepage-themed .rbt-header .mainmenu > li > a { white-space: nowrap; padding-inline: 8px; }
    body.homepage-themed .rbt-header .user-info-wrapper > a { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
