/* AlgoGarage page. Loaded only by algogarage.qmd, after the site stylesheet. */

#quarto-document-content p {
  text-align: left;
}

#quarto-document-content h2 {
  margin-top: 2.75rem;
  margin-bottom: 0.9rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
}

/* The opening paragraphs. */
.ag-intro > p {
  margin-bottom: 1.4rem;
}

/* The navigator in the right margin. */
#quarto-margin-sidebar nav#TOC {
  font-size: 0.85rem;
}

#quarto-margin-sidebar #toc-title {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

/* Identity lockup, same construction as the 0xLAB page. */
.ag-identity {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 0.45rem;
}

.ag-identity-mark {
  flex: 0 0 auto;
  width: 4.9rem;
  height: 4.9rem;
  align-self: center;
  margin-right: 0.95rem;
}

.ag-identity-copy {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  color: #102a43;
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
}

.ag-identity-title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
}

.ag-identity-rule {
  width: 100%;
  margin: 0.15rem 0 0.25rem;
  border: 0;
  border-top: 1px solid #dee2e6;
  opacity: 1;
}

.ag-identity-tagline {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

#quarto-document-content p.ag-credit {
  margin: 0 0 1.6rem;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: #55595c;
}

.ag-credit .ag-heart {
  color: #8B0000;
  font-size: 1.45em;
  line-height: 1;
}

/* Captures. One frame for every image on the page. */
#quarto-document-content img.img-fluid,
#quarto-document-content .quarto-figure img,
#quarto-document-content .quarto-layout-cell img {
  display: block;
  width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#quarto-document-content img.ag-smaller,
#quarto-document-content .quarto-figure img.ag-smaller,
#quarto-document-content .quarto-layout-cell img.ag-smaller {
  width: 76%;
  margin-left: auto;
  margin-right: auto;
}

#quarto-document-content img.ag-smallest,
#quarto-document-content .quarto-figure img.ag-smallest {
  width: 68%;
  margin-left: auto;
  margin-right: auto;
}

#quarto-document-content .quarto-figure,
#quarto-document-content .quarto-layout-panel {
  margin: 1.35rem 0 1.9rem;
}

#quarto-document-content .quarto-layout-panel .quarto-figure,
#quarto-document-content .quarto-layout-cell .quarto-figure {
  margin: 0;
}

#quarto-document-content .quarto-layout-cell {
  margin-bottom: 1rem;
}

#quarto-document-content figure {
  margin: 0;
}

#quarto-document-content figcaption,
#quarto-document-content .figure-caption {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #6c757d;
  text-align: left;
}

#quarto-document-content .quarto-figure-center > figure > p,
#quarto-document-content .quarto-figure-center > figure > div {
  margin: 0;
}

/* Help levels. */
.ag-levels {
  width: 100%;
  margin: 1.1rem 0 2rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ag-levels th {
  padding: 0.35rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid #dee2e6;
  color: #6c757d;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-align: left;
  text-transform: uppercase;
  vertical-align: bottom;
}

.ag-levels td {
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid #eef0f2;
  line-height: 1.45;
  vertical-align: top;
}

.ag-levels tr:last-child td {
  border-bottom: 1px solid #dee2e6;
}

.ag-levels td:first-child {
  width: 5.5rem;
  color: #102a43;
  font-weight: 700;
  white-space: nowrap;
}

.ag-levels td:nth-child(2),
.ag-levels td:nth-child(3) {
  width: 9.5rem;
  color: #55595c;
}

/* The paired exercise. */
.ag-pair {
  margin: 1.2rem 0 2rem;
  padding: 1.15rem 1.35rem 1.05rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
}

.ag-kicker {
  display: block;
  margin: 0 0 0.35rem;
  color: #8B0000;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ag-pair p {
  margin: 0 0 0.75rem;
}

.ag-pair pre {
  margin: 0.55rem 0 1.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid #eceff1;
  border-radius: 4px;
  background: #f8f9fa;
  color: #2f3437;
  font-size: 0.8rem;
  line-height: 1.55;
  overflow-x: auto;
}

.ag-pair pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: inherit;
}

.ag-pair .ag-pair-last {
  margin-bottom: 0;
}

/* The path from upload to review. */
.ag-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 1.1rem;
  margin: 1.3rem 0 2rem;
  padding: 0;
  list-style: none;
  counter-reset: ag-step;
}

.ag-path li {
  padding-top: 0.65rem;
  border-top: 2px solid #102a43;
  color: #55595c;
  font-size: 0.85rem;
  line-height: 1.45;
}

.ag-path li::before {
  counter-increment: ag-step;
  content: counter(ag-step, decimal-leading-zero);
  display: block;
  margin-bottom: 0.3rem;
  color: #6c757d;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.ag-path li b {
  display: block;
  margin-bottom: 0.2rem;
  color: #102a43;
  font-weight: 700;
}

/* Walkthrough video. */
.ag-video-figure {
  margin: 1.35rem 0 1.5rem;
}

.ag-video {
  display: block;
  width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #081b2c;
}

@media (max-width: 767.98px) {
  /* Stacked layout cells keep a right margin in Quarto's CSS, which made the first image narrower. */
  #quarto-document-content .quarto-layout-cell {
    margin-right: 0;
  }

  .ag-path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.1rem;
  }

  .ag-levels td:nth-child(2),
  .ag-levels td:nth-child(3) {
    width: auto;
  }
}

@media (max-width: 575.98px) {
  .ag-identity {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr);
    width: 100%;
  }

  .ag-identity-mark {
    width: 4rem;
    height: 4rem;
    margin-right: 0;
  }

  .ag-identity-copy {
    width: 100%;
    padding-left: 0.75rem;
  }

  .ag-identity-title {
    font-size: 1.15rem;
  }

  .ag-identity-tagline {
    font-size: 0.82rem;
    letter-spacing: 0;
  }

  .ag-levels {
    font-size: 0.85rem;
  }

  .ag-levels td:first-child {
    width: auto;
  }
}
