/* WordPress glue for the jl-newui templates. Not part of the static
   templates: only rules that exist because the page runs inside WordPress. */

/* Keep the sticky course bar below the admin toolbar. */
.admin-bar .jl-hdr-top {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .jl-hdr-top {
    top: 46px;
  }
}

@media (max-width: 600px) {
  .admin-bar .jl-hdr-top {
    top: 0;
  }
}

/* Card and row images are wrapped in a link to the course. */
.jl-ccard-media > a {
  display: block;
  height: 100%;
}

/* A card whose image is the provider's logo shows it whole, on white. */
.jl-ccard-media img.jl-ccard-logo {
  object-fit: contain;
  padding: 1rem;
  background-color: var(--jl-white);
}

/* The row image fills the row's height, whatever the image's own shape. */
.jl-crow-media {
  min-height: 7rem;
}

.jl-crow-media > a {
  position: absolute;
  inset: 0;
}

/* A course with no featured image shows the Jobsland mark, uncropped. */
.jl-crow-media img.jl-crow-logo {
  object-fit: contain;
  padding: 1.5rem;
  background-color: var(--jl-white);
}

@media (max-width: 767.98px) {
  .jl-crow-media img.jl-crow-logo {
    padding: 2.5rem;
  }
}

/* No results. */
.jl-ac-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background-color: var(--jl-white);
  border: 1px solid var(--jl-line);
  border-radius: var(--jl-radius);
}

.jl-ac-empty h3 {
  font-size: 1.125rem;
}

.jl-ac-empty p {
  color: var(--jl-body);
  font-size: var(--jl-fs-sm);
}

/* "Show less" turns the chevron up. */
.jl-flt-more[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* The Apply button (hidden once JavaScript runs) comes after the last
   group, so close the last group off here instead of with :last-child. */
.jl-flt .jl-flt-group:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Pages without their own template yet (index.php). */
.jl-page {
  padding: 1.5rem;
  background-color: var(--jl-white);
  border: 1px solid var(--jl-line);
  border-radius: var(--jl-radius);
}

@media (min-width: 992px) {
  .jl-page {
    padding: 2.5rem;
  }
}

/* ------------------------------------------------------------------------
 * Single course (single-course.php)
 * --------------------------------------------------------------------- */

.jl-sc-panel-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

/* Course summary: label on the left, value on the right. */
.jl-sc-facts {
  margin: 0;
}

.jl-sc-fact {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--jl-line);
}

.jl-sc-fact:first-child {
  padding-top: 0;
}

.jl-sc-fact:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.jl-sc-fact dt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--jl-body);
  font-size: var(--jl-fs-sm);
  font-weight: 500;
}

.jl-sc-fact dt svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  color: var(--jl-primary);
}

.jl-sc-fact dd {
  margin: 0;
  color: var(--jl-heading);
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .jl-sc-fact {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Section links above the course text. */
.jl-sc-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--jl-line);
}

.jl-sc-toc a {
  padding: 0.375rem 0.875rem;
  color: var(--jl-heading);
  font-size: var(--jl-fs-sm);
  font-weight: 600;
  text-decoration: none;
  background-color: var(--jl-surface);
  border: 1px solid var(--jl-line);
  border-radius: var(--jl-radius-pill);
}

.jl-sc-toc a:hover,
.jl-sc-toc a:focus-visible {
  color: var(--jl-white);
  background-color: var(--jl-primary);
  border-color: var(--jl-primary);
}

.jl-sc-text,
#jl-sc-summary,
#jl-sc-lessons,
#jl-sc-buy {
  scroll-margin-top: calc(var(--jl-sticky-top) + 1rem);
}

.jl-sc-text + .jl-sc-text {
  margin-top: 2rem;
}

/* Lesson list (Sensei modules and lessons) in the FAQ accordion style. */
.jl-sc-lessons-count,
.jl-sc-mod-count {
  color: var(--jl-muted);
  font-size: var(--jl-fs-sm);
  font-weight: 500;
}

.jl-sc-mod-count {
  margin-left: auto;
}

.jl-sc-outline .accordion-button::after {
  margin-left: 0.75rem;
}

.jl-sc-faq-acc .accordion-button {
  gap: 0.5rem;
  color: var(--jl-heading);
  font-weight: 600;
}

.jl-sc-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
}

.jl-sc-lesson {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--jl-line);
}

.jl-sc-lesson:first-child {
  border-top: 0;
}

.jl-sc-lesson > svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  color: var(--jl-muted);
}

.jl-sc-lesson.is-done > svg {
  color: var(--jl-green);
}

.jl-sc-lesson a {
  color: var(--jl-heading);
  font-weight: 500;
}

.jl-sc-lesson a:hover {
  color: var(--jl-primary);
}

.jl-sc-lesson-len {
  margin-left: auto;
  color: var(--jl-muted);
  font-size: var(--jl-fs-xs);
  white-space: nowrap;
}

/* Enrol box. */
.jl-sc-buy-tag {
  color: var(--jl-body);
  font-size: var(--jl-fs-sm);
}

.jl-sc-buy-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.jl-sc-buy-cart svg {
  width: 1.125rem;
  height: 1.125rem;
}

.jl-sc-buy-row small {
  display: block;
  color: var(--jl-muted);
  font-size: var(--jl-fs-xs);
}

.jl-sc-buy-note {
  color: var(--jl-body);
  font-size: var(--jl-fs-sm);
}

.jl-sc-buy-note .jl-auth-go {
  padding: 0;
  color: var(--jl-primary);
  font-weight: 600;
  background: none;
  border: 0;
  text-decoration: underline;
}

.jl-sc-buy-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--jl-green);
  font-weight: 700;
}

.jl-sc-buy-status svg {
  width: 1.25rem;
  height: 1.25rem;
}

.jl-sc-progress {
  margin-bottom: 1rem;
  color: var(--jl-heading);
}

.jl-sc-progress .progress {
  --bs-progress-bar-bg: var(--jl-primary);
  --bs-progress-bg: var(--jl-surface);
  height: 0.5rem;
}

.jl-share-btn.is-copied {
  color: var(--jl-white);
  background-color: var(--jl-green);
}

/* Sensei's notices ("You're enrolled", prerequisites). */
.jl-sc-notices .sensei-message {
  margin: 0 0 0.5rem;
  padding: 0.875rem 1.25rem;
  color: var(--jl-heading);
  font-size: var(--jl-fs-sm);
  background-color: var(--jl-primary-soft);
  border: 0;
  border-radius: var(--jl-radius-sm);
}
