/* Courses Hub (page-courses-hub.php) */

.courses-hub {
    --ch-dark: #160E2B;
    --ch-text: #17122A;
    --ch-muted: #5B5470;
    --ch-purple: #5B1F99;
    --ch-purple-hover: #4A1880;
    --ch-link: #7A2FC8;
    --ch-light-purple: #D7A6F5;
    --ch-lavender: #F7F5FB;
    --ch-border: #E4DEEE;
    --ch-header-h: 0px; /* set by courses-hub.js from the sticky site header */
    --ch-tabs-h: 0px;
    color: var(--ch-text);
}

main.site-main.courses-hub {
    max-width: none !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.courses-hub .max-w-content,
.courses-hub .courses-hub-wide {
    padding-left: 20px;
    padding-right: 20px;
}
@media (min-width: 768px) {
    .courses-hub .max-w-content,
    .courses-hub .courses-hub-wide { padding-left: 32px; padding-right: 32px; }
}
/* Suite filter + cards use more of large screens than the hero */
.courses-hub .courses-hub-wide { max-width: 85rem; }

.courses-hub .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.courses-hub-editor-notice {
    padding: 10px 20px;
    background: #FFF4E5;
    border-bottom: 1px solid #F5C47A;
    font-size: 14px;
    color: #6B4100;
}

/* ── 1. Hero ── */
.courses-hub-hero {
    background: var(--ch-dark);
    color: #ffffff;
    padding-top: 36px;
    padding-bottom: 28px;
}
.courses-hub-hero__row {
    position: relative;
}
.courses-hub-hero__copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 64rem;
    margin: 0 auto;
    text-align: center;
}
@media (min-width: 1024px) {
    .courses-hub-hero { padding-top: 44px; }
}

.courses-hub-hero__eyebrow,
.courses-hub-hero__title { text-align: center; }
/* Eyebrow and headline: same type as the Product Page Hero block */
.courses-hub-hero__eyebrow {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 500;
    line-height: 160%;
    letter-spacing: 2.72px;
    text-transform: uppercase;
}
.courses-hub-hero__title {
    margin: 0 0 24px;
    font-size: clamp(2.25rem, 5vw, 70px);
    font-weight: 500;
    line-height: 120%;
    letter-spacing: -0.06em;
    color: #ffffff;
}
@media (min-width: 768px) {
    .courses-hub-hero__title { margin-bottom: 32px; letter-spacing: -3.5px; }
}
@media (min-width: 1024px) {
    .courses-hub-hero__title { margin-bottom: 48px; }
}

/* "Try a random course" (behaviour in courses-hub.js): topic names spin under
   the button on hover/focus; a click lifts the current one into the button. */
