:root {
  --hover-highlight-line-width: 0.25rem;
}

.list-row {
  position: relative;
  overflow: hidden;

  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
  gap: var(--space--base);

  padding: var(--space--base);
  margin: 0;
  background-color: var(--color--background-light);
  border: var(--border--light);

  &:not(:last-child) {
    border-bottom: none;
  }

  &::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: var(--hover-highlight-line-width);
    height: 100%;
    background-color: var(--color--primary-light);
    transform: translateX(calc(-1 * var(--hover-highlight-line-width)));
    transition: transform var(--transition-duration--fast) var(--transition-timing--base);
  }
}

.list-row:hover:has(a) {
  &::after {
    transform: none;
  }

  & .list-row__link::after {
    opacity: 1;
  }
}

.list-row--secondary {
  padding-block: var(--space--x-small);
  background-color: var(--color--background-base);
}

.list-row__main {
  flex: 1;

  & a {
    text-decoration: none;
  }
}

.list-row__link::after {
  /* Expands the touch target for the link to cover the entire container */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-hover);
  opacity: 0;
  transition: opacity var(--transition-duration--fast) var(--transition-timing--base);
}

.list-row__action {
  position: relative;
  z-index: var(--z-index--base);
}
