/**
 * @file
 * Button component.
 */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding: 0.75rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--jh-radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.button--primary {
  border-color: var(--jh-orange);
  background: var(--jh-orange);
  color: var(--jh-ink);
}

.button--primary:hover,
.button--primary:focus-visible {
  border-color: var(--jh-orange-hover);
  background: var(--jh-orange-hover);
  color: var(--jh-ink);
}

.button--secondary {
  border-color: var(--jh-ink);
  background: transparent;
  color: var(--jh-ink);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: var(--jh-ink);
  color: var(--jh-white);
}

.button--text {
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--jh-orange-deep);
  font-size: 1rem;
  font-weight: 600;
}

.button--text:hover,
.button--text:focus-visible {
  color: var(--jh-orange-deep);
}

/* The arrow is decoration: the second declaration gives it empty alternative
   text so screen readers skip it; browsers without that syntax use the
   first. As a flex item it can be moved with a transform. */
.button--text::after {
  margin-left: 0.15em;
  content: "→";
  content: "→" / "";
  transition: transform 0.2s ease-out;
}

.button--text:hover::after,
.button--text:focus-visible::after {
  transform: translateX(0.5em);
}

@media (prefers-reduced-motion: reduce) {
  .button--text::after {
    transition: none;
  }
}

@media (max-width: 820px) {
  .button {
    padding: 0.75rem 1.25rem;
  }
}
