/*
Form paragraph.

Styleguide components.d_p.d_p_text_with_bckg
*/

// Colour variables used in this paragraph.
$d-p-text-with-bckg-background-overlay: $color-odysseus !default;
$d-p-text-with-bckg-line-color: $line-background !default;
$d-p-text-with-bckg-line-color-inverted: $color-nestor !default;
$d-p-text-with-bckg-header-color: $color-cassandra !default;

// Margins, paddings and sizing.
$d-p-text-with-bckg-button-margin-top: 3.125rem !default;
$d-p-text-with-bckg-padding-top: 6.5% !default;
$d-p-text-with-bckg-padding-bottom: 6.5% !default;
$d-p-text-with-bckg-mobile-padding-top: 6.25rem !default;
$d-p-text-with-bckg-mobile-padding-bottom: 6.25rem !default;

// Other settings
$d-p-text-with-bckg-img-opacity: 0.1 !default;

// Override default values.
.padding-top-default {
  .paragraph--type--d-p-text-with-bckg {
    padding-top: $d-p-text-with-bckg-padding-top;

    @include media-breakpoint-down(sm) {
      padding-top: $d-p-text-with-bckg-mobile-padding-top;
    }
  }
}

.padding-bottom-default {
  .paragraph--type--d-p-text-with-bckg {
    padding-bottom: $d-p-text-with-bckg-padding-bottom;

    @include media-breakpoint-down(sm) {
      padding-bottom: $d-p-text-with-bckg-mobile-padding-bottom;
    }
  }
}

.theme-default .paragraph--type--d-p-text-with-bckg {
  background: $d-p-text-with-bckg-background-overlay;
}

.paragraph--type--d-p-text-with-bckg {
  position: relative;
  z-index: 0;
  text-align: center;

  .field--name-field-d-main-title {
    @include font-main-header;
    color: $d-p-text-with-bckg-header-color;
    text-align: center;
  }

  .field--name-field-d-media-icon {
    text-align: center;
  }

  h3.field--name-field-d-subtitle {
    @include font-subtitle;
    text-align: center;
  }

  p {
    @include font-body-standard;
    line-height: 1.7;
  }

  .field--name-field-d-main-title,
  .field--name-field-d-subtitle {
    + div > .field--type-link,
    + .field--name-field-d-long-text {
      &::before {
        @include decoration-header-line-main-center($d-p-text-with-bckg-line-color, $d-p-text-with-bckg-line-color-inverted)
      }
    }
  }

  .field--name-field-d-long-text {
    p {
      word-wrap: break-word;
      hyphens: auto;
    }
  }

  .field--type-link {
    text-align: center;
  }

  .d-media-background-wrapper {
    opacity: $d-p-text-with-bckg-img-opacity;
  }

  .content-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
  }
}
