/* ===========================
   MAIN CONTAINER & LAYOUT
=========================== */

.esp-related-card {
  position: relative;
  display: flex;
  width: 100%;           /* Fill the Swiper slide width */
  height: 100%;          /* Fill the slide height */
  min-height: 250px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: 0px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.4s ease;
  overflow: hidden;
  cursor: pointer;
  padding: 0 !important;
  text-decoration: none !important;
  box-sizing: border-box;
}

.esp-related-card:hover {
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.esp-related-card .spacer {
  flex: 1 1 auto;
  min-height: auto;
  align-self: stretch;
  width: 100%;
}

.esp-related-card .inner-column{
    min-width: 180px !important;
}

/* ===========================
   COLUMNS STRUCTURE
=========================== */

.esp-related-card .columns-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 250px;   /* ensures left-column fills even when hover-industries expand */
}

.esp-related-card .left-column {
  position: relative;
  flex: 0 0 30%;
  display: flex;
  flex-direction: column;   /* image + list stacked vertically */
  padding: 8px;             /* خیلی کم */
  overflow: hidden;         /* clips expanding list cleanly */
  z-index: 1;
  background-color: rgba(255, 255, 255, 0.9);
  justify-content: space-between;
  align-items: stretch;
}

/* Gradient background for entire left column on hover */
.esp-related-card .left-column::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(227, 234, 237, 0.2), rgba(227, 234, 237, 0.8));
  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 0; /* behind content */
  pointer-events: none;
}
.esp-related-card:hover .left-column::before {
  opacity: 1;
}
.esp-related-card .left-column > img.main-img {
  max-width: 100%;
  width: 100%;
  flex: 0 0 50%;           /* image takes exactly top half */
  min-height: 0;
  padding: 16px;           /* پدینگ بیشتر به عکس جدا */
  box-sizing: border-box;
  object-fit: cover !important;
  -o-object-fit: cover !important;
  display: block;
  position: relative;
  z-index: 2;
}

.esp-related-card .right-column {
  position: relative;
  flex: 0 0 70%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(15px, 3vw, 25px);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  z-index: 3;
}

/* Remove the gradient overlay from left-column on hover - not needed */
.esp-related-card .inner-overlay {
  display: none;
}

/* ===========================
   CONTENT STYLES
=========================== */

.esp-related-card .title {
  font-family: "Noto Serif", serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 2.2vw, 1.8rem);
  line-height: 1.4;
  color: #333;
  transition: color 0.3s ease;
  margin: 0 0 clamp(2px, 0.5vw, 25px) 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: calc(2 * 1.4em);
  text-align: left;
}

.esp-related-card .description {
  font-family: "Noto Serif", serif;
  font-size: clamp(0.8rem, 1.3vw, 1.1rem);
  font-weight: 500;
  line-height: 1.5;
  color: #333;
  margin: 0 0 clamp(15px, 3vw, 25px) 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: calc(4 * 1.5em);
}

.esp-related-card .ESP-Code {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(0.875rem, 3vw, 1.2rem);
  font-weight: 600;
  line-height: 1.4;
  color: #111;
  padding: clamp(12px, 2.5vw, 18px) 5px;
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 10px);
  transition: all 0.3s ease;
  margin: 0;
  width: fit-content;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: calc(1.4em + clamp(12px, 2.5vw, 18px) * 2);
}

/* ===========================
   ANIMATED BUTTON
=========================== */

.esp-related-card .animated-text {
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(0.8rem, 1.3vw, 1.1rem);
  color: #505050 !important;
  border-radius: 0 !important;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0px;
  padding: 5px clamp(15px, 1.2vw, 20px);
  overflow: hidden;
  transition: all 0.3s ease;
  z-index: 5;
  text-decoration: none;
  text-align: center;
  background: transparent;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}

.esp-related-card .animated-text::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background-color: #9C0002;
  transition: height 0.3s ease;
  z-index: -1;
}

/* ===========================
   HOVER EFFECTS
=========================== */

.esp-related-card:hover .animated-text::before {
  height: 100%;
}

.esp-related-card:hover .animated-text {
  color: #fff !important;
  border-color: transparent; /* No border as requested previously */
  transform: translate(4px, -2px);
}

.esp-related-card:hover .title {
  color: #9C0002;
}

.esp-related-card:hover .inner-overlay {
  opacity: 1;
}

 /* ===========================
    LISTING GRID - FINAL
 =========================== */
.esp-related-card .listing-grid {
  align-self: stretch;
  margin: 10px 0 !important;
  padding: 0 !important;
  width: 100%;
  box-sizing: border-box;
  min-height: 0; 
  display: grid;
  grid-auto-rows: minmax(20px, auto); 
  gap: 5px; 
  text-align: left;
  z-index: 5;
}

