/* Challenges index and challenge detail pages. */
body.challenges-index .grid {
  align-items: start;
}

body.challenges-index .card .meta {
  margin-bottom: 0;
}

.button[aria-disabled="true"] {
  color: #4f5e5b;
  background: #e5ecea;
  border-color: #9aadaa;
  cursor: not-allowed;
}

.challenge-page .hero .meta {
  max-width: 760px;
}

.challenge-page .article-body {
  font-family: var(--serif);
  font-size: 1.08rem;
}

.challenge-page .article-body > p:first-of-type {
  font-size: 1.14rem;
}

.challenge-page .article-body h2 {
  margin-top: 2.8rem;
  scroll-margin-top: calc(var(--site-header-height) + 24px);
}

.challenge-page .article-body h3 {
  color: var(--accent);
  font-family: var(--serif);
}

.challenge-page .challenge-cover {
  margin-top: 0;
}

.challenge-page .article-body figure {
  padding: 0;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(23 70 77 / .08);
}

.challenge-page .article-body figure img {
  border-radius: 11px 11px 0 0;
}

.challenge-page .article-body figcaption {
  display: block;
  padding: 12px 16px 14px;
  color: #4d5754;
  font-family: var(--sans);
  line-height: 1.5;
}

.challenge-page .article-body .figure-credit {
  display: block;
  margin-top: 4px;
  font-size: .84rem;
}

.challenge-page .article-body blockquote {
  margin: 2rem 0;
  padding: 18px 22px;
  background: var(--soft);
  border-left: 5px solid var(--accent2);
  font-size: 1rem;
}

.challenge-page .article-body pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 18px;
  color: #f6f8fa;
  background: #0d1726;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .88rem;
  line-height: 1.55;
}

.challenge-page .article-body code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .9em;
}

.challenge-page .article-body :not(pre) > code {
  padding: .12em .35em;
  background: #edf2f1;
  border-radius: 4px;
}

.challenge-page .table-wrap {
  max-width: 100%;
  margin: 1.8rem 0;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.challenge-page table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: .9rem;
  line-height: 1.45;
}

.challenge-page th,
.challenge-page td {
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.challenge-page th {
  color: #fff;
  background: #315f7f;
}

.challenge-page tbody tr:nth-child(even) {
  background: #f3f7f6;
}

.challenge-page tbody tr:last-child td {
  border-bottom: 0;
}

.repository-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 1.7rem 0;
  padding: 18px 20px;
  background: #e8f3f4;
  border: 1px solid #bfd4d7;
  border-left: 5px solid #2f7a83;
  border-radius: 10px;
  font-family: var(--sans);
}

.repository-callout a {
  font-weight: 800;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.8rem 0;
  overflow: hidden;
  background: #0d1726;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(23 70 77 / .14);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-poster {
  display: block;
  margin: 1.8rem 0 1rem;
  overflow: hidden;
  border-radius: 12px;
  line-height: 0;
}

.video-poster img {
  width: 100%;
  height: auto;
}

.challenge-distribution-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 2.4rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
}

@media (max-width: 720px) {
  .challenge-page .article-body {
    font-size: 1rem;
  }

  .repository-callout {
    align-items: flex-start;
    flex-direction: column;
  }

  .challenge-page th,
  .challenge-page td {
    padding: 9px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-poster,
  .repository-callout {
    scroll-behavior: auto;
  }
}
