.logo-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  text-decoration: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.logo-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  will-change: transform;
}

.logo-link__label {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  transition: all 0.5s ease-in-out;
}

.logo-link__text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  overflow: hidden;
  width: auto;
  height: auto;
  max-width: 260px;
  margin-left: 12px;
  opacity: 1;
  transform: translateX(0);
  transform-origin: left center;
  transition: all 0.5s ease-in-out;
}

.logo-link__text img {
  width: auto;
  height: 32px;
}

/* Wordmark twins, see site-header.php: blue letters on light, white on dark. */
.logo-link__text .logo-link__img--dark,
html[data-theme="dark"] .logo-link__text .logo-link__img--light {
  display: none;
}

html[data-theme="dark"] .logo-link__text .logo-link__img--dark {
  display: block;
}

.header._scrolled .logo-link__text {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  transform: translateX(-15px);
}

.header._scrolled .logo-link__label {
  transform: scale(0.85);
}

@media (min-width: 1600px) {
  .logo-link__label {
    width: 64px;
    height: 64px;
  }
  .logo-link__text {
    max-width: 340px;
    margin-left: 16px;
  }
  .logo-link__text img {
    height: 40px;
  }
}

@media (min-width: 1200px) and (max-width: 1599px) {
  .logo-link__label {
    width: 56px;
    height: 56px;
  }
  .logo-link__text {
    max-width: 280px;
    margin-left: 14px;
  }
  .logo-link__text img {
    height: 36px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .logo-link__label {
    width: 48px;
    height: 48px;
  }
  .logo-link__text {
    margin-left: 10px;
  }
  .logo-link__text img {
    height: 30px;
  }
}

@media (max-width: 991px) {
  .logo-link__label {
    width: 42px;
    height: 42px;
  }
}

/*
 * Small screens. All five controls stay in the bar at their full spacing,
 * so the wordmark gives way instead: below 768px it takes whatever room the
 * controls leave, up to 200px, and scales with it.
 */
@media (max-width: 767px) {
  .logo-link__text {
    flex-shrink: 1;
    min-width: 0;
    max-width: 200px;
    margin-left: 8px;
  }

  .logo-link__text img {
    width: 100%;
    height: auto;
  }
}

/*
 * Phones. Beside five icons the wordmark would shrink to an unreadable
 * 15px strip and crowd the bar, so the shield stands alone, a size larger;
 * its alt text still names the university.
 */
@media (max-width: 480px) {
  .logo-link__label {
    width: 40px;
    height: 40px;
  }

  .logo-link__text {
    display: none;
  }
}
