/* ==========================================================================
   Page: course
   ========================================================================== */

/* Course detail pages: course-itqan, course-tajweed, course-islamic, course-arabic, course-literacy
   Hero + facts · sticky section tabs · content column + sticky booking card · timeline · related courses.
   The design leaves most single-line labels at the font's own line height, hence `line-height: normal`.
   Some min-heights look odd (84px summary, 70px cohort row, 53px link): the design used content-box
   sizing, so min-height + padding + border is what it actually renders. */

.course-page {
  --course-hairline: #E6EEF5;
  --course-tag-ink: #105A8D;
  --course-rail: #C9DCEC;
  --course-avatar-bg: #DCEBF7;
  --course-avatar-ink: #4F7FA6;
  --course-tabs-h: 56px;
  --course-sticky-offset: calc(var(--sticky-top) + var(--course-tabs-h) + 16px);
  line-height: normal;
}
.course-page .pill { line-height: normal; }

/* Hero ------------------------------------------------------------------- */
.course-hero__inner { padding-block: 32px 36px; }
.course-hero__badge { padding: 6px 12px; font-size: 13px; }
.course-hero__badge--spec { color: var(--course-tag-ink); }
.course-hero__title { line-height: 1.3; }
.course-hero__lead { max-width: var(--lead-max, 760px); }

.course-facts {
  margin-top: 10px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  overflow: hidden;
}
.course-facts__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 18px;
  border-left: 1px solid var(--course-hairline);
}
.course-facts dt { font-size: 12.5px; font-weight: 700; color: var(--c-text-3); }
.course-facts dd { font-size: 15.5px; font-weight: 700; }

/* Section tabs (sticky under the compact header) ------------------------- */
.course-tabs {
  position: sticky;
  top: var(--sticky-top);
  z-index: 20;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 4px 12px rgba(10, 63, 101, 0.05);
}
.course-tabs__inner {
  height: var(--course-tabs-h);
  display: flex;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.course-tabs__inner::-webkit-scrollbar { display: none; }
.course-tabs__link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 14px;
  color: var(--c-text-2);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.course-tabs__link:hover { color: var(--c-navy); background: var(--c-pale-2); }
.course-tabs__link[aria-current="true"] {
  color: var(--c-navy);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--c-primary);
}
.course-tabs__link:focus-visible { outline-offset: -3px; }

/* Layout: content column + booking card ---------------------------------- */
.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas: "content book";
  gap: 48px;
  align-items: start;
  padding-block: 48px 72px;
}
.course-content { grid-area: content; display: flex; flex-direction: column; gap: 56px; min-width: 0; }
/* Clear the sticky bars on #anchor jumps: html's scroll-padding-top (compact header + 16px) + the tabs
   = header + the design's 72px (56px tabs + 16px). */
.course-page section[id] { scroll-margin-top: var(--course-tabs-h); }

.course-section { display: flex; flex-direction: column; gap: 18px; }
.course-section__head { display: flex; flex-direction: column; gap: 8px; }
.course-section__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.course-page .course-section__title { line-height: normal; }
.course-section__lead { font-size: 16px; line-height: 1.7; color: var(--c-text-2); }
.course-section__lead strong { color: var(--c-ink); }

/* Overview (all course pages): about text · outcomes box · "is it for you" cards */
.course-about__text { font-size: 16.5px; line-height: 1.9; color: var(--c-text-2); }
.course-about__sub { margin-top: 16px; font-size: 20px; font-weight: 800; }

.course-outcomes {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  background: var(--c-pale-2);
  border: 1px solid var(--course-hairline);
  border-radius: var(--radius-lg);
}
.course-outcomes__title { font-size: 20px; font-weight: 800; }
.course-outcomes__list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.course-outcomes__item { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; line-height: 1.7; }
.course-outcomes__item svg { margin-top: 5px; color: var(--c-gold); }

.course-fit { list-style: none; }
.course-fit__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 18px;
  background: var(--c-pale-2);
  border-radius: var(--radius-lg);
  text-align: center;
  font-size: 15.5px;
  line-height: 1.7;
}
.course-fit__card svg { color: var(--c-primary); }

/* Curriculum meta chips + week timeline ---------------------------------- */
.course-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.course-meta__item { padding: 7px 12px; font-size: 13.5px; line-height: normal; }

