#section-4 {
  display: flex;
  flex-direction: row;
  padding: 28px;
}

.sec4-con {
  display: flex;
  flex-direction: row-reverse;
  gap: 20px;
  align-items: stretch;
}

.sec4-con > .sec4-text-con,
.sec4-con > .sec4-img-con {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
}

.sec4-text-con {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.sec4-text-con h2 {
  color: var(--teritary-col);
  padding: 15px;
  font-size: x-large;
  margin-bottom: 10px;
}

.sec4-text-con p {
  padding: 15px;
  font-size: 16px;
  text-align: justify;
  line-height: 1.6;
  margin-top: -15px;
}

.sec4-img-con {
  padding: 20px;
}
.sec4-img-con img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 350px;
  border-radius: 5%;
  margin-bottom: 5%;
}

@media (max-width: 1200px) {
  #section-4 {
    padding: 28px;
  }
  .sec4-con {
    gap: 16px;
    align-items: stretch;
  }

  .sec4-con > .sec4-text-con,
  .sec4-con > .sec4-img-con {
    flex: 1 1 50%;
    min-width: 0; /* prevents overflow from long content */
    box-sizing: border-box;
    padding: 8px;
  }

  .sec4-text-con h2 {
    font-size: 1.6rem;
    padding: 12px 8px;
  }
  .sec4-text-con p {
    font-size: 0.95rem;
    padding: 8px 8px;
    line-height: 1.55;
  }

  .sec4-img-con {
    padding: 8px;
  }
  .sec4-img-con img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
  }
}

/* <= 900px: tablets and large phones — stack columns vertically */
@media (max-width: 900px) {
  #section-4,
  .sec4-con {
    flex-direction: column;
    padding: 18px;
    gap: 12px;
  }

  .sec4-text-con,
  .sec4-img-con {
    max-width: 100%;
    padding: 8px 4px;
  }

  .sec4-text-con h2 {
    font-size: 1.35rem;
    padding: 8px 4px;
    text-align: left;
  }

  .sec4-text-con p {
    font-size: 0.95rem;
    padding: 6px 4px;
    line-height: 1.5;
    text-align: left;
  }

  .sec4-img-con img {
    width: 100%;
    height: auto;
    padding: 0;
    display: block;
  }
}

/* <= 520px: phones — compact spacing, ensure no horizontal scroll, readable text */
@media (max-width: 520px) {
  #section-4,
  .sec4-con {
    padding: 14px 10px;
    gap: 10px;
  }

  .sec4-text-con h2 {
    padding: 6px 2px;
    margin: 0;
    text-align: center;
    margin-top: -20px;
  }

  .sec4-text-con p {
    font-size: 0.95rem;
    padding: 6px 2px;
    line-height: 1.45;
    text-align: justify;
    word-break: break-word;
  }

  .sec4-img-con {
    padding: 6px 2px;
  }
  .sec4-img-con img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
  }
}

/* <= 375px: very small phones — smallest comfortable sizes, avoid overflow */
@media (max-width: 375px) {
  #section-4,
  .sec4-con {
    padding: 10px 8px;
    gap: 8px;
  }

  .sec4-text-con h2 {
    font-size: 1.05rem;
    padding: 4px 2px;
  }
  .sec4-text-con p {
    font-size: 0.95rem;
    padding: 4px 2px;
    line-height: 1.4;
  }

  .sec4-img-con img {
    width: 100%;
    height: auto;
    display: block;
  }
}

@media (max-width: 900px) {
  #section-4 {
    padding: 20px;
  }

  .sec4-con {
    flex-direction: column;
    gap: 18px;
  }

  .sec4-text-con,
  .sec4-img-con {
    width: 100%;
  }

  .sec4-text-con h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 20px;
  }

  .sec4-text-con p {
    font-size: 0.95rem;
    text-align: justify;
  }

  .sec4-img-con img {
    max-width: 100%;
  }
}

/* -----------------------------
   MOBILE VIEW (≤ 520px)
------------------------------*/
@media (max-width: 520px) {
  #section-4 {
    padding: 14px 10px;
  }

  .sec4-text-con h2 {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 20px;
  }

  .sec4-text-con p {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .sec4-img-con img {
    width: 100%;
    height: auto;
  }
}
