.yt-chapters {
  --yt-chapters-accent: #f29400;
  --yt-chapters-line: #e1e1e3;
  --yt-chapters-active-bg: rgba(242, 148, 0, 0.12);
  display: grid;
  gap: 1.5rem;
}

.yt-chapters__player {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #0b1016;
}

/* iframe direkt oder Platzhalter von cf-cookiemanager (div[data-service]) auf volle Fläche ziehen */
.yt-chapters__player > iframe,
.yt-chapters__player > div[data-service] {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
}

.yt-chapters__player div[data-service] iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-chapters__title {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.yt-chapters__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--yt-chapters-line);
}

.yt-chapters__item {
  margin: 0;
  border-bottom: 1px solid var(--yt-chapters-line);
}

.yt-chapters__button {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  width: 100%;
  margin: 0;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-left: 3px solid transparent;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.yt-chapters__button:hover {
  background-color: var(--yt-chapters-active-bg);
}

.yt-chapters__button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.yt-chapters__button.is-active {
  border-left-color: var(--yt-chapters-accent);
  background-color: var(--yt-chapters-active-bg);
  font-weight: 700;
}

.yt-chapters__time {
  flex: 0 0 auto;
  min-width: 3.5em;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

@media (min-width: 992px) {
  .yt-chapters--has-chapters {
    grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
    align-items: stretch;
  }

  /* Liste nimmt die Höhe des Videos an und scrollt bei vielen Kapiteln */
  .yt-chapters__nav {
    position: relative;
  }

  .yt-chapters__nav-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
  }

  .yt-chapters__list {
    flex: 1 1 auto;
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yt-chapters__button {
    transition: none;
  }
}