.course-weeks { list-style: none; display: flex; flex-direction: column; }
.course-week {
  display: grid;
  grid-template-columns: 128px 36px minmax(0, 1fr);
  grid-template-areas: "when rail body";
  column-gap: 14px;
}
.course-week__when { grid-area: when; display: flex; flex-direction: column; gap: 2px; padding-top: 22px; }
.course-week__num { font-size: 12.5px; font-weight: 700; color: var(--c-primary); }
.course-week__date { font-size: 14.5px; font-weight: 700; }
.course-week__rail { grid-area: rail; position: relative; display: flex; justify-content: center; }
.course-week__rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--course-rail);
}
.course-week:first-child .course-week__rail::before { top: 39px; }
.course-week:last-child .course-week__rail::before { bottom: calc(100% - 39px); }
.course-week__dot {
  position: relative;
  width: 34px;
  height: 34px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--c-primary);
  color: var(--c-white);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 0 0 5px var(--c-white);
}
.course-week--final .course-week__dot { background: var(--c-gold); }
.course-week__body { grid-area: body; padding: 10px 0 12px; }
.course-week__card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: 14px;
}
.course-week__card--key { background: var(--c-cream); border-color: var(--c-gold-border); }
.course-week__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.course-page .course-week__title { font-size: 17.5px; font-weight: 800; line-height: 1.5; }
.course-week__text { font-size: 15px; line-height: 1.8; color: var(--c-text-2); }
.course-week__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.course-week__tags li {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--c-pale);
  color: var(--course-tag-ink);
  font-size: 12.5px;
}

/* Team, extras ----------------------------------------------------------- */
.course-team, .course-extras { list-style: none; }
.course-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
}
.course-avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--course-avatar-bg);
  color: var(--course-avatar-ink);
}
.course-avatar--lg { width: 96px; height: 96px; }
/* A trainer photo from the dashboard fills the round avatar. */
.course-avatar > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.course-person__text { display: flex; flex-direction: column; gap: 2px; }
.course-person__name { font-size: 15.5px; font-weight: 700; }
.course-person__role { font-size: 13.5px; color: var(--c-text-2); }

.course-extra {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--c-pale-2);
  border-radius: 14px;
}
.course-extra__title { font-size: 15.5px; font-weight: 700; }
.course-extra__text { font-size: 14px; line-height: 1.6; color: var(--c-text-2); }
.course-extras__terms { font-size: 13.5px; }

/* Certificate ------------------------------------------------------------ */
.course-cert__text { display: flex; flex-direction: column; gap: 12px; }
.course-cert__lead { font-size: 15.5px; line-height: 1.8; color: var(--c-text-2); }
.course-cert__steps { display: flex; flex-direction: column; gap: 6px; padding-inline-start: 20px; font-size: 15px; line-height: 1.7; }

/* FAQ -------------------------------------------------------------------- */
.course-faq { gap: 14px; }
.course-faq .accordion { gap: 14px; }
.course-faq .accordion summary { min-height: 84px; } /* 56px + 2 × 14px padding, as designed */

/* Specialised courses: teacher, comparison, related ---------------------- */
.course-section--tight { gap: 16px; }
.course-page :is(.course-about__sub, .course-outcomes__title, .course-teacher__name, .course-compare__title) { line-height: normal; }

.course-teacher {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
}
.course-teacher__info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.course-teacher__id { display: flex; flex-direction: column; gap: 2px; }
.course-teacher__name { font-family: var(--font-head); font-size: 21px; font-weight: 800; }
.course-teacher__role { font-size: 15px; color: var(--c-text-2); }
.course-teacher .text-link { align-self: flex-start; }

.course-bullets { display: flex; flex-direction: column; gap: 6px; padding-inline-start: 18px; font-size: 15px; line-height: 1.7; color: var(--c-text-2); }

.course-compare {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}
.course-compare--current { border: 1.5px solid var(--c-primary); }
.course-compare__title { font-family: var(--font-head); font-size: 18px; font-weight: 800; }
.course-compare .text-link { align-self: flex-start; }

.course-faq--spec { gap: 12px; }
.course-faq--spec .accordion { gap: 12px; }
.course-faq--spec .course-section__title { margin-bottom: 4px; }

