/* ==========================================================================
   Shared sections — used on more than one page
   (Home, Hot Deals, Single Course, Prime Membership, ...)
   Each page adds its own unique id + class on the <section> for spacing tweaks.
   ========================================================================== */

/* ---------- Logo slider (accreditation + organisations) ---------- */
.ts-logo-slider {
  overflow: hidden;
  padding: 10px 0 26px;
}

.ts-logo-slider__track {
  display: flex;
  gap: 48px;
  will-change: transform;
}

.ts-logo-slider__track > * {
  flex: 0 0 auto;
  transition: transform 0.6s ease;
}

/* ---------- Draggable carousel (JS: initCarousel) ---------- */
.ts-carousel {
  cursor: grab;
  touch-action: pan-y; /* vertical page scroll still works on touch */
  user-select: none;
  -webkit-user-select: none;
}

.ts-carousel.is-dragging {
  cursor: grabbing;
}

.ts-carousel:focus-visible {
  outline: 2px solid var(--ts-orange);
  outline-offset: 4px;
}

.ts-carousel img {
  -webkit-user-drag: none;
  pointer-events: none;
}

/* No item animations while the loop silently jumps back to the middle copy */
.is-jumping > * {
  transition: none !important;
}

/* ---------- News ticker (JS: initTicker) ---------- */
.ts-ticker {
  --ticker-gap: 71px;
  overflow: hidden;
  padding: 10px 0 26px;
}

.ts-ticker__track {
  display: flex;
  width: max-content;
  animation: tsTicker var(--ticker-duration, 40s) linear infinite;
  will-change: transform;
}

.ts-ticker__track > * {
  flex: 0 0 auto;
  margin-right: var(--ticker-gap);
}

@keyframes tsTicker {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-1 * var(--ticker-shift, 50%))); }
}

@media (prefers-reduced-motion: reduce) {
  .ts-ticker {
    overflow-x: auto;
  }

  .ts-ticker__track {
    animation: none;
  }
}

/* ---------- Courses accreditation ---------- */
.ts-accreditation {
  padding-top: 18px;
}

.ts-accreditation__title {
  margin-bottom: 30px;
}

.ts-accreditation__box {
  width: 257px;
  height: 198px;
  padding: 28px 18px;
}

/* ---------- Organisations we've supported ---------- */
.ts-organisations {
  padding-top: 10px;
}

.ts-organisations__title {
  margin-bottom: 32px;
}


.ts-organisations__box {
  width: 262px;
  height: 196px;
  padding: 30px 24px;
  box-shadow: 6px 12px 16px rgba(0, 0, 0, 0.16);
}

/* ---------- Trending courses (cream band + 4-col grid) ---------- */
.ts-trending {
  padding: 16px 0 36px;
  background: var(--ts-cream);
}

.ts-trending__title {
  margin-bottom: 40px;
}

.ts-trending__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 22px;
}

/* ---------- Certificate offer ---------- */
.ts-certificate {
  position: relative;
  padding: 90px 0 40px;
}

.ts-certificate__bg {
  position: absolute;
  left: 0;
  right: 0;
  top: 109px;
  height: 325px;
  background-position: calc(50% - 368px) 0;
}

.ts-certificate__frame {
  position: relative;
  width: 344px;
  height: 412px;
  margin-left: 83px;
  padding: 10px;
  border: 1.5px solid transparent;
  border-radius: 46px 0 46px 0;
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--ts-gradient) border-box;
}

.ts-certificate__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 32px 0 40px 0;
  box-shadow: 10px 12px 18px rgba(0, 0, 0, 0.2);
}

.ts-certificate__content {
  padding-left: 3px;
}

.ts-certificate__title {
  font-family: var(--ts-font-body);
  font-weight: 300;
  font-size: 33px;
  line-height: 38px;
  max-width: 420px;
  margin: 0 0 40px;
}

.ts-certificate__title strong {
  font-weight: 600;
}

.ts-certificate__title b {
  font-weight: 500;
}

.ts-certificate__lead {
  font-weight: 500;
  font-size: 17px;
  margin: 0 0 12px 7px;
}

.ts-certificate__list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 7px;
}

.ts-certificate__list li {
  font-weight: 300;
  font-size: 16px;
  line-height: 26px;
}

.ts-certificate__list .bi {
  font-size: 14px;
  margin-right: 3px;
  -webkit-text-stroke: 0.6px;
}

.ts-certificate__btn {
  width: 260px;
  margin-left: 5px;
}

/* ---------- FAQ / curriculum accordion ---------- */
/* 23px = 10px visible gap + the 13px the panel tucks under its header */
.ts-accordion__item + .ts-accordion__item {
  margin-top: 23px;
}