.courses-hub-random {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.courses-hub-random__stage {
    position: relative;
    display: inline-flex;
    max-width: 100%;
}
.courses-hub-random__btn {
    --ch-random-grad: linear-gradient(90deg, #ff7ae3 13.48%, #d970ff 45.77%, #ab80ff 76.85%);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    max-width: min(92vw, 640px);
    padding: 0 28px !important;
    border: 0 !important;
    border-radius: 9999px !important;
    background: var(--ch-random-grad) !important;
    font-family: inherit;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(60, 10, 90, 0.35); /* keeps white text legible on the light pink end */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.courses-hub-random__btn:hover,
.courses-hub-random__btn:focus-visible {
    outline: none;
    transform: scale(1.03);
    box-shadow: 0 0 0 4px rgba(217, 112, 255, 0.25), 0 10px 30px rgba(171, 128, 255, 0.55);
}
.courses-hub-random__icon {
    position: relative;
    z-index: 2;
    display: inline-flex;
}
.courses-hub-random__btn:hover .courses-hub-random__icon,
.courses-hub-random__btn:focus-visible .courses-hub-random__icon {
    animation: courses-hub-wiggle 0.5s ease;
}
.courses-hub-random__label {
    position: relative;
    z-index: 2;
    min-width: 0;
    padding: 6px 0;
    line-height: 1.3;
    white-space: nowrap;
}
/* Very long names wrap rather than being cut off */
.courses-hub-random__btn.is-long .courses-hub-random__label { white-space: normal; }
/* Light travelling round the border while shuffling: a rotating conic highlight
   behind an inset copy of the button background, so only a 2px ring shows. */
.courses-hub-random__btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: 220%;
    aspect-ratio: 1;
    background: conic-gradient(from 0deg, transparent 0 76%, rgba(255, 255, 255, 0.95) 88%, transparent 97%);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
}
.courses-hub-random__btn::after {
    content: '';
    position: absolute;
    inset: 2px;
    z-index: 1;
    border-radius: 9999px;
    background: var(--ch-random-grad);
    opacity: 0;
    pointer-events: none;
}
.courses-hub-random.is-busy .courses-hub-random__btn { transform: none; }
.courses-hub-random.is-shuffling .courses-hub-random__btn::before {
    opacity: 1;
    animation: courses-hub-orbit 0.9s linear infinite;
}
.courses-hub-random.is-shuffling .courses-hub-random__btn::after { opacity: 1; }
.courses-hub-random.is-shuffling .courses-hub-random__icon svg { animation: courses-hub-twinkle 0.7s ease-in-out infinite; }
.courses-hub-random.is-pop .courses-hub-random__btn { animation: courses-hub-pop 0.35s ease; }

/* Particle burst from the top of the button */
.courses-hub-random__burst {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 3;
    width: 0;
    height: 0;
    pointer-events: none;
}
.courses-hub-random__particle {
    position: absolute;
    top: 0;
    left: 0;
    line-height: 1;
    pointer-events: none;
}

.courses-hub-random__name {
    min-height: 1.6em; /* reserved, so nothing shifts when names appear */
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ch-light-purple);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.courses-hub-random.is-shuffling .courses-hub-random__name { opacity: 1; }

@keyframes courses-hub-orbit { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes courses-hub-twinkle {
    0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
    50% { transform: scale(0.8) rotate(20deg); opacity: 0.75; }
}
@keyframes courses-hub-spin { to { transform: rotate(360deg); } }
@keyframes courses-hub-pop { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes courses-hub-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-14deg); }
    75% { transform: rotate(14deg); }
}
@media (prefers-reduced-motion: reduce) {
    .courses-hub-random__btn { transition: none; }
    .courses-hub-random__btn:hover,
    .courses-hub-random__btn:focus-visible { transform: none; }
    .courses-hub-random__btn:hover .courses-hub-random__icon,
    .courses-hub-random__btn:focus-visible .courses-hub-random__icon,
    .courses-hub-random.is-shuffling .courses-hub-random__btn::before,
    .courses-hub-random.is-shuffling .courses-hub-random__icon svg,
    .courses-hub-random.is-pop .courses-hub-random__btn { animation: none; }
    .courses-hub-random__btn,
    .courses-hub-random__name { transition: none; }
}
/* Static logo bar (from logo_carousel) */
.courses-hub-hero__logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 28px;
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.courses-hub-hero__logos-label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ch-light-purple);
}
.courses-hub-hero__logos-list {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.courses-hub-hero__logos-list img {
    display: block;
    width: auto;
    max-width: 130px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* one muted white on the dark hero */
    opacity: 0.75;
}

/* ── 2. Topic search (centred under the hero) ── */
.courses-hub-finder {
    position: relative;
    padding-top: 32px;
    padding-bottom: 4px;
}
.courses-hub-finder__row {
    position: relative; /* the open bar is positioned across this row */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
}
.courses-hub-search {
    position: relative;
    z-index: 2;
    display: grid;
    flex: 0 1 auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    justify-content: start;
    margin: 0;
}
/* The bar runs from the left edge up to the catalogue button. */
@media (min-width: 768px) {
    .courses-hub-search {
        flex: 1 1 auto;
        grid-template-columns: minmax(0, 1fr);
    }
}
/* Catalogue download link (opens the catalogue popup) */
.courses-hub-catalog-cta,
.courses-hub-catalog-cta:hover {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ch-purple) !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: color 0.2s ease;
}
/* Hover: a lighter purple plus an underline */
.courses-hub-catalog-cta:hover,
.courses-hub-catalog-cta:focus-visible {
    color: #A35DEB !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}
/* Phones: the search takes the whole row; the catalogue link sits just below it, slightly indented. */
@media (max-width: 767px) {
    .courses-hub-search { flex: 1 1 100%; }
    .courses-hub-finder__row { row-gap: 4px; }
    .courses-hub-catalog-cta,
    .courses-hub-catalog-cta:hover { min-height: 40px; padding-left: 1rem; }
}
/* While the panel is open the bar sits above it, so it can cover the panel's top edge. */
.courses-hub-finder.is-open .courses-hub-search { z-index: 61; }
.courses-hub-search__label {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--ch-text);
}
.courses-hub-search__field {
    --ch-scope-w: 132px; /* width of the "All topics" section */
    position: relative;
}
.courses-hub-search__bar {
    position: relative;
}
/* Opening: the bar lifts out of the layout at its current spot (the field keeps
   its space, so nothing shifts), then grows across the whole row, over the
   label and the catalogue button. Closing reverses it. JS sets the start
   position (--ch-bar-x/y/w) and toggles .is-float then .is-open. */
