/* ==========================================================================
 * Route Group
 * ========================================================================== */

.mds-c-route-groups {
  margin: calc(var(--mds-d-spacing--sm) * -1);

  @media screen and (min-width: 750px) {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
}

.mds-c-route-group {
  --mds-t-background-color: var(--mds-t-background-color--primary);
  --mds-v-route-group__border-color: var(--mds-t-border-color--secondary);

  background-color: var(--mds-t-background-color);
  border-radius: var(--mds-d-border-radius--default);
  box-shadow: 0 0 0 1px var(--mds-v-route-group__border-color) inset;
  margin: var(--mds-d-spacing--sm);
  padding: var(--mds-d-spacing--lg);

  @media screen and (max-width: 749px) {
    &:not(:last-child) {
      margin-bottom: var(--mds-d-spacing--lg);
    }
  }

  @media screen and (min-width: 750px) {
    align-items: stretch;
    display: flex;
    flex: 0 1 19.45rem;
    flex-direction: column;
    justify-content: space-between;
  }

  &--theme-danger {
    --border-color: var(--mds-t-border-color--danger);
  }

  > .mds-c-control {
    margin-top: auto;
  }
}

.mds-c-route-group__greenfield {
  @mixin mds-m-text--size-med;

  color: var(--mds-t-text-color--secondary);
  margin-bottom: var(--mds-d-spacing--xl);
  margin-top: var(--mds-d-spacing--lg);
  text-align: center;
  width: 100%;
}

.mds-c-route-group__contacts {
  width: 100%;

  @media screen and (min-width: 750px) {
    display: grid;
    grid-gap: var(--mds-d-spacing--sm);
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  }

  &:not(:last-child) {
    margin-bottom: var(--mds-d-spacing--med);
  }
}

.mds-c-route-group__contact {
  border: 1px solid var(--mds-t-border-color--secondary);
  border-radius: var(--mds-d-border-radius--default);
  box-shadow: var(--mds-d-elevation--1);
  overflow: hidden;
  padding: var(--mds-d-spacing--med);
  transition: background-color 0.2s ease-out;
  user-select: none;

  &:not(:last-child) {
    @media screen and (max-width: 749px) {
      margin-bottom: var(--mds-d-spacing--sm);
    }
  }
}

.mds-c-route-group__main {
  min-height: 10rem; /* Magic number that equals the height of two contacts */

  &:not(:last-child) {
    margin-bottom: var(--mds-d-spacing--lg);
  }
}

.portal {
  height: 0;
  width: 0;
}
