/* GENERAL */
.h5p-theme-primary-cta,
.h5p-theme-secondary-cta,
.h5p-theme-nav-button {
  border: solid 3px var(--h5p-theme-main-cta-base);
  border-radius: var(--h5p-theme-border-radius-medium);
  line-height: 1;
  transition: all 0.1s linear 0s;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.h5p-theme-primary-cta,
.h5p-theme-secondary-cta {
  font-size: var(--h5p-theme-font-size-m);
  font-weight: 600;
}

.h5p-theme-secondary-cta,
.h5p-theme-nav-button {
  padding: var(--h5p-theme-spacing-xs) var(--h5p-theme-spacing-s);
}

.h5p-theme-primary-cta:active,
.h5p-theme-secondary-cta:active {
  background-color: var(--h5p-theme-main-cta-dark);
  border-color: var(--h5p-theme-main-cta-dark);
}

.h5p-theme-primary-cta:before,
.h5p-theme-secondary-cta:before,
.h5p-theme-next:after,
.h5p-theme-previous:before {
  display: inline-block;
  font-family: 'h5p-theme';
  margin-right: var(--h5p-theme-spacing-xxs);
  font-weight: normal;
}

.h5p-theme .h5p-theme-secondary-cta:focus-visible,
.h5p-theme .h5p-theme-primary-cta:focus-visible,
.h5p-theme .h5p-theme-nav-button:focus-visible {
  outline: 2px ridge var(--h5p-theme-main-cta-base);
  border-radius: 4px;
  outline-offset: 2px;
}

/* PRIMARY CTA (USED FOR VALIDATION BUTTONS) */
.h5p-theme-primary-cta,
.h5p-theme .h5p-theme-primary-cta {
  --transition-h5p-theme-primary-cta: all 0.1s linear 0s;
  padding: var(--h5p-theme-spacing-xs) var(--h5p-theme-spacing-l);
  background-color: var(--h5p-theme-main-cta-base);
  transition-property: text-indent, padding;
  transition: var(--transition-h5p-theme-primary-cta);
  color: var(--h5p-theme-contrast-cta);
  max-width: 100%;
}

.h5p-theme-primary-cta:hover,
.h5p-theme .h5p-theme-primary-cta:hover {
  padding: var(--h5p-theme-spacing-xs) calc(var(--h5p-theme-spacing-l) - var(--h5p-theme-spacing-m)/2);
  background-color: var(--h5p-theme-main-cta-light);
  border-color: var(--h5p-theme-main-cta-light);
  text-indent: var(--h5p-theme-spacing-m);
}

.h5p-theme-primary-cta:before {
  position: absolute;
  opacity: 0;
  transform: translate(calc(-1 * var(--h5p-theme-spacing-xxs) - var(--h5p-theme-spacing-m) / 2), 10px);
  transition: var(--transition-h5p-theme-primary-cta);
  transition-property: transform, opacity;
  margin-right: 0;
}

.h5p-theme-primary-cta:hover:before {
  opacity: 1;
  transform: translate(calc(-1 * var(--h5p-theme-spacing-xxs) - var(--h5p-theme-spacing-m)), 0);
}

/* Will target Safari only which needs this or makes the whole content shift a bit. Applied selectively to prevent performance issues */
@supports (-webkit-hyphens: none) and (not (-moz-appearance: none)) {
  .h5p-theme-primary-cta:before {
    will-change: transform;
  }
}

/* If the container is smaller than 200px */
@container (max-width: 200px) {
  .h5p-theme .h5p-theme-primary-cta {
    justify-content: center;
    padding: 0;
    height: var(--h5p-theme-spacing-xl);
    min-width: var(--h5p-theme-spacing-xl);
  }

  .h5p-theme-primary-cta .h5p-theme-label {
    display: none;
  }

  .h5p-theme .h5p-theme-primary-cta:hover {
    text-indent: 0;
    padding: 0;
  }

  .h5p-theme .h5p-theme-primary-cta:before {
    position: unset;
    opacity: 1;
    transform: translate(0, 0);
    text-indent: 0;
    margin-right: 0;
  }

  .h5p-theme .h5p-theme-label {
    display: none;
  }
}

/* SECONDARY CTA (USED FOR SHOW SOLTUIONS, RETRY AND SIMILAR BUTTONS) */
.h5p-theme-secondary-cta,
.h5p-theme .h5p-theme-secondary-cta {
  background-color: var(--h5p-theme-ui-base);
  border-color: var(--h5p-theme-contrast-cta-white);
  color: var(--h5p-theme-contrast-cta-white);
  width: fit-content;
}

.h5p-theme-secondary-cta:hover,
.h5p-theme .h5p-theme-secondary-cta:hover {
  background-color: var(--h5p-theme-contrast-cta-white);
  border-color: var(--h5p-theme-contrast-cta-white);
  color: var(--h5p-theme-secondary-contrast-cta-hover);
}

.h5p-theme-secondary-cta:active,
.h5p-theme .h5p-theme-secondary-cta:active {
  color: var(--h5p-theme-contrast-cta);
}

/* If the container is smaller than 350px */
@container (max-width: 350px) {
  .h5p-theme-secondary-cta .h5p-theme-label {
    display: none;
  }

  .h5p-theme-secondary-cta:before {
    width: 100%;
    margin-right: unset;
  }
}

/* NAVIGATION BUTTONS */
.h5p-theme-nav-button,
.h5p-theme .h5p-theme-nav-button {
  min-width: max-content;
  border: none;
  background-color: var(--h5p-theme-secondary-cta-base);
  font-size: var(--h5p-theme-font-size-s);
  font-weight: bold;
  color: var(--h5p-theme-secondary-contrast-cta);
  white-space: nowrap;
}

.h5p-theme .h5p-theme-nav-button:hover {
  background-color: var(--h5p-theme-secondary-cta-light);
  color: var(--h5p-theme-secondary-contrast-cta);
  border-color: var(--h5p-theme-secondary-cta-light);
}

.h5p-theme .h5p-theme-nav-button:active {
  background-color: var(--h5p-theme-secondary-cta-dark);
  color: var(--h5p-theme-secondary-contrast-cta);
  border-color: var(--h5p-theme-secondary-cta-dark);
}

.h5p-theme-nav-button[aria-disabled="true"],
.h5p-theme-nav-button:disabled {
  opacity: 0.4;
}

.h5p-theme-nav-button.h5p-theme-label {
  display: inline-block;
}

.h5p-theme .h5p-theme-next {
  justify-self: flex-end;
}

.h5p-theme-next:after {
  content: "\e901";
  margin-left: var(--h5p-theme-spacing-xxs);
  margin-right: 0;
}

.h5p-theme .h5p-theme-previous {
  justify-self: flex-start;
}

.h5p-theme-previous:before {
  content: "\e900";
}

/* If smaller than 700px */
@container h5p-navigation (max-width: 700px) {
  .h5p-theme-label {
    display: none;
  }

  .h5p-theme-next:after, .h5p-theme-previous:before {
    margin: 0;
  }

  /* Primary CTA if inside navigation */
  .h5p-theme .h5p-navigation .h5p-theme-primary-cta {
    height: var(--h5p-theme-spacing-xl);
    width: var(--h5p-theme-spacing-xl);
    padding: 0;
    text-indent: 0;
  }

  .h5p-theme .h5p-navigation .h5p-theme-primary-cta:hover {
    height: var(--h5p-theme-spacing-xl);
    width: var(--h5p-theme-spacing-xl);
    padding: 0;
  }

  .h5p-navigation .h5p-theme-primary-cta span {
    display: none;
  }

  .h5p-navigation .h5p-theme-primary-cta:before {
    text-indent: 0;
    position: unset;
    width: 100%;
    opacity: 1;
    transform: translate(0, 0);
  }

  .h5p-navigation .h5p-theme-primary-cta:hover:before {
    text-indent: 0;
    transform: translate(0, 0);
  }
}