.course-related__inner { display: flex; flex-direction: column; gap: 20px; padding-block: 56px 64px; }
.course-page .course-related__title { font-size: 26px; line-height: normal; }
.course-related__card { display: flex; flex-direction: column; gap: 8px; padding: 22px; }
.course-related__kind { font-size: 12.5px; font-weight: 700; color: var(--c-primary); }
.course-related__name { font-family: var(--font-head); font-size: 19px; font-weight: 800; }
.course-related__meta { font-size: 14px; color: var(--c-text-2); }
.course-related__more { margin-top: 6px; color: var(--c-primary); font-size: 14.5px; font-weight: 700; }

/* Booking card ----------------------------------------------------------- */
.course-book {
  grid-area: book;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--c-white);
  border: 1.5px solid var(--c-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel);
}
/* Sticky only when the window is tall enough to show the booking button while stuck. */
@media (min-width: 901px) and (min-height: 800px) {
  .course-book { position: sticky; top: var(--course-sticky-offset); }
}

.course-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.course-price__now { font-family: var(--font-head); font-size: 36px; font-weight: 900; white-space: nowrap; }
.course-price__was { font-size: 16px; color: var(--c-text-3); white-space: nowrap; }
.course-price__off { align-self: baseline; padding: 3px 8px; }
.course-book__pay { margin-top: -8px; font-size: 13.5px; color: var(--c-text-2); }
.course-book__perks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: -4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-success-ink);
}

.course-cohorts { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.course-cohorts__legend { margin-bottom: 8px; font-size: 14.5px; font-weight: 700; }
.course-cohort { min-height: 70px; gap: 10px; padding: 8px 14px; border-radius: var(--radius); }
.course-cohort__text { display: flex; flex-direction: column; flex-grow: 1; }
.course-cohort__name { font-size: 15px; font-weight: 700; }
.course-cohort__note { font-size: 13px; color: var(--c-text-2); }
.course-cohort__tag { align-self: center; padding: 3px 8px; font-size: 12px; }

.course-book__soon {
  padding: 12px 14px;
  background: var(--c-pale-2);
  border: 1px dashed #9DB7CC;
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.6;
}
.course-book__refund { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.6; color: var(--c-text-2); }
.course-book__refund svg { color: var(--c-success); }
.course-book__wa {
  justify-content: center;
  padding-top: 8px;
  border-top: 1px solid var(--course-hairline);
  min-height: 53px;
  color: var(--c-success);
  font-size: 14.5px;
}
.course-book__wa:hover { color: var(--c-success-ink); }

/* Closing band ----------------------------------------------------------- */
.course-page .course-cta .cta-band__title { line-height: normal; }

/* Mobile sticky bar ------------------------------------------------------ */
.course-sticky .sticky-cta__text { min-width: 0; }
.course-sticky .btn { padding-inline: 16px; }
.course-sticky .sticky-cta__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .course-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 32px; }
  /* Facts: tidy 3 × 2 instead of an orphaned last cell */
  .course-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .course-facts__item:nth-child(n + 4) { border-top: 1px solid var(--course-hairline); }
}

@media (max-width: 900px) {
  .course-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "book" "content";
    gap: 40px;
    padding-block: 32px 56px;
  }
}

@media (max-width: 720px) {
  .course-hero__inner { padding-block: 24px 28px; }
  .course-page .course-section__title { line-height: 1.4; }
  .course-content { gap: 44px; }
  .course-book { padding: 20px; }

  .course-week {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas: "rail when" "rail body";
    column-gap: 12px;
  }
  .course-week__when { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding-top: 28px; }
  .course-week__body { padding-top: 8px; }
  .course-week__card { padding: 14px 16px; }

  .course-outcomes { padding: 20px; }
  .course-teacher { flex-direction: column; gap: 16px; padding: 20px; }
  .course-related__inner { padding-block: 44px 48px; }
  .course-page .course-cta .cta-band__title { font-size: 24px; line-height: 1.4; }
}

@media (max-width: 600px) {
  .course-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-facts__item:nth-child(n + 3) { border-top: 1px solid var(--course-hairline); }
}

/* Section titles: the course pages reuse the about page's .about-title (also in about.css).
   Kept last so it still comes after the course rules, as in the single stylesheet. */
.about-title { font-size: 30px; line-height: normal; }
@media (max-width: 720px) {
  .about-title { font-size: 26px; }
}
