@import "govuk_publishing_components/individual_component_support";

.gem-c-metadata {
  @include govuk-text-colour;
  @include govuk-font(16);
  @include responsive-bottom-margin;
  @include govuk-clearfix;

  a {
    font-weight: bold;
    @include govuk-link-common;
    @include govuk-link-style-default;
  }

  .gem-c-metadata__definition-link {
    font-weight: normal;
  }
}

.direction-rtl .gem-c-metadata,
.gem-c-metadata.direction-rtl {
  direction: rtl;
  text-align: start;
}

.gem-c-metadata--inverse {
  color: govuk-colour("white");

  a {
    @include govuk-link-style-inverse;
  }
}

.gem-c-metadata--inverse-padded {
  padding: govuk-spacing(2) govuk-spacing(4);

  @include govuk-media-query($from: tablet) {
    padding: govuk-spacing(2) govuk-spacing(5);
  }

  .gem-c-metadata__list {
    margin: govuk-spacing(2) 0;

    @include govuk-media-query($from: tablet) {
      margin: govuk-spacing(3) 0;
    }
  }
}

.gem-c-metadata__term,
.gem-c-metadata__definition {
  line-height: 1.4;
}

.gem-c-metadata__term {
  margin-top: .5em;

  @include govuk-media-query($from: tablet) {
    box-sizing: border-box;
    float: inline-start;
    padding-inline-start: 0;
    padding-inline-end: govuk-spacing(1);
    margin-top: 0;
  }
}

.gem-c-metadata__definition {
  margin: 0;

  @include govuk-media-query($from: tablet) {
    &:not(:last-of-type) {
      margin-bottom: govuk-spacing(1);
    }
  }
}

.gem-c-metadata__toggle-wrap {
  display: none;
}

.govuk-frontend-supported .gem-c-metadata__toggle-wrap {
  display: block;
}

.govuk-frontend-supported .gem-c-metadata__toggle-items.js-hidden {
  display: none;
}

// stylelint-disable declaration-no-important
@include govuk-media-query($media-type: print) {
  .gem-c-metadata {
    break-inside: avoid;
    color: $govuk-print-text-colour !important;
    background: none;
    margin-bottom: 5mm;

    a,
    a:visited {
      color: $govuk-print-text-colour !important;
    }
  }

  .gem-c-metadata--inverse-padded,
  .gem-c-metadata--inverse-padded .gem-c-metadata__title {
    padding: 0;
  }

  .gem-c-metadata--inverse-padded .gem-c-metadata__list {
    margin-left: 0;
    margin-right: 0;
  }
}
// stylelint-enable declaration-no-important
