/**
 * Counters paragraph
 */

// Colour variables used in this paragraph.
$d-p-counters-background-overlay: $color-agamemnon !default;
$d-p-counters-line-color: $color-nestor !default;
$d-p-counters-line-color-inverted: $line-background !default;
$d-p-counters-header-color: $color-odysseus !default;
$d-p-counters-number-color: $color-odysseus !default;
$d-p-counters-text-color: $color-nestor !default;
$d-p-counters-long-text-color: $color-odysseus !default;

// Margins, paddings and sizing.
$d-p-counters-padding-top: 7.5rem !default;
$d-p-counters-padding-bottom: 7.5rem !default;
$d-p-counters-mobile-padding-top: 3rem !default;
$d-p-counters-mobile-padding-bottom: 3rem !default;
$d-p-single-counter-padding-x: 5% !default;
$d-p-single-counter-mobile-padding-x: 10% !default;

// Other settings
$d-p-counters-background-opacity: 0.2 !default;

// Override default values.
.padding-top-default {
  .paragraph.paragraph--type--d-p-group-of-counters {
    padding-top: $d-p-counters-padding-top;

    @include media-breakpoint-down(sm) {
      padding-top: $d-p-counters-mobile-padding-top;
    }
  }
}
.padding-bottom-default {
  .paragraph.paragraph--type--d-p-group-of-counters {

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

.theme-default {
  .paragraph--type--d-p-group-of-counters  {
    background: $d-p-counters-background-overlay;

    .content > .field--name-field-d-main-title {
      color: $d-p-counters-header-color;
    }

    .paragraph--type--d-p-single-counter {
      .field--name-field-d-number {
        color: $d-p-counters-number-color;
      }

      .field--name-field-d-main-title {
        color: $d-p-counters-text-color;
      }
    }

    .field--name-field-d-long-text {
      color: $d-p-counters-long-text-color;
    }
  }
}

.paragraph--type--d-p-group-of-counters {
  position: relative;
  z-index: 0;

  .d-media-background-wrapper {
    opacity: $d-p-counters-background-opacity;
  }

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

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

    // The header.
    .content > .field--name-field-d-main-title {
      @include font-main-header;
      text-align: center;

      &::after {
        @include decoration-header-line-main-center($d-p-counters-line-color, $d-p-counters-line-color-inverted);
      }
    }

    // List of counters.
    .paragraph--type--d-p-single-counter {
      text-align: center;
      padding-left: $d-p-single-counter-padding-x;
      padding-right: $d-p-single-counter-padding-x;

      @include media-breakpoint-down(sm) {
        padding-left: $d-p-single-counter-mobile-padding-x;
        padding-right: $d-p-single-counter-mobile-padding-x;
      }

      .field--name-field-d-number {
        @include font-main-header;
        font-family: $font-header;
      }
      .field--name-field-d-main-title {
        font-size: 1rem;
        font-weight: normal;
      }
    }

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