/* Benefits Section */
#benefits-section {
  position: relative;
  padding-top: 120px;
  padding-bottom: 100px;
  text-align: center;
  background-color: var(--background-light-primary);
  overflow: hidden; /* Important for containing expanded cards */
}

#benefits-section .container {
  position: relative;
  z-index: 2;
}

/* Section Connectors - Styles remain largely the same */
.section-connector-top {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 0;
}

.section-connector-top .connector-horizontal-line {
  width: 100%;
  height: 1px;
  background-color: #dcdcdc;
}

.section-connector-top .connector-vertical-line-down-to-title {
  width: 1px;
  height: 40px;
  background-color: #dcdcdc;
}

.section-connector-bottom {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
}

.section-connector-bottom .connector-vertical-line-down-from-grid {
  width: 1px;
  height: 60px;
  background-color: #dcdcdc;
}

#benefits-section h2 {
  font-size: 2.8em;
  margin-bottom: 15px;
  color: var(--text-dark-primary);
  font-weight: 600;
}

#benefits-section .subheading {
  font-size: 1.2em;
  margin-bottom: 60px;
  color: var(--text-dark-secondary);
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px; /* Reduced gap slightly */
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch; /* Ensure cards in a row stretch to same height if content differs */
}

.benefits-card {
  position: relative; /* For absolute positioning of children */
  border-radius: 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden; /* Crucial for the expansion effect */
  background-color: var(--background-light-secondary); /* Fallback, but image should cover */
  cursor: pointer;
  will-change: transform, box-shadow, opacity, width, height;
  display: flex; /* To help manage children, though image is absolute */
  justify-content: center; /* Center image container if card is wider */
  align-items: center; /* Center image container if card is taller */
  height: 220px; /* Default height, adjust as needed */
  /* GSAP will animate width/height on hover */
}

.card-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  filter: grayscale(100%);
  border-radius: 16px; /* Match parent card's rounding */
  z-index: 1; /* Base layer */
  /* GSAP will animate filter and potentially transform if needed for centering */
}

.card-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px; /* Redundant if parent is rounded and overflow hidden, but safe */
}

.card-title-overlay { /* New name for the main title */
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px); /* Give some padding */
  color: #FFFFFF;
  padding: 5px 0; /* Minimal vertical padding */
  font-size: 0.9em; /* Adjusted from reference */
  font-weight: 600;
  text-align: center;
  box-sizing: border-box;
  line-height: 1.2;
  z-index: 2; /* Above image */
  pointer-events: none;
  /* GSAP will fade this out on hover */
}

.revealed-panel-left,
.revealed-panel-right {
  position: absolute;
  top: 0;
  height: 100%;
  background-color: var(--background-light-primary); /* Background for the panels */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start; /* Text aligns left in left panel */
  padding: 20px;
  box-sizing: border-box;
  opacity: 0; /* Initially hidden, GSAP handles */
  width: 0; /* Initially zero width, GSAP handles */
  pointer-events: none; /* Initially not interactive */
  z-index: 3; /* Above title and image when revealed */
  border-radius: 16px; /* Match card, though only visible on expanded card */
}

.revealed-panel-left {
  left: 0;
}

.revealed-panel-right {
  right: 0;
  align-items: flex-end; /* Text aligns right in right panel */
}

.revealed-panel-left .info-box,
.revealed-panel-right .info-box {
  width: auto;
  display: block;
  border: none;
  background-color: transparent;
  padding: 2px 0; /* Minimal padding */
  font-size: 0.9em; /* Adjusted from reference */
  color: var(--text-dark-primary);
  margin-bottom: 5px; /* Space between info boxes */
  box-shadow: none;
}
.revealed-panel-left .info-box {
  text-align: left;
}
.revealed-panel-right .info-box {
  text-align: right;
}

.revealed-panel-left .info-box:last-child,
.revealed-panel-right .info-box:last-child {
  margin-bottom: 0;
}

.info-box .info-text {
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .benefits-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
  }
  .benefits-card {
    height: 200px;
  }
}

@media (max-width: 992px) {
  .benefits-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
   #benefits-section h2 {
    font-size: 2.5em;
  }
  #benefits-section .subheading {
    font-size: 1.1em;
  }
  .benefits-card {
    height: 190px;
  }
}

@media (max-width: 768px) {
  #benefits-section h2 {
    font-size: 2.2em;
  }
  #benefits-section .subheading {
    font-size: 1em;
    margin-bottom: 40px;
  }
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .card-title-overlay {
    font-size: 0.85em;
    bottom: 8px;
    left: 8px;
    right: 8px;
    width: auto;
    transform: none; /* Remove translateX for simpler mobile layout */
    text-align: center;
  }
  .benefits-card {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .benefits-grid {
    grid-template-columns: 1fr; 
    gap: 15px;
  }
  .benefits-card {
    height: 220px; /* Can be taller in single column */
  }
  .card-title-overlay {
    font-size: 0.9em;
  }
}
