/* Course detail — KnowledgeHut-inspired compact layout */
.cd-page {
  --cd-header-offset: 72px;
  --cd-nav-height: 52px;
  --cd-section-gap: 40px;
  --cd-radius: 12px;
  --cd-border: #e2e8f0;
  --cd-text: #475569;
  --cd-heading: #0f172a;
  --cd-surface: #f8fafc;
}

/* Hero */
.cd-hero {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  padding: 40px 0 36px;
}

.cd-hero__grid {
  display: grid;
  grid-template-columns: 1fr  minmax(280px, 42%);
  gap: 32px;
  align-items: center;
}

.cd-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.cd-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 700;
}

.cd-hero__rating {
  font-size: 0.875rem;
  font-weight: 700;
  color: #b45309;
}

.cd-hero__rating-star {
  color: #f59e0b;
}

.cd-hero__meta-item {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}

.cd-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--cd-heading);
  margin: 0 0 14px;
}

.cd-hero__excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--cd-text);
  margin: 0 0 16px;
  max-width: 52ch;
}

.cd-hero__highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cd-hero__highlights li {
  position: relative;
  padding-left: 22px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.45;
}

.cd-hero__highlights li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 800;
}

.cd-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cd-btn-enroll {
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
}

.cd-btn-secondary {
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
}

.cd-hero__media {
  min-width: 0;
}

.cd-hero__media-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid var(--cd-border);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

@media (min-width: 993px) {
  .cd-hero__media {
    display: flex;
    justify-content: flex-end;
  }

  .cd-hero__media-frame {
    max-width: 100%;
  }
}

.cd-hero__media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 8px;
}

/* Mobile enroll (duplicate sidebar) */
.cd-mobile-enroll {
  display: none;
  padding: 0 0 16px;
  background: var(--cd-surface);
  border-bottom: 1px solid var(--cd-border);
}

.cd-mobile-enroll .cd-sidebar-trust {
  display: none;
}

/* Sticky nav */
.cd-sticky-nav {
  position: sticky;
  top: var(--cd-header-offset);
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--cd-border);
  backdrop-filter: blur(8px);
}

.cd-sticky-nav__inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.cd-sticky-nav__inner::-webkit-scrollbar {
  display: none;
}

.cd-sticky-nav__link {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.cd-sticky-nav__link:hover,
.cd-sticky-nav__link:focus-visible {
  color: var(--royal, #004a7e);
  background: #f1f5f9;
  outline: none;
}

.cd-sticky-nav__link.is-active {
  color: var(--royal, #004a7e);
  background: #eff6ff;
}

/* Body grid */
.cd-body {
  padding: 32px 0 48px;
}

.cd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 32%);
  gap: 32px;
  align-items: start;
}

.cd-main {
  min-width: 0;
}

.cd-section {
  scroll-margin-top: calc(var(--cd-header-offset) + var(--cd-nav-height) + 16px);
  margin-bottom: var(--cd-section-gap);
  padding-bottom: var(--cd-section-gap);
  border-bottom: 1px solid var(--cd-border);
}

.cd-section:last-child,
.cd-section--instructor {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cd-section__title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cd-heading);
  margin: 0 0 20px;
}

/* Prose */
.cd-prose {
  color: var(--cd-text);
  font-size: 0.95rem;
  line-height: 1.65;
  max-width: 68ch;
}

.cd-prose p {
  margin: 0 0 12px;
}

.cd-prose ul,
.cd-prose ol {
  margin: 0 0 14px;
  padding-left: 1.25rem;
}

.cd-prose strong {
  color: var(--cd-heading);
}

.cd-prose h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cd-heading);
  margin: 20px 0 10px;
}

.cd-prose h3:first-child {
  margin-top: 0;
}

/* Feature grid */
.cd-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.cd-feature-card {
  padding: 18px;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius);
  background: #fff;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.cd-feature-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.cd-feature-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eff6ff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--royal, #004a7e);
}

.cd-feature-card__icon--check::before { content: "✓"; }
.cd-feature-card__icon--star::before { content: "★"; }
.cd-feature-card__icon--bolt::before { content: "⚡"; }
.cd-feature-card__icon--shield::before { content: "◆"; }
.cd-feature-card__icon--chart::before { content: "▣"; }
.cd-feature-card__icon--users::before { content: "◎"; }

.cd-feature-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cd-heading);
  margin: 0 0 6px;
  line-height: 1.35;
}

.cd-feature-card__body {
  font-size: 0.85rem;
  color: var(--cd-text);
  margin: 0;
  line-height: 1.5;
}

/* Curriculum */
.cd-curriculum details {
  margin-bottom: 10px;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius);
  background: #fff;
}

.cd-curriculum details[open] {
  border-color: var(--royal, #004a7e);
  box-shadow: 0 4px 16px rgba(0, 74, 126, 0.06);
}

.cd-curriculum summary {
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cd-heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cd-curriculum summary::-webkit-details-marker {
  display: none;
}

.cd-curriculum summary::after {
  content: "↓";
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.cd-curriculum details[open] summary::after {
  transform: rotate(180deg);
  color: var(--royal, #004a7e);
}

.cd-curriculum .content {
  padding: 0 18px 16px;
  color: var(--cd-text);
  font-size: 0.88rem;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
}

.cd-curriculum .content p {
  margin: 0 0 8px;
}

.cd-curriculum .curriculum-intro,
.cd-curriculum .curriculum-rich {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--cd-text);
}

.cd-curriculum .curriculum-intro p,
.cd-curriculum .curriculum-rich p {
  margin: 0 0 8px;
}

/* Audience / Who Can Do */
.cd-audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.cd-audience-card {
  padding: 18px;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius);
  background: #fff;
}

.cd-audience-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cd-heading);
  margin: 0 0 12px;
}

