@use "../../styles/variables" as vars;
@use "../../styles/screen" as screen;

.page-layout {
  &__row {
    position: relative;

    display: flex;
    flex-flow: row nowrap;
    align-items: flex-start;

    margin: 0 auto;
    width: 100%;
    max-width: vars.$site-width;

    @include screen.print {
      width: 100% !important;
      padding: 0 !important;
      margin: 0 !important;
      max-width: 100% !important;
    }

    @include screen.smTablet {
      flex-flow: column wrap;
    }
  }

  &__column-left {
    position: sticky;
    top: 20px;
    bottom: 20px;
    z-index: 1001;

    flex-shrink: 0;
    margin-left: 0;
    margin-right: 1.5%;
    width: vars.$left-aside-width;

    @media (max-width: vars.$media-breakpoint-desktop) {
      width: vars.$left-aside-width-desktop;
    }

    @media (max-width: vars.$media-breakpoint-tablet) {
      position: relative;
      top: 0;

      width: 100%;
      margin-right: 0;
    }
  }

  &__column-right {
    position: relative;
    width: calc(100% - #{vars.$left-aside-width} - #{vars.$column-spacing});

    @include screen.print {
      width: 100% !important;
      margin-top: 20px !important;
    }

    @media (max-width: vars.$media-breakpoint-desktop) {
      width: calc(100% - #{vars.$left-aside-width-desktop} - 1.5%);
    }

    @media (max-width: vars.$media-breakpoint-tablet) {
      width: 100%;
    }
  }

  &__header-right {
    margin-top: auto;
    display: flex;
    justify-content: space-between;

    @include screen.smTablet {
      flex-direction: column;
      order: 1;
    }
  }

  &__header-left {
    margin-top: auto;

    @include screen.smTablet {
      order: 2;
    }
  }

  &__title-row {
    display: flex;
    align-items: center;
    width: 100%;
  }

  &__title {
    width: calc(100% - 120px);
  }

  &__title--fullwidth {
    width: 100%;
  }

  &__header {
    position: relative;
    z-index: 1001;

    padding-top: vars.$space-top-site;
    margin-bottom: vars.$space-xl;

    @include screen.mobile {
      margin-bottom: vars.$space-m;
    }
  }

  &__content &__column-left {
    @include screen.smTablet {
      margin-bottom: vars.$space-xl;
    }

    @include screen.mobile {
      margin-bottom: vars.$space-m;
    }
  }

  &__content &__column-left:empty {
    @include screen.smTablet {
      margin-bottom: 0;
    }
  }

  &__sticky-content {
    @include screen.gt-mobile {
      position: sticky;
      z-index: 1000;
      top: 60px;
    }
  }
}
