/*
 * Course single page (single-course.php / templates/course.php).
 * Loaded after style.css on course pages only.
 */

.course-wrapper {
  --course-cream: #F2EAE1;
  --course-wine: #4E1E29;
  --course-orange: #FF6C4A;
  --course-sand: #D4B8A6;
  --course-brown: #B68A6D;
  --course-beige: #E3D9C9;
  --course-line: rgba(182, 138, 109, 0.45);
  --course-sticky-top: 84px;
  position: relative;
  padding: 92px 0 120px;
  color: var(--course-wine);
}

.course-wrapper .course-section-title,
.course-wrapper .course-cta h2,
.course-wrapper h3 {
  letter-spacing: -0.01em;
}

.course-wrapper .link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  line-height: 1.3;
  transition: color 0.26s ease-out;
}

.course-wrapper .link svg {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
}

.course-wrapper .link:hover,
.course-wrapper .link:focus-visible {
  color: var(--course-orange);
}

/* Breadcrumbs */
.course-wrapper .course-breadcrumbs {
  margin: 0;
}

/* Hero */
.course-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 72px;
  align-items: start;
  margin: 72px 0 0;
}

.course-hero-text {
  padding: 8px 0 0;
}

.course-hero .section-title .langs {
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
}

.course-tags .pill {
  padding: 8px 12px;
  border: 1px solid;
  border-radius: 60px;
  font-size: 15px;
  line-height: 18px;
  letter-spacing: -0.01em;
}

.course-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 40px 0 0;
  border-bottom: 1px solid var(--course-sand);
}

.course-tags + .course-facts {
  margin: 40px 0 0;
}

.course-facts .fact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 16px 0 24px;
  border-top: 1px solid var(--course-sand);
}

.course-facts .fact.stat {
  flex-direction: column-reverse;
  justify-content: flex-end;
}

.course-facts .fact:nth-child(odd):last-child,
.course-facts .fact.lecturers {
  grid-column: 1 / -1;
}

.course-facts dt {
  font-family: 'SimplerPro_Alte-SemiBold', sans-serif;
  font-size: 15px;
  line-height: 1;
}

.course-facts dd {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.course-facts .stat dd {
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.course-facts .fact.lecturers {
  align-items: stretch;
  gap: 0;
  padding-bottom: 0;
}

.course-facts .lecturers dt {
  margin: 0;
}

.course-facts .lecturers dd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.course-facts .lecturers dd + dd {
  border-top: 1px solid var(--course-line);
}

.course-facts .lecturers .link {
  flex: 0 0 auto;
}

.course-hero-media {
  position: relative;
  aspect-ratio: 1 / 0.96;
  overflow: hidden;
  border-radius: 4px;
  background: var(--course-brown);
}

/* Keywords under the cover image, as the project page's pills */
.course-keywords {
  margin: 24px 0 0;
}

.course-keywords .small {
  margin: 0 0 8px;
}

.course-keywords .topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-keywords .topic {
  font-size: 15px;
  line-height: 18px;
  letter-spacing: -0.01em;
  padding: 8px 12px;
  border: 1px solid;
  border-radius: 60px;
  transition: all 0.26s ease-out;
}

.course-keywords .topic:hover {
  color: var(--course-orange);
}

.course-wrapper img.placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  max-width: 340px;
  height: auto;
  opacity: 0.35;
  transform: translate(-50%, -50%);
}

/* Body */
.course-body {
  display: grid;
  grid-template-columns: minmax(0, 23.5%) minmax(0, 1fr);
  gap: 0 10%;
  align-items: start;
  margin: 120px 0 0;
}

.course-aside {
  position: sticky;
  top: var(--course-sticky-top);
}

p.small.course-toc-title {
  font-family: 'SimplerPro_Alte-SemiBold', sans-serif;
  font-size: 14px;
}

.course-toc-title {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--course-line);
}

.course-toc a {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--course-line);
  font-size: 15px;
  line-height: 1.3;
  transition: color 0.26s ease-out;
}