.courses-hub-finder.is-float .courses-hub-search,
.courses-hub-finder.is-float .courses-hub-search__field { position: static; } /* so the bar positions against the row */
.courses-hub-finder.is-float .courses-hub-search__bar {
    position: absolute;
    top: var(--ch-bar-y, 0);
    left: var(--ch-bar-x, 0);
    z-index: 62;
    width: var(--ch-bar-w, 100%);
    transition: left 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.courses-hub-finder.is-float.is-open .courses-hub-search__bar {
    left: 0;
    width: 100%;
}
@media (prefers-reduced-motion: reduce) {
    .courses-hub-finder.is-float .courses-hub-search__bar { transition: none; }
}
/* Magnifying glass inside the input */
.courses-hub-search__scope {
    position: absolute;
    top: 1.5px;
    bottom: 1.5px;
    left: 1.5px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    width: var(--ch-scope-w);
    box-sizing: border-box;
    margin: 0;
    padding: 0 14px 0 22px !important;
    border: 0 !important;
    border-right: 1.5px solid #E4DEEE !important;
    border-radius: 28px 0 0 28px !important;
    background: transparent !important;
    font-family: inherit;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap;
    color: var(--ch-text) !important;
    cursor: pointer;
}
.courses-hub-search__scope:hover { background: #F8F4FE !important; }
.courses-hub-search__scope:focus-visible { outline: 2px solid var(--ch-link); outline-offset: -4px; }
.courses-hub-finder.is-open .courses-hub-search__scope { border-bottom-left-radius: 0 !important; }
.courses-hub-search__scope svg {
    color: var(--ch-muted);
    transition: transform 0.2s ease;
}
.courses-hub-finder.is-open .courses-hub-search__scope svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
    .courses-hub-search__scope svg { transition: none; }
}
.courses-hub-search__input {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 52px 15px calc(var(--ch-scope-w) + 16px) !important;
    border: 1.5px solid #CFC4E3 !important;
    border-radius: 28px !important; /* a real value (not 9999px) so the corners can animate */
    transition: border-radius 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    background: #ffffff !important;
    font-family: inherit;
    font-size: 16px !important;
    color: var(--ch-text) !important;
    box-shadow: none !important;
    outline: none;
}
.courses-hub-search__input::placeholder { color: #6E6782; }
.courses-hub-search__input:focus {
    border-color: var(--ch-link) !important;
}
.courses-hub-search__clear {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: var(--ch-purple) !important;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.courses-hub-search__clear:hover { background: #F1EAFA !important; }
/* Search icon at the right end; the clear (x) takes its place once there's text */
.courses-hub-search__icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    color: var(--ch-muted);
    pointer-events: none;
}
.courses-hub-search__clear:not([hidden]) ~ .courses-hub-search__icon { display: none; }

/* Open: bar and panel read as one element. The bar's bottom corners square off,
   its bottom border goes, and a white strip hides the panel's top edge under it. */
.courses-hub-finder.is-open .courses-hub-search__input {
    border-color: #CFC4E3 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-color: transparent !important;
    box-shadow: none;
}
.courses-hub-search__bar::after {
    content: '';
    position: absolute;
    left: 1.5px;
    right: 1.5px;
    bottom: -1.5px;
    z-index: 3;
    height: 3px;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
}
.courses-hub-finder.is-open .courses-hub-search__bar::after { opacity: 1; }
/* ── 2. Topic index panel ── */
.courses-hub-index {
    position: absolute;
    top: var(--ch-panel-top, calc(100% + 8px)); /* set by courses-hub.js: right under the bar */
    left: 20px;
    right: 20px;
    z-index: 60;
    max-height: min(70vh, 640px);
    overflow-y: auto;
    padding: 24px;
    border: 1.5px solid #CFC4E3;
    border-radius: 20px;
    background: #ffffff;
    color: var(--ch-text);
    box-shadow: 0 24px 50px rgba(10, 4, 24, 0.18);
}
.courses-hub-index[hidden] { display: none; }
/* The bar and the panel are the same width, so the panel's top corners are square. */
.courses-hub-finder.is-open .courses-hub-index {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Open/close animation ("melt") */
/* (b) Melt: the bar's corners square off first, then the panel flows down from it. */
.courses-hub-finder[data-search-anim="b"] .courses-hub-index {
    opacity: 0;
    transform: scaleY(0.88);
    transform-origin: var(--ch-bar-mid, 50%) top;
    transition: opacity 0.2s ease 0.08s, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s;
}
.courses-hub-finder[data-search-anim="b"].is-open .courses-hub-index { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .courses-hub-finder .courses-hub-index,
    .courses-hub-search__input { transition: none !important; }
}
@media (min-width: 768px) {
    .courses-hub-index { left: 32px; right: 32px; }
}
@media (min-width: 1024px) {
    .courses-hub-index { padding: 28px 32px 32px; }
}
.courses-hub-index__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.courses-hub-index__title {
    flex: 1;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}
.courses-hub-index__catalogue,
.courses-hub-index__catalogue:hover {
    display: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--ch-link);
    text-decoration: underline;
}
@media (min-width: 768px) {
    .courses-hub-index__catalogue { display: inline; }
}
.courses-hub-index__close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border: 1px solid var(--ch-border) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: var(--ch-text) !important;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.courses-hub-index__close:hover { background: var(--ch-lavender) !important; }

.courses-hub-index__cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}
@media (min-width: 768px) {
    .courses-hub-index__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
    .courses-hub-index__cols { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
    .courses-hub-index__col { padding: 0 20px; border-left: 1px solid var(--ch-border); }
    .courses-hub-index__col:first-child { padding-left: 0; border-left: 0; }
}
.courses-hub-index__col { min-width: 0; transition: opacity 0.2s ease; }
.courses-hub-index__col.is-empty { opacity: 0.5; }

.courses-hub-index__suite {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-width: 0;
    white-space: normal !important;
    height: auto !important;
    margin: 0 0 12px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-align: left;
    cursor: pointer;
}
.courses-hub-index__suite-name {
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.35;
    text-transform: uppercase;
    color: var(--suite-color);
}
.courses-hub-index__suite:hover .courses-hub-index__suite-name { text-decoration: underline; }
.courses-hub-index__suite-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--ch-muted);
}
.courses-hub-index__list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.courses-hub-index__list li[hidden] { display: none; }
.courses-hub-index__topic,
.courses-hub-index__topic:hover {
    display: block;
    margin: 0 -8px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--ch-text);
    text-decoration: none;
}
.courses-hub-index__topic:hover,
.courses-hub-index__topic[aria-selected="true"] {
    background: #F3EDFB;
    color: var(--ch-purple);
}
.courses-hub-index__empty {
    margin: 0;
    font-size: 14px;
    color: var(--ch-muted);
}
.courses-hub-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #EFE5FB;
    font-size: 11px;
    font-weight: 600;
    color: var(--ch-purple);
    vertical-align: 1px;
}

/* ── 3. Our most popular courses ── */
/* Section headings: "Our most popular courses" and "All topics" */
.courses-hub-section-title {
    margin: 0 0 20px;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ch-text);
}
@media (min-width: 768px) {
    .courses-hub-section-title { font-size: 32px; }
}

.courses-hub-popular {
    padding-top: 32px;
    padding-bottom: 8px;
}
.courses-hub-popular[hidden] { display: none; }

