@use 'sass:map';
@use '@ecl/theme-ec/theme' as *;

* + .anatomy {
  margin-top: var(--ws-s-m);
}

.container {
  background-color: var(--ws-c-n-40);
  padding: var(--ws-s-l) var(--ws-s-m);
}

.image-container {
  align-items: center;
  background-color: map.get($theme, 'color', 'white');
  border: 1px solid var(--ws-c-n-60);
  display: flex;
  justify-content: center;
}

.image {
  // IE fix
  flex-basis: auto;
  flex-grow: 0;
  flex-shrink: 0;

  // end of: IE fix
  height: auto;
  max-width: 100%;
}

.legend {
  align-items: center;
  display: flex;
  flex-direction: row;
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.legend__item {
  display: inline-flex;
  margin-right: var(--ws-s-xl);

  &:last-child {
    margin-right: 0;
  }
}

.legend__item-last {
  flex-grow: 1;
  display: inline-flex;
  justify-content: flex-end;
}

.legend__color {
  border-radius: 2px;
  height: 1rem;
  margin-right: var(--ws-s-s);
  width: 1.25rem;
}

.legend__label {
  color: var(--ws-c-d);
  font: var(--ws-f-s);
  font-style: italic;
}

.legend__description {
  color: var(--ws-c-d-80);
  font: var(--ws-f-s);
  margin-top: var(--ws-s-m);
}

.link {
  align-items: center;
  box-sizing: border-box;
  color: var(--ws-c-p);
  display: inline-flex;
  float: right;
  font: var(--ws-f-m);
  text-decoration: none;
}

.link__icon {
  fill: currentcolor;
  height: 1em;
  margin-left: var(--ws-s-xs);
  width: 1em;
  transform: rotateZ(90deg);
}

.link:hover,
.link:focus {
  color: map.get($theme, 'color', 'black');
  text-decoration: underline;

  &.link--icon {
    text-decoration: none;
  }

  &.link--icon .link__label {
    text-decoration: underline;
  }
}

.link:focus {
  outline: 2px solid var(--ws-c-p);
  outline-offset: 2px;
}
// stylelint-disable-next-line media-query-no-invalid
@media screen and (min-width: map.get($theme, 'breakpoint', 'm')) {
  * + .anatomy {
    margin-top: var(--ws-s-l);
  }

  .anatomy--vertical {
    border: 1px solid var(--ws-c-n-60);

    .image {
      border-width: 0;
      flex-grow: 1;
      height: 100%;
    }

    .legend {
      flex-direction: column;
    }

    .legend__item {
      margin-right: 0;
      margin-top: var(--ws-s-s);

      &:first-child {
        margin-top: 0;
      }
    }

    .legend__description {
      margin-top: var(--ws-s-l);
    }
  }
}
