/**
 * Social media follow 
 * @define social-media-follow
 */

@use 'sass:map';
@use '@ecl/vanilla-layout-grid/mixins/breakpoints';

// Exposed variables
$theme: null !default;
$social-media-follow: null !default;

.ecl-social-media-follow {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.ecl-social-media-follow__description {
  color: var(--c-d);
  font: var(--f-m);
  font-weight: map.get($theme, 'font-weight', 'bold');
  margin-bottom: var(--s-s);
  margin-top: 0;
}

.ecl-social-media-follow__list {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin-bottom: 0;
  margin-top: calc(-1 * var(--s-2xs));
  padding-inline-start: 0;
}

.ecl-social-media-follow__item {
  display: flex;
  margin-inline-end: map.get($social-media-follow, 'item-margin');
  padding-top: var(--s-2xs);

  &:last-child {
    margin-inline-end: 0;
  }
}

.ecl-social-media-follow__link {
  align-items: center;
  display: flex;
  overflow: hidden; /* Improve rendering on IE */
}

// Icon
.ecl-social-media-follow__icon {
  color: var(--c-d);
  flex-shrink: 0;
  top: 0 !important;
}

@mixin ecl-social-media-follow-vertical {
  .ecl-social-media-follow__list {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 0;
  }

  .ecl-social-media-follow__item {
    margin-inline-end: 0;
    padding-bottom: var(--s-xs);
    padding-top: var(--s-xs);

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

    &:last-child {
      padding-bottom: 0;
    }
  }
}

// Vertical
.ecl-social-media-follow--vertical {
  @include ecl-social-media-follow-vertical;
}

/* stylelint-disable-next-line order/order */
@include breakpoints.down('s') {
  @include ecl-social-media-follow-vertical;
}

// Position
.ecl-social-media-follow--right {
  align-items: flex-end;

  .ecl-social-media-follow__list {
    align-items: flex-end;
  }
}