/* Four compact topic cards, dark, the first one featured */
.courses-hub-minis {
    display: flex;
    gap: 16px;
    margin: 0 -20px;
    padding: 14px 20px 16px; /* top: room for the "Top choice" badge */
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}
.courses-hub-minis > .courses-hub-mini { flex: 0 0 80%; scroll-snap-align: start; }
@media (min-width: 768px) {
    .courses-hub-minis {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 0;
        padding: 14px 0 8px;
        overflow: visible;
    }
}
@media (min-width: 1100px) {
    .courses-hub-minis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.courses-hub-mini {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: var(--ch-dark);
    color: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
@media (min-width: 1024px) {
    .courses-hub-mini { padding: 24px; }
}
.courses-hub-mini:hover,
.courses-hub-mini:focus-within {
    transform: translateY(-3px);
    background-color: #22163D;
    box-shadow: 0 16px 34px rgba(91, 31, 153, 0.35);
}
/* First card: the topic pages' gradient border + "Top choice" badge on the top edge */
.courses-hub-mini--first {
    border-width: 2px;
    background:
        linear-gradient(var(--ch-dark), var(--ch-dark)) padding-box,
        linear-gradient(90deg, #ff7ae3 13.48%, #d970ff 45.77%, #ab80ff 76.85%) border-box;
}
.courses-hub-mini--first:hover,
.courses-hub-mini--first:focus-within {
    background:
        linear-gradient(#22163D, #22163D) padding-box,
        linear-gradient(90deg, #ff7ae3 13.48%, #d970ff 45.77%, #ab80ff 76.85%) border-box;
}
.courses-hub-mini__badge {
    position: absolute;
    top: 0;
    left: 14px;
    z-index: 3;
    transform: translateY(-50%);
    padding: 4px 10px;
    border: 1.5px solid transparent;
    border-radius: 6px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(90deg, #ff7ae3 13.48%, #d970ff 45.77%, #ab80ff 76.85%) border-box;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    color: #090a0b;
    pointer-events: none;
}
.courses-hub-mini__title {
    flex: 1 1 auto;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
}
.courses-hub-mini__link,
.courses-hub-mini__link:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}
/* The whole card opens the topic page; "Try a course free" sits above that. */
.courses-hub-mini__link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 14px;
}
.courses-hub-mini__link:focus-visible { outline: none; }
.courses-hub-mini:has(.courses-hub-mini__link:focus-visible) { outline: 3px solid var(--ch-link); outline-offset: 2px; }
.courses-hub-mini__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}
.courses-hub-mini__try,
.courses-hub-mini__try:hover {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 2px solid #ffffff;
    border-radius: 9999px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 600;
    color: var(--ch-purple) !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}
/* Hover: turns a soft pink (like the outlined "Try now" buttons in the topic cards) */
.courses-hub-mini__try:hover,
.courses-hub-mini__try:focus-visible {
    border-color: #EFE5FB;
    background: #EFE5FB;
    color: var(--ch-purple) !important;
}
.courses-hub-mini__all {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: underline;
}
@media (max-width: 767px) {
    .courses-hub-mini__try { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .courses-hub-mini { transition: none; }
    .courses-hub-mini:hover,
    .courses-hub-mini:focus-within { transform: none; }
}

/* ── 4. Suites ── */
.courses-hub-suites {
    padding-top: 40px;
    padding-bottom: 56px;
}
.courses-hub-suite {
    position: relative;
    margin-bottom: 0;
    padding: 16px;
    border: 1px solid var(--ch-border);
    border-radius: 24px;
    background: var(--ch-lavender);
    scroll-margin-top: calc(var(--ch-header-h) + var(--ch-tabs-h) + 16px);
}
.courses-hub-suite[hidden] { display: none; }
/* Clear break between suites: extra space with a divider line in the middle
   (not shown when the filter is showing a single suite). */
.courses-hub-suite + .courses-hub-suite {
    margin-top: 64px;
}
.courses-hub-suite + .courses-hub-suite::before {
    content: '';
    position: absolute;
    top: -33px;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 2px;
    background: #CFC4E3;
}

@media (min-width: 768px) {
    .courses-hub-suite { padding: 20px; }
}
.courses-hub-suite__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ch-border);
}

.courses-hub-suite__title {
    margin: 0 0 2px;
    font-size: 22px;
    font-weight: 600;
    color: var(--ch-text);
}
.courses-hub-suite__desc {
    margin: 0;
    font-size: 14px;
    color: var(--ch-muted);
}
.courses-hub-suite__count {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 9999px;
    background: #ECE5F7;
    font-size: 13px;
    font-weight: 600;
    color: var(--ch-purple);
}

.courses-hub-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}
@media (min-width: 1100px) {
    .courses-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.courses-hub-suite:not(.is-expanded) .courses-hub-card.is-extra { display: none; }

.courses-hub-suite__more {
    margin-top: 16px;
    text-align: center;
}
.courses-hub-suite__toggle {
    letter-spacing: 0 !important;
    min-height: 44px;
    padding: 0.6rem 1.5rem !important;
    border: 1px solid var(--ch-purple) !important;
    border-radius: 9999px !important;
    background: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--ch-purple) !important;
    cursor: pointer;
}
.courses-hub-suite__toggle:hover { background: #F1EAFA !important; }

/* ── Topic cards ── */
.courses-hub-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border: 1.5px solid #CFC4E3;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(23, 18, 42, 0.06);
    overflow: hidden;
    scroll-margin-top: calc(var(--ch-header-h) + var(--ch-tabs-h) + 24px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
@media (min-width: 640px) {
    .courses-hub-card { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}
.courses-hub-card:hover,
.courses-hub-card:focus-within,
.courses-hub-card.is-featured {
    transform: translateY(-3px);
    border-color: #A77BF0;
    box-shadow: 0 14px 34px rgba(91, 31, 153, 0.16);
}
.courses-hub-card.is-featured {
    position: relative;
    z-index: 5;
    transform: translateY(-4px) scale(1.035);
    border-color: var(--ch-link);
    box-shadow: 0 0 0 3px rgba(122, 47, 200, 0.35), 0 22px 48px rgba(91, 31, 153, 0.28);
    animation: courses-hub-pulse 1.2s ease-out 2;
}
/* While a card is spotlighted (picked from the search), the rest fade back.
   Cleared by clicking anywhere outside it, Escape, or picking another topic. */
.courses-hub-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.3s ease, filter 0.3s ease;
}
.courses-hub.is-spotlight .courses-hub-card:not(.is-featured) {
    opacity: 0.35;
    filter: grayscale(0.7);
}
.courses-hub.is-spotlight .courses-hub-card:not(.is-featured):hover { opacity: 0.6; }
@keyframes courses-hub-pulse {
    0% { box-shadow: 0 0 0 0 rgba(122, 47, 200, 0.55), 0 22px 48px rgba(91, 31, 153, 0.28); }
    100% { box-shadow: 0 0 0 16px rgba(122, 47, 200, 0), 0 22px 48px rgba(91, 31, 153, 0.28); }
}
@media (prefers-reduced-motion: reduce) {
    .courses-hub-card { transition: none; }
    .courses-hub-card:hover,
    .courses-hub-card:focus-within,
    .courses-hub-card.is-featured { transform: none; }
    .courses-hub-card.is-featured { animation: none; outline: 3px solid var(--ch-link); }
}

/* Left half: the topic tile (image with the topic name on it); stats on hover */
.courses-hub-card__topic {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #EFE8F9;
    overflow: hidden;
    cursor: pointer;
}
@media (min-width: 640px) {
    /* Stretch to the card's height; the card is at least a 16:9 tile tall. */
    .courses-hub-card { grid-template-rows: minmax(150px, auto); }
    .courses-hub-card__topic { aspect-ratio: auto; }
}
.courses-hub-card__img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center; /* the topic name sits bottom-left on these tiles */
}
.courses-hub-card__tag {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    margin: 0;
    pointer-events: none;
}
.courses-hub-card__overlay {
    position: absolute;
    inset: 0;
    /* Stats sit at the bottom of the tile's top half, leaving the topic name
       (bottom-left on the tile) visible through the tint. */
    display: grid;
    grid-template-rows: 1fr 1fr;
    padding: 0 12px;
    background: rgba(22, 14, 43, 0.75);
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
}
/* Shown whenever the card is hovered or focused, including over the course rows. */
.courses-hub-card:hover .courses-hub-card__overlay,
.courses-hub-card:focus-within .courses-hub-card__overlay,
.courses-hub-card.is-featured .courses-hub-card__overlay { opacity: 1; }
.courses-hub-card__tag { transition: opacity 0.2s ease; }
.courses-hub-card:hover .courses-hub-card__tag,
.courses-hub-card:focus-within .courses-hub-card__tag,
.courses-hub-card.is-featured .courses-hub-card__tag { opacity: 0; }
.courses-hub-card__view-topic {
    /* Bottom-right of the tile, clear of the topic name (bottom-left). */
    grid-row: 2;
    align-self: end;
    justify-self: end;
    margin-bottom: 10px;
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
/* Pointing at the tile itself (the part that opens the topic) fills it in. */
.courses-hub-card__topic:hover .courses-hub-card__view-topic {
    background: #ffffff;
    color: var(--ch-purple);
}
.courses-hub-card__stats {
    grid-row: 1;
    align-self: end;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 0;
    padding-bottom: 4px;
    text-align: center;
}
.courses-hub-card__stats div { display: flex; flex-direction: column-reverse; }
.courses-hub-card__stats dd { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.courses-hub-card__stats dt { font-size: 11px; color: rgba(255, 255, 255, 0.75); }

.courses-hub-card__title { margin: 0; }
/* Whole card links to the topic page; the course column sits above it. */
.courses-hub-card__link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}
.courses-hub-card__link:focus-visible { outline: none; }
.courses-hub-card:has(.courses-hub-card__link:focus-visible) { outline: 3px solid var(--ch-link); outline-offset: 2px; }

/* Right half: try a course */
.courses-hub-card__courses {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--ch-border);
    background: #FCFBFE;
}
@media (min-width: 640px) {
    .courses-hub-card__courses { border-top: 0; border-left: 1px solid var(--ch-border); }
}
.courses-hub-card__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.courses-hub-course {
    position: relative;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    box-sizing: border-box;
    padding: 6px 6px 6px 12px;
    border: 1px solid #ECE7F4;
    border-radius: 10px;
    background: #ffffff;
}
.courses-hub-course__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.courses-hub-course__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ch-text);
}
.courses-hub-course__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-sizing: border-box;
    min-height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--ch-purple);
    border-radius: 9999px;
    background: var(--ch-purple);
    font-size: 13px;
    font-weight: 600;
    color: #ffffff !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.courses-hub-course__arrow {
    display: inline-block;
    transition: transform 0.15s ease;
}
/* Hover (on the row or the button) and focus: every button responds the same
   way — a deeper shade of its own style plus the arrow nudging right. Colour
   and position only, never size. */
