/* Shared styling for every Stuw documentation site. */

/* Header: wordmark and the navigation between Stuw sites (see partials/header.html). */
/* Material sets display: inline-block on header buttons with a more specific selector. */
.md-header__button.stuw-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  padding: 0.2rem 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: inherit;
}

.stuw-brand img {
  display: block;
  width: auto;
  height: 1.6rem;
}

.md-header--stuw .md-header__title {
  visibility: hidden;
}

.stuw-groups,
.stuw-group__menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stuw-groups {
  display: none;
  gap: 0 1.2rem;
  margin-left: 0.8rem;
}

@media screen and (min-width: 60em) {
  .stuw-groups {
    display: flex;
  }
}

.stuw-group {
  position: relative;
}

.stuw-group__label {
  display: flex;
  align-items: center;
  height: 2.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.75;
}

.stuw-group__label::after {
  content: "▾";
  margin-left: 0.3em;
  font-size: 0.8em;
}

.stuw-group:hover .stuw-group__label,
.stuw-group:focus-within .stuw-group__label,
.stuw-group--active .stuw-group__label {
  opacity: 1;
}

.stuw-group--active .stuw-group__label {
  box-shadow: inset 0 -2px 0 var(--md-accent-fg-color);
}

.stuw-group__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -0.8rem;
  z-index: 5;
  min-width: 11rem;
  padding: 0.3rem 0;
  background-color: var(--md-primary-fg-color--dark);
  border-radius: 0 0 0.2rem 0.2rem;
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.3);
}

.stuw-group:hover .stuw-group__menu,
.stuw-group:focus-within .stuw-group__menu {
  display: block;
}

.stuw-group__site {
  display: block;
  padding: 0.45rem 0.8rem;
  font-size: 0.75rem;
  color: var(--md-primary-bg-color);
}

.stuw-group__site:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.stuw-group__site--active {
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--md-accent-fg-color);
}

/* Sites in the drawer, for screens that are too narrow for the header navigation. */
.stuw-drawer-sites {
  padding: 0.4rem 0.8rem 0.6rem;
  border-bottom: 0.05rem solid var(--md-default-fg-color--lightest);
  font-size: 0.7rem;
}

.stuw-drawer-sites ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stuw-drawer-sites__domain {
  margin: 0.4rem 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
}

.stuw-drawer-sites a {
  display: block;
  padding: 0.2rem 0;
}

.stuw-drawer-sites__active {
  font-weight: 700;
}

@media screen and (min-width: 60em) {
  .stuw-drawer-sites {
    display: none;
  }
}

/* Sidebar footer: repository link and version selector, the parts that differ per repository. */
.md-sidebar--primary .md-sidebar__scrollwrap {
  display: flex;
  flex-direction: column;
}

.md-sidebar--primary .md-sidebar__inner {
  flex: 1 0 auto;
}

.stuw-sidebar-footer {
  position: sticky;
  bottom: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-top: 0.05rem solid var(--md-default-fg-color--lightest);
  background-color: var(--md-default-bg-color);
  font-size: 0.7rem;
}

.stuw-sidebar-footer__source {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--md-default-fg-color--light);
}

.stuw-sidebar-footer__source .md-icon svg {
  width: 1rem;
  height: 1rem;
  vertical-align: middle;
  fill: currentcolor;
}

.stuw-version {
  position: relative;
}

.stuw-version summary {
  white-space: nowrap;
  cursor: default;
  list-style: none;
  color: var(--md-default-fg-color--light);
}

.stuw-version summary::-webkit-details-marker {
  display: none;
}

.stuw-version--ready summary {
  cursor: pointer;
}

.stuw-version--ready summary::after {
  content: " ▴";
  font-size: 0.8em;
}

.stuw-version__list {
  position: absolute;
  right: 0;
  bottom: 100%;
  min-width: 8rem;
  margin: 0 0 0.4rem;
  padding: 0.3rem 0;
  list-style: none;
  background-color: var(--md-default-bg-color);
  border-radius: 0.2rem;
  box-shadow: var(--md-shadow-z2);
}

.stuw-version__list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.8rem;
}

.stuw-version__list a:hover {
  background-color: var(--md-default-fg-color--lightest);
}

.stuw-version__active {
  font-weight: 700;
}

.stuw-version__alias {
  color: var(--md-default-fg-color--light);
  font-weight: 400;
}

/* The footer is part of the sidebar on wide screens and part of the drawer nav on narrow ones. */
@media screen and (max-width: 76.1875em) {
  .stuw-sidebar-footer--desktop {
    display: none;
  }
}

@media screen and (min-width: 76.25em) {
  .stuw-sidebar-footer--drawer {
    display: none;
  }
}

.stuw-version__list {
  white-space: nowrap;
}
