// stylelint-disable selector-max-class
// stylelint-disable selector-max-compound-selectors
// stylelint-disable selector-max-combinators

// Section

.sections {
  position: relative;
}

.section {
  --lx-section-spacer-y: #{$section-spacer-y};
  --lx-section-spacer-y-lg: #{$section-spacer-y-lg};
  --lx-section-spacer-t: var(--lx-section-spacer-y);
  --lx-section-spacer-b: var(--lx-section-spacer-y);
  --lx-section-bg-pull-length: #{$section-bg-pull-length};
  --lx-section-bg-pull-length-lg: #{$section-bg-pull-length-lg};
  --lx-section-header-mb: #{$section-header-mb};
  --lx-section-header-mb-lg: #{$section-header-mb-lg};
  --lx-section-footer-mt: #{$section-footer-mt};
  --lx-section-footer-mt-lg: #{$section-footer-mt-lg};

  position: relative;
  display: flex;
  flex-direction: column;
  // background-color: var(--#{$prefix}body-bg);

  + .sticky-placeholder {
    --lx-section-spacer-y: #{$section-spacer-y};
    --lx-section-spacer-y-lg: #{$section-spacer-y-lg};
    --lx-placeholder-spacer-y: 0;
    --lx-placeholder-spacer-t: var(--lx-placeholder-spacer-y);
    --lx-placeholder-spacer-b: var(--lx-placeholder-spacer-y);
    padding-top: var(--lx-placeholder-spacer-t);
    padding-bottom: var(--lx-placeholder-spacer-b);
  }
}

.section-inner {
  position: relative;
  // z-index: 2;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--lx-section-spacer-t) * .75);
  padding-bottom: calc(var(--lx-section-spacer-b) * .75);

  .section-bg + &:not(.sections) {
    height: 100%;
    padding-top: var(--lx-section-spacer-t);
  }

  &:last-child {
    padding-bottom: var(--lx-section-spacer-b);
  }

  &.sections {
    padding-top: 0;
    padding-bottom: 0;
  }
}

.section-header:not(.swiper-slide) {
  margin-bottom: var(--lx-section-header-mb);
}

.section-title {
  font-family: $section-title-font-family;
  font-style: $section-title-font-style;
  font-weight: $section-title-font-weight;
  @include font-size($section-title-font-size);
}

.section-footer {
  margin-top: var(--lx-section-footer-mt);
}

