// from https://github.com/CDCgov/dibbs-design-system/blob/main/sass/design_system.scss
// pagination styles removed as in the viewer we want link-y buttons vs button-y buttons

@use "variables" as *;
@use "uswds-core" as *;
@use "uswds-settings" as *;

html,
body {
  height: 100%;
}
html {
  scroll-behavior: auto;
  box-sizing: border-box;
}

body {
  @include u-font("sans", 5);
  line-height: 1.4;
  background-color: $background;
}

.application-container {
  display: flex;
  flex-flow: column;
  min-height: 100%;
}

.usa-header,
.usa-footer {
  padding: 1rem 5rem;
  margin: 0;
  background-color: color("primary-darker");
}

h1,
.usa-prose > h1 {
  @include u-font("serif", 12);
}
h2,
.usa-prose > h2 {
  @include u-font("sans", 11);
}
h3,
.usa-prose h3 {
  @include u-font("sans", 8);
}
h4,
.usa-prose > h4,
h5,
.usa-prose > h5 {
  @include u-font("sans", 5);
}

.main-body {
  display: flex;
  flex: 1 1 auto;
}

.usa-button {
  background-color: color("secondary");
  box-shadow: inset 0 0 0 2px color("secondary");

  &:hover {
    box-shadow: inset 0 0 0 2px color("secondary-dark");
    background-color: color("secondary-dark");
  }

  &:active {
    box-shadow: inset 0 0 0 2px color("secondary-darker");
    background-color: color("secondary-darker");
  }

  &--outline {
    background-color: transparent;
    color: color("secondary");

    &:hover {
      background-color: transparent;
      box-shadow: inset 0 0 0 2px color("secondary-dark");
      color: color("secondary-dark");
    }

    &:active {
      background-color: transparent;
      box-shadow: inset 0 0 0 2px color("secondary-darker");
      color: color("secondary-darker");
    }
  }

  &--secondary {
    background-color: white;
    box-shadow: inset 0 0 0 2px color("secondary");
    color: color("secondary");
  }

  &--secondary:hover {
    background-color: white;
    box-shadow: inset 0 0 0 2px color("secondary-dark");
    color: color("secondary-dark");
  }

  &--secondary:active {
    background-color: white;
    box-shadow: inset 0 0 0 2px color("secondary-darker");
    color: color("secondary-darker");
  }

  &:disabled,
  &:disabled:hover,
  &:disabled:active {
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
    background-color: color("disabled-light");
  }

  &--destructive {
    box-shadow: none;
    color: white;
    background-color: $destructive-primary;
  }
  &--destructive:hover {
    box-shadow: none;
    color: white;
    background-color: $destructive-dark;
  }
  &--destructive:active {
    box-shadow: none;
    color: white;
    background-color: $destructive-darker;
  }
}

.usa-button--unstyled,
a,
a:visited {
  box-shadow: none;
  background-color: transparent;
}

.usa-button--unstyled:disabled {
  box-shadow: none;
  color: color("disabled");
  background-color: transparent;

  &:hover {
    background-color: transparent;
  }
}

.usa-button--unstyled:hover,
a:hover {
  box-shadow: none;
  color: color("primary-dark");
  background-color: transparent;
}

.usa-button--unstyled:active,
a:active {
  box-shadow: none;
  color: color("primary-darker");
  background-color: transparent;
}

.usa-alert--success {
  .usa-alert__body::before {
    background-color: color("success-dark");
  }
}

.usa-alert--info {
  .usa-alert__body::before {
    background-color: color("info-dark");
  }
}

.usa-alert--warning {
  .usa-alert__body::before {
    background-color: color("warning-dark");
  }
}

.usa-alert--error {
  .usa-alert__body::before {
    background-color: color("error-dark");
  }
}

.usa-step-indicator__segment:before {
  box-shadow:
    0 0 0 0.25rem white,
    0 0 0 0 white;
}

.usa-step-indicator__segment-label,
.usa-step-indicator__segment:before {
  color: $text-inactive-dark;
}

.usa-step-indicator__segment--current .usa-step-indicator__segment-label {
  color: color("primary");
}

.usa-step-indicator__segment--current::before,
.usa-step-indicator__segment--current::after {
  background-color: color("primary");
  color: color("primary");
  box-shadow:
    0 0 0 0.25rem white,
    0 0 0 0 white;
}

.usa-accordion {
  border-radius: 4px;
  padding: 0px;
}

.usa-accordion__button,
.usa-accordion__button:hover {
  background-color: $background-darker;
  color: $text-primary;
}

.usa-modal__close {
  background-color: white;
  box-shadow: none;

  &:active,
  &:hover {
    background-color: white;
    box-shadow: none;
  }
}

.usa-checkbox__input:checked + [class*="__label"]::before {
  background-color: color("secondary");
  box-shadow: none;
}
.usa-radio__input:checked + [class*="__label"]::before {
  background-color: color("secondary");
  box-shadow:
    0 0 0 2px color("secondary"),
    inset 0 0 0 2px #fff;
}

.usa-checkbox__label {
  cursor: pointer;
  display: inherit;
  font-weight: normal;
  margin-top: 0rem;
  padding-left: 2rem;
  position: relative;
}

.usa-pagination {
  background-color: transparent;
}

.usa-step-indicator__segment-label {
  padding-right: 0;
}

.usa-sidenav__item a:not(.usa-sidenav__sublist a) {
  font-weight: bold;
}

ul.usa-sidenav
  > li.usa-sidenav__item
  > ul.usa-sidenav__sublist
  > li.usa-sidenav__item
  > a {
  font-weight: bold;
}

ul.usa-sidenav
  > li.usa-sidenav__item
  > ul.usa-sidenav__sublist
  > li.usa-sidenav__item
  > a.usa-current {
  &::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0.25rem;
    top: 0.25rem;
    width: 0.25rem;
    left: 0rem;
    border-radius: 99rem;
  }
}

.usa-step-indicator__current-step {
  background-color: color("primary");
  margin-right: 0.5rem;
  padding: 0;
  height: 2.75rem;
  width: 2.75rem;
}

.usa-step-indicator__total-steps {
  color: color("primary");
}

.usa-step-indicator__total-steps,
.usa-step-indicator__current-step {
  font-size: 2rem;
}

.usa-step-indicator__segment--current:before,
.usa-step-indicator__segment--complete:before {
  box-shadow:
    inset 0 0 0 0 color("primary-darker"),
    0 0 0 0.25rem white;
}

.usa-alert__heading {
  &.h1 {
    font-size: 2.125rem;
    font-weight: bold;
    line-height: 1.5;
  }

  &.h2 {
    font-size: 1.875rem;
    font-weight: bold;
    line-height: 1.5;
  }

  &.h3 {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.4;
  }

  &.h4 {
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1.3;
  }

  &.h5 {
    font-size: 1.125rem;
    font-weight: bold;
    line-height: 1.2;
  }

  &.h6 {
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.2;
  }
}

.usa-alert__text {
  font-size: 0.875rem;
}
