/*
 * The Kurs page (the view "Kurs", js/components/KursPage.js, 1.41.0): the
 * course on one page in sections (Om kurset, Beskrivelse, Læringsutbytte,
 * Økter og tid, Evaluering), with a list of them on the left that marks the
 * one in view. Below 992px the list is a row of links above the sections.
 * The sections are the theme's cards (bauhaus-theme.css).
 */

.kurs-page {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto 1.5rem;
}

/* --- The list of sections ------------------------------------------------- */

.kurs-nav {
  position: sticky;
  top: 1rem;
}

.kurs-nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 3px solid var(--bh-black, #111);
  background: var(--bh-white, #fff);
  box-shadow: var(--bh-shadow-sm, 3px 3px 0 #111);
}

.kurs-nav-list li + li {
  border-top: 1px solid #ddd;
}

.kurs-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: none;
  color: var(--bh-navy, #1B2A4A);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: left;
  text-transform: uppercase;
}

.kurs-nav-link i {
  width: 1.1rem;
  text-align: center;
}

.kurs-nav-link:hover {
  background: var(--bh-cream, #F5F0E6);
}

.kurs-nav-link[aria-current="true"] {
  background: var(--bh-navy, #1B2A4A);
  color: var(--bh-white, #fff);
}

.kurs-nav-link .ce-tab-count {
  margin-left: auto;
}

/* --- The sections ------------------------------------------------------------ */

.kurs-section {
  margin-bottom: 1.5rem;
  scroll-margin-top: 1rem;
}

.kurs-section:last-child {
  margin-bottom: 0;
}

/* The heading takes the keyboard focus when its section is chosen in the list */
.kurs-section-title:focus {
  outline: none;
}

.kurs-section-title:focus-visible {
  outline: 2px solid var(--bh-gold, #E8A820);
  outline-offset: 2px;
}

.kurs-section-help {
  flex-shrink: 0;
  font-weight: 600;
}

/* The whole session list, without a scroll box of its own */
.kurs-page .session-list {
  max-height: none;
}

/* Tips for the course's level, folded */
.level-tips {
  border: 2px solid var(--bh-black, #111);
  background: var(--bh-white, #fff);
}

.level-tips > summary {
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.level-tips[open] > summary {
  border-bottom: 1px solid #ddd;
}

/* "Om SOLO-nivåene" in the SOLO chooser */
.solo-guide-link {
  font-weight: 600;
  white-space: nowrap;
}

/* --- Tablets and phones ------------------------------------------------------------ */

@media (max-width: 991.98px) {
  .kurs-page {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .kurs-nav {
    top: 0;
    z-index: 5;
  }

  .kurs-nav-list {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .kurs-nav-list::-webkit-scrollbar {
    display: none;
  }

  .kurs-nav-list li + li {
    border-top: 0;
    border-left: 1px solid #ddd;
  }

  .kurs-nav-link {
    white-space: nowrap;
  }

  /* A section scrolled to stops below the list */
  .kurs-section {
    scroll-margin-top: 3.5rem;
  }
}
