/*
  Buttons and links created in the WYSIWYG editor.

  Roles:
  - Primary (.service-cta-block__link--cta-action, .btn-start): solid fill.
  - Secondary (.service-cta-block__link--cta-information): outlined.
  - Text links (.external-link, .pdf-link): icon follows the text colour.

  Green on the default background, pink inside the accent page section. The
  start button is always pink.
*/
body {
  --hh-button-primary-bg: #007f3b;
  --hh-button-primary-bg-hover: #00662f;
  --hh-button-primary-text: var(--color-white);
  --hh-button-secondary-border: var(--color-accent);
  --hh-button-secondary-text: var(--color-accent);
  --hh-button-secondary-text-hover: var(--color-accent-contrast);
  --hh-focus-ring: var(--color-text);
}

.lgd-page-section--bg-colour-1 {
  --hh-button-primary-bg: #fa2cde;
  --hh-button-primary-bg-hover: #ed328b;
  --hh-button-primary-text: #000;
  --hh-button-secondary-border: #fa2cde;
  --hh-button-secondary-text: var(--color-accent-contrast);
  --hh-button-secondary-text-hover: #000;
  --hh-focus-ring: var(--color-accent-contrast);
}

/* Primary */
.service-cta-block__link--cta-action,
.btn.btn-start {
  color: var(--hh-button-primary-text) !important;
  background-color: var(--hh-button-primary-bg);
}

.service-cta-block__link--cta-action:hover,
.service-cta-block__link--cta-action:focus,
.btn.btn-start:hover,
.btn.btn-start:focus {
  color: var(--hh-button-primary-text) !important;
  background-color: var(--hh-button-primary-bg-hover);
}

/* Primary with arrow: keep the icon next to the text and the same colour. */
.service-cta-block__link.action-link {
  justify-content: flex-start;
  --icon-color: currentColor;
}

.service-cta-block__link.action-link::before {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: var(--spacing-smaller);
  mask-size: contain;
}

/*
  Start button: the primary style in pink, larger, with an arrow point like
  the banner button. The point inherits the background so it follows hover.
*/
.btn.btn-start {
  --hh-start-point: 0.5em;
  --hh-button-primary-bg: #fa2cde;
  --hh-button-primary-bg-hover: #ed328b;
  --hh-button-primary-text: #000;
  position: relative;
  margin-inline-end: var(--hh-start-point);
  padding: var(--spacing) var(--spacing-large);
  border: 0;
  font-size: 20px;
  font-weight: bold;
}

.btn.btn-start::after {
  position: absolute;
  top: 0;
  left: 100%;
  width: var(--hh-start-point);
  height: 100%;
  margin: 0;
  content: "";
  background-color: inherit;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Secondary */
.service-cta-block__link--cta-information {
  color: var(--hh-button-secondary-text) !important;
  background-color: transparent;
  box-shadow: inset 0 0 0 3px var(--hh-button-secondary-border);
}

.service-cta-block__link--cta-information:hover,
.service-cta-block__link--cta-information:focus {
  color: var(--hh-button-secondary-text-hover) !important;
  background-color: var(--hh-button-secondary-border);
}

/* Focus ring sits outside the button so it shows on both backgrounds. */
.service-cta-block__link:focus-visible,
.btn.btn-start:focus-visible {
  outline: 3px solid var(--hh-focus-ring);
  outline-offset: 3px;
}

/* Text links */
.external-link {
  --external-link-icon-color: currentColor;
}

.pdf-link::after {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-inline-start: 0.25rem;
  vertical-align: -0.125em;
  content: "";
  background-color: currentColor;
  mask: url(../../../../contrib/localgov_base/templates/includes/icons/file.svg) center / contain no-repeat;
}