.course-toc a .dot {
  flex: 0 0 auto;
  width: auto;
  height: 8px;
  margin: 0;
  color: var(--course-orange);
  opacity: 0;
  transition: width 0.26s ease-out, margin 0.26s ease-out, opacity 0.26s ease-out;
}

.course-toc a:hover,
.course-toc a:focus-visible {
  color: var(--course-orange);
}

.course-toc a.is-active {
  font-family: 'SimplerPro_Alte-SemiBold', sans-serif;
}

.course-toc a.is-active .dot {
  width: auto;
  height: 8px;
  margin: 0 8px 0 0;
  opacity: 1;
}

.course-study-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 28px 0 0;
  padding: 20px;
  border-radius: 4px;
  background: var(--course-sand);
}

.course-study-box .eyebrow {
  font-family: 'SimplerPro_Alte-SemiBold', sans-serif;
}

.course-study-box .text {
  margin: -4px 0 4px;
  font-size: 20px;
  line-height: 1.3;
}

.course-study-box .button {
  width: 100%;
}

.course-section + .course-section {
  margin: 80px 0 0;
}

.course-section {
  scroll-margin-top: var(--course-sticky-top);
}

.course-wrapper .course-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--course-line);
  font-family: 'SimplerPro_Alte-SemiBold', sans-serif;
  font-size: 30px;
  line-height: 1.2;
}

.course-section-title .dot {
  flex: 0 0 auto;
  width: auto;
  height: 12px;
  color: var(--course-orange);
}

.course-section-body {
  padding: 24px 0;
  border-bottom: 1px solid var(--course-line);
  font-size: 16px;
  line-height: 1.5;
}

.course-section-body.rich-text p,
.course-section-body.rich-text ul,
.course-section-body.rich-text ol {
  margin: 0 0 12px;
  font-size: inherit;
  line-height: inherit;
}

.course-section-body.rich-text > :last-child {
  margin-bottom: 0;
}

.course-section-body.rich-text ul {
  padding-left: 22px;
  list-style: disc;
}

.course-section-body.rich-text ol {
  padding-left: 22px;
  list-style: decimal;
}

.course-section-body.rich-text strong,
.course-section-body.rich-text b {
  font-family: 'SimplerPro_Alte-SemiBold', sans-serif;
}

.course-section-body.rich-text em,
.course-section-body.rich-text i {
  font-style: italic;
}

.course-section-body.rich-text a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.course-section-body.rich-text a:hover {
  color: var(--course-orange);
}

.course-topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
}

.course-topics li {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--course-line);
}

.course-topics .num {
  flex: 0 0 auto;
  min-width: 18px;
  font-family: 'SimplerPro_Alte-SemiBold', sans-serif;
  font-size: 12px;
}

.course-topics .topic {
  padding-right: 20px;
  font-size: 20px;
  line-height: 1.3;
  text-wrap: pretty;
}

.course-learning {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.course-learning.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.course-learning .col {
  padding: 24px 0 0;
  text-wrap: pretty;
}

.course-learning .col.practical {
  margin: 24px 0 0;
  padding: 24px;
  border-radius: 4px;
  background: var(--course-beige);
}

.course-wrapper .course-learning h3 {
  margin: 0 0 12px;
  font-family: 'SimplerPro_Alte-SemiBold', sans-serif;
  font-size: 15px;
  line-height: 1.3;
}

.course-learning p {
  font-size: 16px;
  line-height: 1.5;
}

/* More courses */
.course-more {
  margin: 160px 0 0;
}

.course-more-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 54px;
}

.course-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.course-card .img-wrapper {
  position: relative;
  display: block;
  margin: 0 0 8px;
  aspect-ratio: 2.18 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--course-brown);
  transition: all 0.26s ease-out;
}

.course-card .img-wrapper .ofc {
  transition: transform 0.6s ease-out;
}

.course-card .title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 20px;
  line-height: 1.3;
  transition: color 0.26s ease-out;
}

