/* =====================================================================
   People Skills Development: course pages.

   Hand-written, like native-adapters.css: the demo has no course page,
   so nothing here is generated. It dresses templates/single-psd_course.html,
   borrowing pathway.css's page head (B) and prose (D) and the course
   card's look from register.css. It also loads on the Courses page, for
   the links from there to each course page.

   A  Stage colour   the course's pathway stage, a body class
   B  Head           the code above the title
   C  Columns        the description beside the side panel
   D  Side panel     audience, registration status, funding
   E  Course links   course names on the Courses page
   F  Media          classroom photos and the teaching video
   G  Menu           Courses marked as the current section
   H  Sessions       the open sessions under the tagline
   ===================================================================== */


/* ---------------------------------------------------------------------
   A  Stage colour
   inc/courses.php puts course-stage-<slug> on <body>. The colours mirror
   pathway.css block A, which keys the same six off the home panels'
   classes; change both together.
   --------------------------------------------------------------------- */
.course-stage-assessment  { --stage: #4a3f9c; }
.course-stage-leaders     { --stage: #0d7a72; }
.course-stage-people      { --stage: #1058aa; }
.course-stage-system      { --stage: #a76a06; }
.course-stage-development { --stage: #a76a06; }
.course-stage-partner     { --stage: #1058aa; }


/* ---------------------------------------------------------------------
   B  Head
   A bound detail with no value prints an empty paragraph; it takes no
   room.
   --------------------------------------------------------------------- */
.page-course .course-code {
  grid-column: 1;
  margin: 0 0 .35rem;
  font-family: var(--f-display);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--stage, var(--c-navy));
}
.page-course .course-code:empty,
.page-course .page-sub:empty,
.page-course .course-audience:empty,
.page-course .course-price:empty { display: none; }


/* ---------------------------------------------------------------------
   C  Columns
   The description takes the wide track; the panel stays in view beside
   it, and drops below it under 860px.
   --------------------------------------------------------------------- */
.course-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.course-body > * + * { margin-top: clamp(1rem, 2vw, 1.4rem); }
.course-body h2 { margin-top: clamp(1.75rem, 3vw, 2.5rem); }
@media (max-width: 860px) {
  .course-cols { grid-template-columns: minmax(0, 1fr); }
}


/* ---------------------------------------------------------------------
   D  Side panel
   --------------------------------------------------------------------- */
.course-aside {
  position: sticky;
  top: 1.5rem;
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border-top: 4px solid var(--stage, var(--c-navy));
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--c-paper);
}
@media (max-width: 860px) {
  .course-aside { position: static; }
}
.course-aside p { margin: 0; }
.course-aside-label,
.course-status-label {
  font-family: var(--f-display);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-muted);
}
/* Each label goes with its value */
.course-aside-label:has(+ .course-audience:empty),
.course-aside-label:has(+ .course-price:empty) { display: none; }
.course-audience,
.course-price { margin-top: -.6rem !important; color: var(--c-ink); }
.course-price { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--c-navy-deep); }

.course-status {
  display: grid;
  gap: .5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-line);
}
.course-status.is-open .course-status-label { color: var(--stage, var(--c-navy)); }
.course-status-when {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-navy-deep);
}
.course-status-text { color: var(--c-ink); }
/* One block per open session: its date line, then its Register button. */
.course-status-session { display: grid; gap: .35rem; }
.course-status-session + .course-status-session { padding-top: .5rem; border-top: 1px dashed var(--c-line); }
.course-status-action { margin-top: .35rem !important; }

/* The grant note is a shared block (psd/shared) with its own label above it; the rule goes over the label. */
.course-funding-label { padding-top: 1rem; border-top: 1px solid var(--c-line); }
.course-funding {
  margin-top: -.6rem !important;
  font-size: .92rem;
  color: var(--c-muted);
}


/* ---------------------------------------------------------------------
   E  Course links
   A course name on the Courses page that has a page of its own keeps
   the name's colour and weight, and shows itself with an underline.
   --------------------------------------------------------------------- */
.course-page-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
.course-page-link:hover { color: var(--c-navy); text-decoration-thickness: 2px; }


/* ---------------------------------------------------------------------
   F  Media
   A course's classroom photo runs the width of the description; the
   teaching video is a phone recording, upright, so it keeps to a
   narrow column rather than filling the track.
   --------------------------------------------------------------------- */
.course-body .course-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.course-body .course-photo { margin-inline: 0; }
.course-body .course-video { margin-inline: 0; max-width: 22rem; }
.course-body .course-video video { display: block; width: 100%; border-radius: var(--radius); background: var(--c-navy-ink); }
/* WordPress reads a phone recording's stored frame (640 x 480) without its rotation and prints
   that as an inline size and aspect ratio; the browser plays it upright, so let it size itself. */
.course-body .course-video video { height: auto !important; aspect-ratio: auto !important; }

/* The instructor's head-and-shoulders photo sits small above his title, not across the column. */
.course-body .course-instructor-photo { margin-inline: 0; max-width: 9rem; }
.course-body .course-instructor-photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.course-instructor-role { font-weight: 600; color: var(--c-navy-deep); }

/* ---------------------------------------------------------------------
   G  Menu
   On a course page inc/navigation.php marks the Courses item
   aria-current="true", the current section, where site.css styles only
   "page". These restate site.css's current-item rules for that value;
   opacity holds the underline under its reduced-motion rule too.
   --------------------------------------------------------------------- */
.site-nav a[aria-current="true"] { font-weight: 700; }
.site-nav a[aria-current="true"]::after { transform: scaleX(1); opacity: 1; }


/* ---------------------------------------------------------------------
   H  Sessions
   psd/course-sessions lists each open session under the tagline: its
   dates large, the times, place, format, fee and seats left under them,
   and its Register button to the side, dropping below on phones.
   --------------------------------------------------------------------- */
.course-sessions-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.course-session {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--stage, var(--c-navy));
  border-radius: var(--radius);
  background: var(--c-white);
}
.course-session-body { min-width: 0; }
.course-session p { margin: 0; }
.course-session-dates {
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-navy-deep);
}
.course-session-meta { font-size: .95rem; color: var(--c-muted); }

