/* Course catalog (/courses): hero with live search and a decorative course
   stack, a trust strip, category chips, showcase-card grids and a closing
   call to action. Cards themselves live in course-showcase.css. Theme
   tokens only (--dashboard-*), so the page follows the visitor's theme. */

.cx-page {
  --cx-radius: 1.4rem;
  display: grid;
  gap: 1.5rem;
}

/* ---------- Hero ---------- */
.cx-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(16rem, 0.75fr);
  gap: 2rem;
  align-items: center;
  overflow: hidden;
  padding: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  border-radius: var(--cx-radius);
  color: #ffffff;
  background:
    radial-gradient(90% 120% at 0% 0%, var(--dashboard-hero-end) 0%, transparent 55%),
    radial-gradient(70% 90% at 100% 100%, color-mix(in srgb, var(--dashboard-highlight) 30%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, var(--dashboard-hero-start) 0%, var(--dashboard-hero-mid) 60%, var(--dashboard-hero-end) 140%);
  box-shadow: 0 24px 50px var(--dashboard-shadow, rgba(35, 31, 89, 0.18));
}

.cx-hero__glow {
  position: absolute;
  inset: -30% -10% auto auto;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--dashboard-highlight) 28%, transparent) 0%, transparent 65%);
  pointer-events: none;
}

.cx-hero__content { display: grid; gap: 1rem; min-width: 0; }

.cx-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  margin: 0;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--dashboard-highlight);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cx-hero__eyebrow span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--dashboard-highlight);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--dashboard-highlight) 25%, transparent);
}

.cx-hero__title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 1.4rem + 3vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.cx-hero__title span {
  background: linear-gradient(90deg, #ffffff 0%, var(--dashboard-highlight) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cx-hero__lede {
  max-width: 38rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* Search sits inside the hero */
.cx-search { margin: 0.25rem 0 0; }

.cx-search .course-search-field {
  max-width: 40rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.cx-search .catalog-search__hint { color: rgba(255, 255, 255, 0.72); }

.cx-search .catalog-search__example {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.cx-search .catalog-search__example:hover { background: rgba(255, 255, 255, 0.2); }

.cx-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
}

.cx-hero__stats strong { color: #ffffff; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* Decorative course stack */
.cx-stack { position: relative; height: 24rem; }

.cx-stack__card {
  position: absolute;
  width: min(15rem, 80%);
  padding: 0.7rem 0.7rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  animation: cx-float 7s ease-in-out infinite;
}

.cx-stack__card--1 { top: 0; right: 0; transform: rotate(4deg); z-index: 3; }
.cx-stack__card--2 { top: 6.5rem; left: 0; transform: rotate(-5deg); z-index: 2; animation-delay: -2.3s; }
.cx-stack__card--3 { bottom: -0.5rem; right: 4%; transform: rotate(2deg); z-index: 1; animation-delay: -4.6s; }

@keyframes cx-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

.cx-stack__cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--course-hue), color-mix(in srgb, var(--course-hue) 40%, #0b1020));
  font-size: 1.6rem;
  font-weight: 850;
}

.cx-stack__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.cx-stack__title {
  display: -webkit-box;
  margin: 0.6rem 0.15rem 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cx-stack__meta { margin: 0.2rem 0.15rem 0; color: rgba(255, 255, 255, 0.65); font-size: 0.7rem; }

.cx-stack__bar {
  display: block;
  height: 0.3rem;
  margin: 0.55rem 0.15rem 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.cx-stack__bar span {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--course-hue), var(--dashboard-highlight));
}

.cx-stack__card--2 .cx-stack__bar span { width: 38%; }
.cx-stack__card--3 .cx-stack__bar span { width: 84%; }

/* ---------- Trust strip ---------- */
.cx-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cx-trust li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--dashboard-border);
  border-radius: 1.1rem;
  background: var(--dashboard-surface);
}

.cx-trust strong { display: block; color: var(--dashboard-heading); font-size: 0.9rem; }

.cx-trust small { display: block; margin-top: 0.15rem; color: var(--dashboard-muted); font-size: 0.76rem; line-height: 1.4; }

.cx-trust__icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  background: var(--dashboard-accent-soft);
  color: var(--dashboard-accent);
}

