/* =============================
   Portfolio Grid Layout
============================= */
.ctd-portfolio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* gap: 48px 50px; */
  gap: 60px;
  padding: 40px 30px;
}
.banner__item picture, .banner__item img {
  width: 100%;
    height: 700px;
    display: block;
    object-fit: cover;
    object-position: top;
}

.ctd-portfolio .ctd-portfolio-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  transition: transform 0.3s ease, background-color 0.4s ease, padding 0.4s ease;
  position: relative;
  cursor: pointer;
   
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    background-color: #fff;
    padding: 0;
}

.ctd-portfolio .ctd-portfolio-item:hover .ctd-portfolio-image .ctd-portfolio-img {
  transform: scale(1.05);
}
.ctd-portfolio .ctd-portfolio-item:hover .ctd-arrow-icon {
  transform: translateX(4px);
  transition: transform 0.6s ease-in-out;
}
/* =============================
   Portfolio Image
============================= */
.ctd-portfolio .ctd-portfolio-item .ctd-portfolio-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.ctd-portfolio .ctd-portfolio-image .ctd-portfolio-img {
  width: 100%;
  height: 100%;
  position: relative;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.6s ease-in-out;
}

/* =============================
   Portfolio Content
============================= */
.ctd-portfolio-content {
  width: 100%;
  transition: color 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ctd-portfolio-content h6 {
  margin-top: 20px;
  margin-bottom: 20px;
  font-size: 18px;
  line-height: 22px;
  font-weight: 400;
  font-family: 'Lexend Deca', sans-serif !important;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0px;
  transition: font-size 0.3s ease, color 0.3s ease;
  position: relative;
}

/* =============================
   Arrow & Close (×) Toggle
============================= */
.ctd-icon-wrapper {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
}

/* Mũi tên SVG */
.ctd-arrow-icon {
  display: block;
  /* width: 100%; */
  /* height: auto; */
filter: invert(0%) sepia(0%) saturate(7500%) hue-rotate(0deg) brightness(0%) contrast(100%);
  transition: opacity 0.3s ease;
  /* margin-left: -20px; */
  min-width: 20px !important;
  height: 20px !important;

}

/* Dấu × ẩn ban đầu */
.ctd-close-filter {
  position: absolute;
  top: -3px;
  left: 0;
  width: 100%;
  height: 100%;
  font-size: 30px;
  font-weight: 100;
  line-height: 20px;
  text-align: center;
  color: transparent;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

/* Khi active: ẩn mũi tên, hiện dấu × */
.ctd-portfolio-item.active .ctd-arrow-icon {
  opacity: 0;
  pointer-events: none;
}

.ctd-portfolio-item.active .ctd-close-filter {
  font-weight: 100;
  font-size: 30px;
  opacity: 1;
  color: #fff;
  pointer-events: auto;
}

.ctd-portfolio-item.active .ctd-close-filter:hover {
  transform: none;
  color: #ffeb3b;
}
.project-not-found{
  text-align: center;
  padding-top: 10px;
}

/* =============================
   Active State Item
============================= */

.ctd-loading .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}


.ctd-portfolio .ctd-portfolio-item.active {
  background-color: #264ABC;
    /* padding: 0px 25px; */
    transform: none;
    margin: 0 0;
    /* position: relative; */
}
.ctd-portfolio-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: -30px; 
  right: -30px;
  bottom: 0;
  background-color: #264ABC;
  z-index: -1; 
  border-radius: 0; 
}
.ctd-portfolio-item {
  position: relative;
  z-index: 1;
}
.ctd-portfolio .ctd-portfolio-item.active h6 {
  font-size: 18px;
  color: #fff;
  font-family: 'Lexend Deca', sans-serif;
  font-weight: 400;
}

