@import "govuk_publishing_components/individual_component_support";
@import "govuk/components/accordion/accordion";

// Prevent elements inside the button from receiving click events
.gem-c-accordion__show-all > * {
  pointer-events: none;
}

// This is in place until a proper fix comes through from GOV.UK Frontend.
//
// TODO: Replace with the print styles that will come from GOV.UK Frontend.

// stylelint-disable declaration-no-important
@include govuk-media-query($media-type: print) {
  // Open all of the accordion sections.
  .govuk-accordion__section-content {
    display: block !important;

    > :last-child {
      margin-bottom: 20px;
    }
  }

  .govuk-frontend-supported .govuk-accordion__section-content[hidden] {
    @supports (content-visibility: hidden) {
      content-visibility: auto;
    }
  }

  // Change the colour from the blue link colour to black.
  .govuk-accordion__section-button {
    color: govuk-colour("black") !important;
    padding: 20px 0 0 !important;
    border-bottom: 0 !important;
  }

  // Change the summary subheading size.
  .govuk-accordion__section-summary {
    @include govuk-typography-common;
    @include govuk-font-size($size: 16, $important: true);
  }

  // Hide the unusable "Show all" and "Show" sections.
  .govuk-accordion__show-all,
  .govuk-accordion__section-toggle {
    display: none !important;
  }

  // Remove extra space for expanded accordions, not needed on a printout
  .govuk-accordion__section--expanded {
    .govuk-accordion__section-content {
      padding: 0 !important;
    }
  }
}
// stylelint-enable declaration-no-important
