/* =======================================
  start category
=========================================*/
.category {
  overflow: hidden;
  position: relative;
  background: rgba(249,249,249,0.5);
}
.category::before{
  background-size: cover;
  position: absolute;
  opacity: 0.1;
  content: "";
  height: 100%;
  width: 100%;
  top: 0;
  bottom: 0;
  z-index: -1;
}

.category-parent .category-item {
  background-color: var(--second-color);
  height: 400px;
  margin: 10px;
}

.category-item:nth-child(7) {
  background-color: var(--main-color);
  height: 100%;
}

.category-item:nth-child(1) {
  grid-area: 1 / 1 / 2 / 3;
  ;
}

.category-item:nth-child(2) {
  grid-area: 1 / 3 / 2 / 6
}

.category-item:nth-child(3) {
  grid-area: 2 / 1 / 3 / 4;
}

.category-item:nth-child(4) {
  grid-area: 2 / 4 / 3 / 6;
}

.category-card {
  height: 318px;
  position: relative;
  overflow: hidden;
}

.category-card:before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: "";
  background: linear-gradient(to top, rgba(0,0,0,.2), var(--light-color));
  opacity: 0;
  z-index: 0;
  transition: 0.5s ease-in-out;
}

.category-card img {
  height: 100%;
  object-fit: cover;
  min-width: 100%;
}

.category-preview {
  position: absolute;
  bottom: 30px;
  margin: auto;
  width: auto;
  transform: scale(1);
  background: #fff;
  padding: 1rem;
}

.category-preview h2 {
  color: var(--main-color);
  font-size: 20px;
  font-weight: 500;
}

.category-card:hover .category-preview {
  transform: scale(0);
}

.category-card:hover:before {
  opacity: 0.8
}

.category-name {
  position: absolute;
  visibility: hidden;
  opacity: 0;
  top: 14%;
  left: 10%;
  right: 10%;
  text-align: center;
}

.category-card:hover .category-name {
  visibility: visible;
  opacity: 1;

}

.category-name h3 {
  font-size: 30px;
  font-weight: 500;
  color: var(--deep-blue);
  text-transform: capitalize;
}

.category-content p {
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--deep-blue);
}

.category-card:hover .category-name h3 {
  -webkit-animation: fadeInLeft 1s;
  animation: fadeInLeft 1s;
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
}

@media (max-width: 768px) {
  .category-parent {
    display: block;
  }
}

.category-item{
    margin-bottom: 10px;
}

/* =======================================
  End category
=========================================*/

