/* ===================
   SERVICES SECTION
=================== */
.services-section {
  background: #F4F3EE;
  font-family: 'Montserrat', sans-serif;
}

.services-section.py-5 {
  padding-top: 100px !important;   /* your value */
  /* padding-bottom: 60px !important;  if you need bottom too */
}

.service-row {
  margin-bottom: 8rem !important;
}

.service-text {
  padding: 1rem 0;
}

.service-subtitle {
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #a6764b;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.service-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 1.25rem;
}

.service-description {
  font-family: 'Montserrat', sans-serif;
  color: #555;
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 35rem;
}

/* FLUID IMAGE FRAME + IMAGE */
.service-img-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 22 / 15;      /* Maintain image ratio (edit if needed!) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 0;
  overflow: visible;
  margin-left: auto;
  margin-right: auto;
  max-width: 550px;           /* Largest image size, edit to your liking */
  min-width: 260px;
}

.service-img-actual {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
  position: relative;
  border-radius: 0;
  background: #f6f4ef;
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}

/* OFFSET BORDERS (now relative, not fixed) */
.service-img-frame.left-bottom::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: 8%;
  left: 18%;
  right: -11%;
  bottom: -16%;
  border: 2.5px solid #a6764b;
  z-index: 1;
  border-radius: 0;
}

.service-img-frame.right-top::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: 8%;
  left: -11%;
  right: 18%;
  bottom: -16%;
  border: 2.5px solid #a6764b;
  z-index: 1;
  border-radius: 0;
}


/* === LARGE BACKGROUND TEXT FOR SERVICES (Update) === */

/* Each text column should be relative for correct bg placement */
.service-text-col {
  position: relative;
  z-index: 2; /* Make sure it's above row backgrounds, if any */
}

/* The background word behind each service text box */
.service-bg-text {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: clamp(5rem, 12vw, 11rem);
  color: #222;
  opacity: 0.05;    /* Subtle, ghosted effect */
  font-weight: 100;
  letter-spacing: 0.04em;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  transform: translateY(-50%);
  z-index: 1;
  white-space: pre-line; /* so <br> works in bg text */
}

/* Align left */
.bg-left {
  text-align: left;
  left: 0;
  right: auto;
  padding-left: 0.08em;
  transform: translateY(-50%) translateX(-10%);
}

/* Align center (default, but explicit for clarity) */
.bg-center {
  text-align: center;
  left: 0;
  right: 0;
  transform: translateY(-50%) translateX(-20%);
}

/* Align right */
.bg-right {
  text-align: right;
  right: 0;
  left: auto;
  padding-right: 0.08em;
  transform: translateY(-50%) translateX(7%);
}

/* Ensure main text appears above bg word */
.service-text {
  position: relative;
  z-index: 2;
}

/* Shrink or fade the background word on mobile if you wish */
@media (max-width: 600px) {
  .service-bg-text {
    font-size: 4rem;
    opacity: 0.05;
    letter-spacing: 0.04em;
    padding-left: 0;
    padding-right: 0;
  }
  .bg-left,
  .bg-center,
  .bg-right {
    transform: translateY(-50%) translateX(0);
    text-align: center;
  }
}

/* RESPONSIVE DESIGN */
@media (max-width: 991.98px) {
  .service-row {
    margin-bottom: 2.5rem !important;
  }
  .service-img-frame {
    aspect-ratio: 16 / 9;
    max-width: 100%;
    min-width: 0;
  }
  .service-img-actual {
    width: 100%;
    height: 100%;
  }
  .service-text {
    padding: 0.5rem 0;
  }
  /* Remove offset border under 992px */
  .service-img-frame.left-bottom::after,
  .service-img-frame.right-top::after {
    display: none;
  }
}

/* MOBILE CONTAINER PADDING */
@media (max-width: 575.98px) {
  .services-section .container {
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
  }
}

/* SPACING BETWEEN IMAGE AND TEXT COLUMN + MATCHED WIDTHS ON DESKTOP */
@media (min-width: 992px) {
  /* Add left space to text columns for sections 1 & 3 (text on right) */
  .service-text-col {
    padding-left: 4.5rem;
    max-width: 540px;    /* Prevents text from getting too wide */
  }
  /* Section 2: text on left, so add right space instead */
  .service-row .col-lg-6.order-1.order-lg-1.service-text-col {
    padding-left: 0;
    padding-right: 4.5rem;
    max-width: 540px;
  }
  .service-text {
    max-width: 540px;
  }
}

@media (min-width: 992px) {
  /* Only target Section 2: .service-row:nth-of-type(2) text column */
  .service-row:nth-of-type(2) .service-text-col {
    margin-left: auto;
    margin-right: auto;
    padding-right: 0;      /* Remove the padding-right to center it */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* keep text left-aligned inside */
  }
}

/* More side spacing for services section on mobile (match standards section) */
@media (max-width: 575.98px) {
  .services-section .container {
    padding-left: 2rem !important;   /* Match standards */
    padding-right: 2rem !important;
  }
  .service-text {
    padding-left: 0.5rem;   /* Extra breathing room for text on mobile */
    padding-right: 0.5rem;
  }
}

/* Extra side spacing for services section on tablets (iPad width) */
@media (min-width: 576px) and (max-width: 991.98px) {
  .services-section .container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
  .service-text {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 991px) and (min-width: 601px) {
  .service-bg-text {
    left: 50%;
    transform: translate(-50%, -50%); /* center both X and Y */
    text-align: center;
    white-space: normal; /* allow wrapping if needed */
  }
}
