/* Equal-height course cards. Full syllabuses open in a larger detail view. */
.course-page .courses-section {
  padding: clamp(36px, 5vw, 64px) 0 64px;
  border-top: 1px solid #e1e8f2;
  background: #f5f8fc;
  overflow: visible;
}
.course-page .section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 32px;
  text-align: center;
}
.course-page .section-heading h1 {
  margin: 0;
  color: #0b2e55;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -.035em;
}
.course-page .section-heading p {
  flex-basis: 100%;
  min-width: 100%;
  margin: 0;
  color: #526780;
  font-size: 16px;
  line-height: 1.7;
}
.course-page .heading-line { width: 28px; height: 2px; background: #b9cce4; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(260px, calc(25% - 18px))), 1fr)); gap: 24px; }
.course-page .course-card {
  --accent: #1261d4;
  position: relative;
  display: grid;
  grid-template-rows: 44px 56px minmax(0, 1fr) 96px;
  gap: 14px;
  min-width: 0;
  height: 500px;
  min-height: 0;
  padding: 20px;
  border: 1px solid #dbe5f2;
  border-top: 3px solid var(--accent);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(15, 47, 82, .04);
  scroll-margin-top: 120px;
  transition: border-color .2s, box-shadow .2s;
}
.course-page .course-card:hover,
.course-page .course-card:focus-within {
  border-color: #9dbceb;
  box-shadow: 0 12px 30px rgba(15, 47, 82, .09);
}
.course-card__top { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-width: 0; }
.course-page .course-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #1261d4;
  background: #edf4ff;
  font-size: 22px;
}
.course-card__duration {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: #465d79;
  font-size: 13px;
  font-weight: 600;
}
.course-card__duration i { flex-shrink: 0; color: #1261d4; }
.course-card__duration span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-page .course-card h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: #0b2e55;
  font-size: 20px;
  font-weight: 750;
  line-height: 28px;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.course-card__preview { min-height: 0; overflow: hidden; }
.course-card__preview h3 {
  margin: 0 0 12px;
  color: #526780;
  font-size: 11px;
  font-weight: 750;
  line-height: 16px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.course-card__topics { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.course-card__topics li {
  position: relative;
  min-height: 0;
  padding-left: 15px;
  color: #405975;
  font-size: 14px;
  line-height: 19px;
}
.course-card__topics li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1261d4;
}
.course-card__topics li span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.course-card__more { margin: 10px 0 0; color: #1261d4; font-size: 12px; line-height: 18px; font-weight: 600; }
.course-card__empty { color: #526780; font-size: 15px; line-height: 1.7; }
.course-card__actions { display: grid; grid-template-rows: 44px 44px; gap: 8px; }
.course-page :is(.course-expand-btn, .enquire-btn, .course-detail-back) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #cbdcf3;
  border-radius: 8px;
  background: #fff;
  color: #164e99;
  font: inherit;
  font-size: 14px;
  line-height: 22px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.course-page .course-expand-btn:hover, .course-page .course-detail-back:hover { border-color: #1261d4; background: #f0f6ff; }
.course-page .enquire-btn { border-color: #1261d4; background: #1261d4; color: #fff; }
.course-page .enquire-btn:hover { border-color: #084ba9; background: #084ba9; color: #fff; }
.course-page :is(.course-expand-btn, .enquire-btn, .course-detail-back, .course-detail-close):focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }
.course-empty { grid-column: 1 / -1; margin: 0; padding: 32px 20px; border: 1px solid #dbe5f2; border-radius: 16px; background: #fff; color: #405975; text-align: center; }

/* Native details remain usable if the enhancement script cannot load. */
.course-expand > summary { list-style: none; }
.course-expand > summary::-webkit-details-marker { display: none; }
.course-expand__hide, .course-expand[open] .course-expand__show { display: none; }
.course-expand[open] .course-expand__hide { display: inline; }
.course-expand[open] > summary svg { transform: rotate(-90deg); }
.course-expand[open] > .course-full-content {
  position: absolute;
  z-index: 1;
  inset: 180px 16px 120px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #fff;
  scrollbar-width: thin;
}
.course-expand .course-detail__sections { display: block; }
.course-expand .course-detail__section + .course-detail__section { margin-top: 20px; }

/* The larger view keeps the catalogue cards at their original height. */
.course-detail-dialog {
  inset: 0;
  width: min(980px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid #d2dfef;
  border-radius: 20px;
  background: #fff;
  color: #183d63;
  box-shadow: 0 28px 100px rgba(6, 29, 60, .3);
}
.course-detail-dialog::backdrop { background: rgba(7, 26, 51, .65); }
.course-detail-dialog__layout { display: flex; flex-direction: column; max-height: min(800px, calc(100dvh - 48px)); }
.course-detail-dialog__header { display: flex; flex-shrink: 0; align-items: flex-start; justify-content: space-between; gap: 16px; max-height: 40dvh; overflow: auto; padding: 26px 28px; border-bottom: 1px solid #dbe5f2; background: #f4f8ff; }
.course-detail-dialog__header > div { min-width: 0; }
.course-detail-dialog__eyebrow { margin: 0 0 7px; color: #1261d4; font-size: 11px; font-weight: 750; letter-spacing: .1em; }
.course-detail-dialog__header h2 { margin: 0; color: #0b2e55; font-size: clamp(22px, 3vw, 30px); line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.course-detail-dialog__header h2:focus { outline: none; }
.course-detail-close { position: sticky; top: 0; display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #cbdcf3; border-radius: 50%; background: #fff; color: #0b2e55; cursor: pointer; }
.course-detail-close:hover { background: #e6effd; }
.course-detail-dialog__body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px 28px 28px; scrollbar-gutter: stable; }
.course-detail-dialog__body:focus-visible { outline: 2px solid #1261d4; outline-offset: -4px; }
.course-detail__duration { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin: 0 0 24px; color: #405975; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.course-detail__duration i { color: #1261d4; }
.course-detail__sections { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.course-detail__section:only-child { grid-column: 1 / -1; }
.course-detail__section { min-width: 0; }
.course-detail__section h3 { margin: 0 0 16px; color: #0b2e55; font-size: 18px; font-weight: 750; line-height: 1.4; }
.course-detail__list { display: grid; gap: 10px; margin: 0; padding-left: 20px; list-style: disc outside; color: #405975; font-size: 16px; line-height: 1.65; }
.course-detail__list li { padding-left: 3px; overflow-wrap: anywhere; }
.course-detail__list li::marker { color: #1261d4; }
.course-detail__section--job_profile { padding: 20px; border: 1px solid #dbe5f2; border-radius: 12px; background: #f7faff; }
.course-detail-dialog__footer { display: flex; flex-shrink: 0; justify-content: space-between; gap: 12px; padding: 18px 28px; border-top: 1px solid #dbe5f2; background: #fff; }
.course-page .course-detail-dialog__footer > button { width: auto; min-width: 160px; }
.course-page.course-details-open { overflow: hidden; }
.course-page:is(.course-details-open, .modal-open) :is(.whatsapp-float, .back-to-top) { visibility: hidden; }

@media (max-width: 1279.98px) { .course-grid { gap: 20px; } }
@media (max-width: 991.98px) { .course-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); } }
@media (max-width: 599.98px) {
  .course-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .course-page .courses-section { padding: 30px 6px 40px; }
  .course-page .section-heading { gap: 10px; margin-bottom: 24px; }
  .course-page .section-heading p { font-size: 15px; }
  .course-page .heading-line { display: none; }
  .course-page .course-card { padding: 20px; }
  .course-detail-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 24px); border-radius: 16px; }
  .course-detail-dialog__layout { max-height: calc(100dvh - 24px); }
  .course-detail-dialog__header { gap: 10px; padding: 18px 16px; }
  .course-detail-dialog__body { padding: 20px 16px; }
  .course-detail__sections { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .course-detail__section--job_profile { padding: 16px; }
  .course-detail-dialog__footer { gap: 8px; padding: 14px 12px; }
  .course-page .course-detail-dialog__footer > button { flex: 1; min-width: 0; padding: 10px 8px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .course-page .course-card { transition: none; } }

/* Course enquiries keep their actions visible in short viewports. */
.course-page #enquiryModal { z-index: 99999; }
.course-page .modal-backdrop { z-index: 99998; }
.course-page #enquiryModal .modal-dialog {
  width: calc(100% - 32px);
  max-width: 800px;
  min-height: calc(100dvh - 32px);
  margin: 16px auto;
}
.course-page #enquiryModal .modern-modal {
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 25px 70px rgba(4, 35, 70, .25);
}
.course-page #enquiryForm { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.course-page #enquiryModal .modal-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  flex-shrink: 0;
  align-items: center;
  gap: 14px;
  padding: 24px;
  color: #fff;
  background: #0c3767;
}
.course-page #enquiryModal .modal-brand-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  background: rgba(255,255,255,.1);
  font-size: 22px;
}
.course-page #enquiryModal .modal-top span { display: block; margin: 0 0 5px; color: #c9dcf5; font-size: 10px; font-weight: 700; line-height: 1.5; letter-spacing: .1em; }
.course-page #enquiryModal .modal-top h2 { margin: 0; color: #fff; font-size: 26px; font-weight: 750; line-height: 1.25; }
.course-page #enquiryModal .modal-top p { margin: 6px 0 0; color: #d8e6f7; font-size: 14px; line-height: 1.5; }
.course-page #enquiryModal .modal-close {
  display: grid;
  place-items: center;
  align-self: start;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.course-page #enquiryModal .modal-close:hover { background: rgba(255,255,255,.18); }
.course-page #enquiryModal .modern-body {
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #a3bad8 #f4f8ff;
  padding: 24px;
  background: #fff;
}
.course-page #enquiryModal .modern-body::-webkit-scrollbar-thumb { background: #a3bad8; border-radius: 8px; }
.course-page #enquiryModal .selected-course { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid #dbe5f2; border-radius: 12px; background: #f4f8ff; }
.course-page #enquiryModal .selected-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; color: #1261d4; background: #e6efff; font-size: 21px; }
.course-page #enquiryModal .selected-course > div:last-child { min-width: 0; }
.course-page #enquiryModal .selected-course small { display: block; color: #526780; font-size: 10px; font-weight: 700; line-height: 1.5; letter-spacing: .08em; }
.course-page #enquiryModal .selected-course strong { display: block; margin-top: 3px; color: #0b2e55; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.course-page #enquiryModal .modern-label { display: block; margin: 0 0 7px; color: #274b70; font-size: 14px; font-weight: 700; line-height: 1.5; }
.course-page #enquiryModal .modern-label span { color: #c73545; }
.course-page #enquiryModal .input-wrap { position: relative; }
.course-page #enquiryModal .input-wrap > i { position: absolute; z-index: 2; left: 14px; top: 50%; transform: translateY(-50%); color: #567797; font-size: 16px; pointer-events: none; }
.course-page #enquiryModal .textarea-wrap > i { top: 16px; transform: none; }
.course-page #enquiryModal .modern-input { min-height: 46px; padding-left: 40px; border: 1px solid #cbd8e7; border-radius: 9px; color: #183d63; background: #fbfdff; font-size: 16px; line-height: 1.5; }
.course-page #enquiryModal textarea.modern-input { padding-top: 12px; resize: vertical; }
.course-page #enquiryModal .modern-input:focus { border-color: #1261d4; background: #fff; box-shadow: 0 0 0 3px rgba(18,97,212,.15); }
.course-page #enquiryModal .captcha-refresh-btn { min-height: 44px; font-size: 13px; }
.course-page #enquiryModal .captcha-answer { min-height: 46px; font-size: 16px; }
.course-page #enquiryModal .modern-footer { display: flex; flex-shrink: 0; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid #dbe5f2; background: #fff; }
.course-page #enquiryModal :is(.back-btn,.modern-submit) { min-height: 46px; padding: 10px 18px; border: 1px solid #cbd8e7; border-radius: 8px; color: #405975; background: #fff; font-size: 14px; line-height: 24px; font-weight: 700; }
.course-page #enquiryModal .back-btn:hover { color: #164e99; background: #f0f6ff; }
.course-page #enquiryModal .modern-submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-color: #1261d4; background: #1261d4; color: #fff; }
.course-page #enquiryModal .modern-submit:hover { border-color: #084ba9; background: #084ba9; color: #fff; }
.course-page #enquiryModal :is(.modal-close,.back-btn,.modern-submit,.captcha-refresh-btn):focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }
@media (max-width: 575.98px) {
  .course-page #enquiryModal .modal-dialog { width: calc(100% - 20px); min-height: calc(100dvh - 20px); margin: 10px auto; }
  .course-page #enquiryModal .modern-modal { max-height: calc(100dvh - 20px); border-radius: 16px; }
  .course-page #enquiryModal .modal-top { grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; padding: 18px 16px; }
  .course-page #enquiryModal .modal-brand-icon { display: none; }
  .course-page #enquiryModal .modal-top h2 { font-size: 23px; }
  .course-page #enquiryModal .modal-top span { font-size: 9px; }
  .course-page #enquiryModal .modern-body { padding: 18px 16px; scrollbar-gutter: auto; }
  .course-page #enquiryModal .modern-footer { gap: 8px; padding: 12px 16px; }
  .course-page #enquiryModal :is(.back-btn,.modern-submit) { padding: 10px 14px; font-size: 13px; }
  .course-page #enquiryModal .back-btn { flex: 0 0 auto; }
  .course-page #enquiryModal .modern-submit { flex: 1 1 auto; }
}
@media (max-height: 450px) {
  .course-page #enquiryModal .modal-top { padding-top: 12px; padding-bottom: 12px; }
  .course-page #enquiryModal .modal-top :is(span,p) { display: none; }
  .course-page #enquiryModal .modern-footer { padding-top: 10px; padding-bottom: 10px; }
}