.section-more {
  .btn-link {

    &:not(.btn-hover-outline-primary) {
      margin-left: calc(-1 * var(--#{$prefix}btn-padding-x));
    }
  }
}

.section-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transition: $transition-base;
}

// .section--bg-pull-up-t,
// .section--bg-pull-up-b,
// .section--bg-pull-up,
// .section--bg-pull-down-t,
// .section--bg-pull-down-b,
// .section--bg-pull-down {
//   > .section-bg {
//     top: var(--lx-section-bg-pull-t, 0);
//     bottom: var(--lx-section-bg-pull-b, 0);
//   }
//   + .section > .section-bg,
//   + .sticky-placeholder + .section > .section-bg {
//     top: var(--lx-next-section-bg-pull-t, 0);
//   }
// }

.section--bg-pull-up-t,
.section--bg-pull-up {
  --lx-section-bg-pull-t: calc(-1 * var(--lx-section-bg-pull-length));

  > .section-bg {
    top: var(--lx-section-bg-pull-t, 0);
  }
}

.section--bg-pull-up-b,
.section--bg-pull-up {
  --lx-section-bg-pull-b: var(--lx-section-bg-pull-length);

  > .section-bg {
    bottom: var(--lx-section-bg-pull-b, 0);
  }

  + .section,
  + .sticky-placeholder + .section {
    --lx-next-section-bg-pull-t: calc(-1 * var(--lx-section-bg-pull-length));

    > .section-bg {
      top: var(--lx-next-section-bg-pull-t, 0);
    }
  }
}

.section--bg-pull-down-t,
.section--bg-pull-down {
  --lx-section-bg-pull-t: var(--lx-section-bg-pull-length);

  > .section-bg {
    top: var(--lx-section-bg-pull-t, 0);
  }
}

.section--bg-pull-down-b,
.section--bg-pull-down {
  --lx-section-bg-pull-b: calc(-1 * var(--lx-section-bg-pull-length));

  > .section-bg {
    bottom: var(--lx-section-bg-pull-b, 0);
  }

  + .section,
  + .sticky-placeholder + .section {
    --lx-next-section-bg-pull-t: var(--lx-section-bg-pull-length);

    > .section-bg {
      top: var(--lx-next-section-bg-pull-t, 0);
    }
  }
}

.sections--main {

  > .section:first-child {
    margin-top: calc(-1 * var(--lx-masthead-height, $masthead-navbar-height));
  }

  > .section:first-child,
  > .section:first-child > .section-bg + .section {
    --lx-section-bg-pull-t: var(--lx-section-spacer-t);

    > .section-bg + .section-inner,
    > .section-inner:first-child {
      --lx-section-spacer-t: calc(var(--lx-section-spacer-y) + var(--lx-masthead-height, #{$masthead-navbar-height}));
    }

    &.section--bg-pull-up-t,
    &.section--bg-pull-up {
      --lx-section-bg-pull-t: 0;
    }

    &.section--bg-pull-down-t,
    &.section--bg-pull-down {
      --lx-section-bg-pull-t: var(--lx-section-bg-pull-length);
    }
  }
}

.list {
  position: relative;
  padding-left: 2.75rem;

  &::before {
    position: relative;
    display: block;
    float: left;
    width: 1.75rem;
    height: 1px;
    margin-top: .85rem;
    margin-left: -2.75rem;
    content: "";
    background-color: $primary;
  }
}

.section.section--spacer-y-0 {
  --lx-section-spacer-y: 0rem; // stylelint-disable-line length-zero-no-unit
  --lx-section-spacer-t: 0rem; // stylelint-disable-line length-zero-no-unit
  --lx-section-spacer-b: 0rem; // stylelint-disable-line length-zero-no-unit

  // + .sticky-placeholder {
  //   --lx-placeholder-spacer-y: 0;
  // }
}

.section.section--spacer-t-0 {
  --lx-section-spacer-t: 0rem; // stylelint-disable-line length-zero-no-unit

  // + .sticky-placeholder {
  //   --lx-placeholder-spacer-t: 0;
  // }
}

.section.section--spacer-b-0 {
  --lx-section-spacer-b: 0rem; // stylelint-disable-line length-zero-no-unit

  // + .sticky-placeholder {
  //   --lx-placeholder-spacer-b: 0;
  // }
}

.section.section--spacer-y-sm {
  --lx-section-spacer-y: 1rem;
  --lx-section-spacer-t: 1rem;
  --lx-section-spacer-b: 1rem;

  // + .sticky-placeholder {
  //   --lx-placeholder-spacer-y: 1rem;
  // }
}

.section.section--spacer-t-sm {
  --lx-section-spacer-t: 1rem;

  // + .sticky-placeholder {
  //   --lx-placeholder-spacer-t: 1rem;
  // }
}

.section.section--spacer-b-sm {
  --lx-section-spacer-b: 1rem;

  // + .sticky-placeholder {
  //   --lx-placeholder-spacer-b: 1rem;
  // }
}

.if-is-sticky--spacer-sm {
  &.is-sticky {
    --lx-section-spacer-y: 1rem;
    --lx-section-spacer-t: var(--lx-section-spacer-y);
    --lx-section-spacer-b: var(--lx-section-spacer-y);

    // + .sticky-placeholder {
    //   --lx-placeholder-spacer-y: calc(var(--lx-section-spacer-y) - 1rem);
    //   --lx-placeholder-spacer-t: var(--lx-placeholder-spacer-y);
    //   --lx-placeholder-spacer-b: var(--lx-placeholder-spacer-y);
    // }
  }
}

.sections--sidebar {
  .section {
    --lx-section-spacer-t: 0;
  }
}

@include media-breakpoint-up(lg) {

  .section {
    --lx-section-spacer-y: var(--lx-section-spacer-y-lg);
    --lx-section-bg-pull-length: var(--lx-section-bg-pull-length-lg);
    --lx-section-header-mb: var(--lx-section-header-mb-lg);
    --lx-section-footer-mt: var(--lx-section-footer-mt-lg);

    // + .sticky-placeholder {
    //   --lx-section-spacer-y: var(--lx-section-spacer-y-lg);
    // }
  }

  .row > .section-subtitle {
    padding: 1rem;
    border-left: var(--lx-ornament-border-width) var(--lx-ornament-border-color) var(--lx-ornament-border-style);
  }

}