.ts-accordion__head {
  width: 100%;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 33px;
  border: 0;
  border-radius: 14px 0 13px 0;
  background: var(--ts-gradient);
  color: #fff9f0;
  font-family: var(--ts-font-head);
  font-weight: 500;
  font-size: 13.4px;
  text-align: left;
  position: relative;
  z-index: 1; /* sits over the panel tucked beneath it */
}

.ts-accordion__head .bi {
  font-size: 11px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-text-stroke: 0.5px;
}

.ts-accordion__head[aria-expanded="true"] .bi {
  transform: rotate(180deg);
}

/* The panel wrapper always keeps its -13px tuck (even when closed), so nothing
   jumps when Bootstrap starts or finishes the height animation */
.ts-accordion__item > .collapse,
.ts-accordion__item > .collapsing {
  margin-top: -13px;
}

.ts-accordion__item > .collapse:not(.show) {
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.ts-accordion__item > .collapsing {
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ts-accordion__body {
  padding: 19px 33px 6px;
  border: 1px solid transparent;
  border-top: 0;
  border-radius: 0 0 12px 0;
  background:
    linear-gradient(var(--ts-cream), var(--ts-cream)) padding-box,
    var(--ts-gradient) border-box;
  font-family: var(--ts-font-head);
  font-weight: 300;
  font-size: 11.7px;
  color: var(--ts-dark);
}

.ts-accordion__body p {
  margin: 0;
}

/* Curriculum lesson row */
.ts-lesson {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ts-lesson li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-lesson .bi {
  font-size: 15px;
  color: var(--ts-dark);
}

/* Accordion block widths */
.ts-accordion {
  max-width: 622px;
}

.ts-accordion--center {
  max-width: 560px;
  margin-inline: auto;
}

/* ---------- Copy-coupon tooltip (banner art) ---------- */
.ts-copy-hit {
  position: absolute;
  border: 0;
  border-radius: 30px;
  background: transparent;
  cursor: pointer;
}

.ts-copy-hit:focus-visible {
  outline: 2px solid var(--ts-orange);
}

.ts-copy-hit[data-copied]::after {
  content: "Copied!";
  position: absolute;
  left: 50%;
  top: -34px;
  transform: translateX(-50%);
  background: var(--ts-dark);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199.98px) {
  .ts-certificate__frame {
    margin-left: 0;
  }
}

@media (max-width: 991.98px) {
  .ts-trending__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ts-certificate__content {
    padding-top: 30px;
  }
}

@media (max-width: 767.98px) {
  .ts-trending {
    padding: 34px 0 30px;
  }

  .ts-trending__title {
    margin-bottom: 22px;
  }

  .ts-trending__grid {
    gap: 14px 12px;
  }

  .ts-accreditation {
    padding-top: 34px;
  }

  .ts-accreditation__title,
  .ts-organisations__title {
    margin-bottom: 14px;
  }

  /* Centre logo is enlarged, neighbours sit behind it */
  .ts-accreditation .ts-logo-slider {
    padding: 50px 0;
  }

  .ts-accreditation .ts-logo-slider__track {
    gap: 0;
  }

  .ts-accreditation__box {
    width: 170px;
    height: 135px;
    padding: 18px 12px;
  }

  .ts-accreditation__box.is-center {
    transform: scale(1.4);
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  }

  .ts-organisations {
    padding-top: 40px;
  }

  .ts-organisations__slider {
    --ticker-gap: 40px;
  }

  .ts-organisations__box {
    width: 158px;
    height: 120px;
    padding: 16px 12px;
    border-width: 2.5px;
    border-radius: 20px 0 20px 0;
  }

  .ts-certificate {
    padding: 30px 0;
  }

  .ts-certificate__bg {
    top: auto;
    bottom: 40px;
    height: 710px; /* two chevron rows + gap */
  }

  .ts-certificate__frame {
    width: 345px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 344 / 412;
    margin-inline: auto;
  }

  .ts-certificate__content {
    padding: 64px 16px 20px;
  }

  .ts-certificate__title {
    font-size: 30px;
    line-height: 36px;
    max-width: 330px;
    margin-bottom: 30px;
  }

  .ts-certificate__lead {
    font-size: 15px;
  }

  .ts-certificate__list li {
    font-size: 14px;
    line-height: 24px;
  }

  .ts-certificate__btn {
    width: 260px;
    height: 40px;
    font-size: 20px;
  }

  .ts-accordion__head {
    padding: 0 16px 0 18px;
    font-size: 11px;
  }

  .ts-accordion__body {
    padding: 20px 18px 10px;
  }
}