.courses-hub-course:hover .courses-hub-course__btn,
.courses-hub-course__btn:focus-visible {
    background: #3E1270;
    border-color: #3E1270;
    color: #ffffff !important;
    text-decoration: none !important;
}
.courses-hub-course:hover .courses-hub-course__arrow,
.courses-hub-course__btn:focus-visible .courses-hub-course__arrow {
    transform: translateX(3px);
}
@media (prefers-reduced-motion: reduce) {
    .courses-hub-course__arrow { transition: none; }
}
/* The whole row is the button's hit area */
.courses-hub-course__btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
}
.courses-hub-course:hover {
    border-color: #C8A3FF;
    background: #F8F4FE;
}

/* Row 2: outlined button; on hover it gets a light purple fill (it stays
   outlined, so it never looks like the Most Popular button). */
.courses-hub-course__btn--outline {
    background: transparent;
    color: var(--ch-purple) !important;
}
.courses-hub-course:hover .courses-hub-course__btn--outline,
.courses-hub-course__btn--outline:focus-visible {
    background: #EFE5FB;
    border-color: var(--ch-purple);
    color: var(--ch-purple) !important;
}

/* Row 1: the topic page's "Most Popular" course (gradient border + badge on the top edge) */
.courses-hub-course--popular {
    margin-top: 9px;
    padding-top: 9px;
    border: 1.5px solid transparent;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(90deg, #ff7ae3 13.48%, #d970ff 45.77%, #ab80ff 76.85%) border-box;
}
.courses-hub-course--popular:hover {
    border-color: transparent;
    background:
        linear-gradient(#F8F4FE, #F8F4FE) padding-box,
        linear-gradient(90deg, #ff7ae3 13.48%, #d970ff 45.77%, #ab80ff 76.85%) border-box;
}
.courses-hub-course__badge {
    position: absolute;
    top: 0;
    left: 10px;
    z-index: 1;
    transform: translateY(-50%);
    padding: 3px 8px;
    border: 1.5px solid transparent;
    border-radius: 5px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(90deg, #ff7ae3 13.48%, #d970ff 45.77%, #ab80ff 76.85%) border-box;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.2;
    color: #090a0b;
    white-space: nowrap;
    pointer-events: none;
}
.courses-hub-course:has(.courses-hub-course__btn:focus-visible) {
    outline: 2px solid var(--ch-link);
    outline-offset: 2px;
}
@media (min-width: 1100px) {
    .courses-hub-course__btn { min-height: 34px; }
}

/* ── 8. Free trial popup ── */
.courses-hub-trial {
    width: min(520px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ch-text);
    overflow: visible;
}
.courses-hub-trial::backdrop {
    background: rgba(22, 14, 43, 0.55);
}
.courses-hub-trial__inner {
    position: relative;
    z-index: 1;
    max-height: calc(100vh - 24px);
    box-sizing: border-box;
    overflow-y: auto;
    padding: 24px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(10, 4, 24, 0.4);
}
/* Confetti: starts at the card's centre, behind it, and flies out past its edges */
.courses-hub-trial__confetti {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.courses-hub-trial__confetti span {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 2px;
}
@media (min-width: 640px) {
    .courses-hub-trial__inner { padding: 28px 32px; }
}
.courses-hub-trial__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border: 1px solid var(--ch-border) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: var(--ch-text) !important;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.courses-hub-trial__close:hover { background: var(--ch-lavender) !important; }
.courses-hub-trial__course {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
    padding-right: 44px;
}
.courses-hub-trial__thumb {
    position: relative;
    flex-shrink: 0;
    width: 132px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: #EFE8F9;
    overflow: hidden;
}
.courses-hub-trial__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.courses-hub-trial__eyebrow {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ch-link);
}
.courses-hub-trial__title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ch-text);
}
.courses-hub-trial__again {
    margin: 6px 0 0;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    font-family: inherit;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    color: var(--ch-link) !important;
    text-decoration: underline;
    cursor: pointer;
}
.courses-hub-trial__again[hidden] { display: none; }

/* ── Random pick reveal (random-button popups only) ──
   1. The card springs in.  2. A blurred glow and a crisp gradient ring sweep
   round it, then settle to a soft glow.  3. The thumbnail flips over like a
   revealed card (scaling 0.9 → 1).
   Confetti fires from behind at the same time (courses-hub.js). */
@property --ch-glow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.courses-hub-trial__glow,
.courses-hub-trial__ring {
    position: absolute;
    z-index: 0;
    border-radius: 24px;
    background: conic-gradient(from var(--ch-glow-angle), #ff7ae3, #d970ff, #ab80ff, #7A2FC8, #ff7ae3);
    opacity: 0;
    pointer-events: none;
}
.courses-hub-trial__glow { inset: -10px; filter: blur(22px); }
.courses-hub-trial__ring { inset: -3px; }
.courses-hub-trial.is-random-entry .courses-hub-trial__glow {
    animation: courses-hub-glow 2.6s ease-out both, courses-hub-sweep 1.3s linear 2;
}
.courses-hub-trial.is-random-entry .courses-hub-trial__ring {
    animation: courses-hub-ring 2.6s ease-out both, courses-hub-sweep 1.3s linear 2;
}
.courses-hub-trial.is-random-entry .courses-hub-trial__inner {
    animation: courses-hub-spring 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.courses-hub-trial.is-random-entry .courses-hub-trial__course { perspective: 700px; }
.courses-hub-trial.is-random-entry .courses-hub-trial__thumb {
    animation: courses-hub-flip 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s both;
}

.courses-hub-trial.is-random-entry .courses-hub-trial__title {
    animation: courses-hub-rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s both;
}
@keyframes courses-hub-sweep { to { --ch-glow-angle: 360deg; } }
@keyframes courses-hub-glow {
    0% { opacity: 0; }
    20% { opacity: 0.95; }
    100% { opacity: 0.45; } /* settles to a soft glow while the popup is open */
}
@keyframes courses-hub-ring {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0.6; }
}
@keyframes courses-hub-spring {
    0% { opacity: 0; transform: translateY(24px) scale(0.85); }
    60% { opacity: 1; }
    100% { opacity: 1; transform: none; }
}
@keyframes courses-hub-flip {
    0% { opacity: 0; transform: rotateY(90deg) scale(0.9); }
    60% { opacity: 1; transform: rotateY(-8deg) scale(0.97); }
    100% { opacity: 1; transform: rotateY(0) scale(1); }
}

@keyframes courses-hub-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .courses-hub-trial.is-random-entry .courses-hub-trial__thumb,
    .courses-hub-trial.is-random-entry .courses-hub-trial__title,
    .courses-hub-trial.is-random-entry .courses-hub-trial__inner,

    .courses-hub-trial.is-random-entry .courses-hub-trial__glow,
    .courses-hub-trial.is-random-entry .courses-hub-trial__ring { animation: none; }
}
.courses-hub-trial__meta {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--ch-muted);
}
.courses-hub-trial__intro {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--ch-muted);
}
.courses-hub-trial__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.courses-hub-trial__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}
@media (min-width: 480px) {
    .courses-hub-trial__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.courses-hub-trial__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ch-text);
}
.courses-hub-trial__field input {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 14px !important;
    border: 1px solid #D9D3E6 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    font-family: inherit;
    font-size: 16px !important;
    font-weight: 400;
    color: var(--ch-text) !important;
}
.courses-hub-trial__field input:focus {
    outline: none;
    border-color: var(--ch-link) !important;
    box-shadow: 0 0 0 3px rgba(122, 47, 200, 0.18);
}
.courses-hub-trial__email-error {
    margin: -4px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #C0262D;
}
.courses-hub-trial__email-error[hidden] { display: none; }
.courses-hub-trial__field input[aria-invalid="true"] { border-color: #C0262D !important; }
.courses-hub-trial__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    margin-top: 4px;
    padding: 0 24px !important;
    border: 2px solid var(--ch-purple) !important; /* same box on hover, so nothing shifts */
    border-radius: 9999px !important;
    background: var(--ch-purple) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
/* Hover: white fill, purple border and text (like the "Try Now" buttons) */
.courses-hub-trial__submit:hover:not(:disabled),
.courses-hub-trial__submit:focus-visible {
    background: #ffffff !important;
    color: var(--ch-purple) !important;
}
.courses-hub-trial__submit:disabled { opacity: 0.7; cursor: wait; }
.courses-hub-trial__spinner[hidden] { display: none; }
.courses-hub-trial__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: courses-hub-spin 0.8s linear infinite;
}
@keyframes courses-hub-spin { to { transform: rotate(360deg); } }
.courses-hub-trial__message:empty { display: none; }
.courses-hub-trial__message {
    font-size: 14px;
    color: #C0262D;
}
.courses-hub-trial__privacy {
    margin: 14px 0 10px;
    font-size: 12px;
    color: var(--ch-muted);
}
.courses-hub-trial__privacy a { color: var(--ch-link); }
.courses-hub-trial__more,
.courses-hub-trial__more:hover {
    font-size: 14px;
    font-weight: 600;
    color: var(--ch-link);
    text-decoration: underline;
}
@media (max-width: 479px) {
    .courses-hub-trial__course { flex-direction: column; align-items: flex-start; }
    .courses-hub-trial__thumb { width: 100%; }
}

