/*
 * tutorial.css
 * ------------
 * Styles for the tutorial-style practice pages (see tutorial.js).
 * Everything is scoped to body.pubh-tutorial, which practice/_metadata.yml
 * adds only to practice pages, so the home page and My Progress page are
 * unchanged.
 */

.pubh-tutorial {
  --pubh-tut-accent: #367b79;          /* same teal as the navbar */
  --pubh-tut-accent-soft: rgba(54, 123, 121, 0.1);
  --pubh-tut-muted: #6c757d;
}

/* ---- One section at a time ------------------------------------------- */

.pubh-tutorial .pubh-tut-hidden {
  display: none !important;
}

/* The first heading in each section sits right under the page title. */
.pubh-tutorial .pubh-tut-section > h2:first-child {
  margin-top: 0.5rem;
}

/* ---- Sidebar ---------------------------------------------------------- */

.pubh-tutorial #TOC.pubh-tut-toc > h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pubh-tut-muted);
  margin-bottom: 0.5rem;
}

.pubh-tutorial #TOC.pubh-tut-toc > ul {
  margin-left: 0;
  font-size: 0.9rem;
}

.pubh-tutorial #TOC.pubh-tut-toc > ul > li > a.pubh-tut-link {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  margin: 0.1rem 0;
  border-left: 3px solid transparent;
  border-radius: 0 0.35rem 0.35rem 0;
  line-height: 1.25;
  color: inherit;
  white-space: normal;
}

/* Quarto's scroll-spy "active" style doesn't apply here: undo it so only
   the section on screen is highlighted. */
.pubh-tutorial #TOC.pubh-tut-toc > ul > li > a.pubh-tut-link.active:not(.pubh-current) {
  border-left-color: transparent;
  color: inherit !important;
}

.pubh-tutorial #TOC.pubh-tut-toc > ul > li > a.pubh-tut-link:hover {
  background: var(--pubh-tut-accent-soft);
  color: inherit !important;
}

.pubh-tutorial #TOC.pubh-tut-toc > ul > li > a.pubh-tut-link.pubh-current {
  border-left-color: var(--pubh-tut-accent);
  background: var(--pubh-tut-accent-soft);
  color: var(--pubh-tut-accent) !important;
  font-weight: 600;
}

.pubh-tutorial .pubh-tut-label {
  flex: 1 1 auto;
}

.pubh-tutorial .pubh-tut-status {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--pubh-tut-muted);
  font-variant-numeric: tabular-nums;
}

.pubh-tutorial a.pubh-done .pubh-tut-status {
  color: var(--pubh-tut-accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.pubh-tutorial .pubh-tut-download {
  margin: 1.25rem 0 0.5rem 0.6rem;
}

.pubh-tutorial .pubh-tut-download .btn {
  white-space: normal;
  text-align: left;
}

/* ---- Previous / Next -------------------------------------------------- */

.pubh-tutorial .pubh-tut-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.pubh-tutorial .pubh-tut-pager .btn {
  display: flex;
  flex-direction: column;
  max-width: 48%;
  padding: 0.5rem 0.9rem;
  text-align: left;
  white-space: normal;
}

.pubh-tutorial .pubh-tut-pager .pubh-tut-next {
  margin-left: auto;
  text-align: right;
}

.pubh-tutorial .pubh-tut-dir {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.pubh-tutorial .pubh-tut-title {
  font-weight: 600;
}

/* ---- Printing shows the whole page ------------------------------------ */

@media print {
  .pubh-tutorial .pubh-tut-hidden {
    display: block !important;
  }
  .pubh-tutorial .pubh-tut-pager,
  .pubh-tutorial .pubh-tut-download {
    display: none !important;
  }
}

/* ---- Small screens: a "Section" menu replaces the sidebar ------------ */

.pubh-tutorial .pubh-tut-mobile {
  display: none;
}

@media (max-width: 991.98px) {
  .pubh-tutorial .pubh-tut-mobile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: sticky;
    top: var(--pubh-tut-navbar-h, 56px);
    z-index: 10;
    margin: 0 0 1.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-left: 3px solid var(--pubh-tut-accent);
    border-radius: 0.4rem;
  }
  .pubh-tutorial .pubh-tut-mobile label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pubh-tut-muted);
    margin: 0;
  }
  .pubh-tutorial .pubh-tut-mobile select {
    flex: 1 1 auto;
    min-width: 0;
  }
  .pubh-tutorial .pubh-tut-pager .btn {
    max-width: 49%;
  }
}

@media print {
  .pubh-tutorial .pubh-tut-mobile {
    display: none !important;
  }
}