.cx-trust__icon svg { width: 1.25rem; height: 1.25rem; }

.cx-trust__icon--teal { background: color-mix(in srgb, #0891b2 14%, var(--dashboard-surface)); color: #0891b2; }
.cx-trust__icon--amber { background: color-mix(in srgb, #f59e0b 16%, var(--dashboard-surface)); color: #d97706; }
.cx-trust__icon--pink { background: color-mix(in srgb, #db2777 13%, var(--dashboard-surface)); color: #db2777; }

/* ---------- Category chips ---------- */
.cx-filter { display: grid; gap: 0.6rem; }

.cx-filter .catalog-filter__label {
  margin: 0;
  color: var(--dashboard-accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cx-filter .catalog-filter__chip {
  min-height: 2.6rem;
  border-radius: 999px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.cx-filter .catalog-filter__chip:hover { transform: translateY(-1px); }

.cx-filter .catalog-filter__chip:not([aria-current="true"]) {
  border-color: var(--dashboard-border);
  background: var(--dashboard-surface);
  color: var(--dashboard-heading);
}

.cx-filter .catalog-filter__chip[aria-current="true"] {
  box-shadow: 0 10px 24px color-mix(in srgb, var(--dashboard-accent) 25%, transparent);
}

/* ---------- Groups ---------- */
.cx-groups { display: grid; gap: 2rem; margin-top: 1.25rem; }

.cx-group { display: grid; gap: 1rem; }

.cx-group[hidden] { display: none; }

.cx-group__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--dashboard-border);
}

.cx-group__heading { flex: 1; min-width: 0; }

.cx-group__heading h2 {
  margin: 0;
  color: var(--dashboard-heading);
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.55rem);
}

.cx-group__heading p { margin: 0.2rem 0 0; color: var(--dashboard-muted); font-size: 0.88rem; }

.cx-group__count {
  flex: 0 0 auto;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--dashboard-accent-soft);
  color: var(--dashboard-accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.cx-page .ex-grid { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.25rem; }

.cx-results { display: grid; gap: 1rem; }

.cx-results[hidden],
.cx-browse[hidden] { display: none; }

.cx-empty {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 3rem 1rem;
  border: 1.5px dashed var(--dashboard-border);
  border-radius: var(--cx-radius);
  color: var(--dashboard-muted);
  text-align: center;
}

.cx-empty strong { color: var(--dashboard-heading); font-size: 1.1rem; }

/* ---------- Closing call to action ---------- */
.cx-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 1rem;
  padding: clamp(1.25rem, 1rem + 1.5vw, 2.25rem);
  border-radius: var(--cx-radius);
  color: #ffffff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.18) 0%, transparent 55%),
    linear-gradient(135deg, var(--dashboard-accent-deep), var(--dashboard-accent) 55%, #db2777 140%);
  box-shadow: 0 20px 40px color-mix(in srgb, var(--dashboard-accent) 28%, transparent);
}

.cx-cta h2 { margin: 0; color: #ffffff; font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); }

.cx-cta p { max-width: 36rem; margin: 0.35rem 0 0; color: rgba(255, 255, 255, 0.85); }

.cx-cta__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cx-hero { grid-template-columns: 1fr; }
  .cx-stack { display: none; }
  .cx-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .cx-trust { gap: 0.6rem; }
  .cx-trust li { align-items: center; gap: 0.55rem; padding: 0.7rem; }
  .cx-trust small { display: none; }
  .cx-trust strong { font-size: 0.8rem; }
  .cx-trust__icon { width: 2rem; height: 2rem; }
  .cx-group__header { flex-wrap: wrap; }
  .cx-cta__actions { width: 100%; }
  .cx-cta__actions .ex-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cx-stack__card { animation: none; }
  .cx-filter .catalog-filter__chip { transition: none; }
  .cx-filter .catalog-filter__chip:hover { transform: none; }
}
