/**
 * @file
 * Topics A-Z grid of topic chips.
 */

.sml-topics__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sml-topics__item {
  display: flex;
}

.sml-topics__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--sml-font-jost);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.2;
  border: 3px solid transparent;
  border-radius: 10px;
  color: var(--sml-black);
  text-decoration: none;
}

.sml-topics__link:hover {
  background: var(--sml-gray);
  color: var(--sml-black);
  text-decoration: none;
}

.sml-topics__link:hover .sml-topics__label {
  color: var(--sml-purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sml-topics__link:focus,
.sml-topics__link:focus-visible,
.sml-topics__link:active {
  outline: none;
  border-color: var(--sml-black);
  background: var(--sml-white);
  color: var(--sml-black);
  text-decoration: none;
}

.sml-topics__link:focus,
.sml-topics__link:active {
  border-style: solid;
}

.sml-topics__link:focus-visible {
  border-style: dashed;
}

.sml-topics__link .sml-arrow {
  flex: 0 0 auto;
  width: 2.25rem;
}

@media (max-width: 991px) {
  .sml-topics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .sml-topics__grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1500px) {
  .sml-topics__grid {
    grid-template-columns: repeat(4, 317px);
    justify-content: space-between;
    gap: 20px 42px;
  }

  .sml-topics__item {
    min-height: 76px;
  }

  .sml-topics__link {
    gap: 0.625rem;
    padding: 0.625rem;
  }

  .sml-topics__link .sml-arrow {
    width: 2.875rem;
  }
}
