/* Services Hero Section - Clean BEM Implementation 2025 */

/* Using BEM methodology with unique namespace to avoid conflicts */
.gj-services-hero {
  position: relative;
  width: 100%;
  padding: 10rem 0 6rem;
  box-sizing: border-box;
  background-color: var(--color-raw-white);
  overflow: hidden;
}

/* Background elements */
.gj-services-hero__bg-accent {
  position: absolute;
  top: -15%;
  right: -5%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle, rgba(217, 45, 39, 0.04) 0%, rgba(217, 45, 39, 0.01) 70%);
  border-radius: 50%;
  filter: blur(80px);
  z-index: 1;
  animation: float-slow 20s ease-in-out infinite alternate;
}

.gj-services-hero__bg-accent--secondary {
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 50%;
  height: 40%;
  background: radial-gradient(circle, rgba(11, 31, 63, 0.03) 0%, rgba(11, 31, 63, 0.01) 70%);
  border-radius: 50%;
  filter: blur(100px);
  z-index: 1;
  animation: float-slow 25s ease-in-out infinite alternate-reverse;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(2%, 2%) rotate(3deg); }
}

/* Main container with proper max-width */
.gj-services-hero__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  position: relative;
  z-index: 2;
}

/* Left content area */
.gj-services-hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.gj-services-hero__title {
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
  position: relative;
}

.gj-services-hero__title-accent {
  display: block;
  color: var(--color-brand-primary);
  margin-top: 0.5rem;
  animation: fade-in-up 0.8s 0.3s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.gj-services-hero__subtitle {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
  font-weight: 400;
  max-width: 90%;
  animation: fade-in-up 0.8s 0.5s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Badge styling with proper containment */
.gj-services-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: fade-in-up 0.8s 0.7s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
  margin-bottom: 2rem;
}

.gj-services-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.gj-services-hero__badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gj-services-hero__badge-icon {
  width: 1rem;
  height: 1rem;
  color: var(--color-brand-primary);
  flex-shrink: 0;
}

.gj-services-hero__badge-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
}

/* CTA button styling */
.gj-services-hero__cta {
  animation: fade-in-up 0.8s 0.9s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.gj-services-hero__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-brand-primary);
  color: var(--color-raw-white);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(217, 45, 39, 0.25);
}

.gj-services-hero__button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(217, 45, 39, 0.35);
  background-color: #c5201a; /* Slightly darker shade on hover */
}

/* Right side image grid styling */
.gj-services-hero__image-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gj-services-hero__image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
  position: relative;
  max-width: 500px;
  width: 100%;
  height: 100%;
  animation: fade-in 1s 0.5s ease-out forwards;
  opacity: 0;
  transform: perspective(1000px) rotateY(-5deg) rotateX(3deg);
  transition: all 0.3s ease;
  z-index: 2;
}

.gj-services-hero__image-grid:hover {
  transform: perspective(1000px) rotateY(-2deg) rotateX(1deg);
}

.gj-services-hero__image {
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  height: 180px;
  position: relative;
}

.gj-services-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: middle;
  transition: transform 0.5s ease;
}

.gj-services-hero__image:hover img {
  transform: scale(1.05);
}

.gj-services-hero__image--1 {
  transform: translateY(-8px);
}

.gj-services-hero__image--2 {
  transform: translateY(8px);
}

.gj-services-hero__image--3 {
  transform: translateY(8px);
}

.gj-services-hero__image--4 {
  transform: translateY(-8px);
}

/* Accent elements for image */
.gj-services-hero__image-accent {
  position: absolute;
  bottom: -1.5rem;
  right: -1.5rem;
  width: 70%;
  height: 70%;
  border-radius: 1rem;
  background-color: var(--color-brand-primary);
  z-index: -1;
  opacity: 0;
  animation: fade-in 1s 0.7s ease-out forwards;
}

.gj-services-hero__image-pattern {
  position: absolute;
  bottom: 1rem;
  left: -1.5rem;
  width: 6rem;
  height: 6rem;
  background: repeating-linear-gradient(
    45deg,
    rgba(217, 45, 39, 0.1),
    rgba(217, 45, 39, 0.1) 5px,
    transparent 5px,
    transparent 12px
  );
  border-radius: 50%;
  z-index: -1;
  animation: fade-in 1s 0.6s ease-out forwards;
  opacity: 0;
}

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 992px) {
  .gj-services-hero__container {
    grid-template-columns: 1fr;
    gap: 3rem; /* Increased gap between image and content */
  }
  
  .gj-services-hero__content {
    order: 1;
    position: relative; /* Ensure proper stacking context */
    z-index: 2; /* Place text above images */
    background-color: var(--color-raw-white); /* Add background to ensure text is readable */
    padding-top: 1rem; /* Add padding for separation */
  }
  
  .gj-services-hero__image-wrapper {
    order: 0;
    margin-bottom: 0; /* Remove margin as we've increased the gap */
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center; /* Center image wrapper content */
    width: 100%;
  }
  
  .gj-services-hero__image-grid {
    margin: 0 auto;
    max-width: 400px;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 150px);
  }
  
  .gj-services-hero__subtitle {
    max-width: 100%;
  }
}

@media (max-width: 576px) {
  .gj-services-hero {
    padding: 8rem 0 4rem;
  }
  
  .gj-services-hero__container {
    padding: 0;
    gap: 2.5rem; /* Increased gap for better separation on mobile */
  }
  
  /* Full-width content container with proper padding */
  .gj-services-hero__content {
    padding: 0 1rem;
  }
  
  .gj-services-hero__title {
    font-size: 1.5rem;
  }
  
  .gj-services-hero__subtitle {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }
  
  .gj-services-hero__badges {
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }
  
  .gj-services-hero__badge {
    padding: 0.375rem 0.625rem;
  }
  
  .gj-services-hero__badge-icon {
    width: 0.875rem;
    height: 0.875rem;
  }
  
  .gj-services-hero__badge-text {
    font-size: 0.7rem;
  }
  
  /* Complete redesign of the image grid layout for mobile */
  .gj-services-hero__image-wrapper {
    width: 100vw; /* Full viewport width */
    max-width: 100vw;
    margin-left: calc(-50vw + 50%); /* Negative margin trick for full width */
    padding: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .gj-services-hero__image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 145px)); /* Fixed column widths */
    grid-template-rows: repeat(2, minmax(110px, 130px)); /* Fixed row heights */
    gap: 0.5rem;
    margin: 0 auto;
    width: auto; /* Let it be sized by its children */
    justify-content: center; /* Center the grid items */
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 0.5rem;
  }
  
  /* Style for the individual image containers */
  .gj-services-hero__image {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }
  
  /* Make images fill their containers completely */
  .gj-services-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  /* Create clean transition between image grid and content */
  .gj-services-hero__content {
    margin-top: -1rem; /* Pull content up slightly */
    padding-top: 1.5rem; /* Add padding at the top */
    background-color: var(--color-raw-white);
    position: relative;
    z-index: 3; /* Ensure content is above images */
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03); /* Subtle shadow for depth */
  }
}
