/* ==========================================================================
   Jayshree Technosoft - Interactive Expanding Cards Gallery
   Inspired by premium 3D perspective and card accordion designs.
   Fully responsive (Horizontal on Desktop, Vertical on Mobile).
   ========================================================================== */

.expanding-gallery-wrapper {
  padding: 10px 0;
  width: 100%;
}

.expanding-gallery {
  display: flex;
  width: 100%;
  height: 380px;
  gap: 12px;
  box-sizing: border-box;
}

.expanding-card {
  position: relative;
  flex: 1;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  background-color: #022d62;
  transition: flex 0.6s cubic-bezier(0.25, 1, 0.3, 1), 
              transform 0.6s cubic-bezier(0.25, 1, 0.3, 1), 
              box-shadow 0.6s ease;
  box-shadow: 0 10px 25px rgba(2, 45, 98, 0.08);
}

/* Image zoom & fit */
.expanding-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.3, 1);
  opacity: 0.85;
}

/* Glassmorphism text overlay */
.expanding-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  background: linear-gradient(to top, rgba(2, 45, 98, 0.95) 0%, rgba(2, 45, 98, 0.65) 60%, rgba(2, 45, 98, 0) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 60%;
  box-sizing: border-box;
  opacity: 0.9;
  transition: opacity 0.5s ease, background 0.5s ease;
  z-index: 2;
}

.expanding-card-badge {
  align-self: flex-start;
  background: rgba(239, 49, 57, 0.95);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 30px;
  margin-bottom: 8px;
  letter-spacing: 1px;
  transform: translateY(15px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.3, 1), 
              opacity 0.5s ease;
}

.expanding-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #ffffff;
  line-height: 1.2;
  transform: translateY(15px);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.3, 1);
}

.expanding-card-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(20px);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.3, 1), 
              opacity 0.5s ease;
}

/* Hover / Active expanded card state */
.expanding-card:hover,
.expanding-card.active {
  flex: 3.2;
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(2, 45, 98, 0.2);
  z-index: 5;
}

.expanding-card:hover img,
.expanding-card.active img {
  transform: scale(1.08);
  opacity: 1;
}

.expanding-card:hover .expanding-card-content,
.expanding-card.active .expanding-card-content {
  background: linear-gradient(to top, rgba(2, 45, 98, 0.98) 0%, rgba(2, 45, 98, 0.5) 75%, rgba(2, 45, 98, 0) 100%);
  opacity: 1;
}

.expanding-card:hover .expanding-card-badge,
.expanding-card.active .expanding-card-badge {
  opacity: 1;
  transform: translateY(0);
}

.expanding-card:hover .expanding-card-title,
.expanding-card.active .expanding-card-title {
  transform: translateY(0);
}

.expanding-card:hover .expanding-card-desc,
.expanding-card.active .expanding-card-desc {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

/* Responsive Viewports */
@media (max-width: 991px) {
  .expanding-gallery {
    height: 320px;
  }
  .expanding-card-title {
    font-size: 16px;
  }
  .expanding-card-desc {
    font-size: 12px;
  }
}

@media (max-width: 767px) {
  /* Vertical accordion layout for mobile screens */
  .expanding-gallery {
    flex-direction: column;
    height: auto;
    gap: 15px;
  }
  
  .expanding-card {
    height: 140px;
    flex: none;
    transition: height 0.6s cubic-bezier(0.25, 1, 0.3, 1), 
                transform 0.6s ease;
  }
  
  .expanding-card:hover,
  .expanding-card.active {
    height: 280px;
    flex: none;
    transform: translateY(0);
  }
  
  .expanding-card-content {
    height: 75%;
    padding: 16px;
  }
}
