@import "../pages/mixins";

.profile-carousel {
  margin: calc(var(--gutter)/2) auto var(--gutter) auto;

  & .profile-carousel-title {
    text-align: center;
    padding-right: 0.625em;

    & .profile-carousel-title-icon {
      display: inline-block;
      vertical-align: middle;
      width: 2em;
    }

    & .profile-carousel-title-text {
      vertical-align: middle;
    }
  }
}

/* default tile list layout */
/* NOTE: currently used by home page and explore page */
.tile-list {
  display: block;
  display: flex;
  flex-wrap: wrap;
  /* offset tile bottom margin */
  margin-bottom: calc(0 - var(--gutter));

  & .tile {
    display: inline-block; /* fallback */
    margin-bottom: var(--gutter);

    /* single column */
    @add-mixin for-xs {
      width: 100%;
      padding-top: 50%; /* height */
    }

    /* two columns */
    @media (min-width: 480px) and (max-width: 767px) {
      width: 50%; /* fallback */
      width: calc(50% - var(--gutter)); /* width, minus gutter */
      padding-top: 25%; /* height */

      /* add horizontal gutter to every second tile */
      &:nth-child(odd) {
        margin-right: var(--gutter);
      }
    }

    /* four columns */
    @media (min-width: 768px) and (max-width: 991px) {
      width: 25%; /* fallback */
      width: calc(25% - var(--gutter)); /* make room for gutter */
      padding-top: 15%; /* height */

      /* space out tiles 1-3 (all but every fourth) */
      &:not(:nth-child(4n)) {
        margin-right: var(--gutter);
      }
    }

    /* five columns */
    @add-mixin from-md {
      width: 20%; /* fallback */
      width: calc(20% - var(--gutter)); /* make room for gutter */

      /* space out tiles 1-4 (all but every fifth) */
      &:not(:nth-child(5n)) {
        margin-right: var(--gutter);
      }
    }

    /* handle orphans for all multicolumn layouts */
    @add-mixin from-xs {
      &:last-child {
        margin-right: 0;
      }
    }
  }
}
