@import '_variables';

/**
 * code-group
 */
.code-group__nav {
  margin-top: 0.85rem;
  // 2 * margin + border-radius of <pre> tag
  margin-bottom: calc(-1.7rem - 6px);
  padding-bottom: calc(1.7rem - 6px);
  padding-left: 10px;
  padding-top: 10px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  background-color: var(--code-bg-color);
}

.code-group__ul {
  margin: auto 0;
  padding-left: 0;
  display: inline-flex;
  list-style: none;
}

.code-group__nav-tab {
  border: 0;
  padding: 5px;
  cursor: pointer;
  background-color: transparent;
  font-size: 0.85em;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.code-group__nav-tab:focus {
  outline: none;
}

.code-group__nav-tab:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.9);
}

.code-group__nav-tab-active {
  border-bottom: var(--c-brand) 1px solid;
}

@media (max-width: $MQMobileNarrow) {
  .code-group__nav {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    border-radius: 0;
  }
}

/**
 * code-group-item
 */
.code-group-item {
  display: none;
}

.code-group-item__active {
  display: block;
}

.code-group-item > pre {
  background-color: orange;
}
