/**
 * @file
 * Button styles.
 */

.button:not(:where([class~="prose"] *)) {
  align-items: center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--gray-300);
  border-color: var(--gray-300);
  border-radius: 0;
  border-width: 1px;
  color: var(--black);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--font-system);
  font-size: var(--font-size-1);
  font-weight: var(--font-weight-700);
  justify-content: center;
  line-height: var(--leading-none);
  padding-block: var(--size-4);
  padding-inline: var(--size-6);
  position: relative;
  transition: var(--transition-soft-linear);
  white-space: nowrap;
  width: -moz-fit-content;
  width: fit-content;
}

.button:not(:where([class~="prose"] *)):visited {
  color: var(--black);
}

.button:not(:where([class~="prose"] *)):hover {
  background-color: var(--gray-200);
  border-color: var(--gray-300);
}

.button:not(:where([class~="prose"] *)):focus {
  box-shadow: 0 0 var(--white), 0 0 0 2px var(--gray-400), 0 0 var(--white);
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.button:not(:where([class~="prose"] *))[aria-expanded="true"]:focus::after {
  border-color: var(--gray-300);
}

.button:not(:where([class~="prose"] *)):disabled {
  background-color: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  pointer-events: none;
}

/* If two buttons are added, this should add some separation. */

.button:not(:where([class~="prose"] *)) + .button {
  margin-block: var(--size-4);
}

@media (min-width: 1024px) {
  .button:not(:where([class~="prose"] *)) + .button {
    margin-block: 0;
    -webkit-margin-start: var(--size-2);
    margin-inline-start: var(--size-2);
  }
}

@media (--laptop) {
  .button:not(:where([class~="prose"] *)) + .button {
    margin-block: 0;
    -webkit-margin-start: var(--size-2);
    margin-inline-start: var(--size-2);
  }
}

.button:not(:where([class~="prose"] *)) svg {
  display: inline-block;
  height: 1em;
  -webkit-margin-start: var(--size-2);
  margin-inline-start: var(--size-2);
  width: 1em;
}

.button:not(:where([class~="prose"] *)) svg path {
  color: inherit;
}

/* Button primary */

.button--primary {
  background-color: var(--ucla-blue);
  border-color: var(--ucla-blue);
  color: var(--white);
  font-family: var(--font-body);
}

.button--primary:visited {
  background-color: var(--ucla-blue);
  color: var(--white);
}

.button--primary:hover {
  background-color: var(--silver-lake-reservoir);
  color: var(--white);
}

.button--primary:focus {
  box-shadow: 0 0 var(--white), 0 0 0 2px var(--ucla-blue), 0 0 var(--white);
}

.button--primary:active {
  background-color: var(--silver-lake-reservoir);
  color: var(--white);
}

/* Button secondary */

.button--secondary {
  background-color: var(--ucla-yellow);
  border-color: var(--ucla-yellow);
  color: var(--midnight-joshua-tree);
  font-family: var(--font-body);
}

.button--secondary:visited {
  background-color: var(--ucla-yellow);
  color: var(--midnight-joshua-tree);
}

.button--secondary:hover {
  background-color: var(--chumash-soil);
  border-color: var(--chumash-soil);
  color: var(--midnight-joshua-tree);
}

.button--secondary:focus {
  box-shadow: 0 0 var(--white), 0 0 0 2px var(--ucla-yellow), 0 0 var(--white);
}

.button--secondary:active {
  background-color: var(--chumash-soil);
  color: var(--midnight-joshua-tree);
}

/* Give button */

.button--give {
  background-color: transparent;
  border: 0;
  color: var(--white);
  font-family: var(--font-body);
  font-weight: var(--font-weight-400);
  margin-block: 0;
  padding-block: var(--size-2);
  padding-inline: var(--size-4);
}

.button--give:visited {
  background-color: inherit;
  color: inherit;
}

.button--give:hover {
  background-color: inherit;
  color: var(--gray-200);
}

.button--give:focus {
  box-shadow: 0 0 var(--white), 0 0 0 2px var(--white), 0 0 var(--white);
}

.button--give svg {
  inline-size: 1em;
  -webkit-margin-end: var(--size-2);
  margin-inline-end: var(--size-2);
}

/* Translate button */

.button--translate {
  background-color: transparent;
  border: 0;
  color: var(--white);
  font-family: var(--font-body);
  font-weight: var(--font-weight-400);
  margin-block: 0;
  padding-block: var(--size-2);
  padding-inline: var(--size-4);
}

.button--translate:hover {
  background-color: inherit;
  color: var(--gray-200);
}

.button--translate:focus {
  box-shadow: 0 0 var(--white), 0 0 0 2px var(--white), 0 0 var(--white);
}

.button--translate svg {
  inline-size: 1em;
  -webkit-margin-end: var(--size-2);
  margin-inline-end: var(--size-2);
}

/* Search button */

.button--search {
  background-color: transparent;
  border: 0;
  color: var(--white);
  font-family: var(--font-body);
  font-weight: var(--font-weight-400);
  margin-block: 0;
  -webkit-margin-end: 0;
  margin-inline-end: 0;
  padding-block: var(--size-2);
  padding-inline: var(--size-4);
}

.button--search:hover {
  background-color: inherit;
  color: var(--gray-200);
}

.button--search:focus {
  box-shadow: 0 0 var(--white), 0 0 0 2px var(--white), 0 0 var(--white);
}

.button--search svg {
  inline-size: 1em;
  -webkit-margin-end: var(--size-2);
  margin-inline-end: var(--size-2);
}

/* Button square */

.button--square {
  border-radius: var(--radius-4);
  height: 3rem;
  margin: 0;
  padding: 0;
  width: 3rem;
}

.button--square svg {
  height: 1.5rem;
  width: 1.5rem;
}

/* Button outline */

.button--outline {
  background-color: transparent;
  border-color: currentcolor;
  font-family: var(--font-body);
}

.button--outline:hover {
  background-color: var(--black);
  color: var(--white);
}

.button--link {
  color: inherit;
}

.button--link svg {
  display: inline-block;
  height: 1rem;
  -webkit-margin-start: var(--size-05);
  margin-inline-start: var(--size-05);
  width: 1rem;
}

.button--link svg path {
  color: inherit;
}
