@use "@material/animation/_index" as animation;
@use "@material/elevation/_index" as elevation;
@use "@material/top-app-bar/_index" as top-app-bar;

.content-grid {
  padding: 16px;
  transform-origin: 50% calc(100vh - #{top-app-bar.$row-height});
  max-width: 2000px;
  display: flex;
  flex-direction: row;
  align-content: flex-start;
  flex-wrap: wrap;
  flex-grow: 1;
  margin: 0 auto;
  min-height: 512px;
  width: 100%;
  .subheader {
    padding-bottom: 16px;
    align-self: flex-start;
  }

  @media (max-width: top-app-bar.$mobile-breakpoint) {
    transform-origin: 50% calc(100vh - #{top-app-bar.$mobile-row-height});
  }
}

.outer-container {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  width: 100%;
  .subheader {
    transition: animation.standard(color, 250ms);
  }
  &:not(:last-of-type) {
    padding-bottom: 16px;
  }
}

.compact .content-grid .outer-container {
  padding-bottom: 0;
}

.list .content-grid {
  padding-left: 0;
  padding-right: 0;
  margin-bottom: auto;
  flex-grow: 1;
  flex-direction: row;
  flex-wrap: wrap;
  .subheader {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 8px;
  }

  .outer-container {
    width: 100%;
    padding-bottom: 0;
    @media (min-width: 1240px) {
      width: 50%;
    }
    @media (min-width: 1800px) {
      width: 1 / 3 * 100%;
    }
    @media (min-width: 2200px) {
      width: 25%;
    }
  }
}

.compact .content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-gap: 16px;
  max-width: 100%;

  @media (max-width: 1799px) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  @media (max-width: 1299px) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  @media (max-width: 939px) {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.drawer-open {
  &.compact .content-grid {
    @media (max-width: 1599px) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (max-width: 1299px) {
      grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    @media (max-width: 939px) {
      grid-template-columns: repeat(1, minmax(0, 1fr));
    }
  }
}
