// Buttons

.btn {
  text-transform: uppercase;

  &:focus {
    box-shadow: none !important;
  }
}

.btn:focus,
.btn.focus,
.btn:active:focus,
.btn.focus:active,
.btn.active:focus,
.btn.active.focus {
  text-decoration: none;
}

.btn.group-move {
  cursor: move;
}

.btn-secondary {
  color: $gray-800;
  background-color: $white;
  border-color: $gray-400;

  &:hover,
  &:focus {
    color: $gray-800;
    background-color: $gray-100;
  }
}

.btn-link {
  --btn-color: var(--body-color, inherit);
  --btn-hover-color: var(--secondary);
  --btn-focus-color: var(--secondary);
  --btn-active-color: var(--secondary);
  --btn-border-width: 2px;
  --btn-padding-x: 0;
  --btn-padding-y: 0;
  --btn-font-weight: 600;
  text-decoration: none;
  border-bottom-color: var(--template-link-color);

  &:hover,
  &:focus,
  &:active,
  &:active:first-child {
    color: var(--btn-hover-color);
    text-decoration: none;
    border-bottom-color: var(--template-link-color);
  }
}

.link-switch {
  color: inherit;
  opacity: 0.4;

  &.active {
      color: inherit;
      opacity: 1;
  }

  &:hover:not(.active),
  &:focus:not(.active) {
      color: inherit;
      opacity: 0.7;
  }
}

.btn-primary {
  --btn-color: var(--template-primary-contrast-color);
  --btn-bg: var(--template-primary-color);
  --btn-border-color: var(--template-primary-color);
  --btn-hover-color: var(--template-primary-hover-contrast-color);
  --btn-hover-bg: var(--template-primary-hover-color);
  --btn-hover-border-color: var(--template-primary-hover-color);
  --btn-focus-shadow-rgb: 39, 39, 111;
  --btn-active-color: var(--template-primary-hover-contrast-color);
  --btn-active-bg: var(--template-primary-hover-color);
  --btn-active-border-color: var(--template-primary-hover-color);
  --btn-active-shadow: none;
  --btn-disabled-color: var(--template-primary-contrast-color);
  --btn-disabled-bg: var(--template-primary-color);
  --btn-disabled-border-color: var(--template-primary-color);
}

.btn-outline-primary {
  --btn-color: var(--template-primary-color);
  --btn-border-color: var(--template-primary-color);
  --btn-hover-color: var(--template-primary-hover-contrast-color);
  --btn-hover-bg: var(--template-primary-hover-color);
  --btn-hover-border-color: var(--template-primary-hover-color);
  --btn-focus-shadow-rgb: 1, 1, 86;
  --btn-active-color: var(--template-primary-hover-contrast-color);
  --btn-active-bg: var(--template-primary-hover-color);
  --btn-active-border-color: var(--template-primary-hover-color);
  --btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --btn-disabled-color: var(--template-primary-color);
  --btn-disabled-bg: transparent;
  --btn-disabled-border-color: var(--template-primary-color);
}

.btn-icon {
  background-color: transparent;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  color: inherit;
  padding: 0.2rem 0.5rem;
  margin: 0;
  font-weight: 600;

  &:focus {
    box-shadow: none !important;
  }
}

.btn-hover {
  opacity: 0.75;

  &:hover {
    opacity: 1;
  }
}

.btn-close {
  &:focus {
    box-shadow: none !important;
  }
}

.btn-group {
  margin-bottom: $neoteric-grid-gutter;

  >input {
      padding: $neoteric-grid-gutter * .5;
      border: 1px solid $gray-400;
      @include border-start-radius($border-radius);
      @include border-end-radius(0);
  }

  >.btn-group {
      margin-bottom: 0;
  }
}

.article-info .association,
.cat-list-association {
  .btn-secondary {
    font-weight: 700;
    color: $white;
    background-color: $gray-600;
    border-color: $gray-400;

    &:hover,
    &:focus {
      color: $white;
      background-color: $gray-800;
    }
  }

  .btn-sm {
    padding: 0 .25rem;
    font-size: .8rem;
    border-radius: .2rem;
  }
}

.offcanvas-toggler {
  background-color: transparent;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  margin: 0;
  text-align: center;
  color: inherit;
}

.modal-header.text-white {
  .btn-close {
      color: var(--neoteric-offcanvas-header-color, #fff);
      background-image: escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='#ffffff'><path d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/></svg>"));
  }
}

.btn-switch {
  border-radius: 0.25em;
  height: 2.36rem;
  width: 2.36rem;
  font-size: 1.05rem;
  padding: 0.25rem;
  margin-bottom: 0 !important;
}

@include media-breakpoint-down(lg) {
  .btn {
    margin-bottom: .25rem;
  }
  .input-group .btn {
    margin-bottom: 0;
  }
}