.cd-audience-card__tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cd-tag {
  display: inline-block;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid var(--cd-border);
  border-radius: 6px;
  line-height: 1.3;
}

/* FAQ */
.cd-faq details {
  margin-bottom: 10px;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius);
  background: #fff;
}

.cd-faq summary {
  padding: 14px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cd-heading);
  cursor: pointer;
  list-style: none;
}

.cd-faq summary::-webkit-details-marker {
  display: none;
}

.cd-faq .content {
  padding: 0 18px 16px;
  font-size: 0.88rem;
  color: var(--cd-text);
  line-height: 1.6;
}

.cd-faq .faq-plain h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 16px 0 8px;
}

/* Instructor */
.cd-instructor {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.cd-instructor__avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Sidebar */
.cd-sidebar--desktop {
  position: sticky;
  top: calc(var(--cd-header-offset) + var(--cd-nav-height) + 12px);
}

.cd-sidebar-card {
  border: 2px solid var(--royal, #004a7e);
  border-radius: 16px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 74, 126, 0.08);
}

.cd-sidebar-card__title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--cd-heading);
}

.cd-sidebar-card__lead {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 16px;
}

.cd-sidebar-card__price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--cd-heading);
  margin-bottom: 14px;
}

.cd-sidebar-card__highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: var(--cd-text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cd-sidebar-card__highlights li {
  padding-left: 18px;
  position: relative;
}

.cd-sidebar-card__highlights li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}

.cd-sidebar-card__meta-label {
  font-weight: 600;
  color: var(--cd-heading);
  margin-right: 4px;
}

.cd-sidebar-card__cta {
  width: 100%;
  padding: 14px;
  font-weight: 700;
  border-radius: 10px;
  text-align: center;
}

.cd-sidebar-trust {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--cd-border);
  border-radius: var(--cd-radius);
  background: #fff;
}

.cd-sidebar-trust h4 {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--cd-heading);
}

.cd-sidebar-trust ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: var(--cd-text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cd-sidebar-trust li {
  padding-left: 18px;
  position: relative;
}

.cd-sidebar-trust li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}

.cd-empty {
  padding: 24px;
  border: 1px dashed var(--cd-border);
  border-radius: var(--cd-radius);
  color: var(--cd-text);
}

.cd-empty a {
  color: var(--royal, #004a7e);
  font-weight: 700;
}

/* Related programs */
.cd-related {
  background: var(--cd-surface);
  padding: 48px 0 100px;
  border-top: 1px solid var(--cd-border);
}

.cd-related__header {
  text-align: center;
  margin-bottom: 28px;
}

.cd-related__title {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 800;
  color: var(--cd-heading);
  margin: 0 0 8px;
}

.cd-related__subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
}

.cd-related__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.cd-related-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--cd-border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cd-related-card:hover,
.cd-related-card:focus-visible {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
  outline: none;
}

.cd-related-card__media {
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 200px;
  background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 100%);
  border-bottom: 1px solid var(--cd-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow: hidden;
}

.cd-related-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.cd-related-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
  padding: 16px 18px 18px;
  min-width: 0;
}

.cd-related-card__tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--royal, #004a7e);
  background: #eff6ff;
  padding: 3px 8px;
  border-radius: 4px;
}

.cd-related-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--cd-heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cd-related-card__meta {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.cd-related-card__cta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--royal, #004a7e);
}

.cd-related__footer {
  text-align: center;
  margin-top: 28px;
}

.cd-related__view-all {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 10px;
}

/* Responsive */
@media (max-width: 992px) {
  .cd-hero__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cd-hero__media {
    order: -1;
    width: 100%;
    max-width: 100%;
  }

  .cd-hero__media-frame {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 12px;
  }

  .cd-related__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cd-related {
    padding-bottom: 120px;
  }

  .cd-related-card__media {
    min-height: 220px;
    padding: 12px;
  }

  .cd-mobile-enroll {
    display: block;
  }

  .cd-sidebar--desktop {
    display: none;
  }

  .cd-grid {
    grid-template-columns: 1fr;
  }

  .cd-sticky-nav {
    top: var(--cd-header-offset);
  }
}

@media (min-width: 577px) and (max-width: 992px) {
  .cd-related__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .cd-hero {
    padding: 28px 0 24px;
  }

  .cd-body {
    padding: 24px 0 36px;
  }

  .cd-section {
    --cd-section-gap: 28px;
  }

  .cd-feature-grid {
    grid-template-columns: 1fr;
  }

  .cd-hero__media-frame {
    padding: 10px;
  }

  .cd-related__header {
    text-align: left;
    margin-bottom: 20px;
  }

  .cd-related-card__media {
    min-height: 200px;
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cd-sticky-nav__link,
  .cd-feature-card,
  .cd-curriculum summary::after {
    transition: none;
  }
}