.course-card .title svg {
  flex: 0 0 auto;
  transition: transform 0.26s ease-out;
}

.course-card .meta {
  font-size: 14px;
  line-height: 1.3;
}

.course-card:hover .title,
.course-card:focus-visible .title {
  color: var(--course-orange);
}

.course-card:hover .title svg,
.course-card:focus-visible .title svg {
  transform: translateX(4px);
}

.course-card:hover .img-wrapper,
.course-card:focus-visible .img-wrapper {
  border-radius: 30px;
}

.course-card:hover .img-wrapper .ofc {
  transform: scale(1.04);
}

/* Bottom banner */
.course-cta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin: 96px 0 0;
  padding: 56px;
  border-radius: 4px;
  background: var(--course-orange);
}

.course-wrapper .course-cta h2 {
  font-family: 'SimplerPro_Alte-SemiBold', sans-serif;
  font-size: 56px;
  line-height: 1.1;
}

.course-cta p {
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1;
}

.course-cta .buttons {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 12px;
}

.course-cta .button:hover,
.course-cta .button:focus-visible {
  background: var(--course-cream);
  border-color: var(--course-wine);
  color: var(--course-wine);
}

.course-cta .button:not(.full) {
  background: transparent;
}

.course-cta .button:not(.full):hover,
.course-cta .button:not(.full):focus-visible {
  background: var(--course-cream);
}

@media (max-width: 1024px) {
  .course-wrapper {
    --course-sticky-top: 52px;
    padding: 76px 0 80px;
  }

  .course-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    margin: 32px 0 0;
  }

  .course-tags,
  .course-facts {
    margin: 32px 0 0;
  }

  .course-facts {
    gap: 0 16px;
  }

  .course-facts .fact {
    padding: 14px 0 20px;
  }

  .course-facts dd {
    font-size: 18px;
  }

  .course-facts .stat dd {
    font-size: 44px;
  }

  .course-hero-media {
    aspect-ratio: 4 / 3;
  }

  .course-keywords .topic {
    font-size: 16px;
    line-height: 19px;
  }

  .course-body {
    grid-template-columns: minmax(0, 1fr);
    margin: 56px 0 0;
  }

  .course-aside {
    position: static;
    order: 2;
    margin: 56px 0 0;
  }

  .course-toc {
    display: none;
  }

  .course-study-box {
    margin: 0;
  }

  .course-section + .course-section {
    margin: 56px 0 0;
  }

  .course-wrapper .course-section-title {
    font-size: 26px;
  }

  .course-more {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .course-more-head {
    display: contents;
  }

  .course-more-head .section-title {
    margin: 0 0 32px;
  }

  .course-more-head .link {
    order: 2;
    margin: 16px 0 0;
    font-size: 16px;
  }

  .course-topics,
  .course-learning.two-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .course-topics li {
    padding: 16px 0;
  }

  .course-topics .topic {
    font-size: 18px;
  }

  .course-learning.two-cols .col.practical {
    margin: 0;
  }

  .course-learning .col.practical {
    padding: 20px 16px;
  }

  .course-more {
    margin: 80px 0 0;
  }

  .course-cards {
    display: flex;
    gap: 16px;
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 0 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .course-cards::-webkit-scrollbar {
    display: none;
  }

  .course-cards li {
    flex: 0 0 272px;
    scroll-snap-align: start;
  }

  .course-card .img-wrapper {
    aspect-ratio: 4 / 3;
  }

  .course-card .title {
    font-size: 18px;
  }

  .course-cta {
    flex-direction: column;
    gap: 24px;
    margin: 64px 0 0;
    padding: 32px 24px;
  }

  .course-wrapper .course-cta h2 {
    font-size: 32px;
    line-height: 1.1;
  }

  .course-cta p {
    font-size: 16px;
    line-height: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .course-wrapper *,
  .course-wrapper *::before,
  .course-wrapper *::after {
    transition: none !important;
  }
}
