/* MOBILE FIRST DESIGN */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: 'Open Sans';
  font-size: 14px;
}

body {
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 55%);
  background-attachment: fixed;
}

.page-wrap {
  height: 100vh;
  display: grid;
  /* Not used because header fixed */
  /*grid-template-rows: min-content 1fr min-content;*/
  grid-template-rows: 1fr min-content;
  grid-template-columns: 1fr;
}

/*** HEADER ***/
header {
  text-align: center;
  color: #eee;
  background: #212121;
  /*background: linear-gradient(#333 0%, #212121 70%);*/
}

.header-fixed {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1;
}

/*** MAIN ***/
main {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
  justify-content: space-evenly;
  
  /* too much margin-top to compensate header fixed */
  margin: 5rem 2rem 2rem 2rem;
}

.item-container {
  transition: 150ms transform; /* when move container */ /*400ms*/
  overflow: hidden;
  /*border: 0.1rem solid #ccc;*/
  border-radius: 0.5rem;
  box-shadow: 0.05rem 0.05rem 0.5rem #ccccff, -0.05rem -0.05rem 0.5rem #ffcccc;
  text-align: center;
  flex: 0 1 12rem;
  
  /* DEBUG */
  /*border: 2px solid #0F0;*/
}

.item-img {
  transition: 150ms transform, 150ms filter; /*800ms 500ms*/
  
  width: 100%;
  aspect-ratio: 16/9;
  
  object-fit: contain;
  filter: brightness(80%) saturate(90%);
  transform: scale(1.05);
}

.item-footer {
  display: none;
}

.item-container:hover .item-img {
  transform: scale(1.15);
  filter: brightness(100%) saturate(100%);
}

a {
  text-decoration: none;
  color: #eee;
}

/*** FOOTER ***/
footer {
  text-align: center;
  
  background: #212121;
  color: #eee;
  padding: 0.7rem;
}

footer p {
  font-weight: 400;
  letter-spacing: 0.1rem;
}

footer .heart {
  color: #e25555;
  font-size: 1.1rem;
  
  margin-left: 0.15rem;
  margin-right: 0.15rem;
}

/*** MEDIA QUERIES ***/
@media only screen and (min-width: 992px) { 
  main {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2rem;
    align-content: flex-start;
    /*align-items: flex-start;*/ /* use it if not using wrap for shrink height flex-item */
    justify-content: space-evenly;
    
    margin: 8rem 6rem 2rem 6rem;
  }
  
  .item-container {
    /* DEBUG */
    /*border: 2px solid #ff0;*/
    
    flex: 0 1 22rem;
  }
  
  .item-footer {
    display: block;
    background: #333;
    font-weight: 600;
    letter-spacing: 0.2rem;
    padding: 0.7rem;
  }
  
  .item-container:hover {
    transform: scale(1.1) translateY(-0.5rem);
  }
}
  
/* Animation when visible */
.item-container {
  opacity: 0;
  /* translate: -50%; */
  scale: 0.5;
  /* rotate: -180deg; */
  transition: 400ms ease;
}

.item-container.show {
  opacity: 1;
  /* translate: 0; */
  scale: 1;
  /* rotate: 0deg; */
}