/* =============================
   Responsive - Mobile
============================= */
@media (max-width: 1024px) {
  .ctd-portfolio {
    overflow: hidden;
    grid-template-columns: repeat(1, 1fr);
  }

  .ctd-portfolio.swiper .swiper-wrapper {
    display: flex;
  }

  .ctd-portfolio .ctd-portfolio-item {
    /* width: 100%; */
    flex-shrink: 0;
    box-sizing: border-box;
    background-color: #fff;
    /* margin-right: 20px; */
  }

  .ctd-portfolio .ctd-portfolio-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
  }

  .ctd-portfolio .ctd-portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 0.6s ease-in-out;
  }

  .ctd-portfolio .ctd-portfolio-content {
    text-align: center;
    margin: 14px 0;
    padding: 0 5px;

  }

  .ctd-portfolio .ctd-portfolio-content h6 {
    font-size: 16px;
    margin: 10px 0;
    font-family: 'Lexend Deca', sans-serif !important;
    text-transform: uppercase;
    text-align: left;
    font-weight: 400;
  }
  
  .swiper-pagination {
    text-align: center;
    margin-top: 16px;
  }
  .ctd-portfolio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 40px 15px;
}
}
@media screen and (max-width: 767px) {
  /* Chuyển sang 2 cột */
    .ctd-portfolio {
        display: flex;
        grid-template-columns: repeat(2, 1fr);
        border: 1px solid #e0e0e0;
        gap: 0;
        padding: 0px !important;
        height: 100%;
        width: 100%;
        flex-wrap: wrap;
    }

  /* Ẩn phần ảnh */
  .ctd-portfolio .ctd-portfolio-image {
    display: none;
  }

  .ctd-portfolio-item {
    box-sizing: border-box;
    padding: 0 !important;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    width: 50% !important;
    justify-content: space-between;
  }
    .ctd-portfolio .ctd-portfolio-content h6 {
        font-size: 14px;
        font-family: 'Lexend Deca', sans-serif !important;
        text-transform: uppercase;
        font-weight: 400;
        line-height: 22px;
        letter-spacing: 0%;
        margin-left: 0px;
        align-items: center;
    }

  /* Active giống hình */
  .ctd-portfolio-item.active {
    background: #264ABC;
    color: #fff;
    padding: 20px 24px; /* giữ padding đều, không padding trái/phải thừa */
    transform: none; /* bỏ scale nếu không muốn phóng */
  }
  .ctd-portfolio .ctd-portfolio-item.active h6 {
  font-size: 14px;
  color: #fff;
  font-family: 'Lexend Deca', sans-serif;
}
  .ctd-portfolio-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #264ABC;
    z-index: -1;
    border-radius: 0;
}
  .ctd-portfolio-item.active .ctd-arrow-icon {
    opacity: 0;
    pointer-events: none;
  }
  .ctd-portfolio-item.active .ctd-close-filter {
    color: #fff;
    opacity: 1;
    pointer-events: auto;
  }

  .ctd-portfolio-item:nth-child(2n) {
    border-right: none;
  }


  .ctd-portfolio-item:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

/* @media screen and (max-width: 431px) {
      .ctd-portfolio .ctd-portfolio-item {
        width: 100%;
        flex-shrink: 0;
        box-sizing: border-box;
        background-color: #fff;
        padding: 0 35px;
        position: relative;
        z-index: -2;
    }
}
@media screen and (max-width: 415px){
     .ctd-portfolio {
        display: flex;
        grid-template-columns: repeat(2, 1fr);
        border: 1px solid #e0e0e0;
        gap: 0;
        padding: 0px !important;
        height: 100%;
        width: 100%;
        flex-wrap: wrap;
    }
.ctd-projectcard-grid {
        display: grid;
        gap: 16px;
        padding: 16px 20px;
        grid-template-columns: repeat(2, 1fr);
    }
    .ctd-portfolio .ctd-portfolio-item {
        width: 50%;
        flex-shrink: 0;
        box-sizing: border-box;
        background-color: #fff;
        padding: 0 20px;
    }    
}
@media (max-width: 393px) {
    .ctd-portfolio {
        display: grid ;
        grid-template-columns: repeat(2, 1fr);
        border: 1px solid #e0e0e0;
        gap: 0;
        padding: 0px !important;
        
        height: 100%;
        width: 100%;
    }
}
@media screen and (max-width: 391px) {
    .ctd-portfolio {
        display: flex;
        grid-template-columns: repeat(2, 1fr);
        border: 1px solid #e0e0e0;
        gap: 0;
        padding: 0px !important;
        height: 100%;
        width: 100%;
        flex-wrap: wrap;
    }
  .ctd-portfolio .ctd-portfolio-image {
    display: none;
  }

  .ctd-portfolio-item {
    box-sizing: border-box;
    padding: 0 !important;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
    .ctd-portfolio .ctd-portfolio-content h6 {
        font-size: 13px;
        font-family: 'Lexend Deca', sans-serif !important;
        text-transform: uppercase;
        font-weight: 400;
        line-height: 22px;
        letter-spacing: 0%;
        margin-left: 0px;
        align-items: center;
    }
  .ctd-portfolio-item.active {
    background: #264ABC;
    color: #fff;
    padding: 20px 24px; 
    transform: none; 
  }
  .ctd-portfolio .ctd-portfolio-item.active h6 {
  font-size: 13px !important;
  color: #fff;
  font-family: 'Lexend Deca', sans-serif;
}
  .ctd-portfolio-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #264ABC;
    z-index: -1;
    border-radius: 0;
}
  .ctd-portfolio-item.active .ctd-arrow-icon {
    opacity: 0;
    pointer-events: none;
  }
  .ctd-portfolio-item.active .ctd-close-filter {
    color: #fff;
    opacity: 1;
    pointer-events: auto;
  }


  .ctd-portfolio-item:nth-child(2n) {
    border-right: none;
  }

  .ctd-portfolio-item:nth-last-child(-n+2) {
    border-bottom: none;
  }
}
@media screen and (max-width: 376px) {
  .ctd-portfolio {
        display: flex;
        grid-template-columns: repeat(2, 1fr);
        border: 1px solid #e0e0e0;
        gap: 0;
        padding: 0px !important;
        height: 100%;
        width: 100%;
        flex-wrap: wrap;
    }
  
} */