/* ── 6. FAQs (rest of the styling comes from blocks/faq-section/faq-section.css) ── */
.courses-hub-faq__intro {
    max-width: 52rem;
    margin: -1.5rem auto 2.5rem;
    font-size: 16px;
    line-height: 1.65;
    text-align: center;
    color: #374151;
}
.courses-hub-faq__intro p { margin: 0 0 0.75em; }
.courses-hub-faq__intro p:last-child { margin-bottom: 0; }

/* ── Mobile (< 768px): a lighter, app-like layout ──
   Logos in a 2 x 2 grid; the popular topics as slim rows that open the trial;
   suites show just their name, with a short "Show all topics" button; each topic
   is a slim row (no tile or hover stats) that opens to show its courses. */
.courses-hub-mini__try-short,
.courses-hub-card__toggle,
.courses-hub-card__all { display: none; }

@media (max-width: 767px) {
    /* Logos: 2 rows of 2, each centred in its cell */
    .courses-hub-hero__logos-label { display: none; }
    .courses-hub-hero__logos-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 16px;
        width: 100%;
    }
    .courses-hub-hero__logos-list li {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .courses-hub-hero__logos-list li:nth-child(n+5) { display: none; }

    /* Most popular: stacked rows; the whole row opens the trial popup */
    .courses-hub-minis {
        flex-direction: column;
        gap: 10px;
        margin: 0;
        padding: 12px 0 0;
        overflow: visible;
    }
    .courses-hub-minis > .courses-hub-mini { flex: none; }
    .courses-hub-mini {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        box-sizing: border-box;
        min-height: 56px;
        padding: 12px 16px;
        border-radius: 12px;
    }
    .courses-hub-mini--first { padding-top: 16px; }
    .courses-hub-mini:hover,
    .courses-hub-mini:focus-within { transform: none; box-shadow: none; }
    .courses-hub-mini__title { font-size: 16px; }
    .courses-hub-mini__all,
    .courses-hub-mini__try-full { display: none; }
    .courses-hub-mini__try-short {
        display: inline-flex;
        align-items: center;
        gap: 2px;
    }
    .courses-hub-mini__actions { flex-shrink: 0; }
    .courses-hub-mini__try,
    .courses-hub-mini__try:hover,
    .courses-hub-mini__try:focus-visible {
        position: static;
        min-height: 0;
        padding: 0;
        border: 0;
        background: none;
        font-size: 13px;
        color: #E9B8FF !important;
        white-space: nowrap;
    }
    .courses-hub-mini__try::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 2;
        border-radius: 12px;
    }
    .courses-hub-mini__chev { flex-shrink: 0; }

    /* Suites: name only, "Show all topics" under the first four */
    .courses-hub-suite + .courses-hub-suite { margin-top: 40px; }
    .courses-hub-suite + .courses-hub-suite::before { top: -21px; }
    .courses-hub-suite__head {
        position: relative;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    .courses-hub-suite__heading { flex: 1 1 auto; min-width: 0; }
    .courses-hub-suite__title {
        margin: 0;
        overflow: hidden;
        font-size: 18px;
        line-height: 1.3;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .courses-hub-suite__desc,
    .courses-hub-suite__count { display: none; }
    .courses-hub-suite__more { margin-top: 12px; }
    .courses-hub-suite__toggle { min-height: 40px; padding: 0.4rem 1.25rem !important; font-size: 14px !important; }
    .courses-hub-card__toggle-icon { transition: transform 0.2s ease; }
    .courses-hub-card.is-open .courses-hub-card__toggle-icon { transform: rotate(180deg); }

    /* Topic cards: slim rows that open to show their courses */
    .courses-hub-grid { gap: 8px; }
    .courses-hub-card {
        display: block;
        border-width: 1px;
        border-radius: 12px;
        box-shadow: none;
    }
    .courses-hub-card:hover,
    .courses-hub-card:focus-within { transform: none; box-shadow: none; }
    .courses-hub-card.is-featured { transform: none; }
    .courses-hub-card.is-open { border-color: #A77BF0; }
    .courses-hub-card__topic { display: none; }
    .courses-hub-card__toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        box-sizing: border-box;
        width: 100%;
        min-height: 52px;
        margin: 0;
        padding: 10px 14px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        line-height: 1.3;
        letter-spacing: 0 !important;
        text-align: left;
        text-transform: none !important;
        color: var(--ch-text) !important;
        cursor: pointer;
    }
    .courses-hub-card__toggle:focus-visible { outline: 2px solid var(--ch-link); outline-offset: -2px; }
    .courses-hub-card__toggle-name {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .courses-hub-card__toggle-count {
        flex-shrink: 0;
        font-size: 12px;
        font-weight: 500;
        color: var(--ch-muted);
    }
    .courses-hub-card__toggle-icon { flex-shrink: 0; color: var(--ch-purple); }
    .courses-hub-card:not(.is-open) .courses-hub-card__courses { display: none; }
    .courses-hub-card__courses { padding: 10px; }
    .courses-hub-card__all {
        display: block;
        padding: 4px 0 2px;
        font-size: 13px;
        font-weight: 600;
        text-align: center;
        color: var(--ch-link) !important;
        text-decoration: none !important;
    }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    .courses-hub-card__toggle-icon { transition: none; }
}

/* ── Suite panel tints: each suite gets a light tint of its topic pages' hero
   gradient, all at the same lightness as the original lavender.
   Blue = Financial and Corporate Crime, green = Health and Safety, pink =
   Performance and Leadership, orange = InfoSec and Data Privacy, purple =
   Diversity and Inclusion. ── */
.courses-hub-suite[data-tint="blue"] {
    --ch-suite-line: #D9E2F8;
    border-color: var(--ch-suite-line);
    background: #F3F6FE;
}
.courses-hub-suite[data-tint="green"] {
    --ch-suite-line: #D3EDDF;
    border-color: var(--ch-suite-line);
    background: #F1FAF5;
}
.courses-hub-suite[data-tint="pink"] {
    --ch-suite-line: #F6DAE1;
    border-color: var(--ch-suite-line);
    background: #FEF3F5;
}
.courses-hub-suite[data-tint="orange"] {
    --ch-suite-line: #F6E2CC;
    border-color: var(--ch-suite-line);
    background: #FEF7EE;
}
.courses-hub-suite[data-tint="purple"] {
    --ch-suite-line: #E4DEEE;
    border-color: var(--ch-suite-line);
    background: #F7F5FB;
}
.courses-hub-suite__head { border-bottom-color: var(--ch-suite-line, var(--ch-border)); }

/* ── Optional hero background image (ACF hero_background_image) ── */
.courses-hub-hero--has-bg {
    background-color: var(--ch-dark);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* ── "Most popular" cards: a background image per suite (set as --mini-bg).
   Hover lightens the image slightly; the first card keeps its gradient border. ── */
.courses-hub-mini.courses-hub-mini--has-bg {
    background: var(--mini-bg) center / cover no-repeat, var(--ch-dark);
}
.courses-hub-mini.courses-hub-mini--has-bg:hover,
.courses-hub-mini.courses-hub-mini--has-bg:focus-within {
    background:
        linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07)),
        var(--mini-bg) center / cover no-repeat,
        var(--ch-dark);
}
.courses-hub-mini--first.courses-hub-mini--has-bg {
    background:
        var(--mini-bg) center / cover no-repeat padding-box,
        linear-gradient(90deg, #ff7ae3 13.48%, #d970ff 45.77%, #ab80ff 76.85%) border-box;
}
.courses-hub-mini--first.courses-hub-mini--has-bg:hover,
.courses-hub-mini--first.courses-hub-mini--has-bg:focus-within {
    background:
        linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.07)) padding-box,
        var(--mini-bg) center / cover no-repeat padding-box,
        linear-gradient(90deg, #ff7ae3 13.48%, #d970ff 45.77%, #ab80ff 76.85%) border-box;
}

/* ── Idle shimmer on "Try a random course" (one soft sweep, added by JS) ── */
.courses-hub-random__shimmer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1; /* above the gradient, under the label */
    width: 30%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
    pointer-events: none;
}

/* ── Shuffle streak (trial popup, after 3 shuffles) ── */
.courses-hub-trial__streak {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #ECE7F4;
    animation: courses-hub-streak-in 0.35s ease-out both;
}
.courses-hub-trial__streak[hidden] { display: none; }
.courses-hub-trial__streak-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ch-text);
}
.courses-hub-trial__streak-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
@keyframes courses-hub-streak-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .courses-hub-trial__streak { animation: none; }
}

/* ── Bottom-of-page line: "Feeling lucky? Try a random course →" ── */
.courses-hub-bottom-random {
    margin: 0 auto;
    padding: 8px 20px 40px;
    font-size: 15px;
    text-align: center;
    color: var(--ch-muted);
}
.courses-hub-bottom-random__btn {
    display: inline-block;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    font-family: inherit;
    font-size: inherit !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-align: left;
    color: var(--ch-link) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.courses-hub-bottom-random__btn:hover,
.courses-hub-bottom-random__btn:focus-visible { color: #A35DEB !important; }
.courses-hub-bottom-random__btn[aria-busy="true"] { text-decoration: none; }