.esp-related-card .jet-listing-grid {
  align-self: stretch;
  width: 100%;
  text-align: left;
}

/* Industry Icons Container */
.esp-related-card .jet-listing-grid .e-con-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0 !important;
}

/* ===========================
   RESPONSIVE BREAKPOINTS
=========================== */

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
  .esp-related-card {
    width: 100%;
    margin: clamp(10px, 1vw, 20px) 0;
  }
  
  .esp-related-card .left-column {
    flex: 0 0 35%;
    padding: clamp(10px, 2vw, 20px);
  }
  
  .esp-related-card .right-column {
    flex: 0 0 65%;
    padding: 25px 30px;
  }
}

/* Tablet (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .esp-related-card {
    min-height: 280px;
    margin: 0;
    width: 100%;    /* Must fill the Swiper slide */
  }
  
  .esp-related-card .title {
    font-size: clamp(1.1rem, 3.2vw, 1.8rem) !important;
  }
  
  .esp-related-card .left-column {
    flex: 0 0 35%;
  }
  
  .esp-related-card .right-column {
    flex: 0 0 65%;
  }
  
  .esp-related-card .description {
    font-size: 0.9rem;
  }
}

/* Mobile (767px and down) */
@media (max-width: 767px) {
  .esp-related-card .ESP-Code {
    font-size: 1rem !important;
  }
  
  .esp-related-card {
    width: 100% !important;    /* Fill slide, not 90% */
    height: auto !important;
    margin: 0 !important;      /* No margin inside swiper slide */
    min-height: 200px;
    box-shadow: 0 0px 8px 5px rgba(0, 0, 0, 0.25);
  }
  
  .esp-related-card .columns-wrapper {
    flex-direction: column;
  }
  
  .esp-related-card .left-column {
    flex: 1;
    padding: clamp(10px, 3vw, 20px);
    align-items: center;
  }
  .esp-related-card .left-column img {
    height: 200px;
  }
  
  .esp-related-card .right-column {
    flex: 0 0 auto;
    padding: 8px 18px 18px;
  }
  
  .esp-related-card .title {
    font-size: 1.5rem !important;
    height: calc(2 * 1.4em);
  }
  
  .esp-related-card .description {
    font-size: 0.85rem !important;
    -webkit-line-clamp: 3 !important;
    height: calc(3 * 1.5em) !important;
    text-align: left !important;
  }
  
  .esp-related-card .ESP-Code {
    padding: 12px 16px;
    font-size: 0.9rem;
    width: 100%;
    justify-content: left;
  }
  
  .esp-related-card .animated-text {
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
    transform: translateY(0);
    opacity: 1;
  }
  
  .esp-related-card .listing-grid {
    gap: 6px;
  }

  .esp-related-card .jet-listing-grid .e-con-inner {
    gap: 8px;
  }
}

/* ===========================
   PERFORMANCE OPTIMIZATIONS
=========================== */

@media (prefers-reduced-motion: reduce) {
  .esp-related-card,
  .esp-related-card .inner-overlay,
  .esp-related-card .animated-text,
  .esp-related-card .animated-text::before,
  .esp-related-card .title {
    transition-duration: 0.1s;
  }
}

.esp-related-card,
.esp-related-card .animated-text::before {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ===========================
   LIST ITEM RELATED (MINIMAL)
=========================== */
.esp-related-card .industries-wrapper {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
}
.esp-related-card .list-item-related {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 8px;
  padding: 0;
  margin-bottom: 6px;
}
.esp-related-card .list-item-related span {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.esp-related-card .list-item-related .ind-icon {
  flex-shrink: 0;
  width: 16px !important;
  height: 16px !important;
  object-fit: contain !important;
}

@media (max-width: 767px) {
  .esp-related-card .list-item-related {
    justify-content: flex-start !important;
    text-align: left !important;
    margin-bottom: 8px;
  }
  .esp-related-card .list-item-related span {
    font-size: 14.5px;
  }
  .esp-related-card .industries-wrapper {
    width: 100%;
    align-items: flex-start;
  }
}

/* ===========================
   TOUCH DEVICES (NO HOVER)
=========================== */
@media (hover: none) {
  .esp-related-card .animated-text {
    background-color: #DFE9F0;
    color: #9C0002 !important;
    padding: 6px 12px !important;
    border-radius: 4px;
    border: none !important;
  }
  .esp-related-card .animated-text::before {
    display: none !important;
  }
  
  /* Disable hover transforms that cause double-tap on iOS */
  .esp-related-card:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
  }
  .esp-related-card:hover .animated-text {
    transform: none !important;
  }
  .esp-related-card:hover .title {
    color: #333;
  }
  
  /* Simple click animation */
  .esp-related-card:active {
    transform: scale(0.98) !important;
    transition: transform 0.1s !important;
  }
}
