@import "govuk_publishing_components/individual_component_support";

.html-publication {
  .publication-external {
    margin-bottom: govuk-spacing(4);
    position: relative;

    // design calls for the logos at the top to always be left aligned
    .direction-rtl & {
      direction: ltr;
    }
  }

  .contents-list-container {
    @include govuk-media-query($from: desktop) {
      position: sticky;
      top: govuk-spacing(2);
      max-height: 100vh;
      overflow-y: auto;
      margin-bottom: govuk-spacing(4);
    }

    .direction-rtl & {
      float: right;
    }
  }

  .contents-container {
    .direction-rtl & {
      float: left;
    }
  }

  .offset-empty-contents-list {
    // stylelint-disable max-nesting-depth
    @include govuk-media-query($from: desktop) {
      float: right;

      .direction-rtl & {
        float: left;
      }
    }
    // stylelint-enable max-nesting-depth
  }

  .meta-data {
    display: none;
  }

  .sticky-element {
    .sticky-element__print-link {
      margin-left: govuk-spacing(3);
    }
  }

  @include govuk-media-query($until: desktop) {
    .sticky-element--enabled {
      position: static;
    }
  }
}

// Required to display a separate meta data page when printing
@include govuk-media-query($media-type: print) {
  .html-publication .print-wrapper {
    .meta-data--display-print {
      page-break-before: always;
      page-break-after: always;
      display: block;

      .meta-data-licence {
        width: 78px;
        height: auto;
        margin-top: 60px;
        margin-bottom: 40px;
      }
    }
  }
}
