/*
 * Box styles for individual boxes
 */
.box {
  display: flex;
  align-items: center;
  width: 1000px;
  /* Increased width for a larger box */
  height: 550px;
  padding: 20px;
  box-sizing: border-box;
  background-color: #f2f2f2;
  transition: box-shadow 0.4s ease;
  border-radius: 10px;
  margin: 0 auto;
  /* Center the box */
  overflow: visible;
  /* Ensure content is visible */

  /* This complex border creates the zigzag pattern on the top/bottom and a solid white border on the sides */
  border-top: 45px solid transparent;
  border-bottom: 45px solid transparent;
  border-left: 45px solid white;
  border-right: 45px solid white;

  border-image-source: url("../img/bg/63.jpg");
  border-image-slice: 45;
  border-image-width: 15px;
  border-image-repeat: repeat;
}

.box:hover {
  box-shadow: 0 0 15px 5px rgba(255, 255, 255, 0.8);
}




.content {
  flex: 1;
  color: #4C808A;
  font-size: 1.2rem;
  padding-right: 20px;
  color: black;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  box-sizing: border-box;
}

@font-face {
  font-family: 'Betenoira';
  src: url('../fonts/betenoira/BeteNoirNF.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

.content h2 {
  margin: 0 0 10px 0;
  font-family: 'Verdana';
  color: #4C808A;
  font-size: 40px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.2;
}

.image-wrapper {
  flex-shrink: 0;
  width: 250px;
  /* Slightly reduced to fit in the smaller box */
  height: 400px;
  /* Slightly reduced to fit better */
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transition: box-shadow 0.4s ease;
}

/* For the specific mission box only */
.box.mission-box {
  justify-content: center;
  /* Center content horizontally in the flex container */
  text-align: center;
  /* Center text */
  overflow: visible;
  /* Allow content to be visible */
}

.box.mission-box .content {
  padding-right: 0;
  /* Remove right padding since we're centering */
  padding-left: 20px;
  /* Add some left padding if needed */
  width: 100%;
  max-width: 100%;
  overflow: visible;
  /* Allow text to be visible */
}

.box.mission-box .content h2 {
  margin-top: 0;
  width: 100%;
  /* Ensure heading takes full width */
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.box.mission-box .content p {
  width: 100%;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  text-align: justify;
  hyphens: auto;
}



/*
 * Row styling for the container of boxes
 */
/* .row {
  display: flex;
  justify-content: center;
  max-width: 2400px;
  margin: 0 auto;
  padding: 20px 0;
} */

/* .ms-product-tab{
  background-image: url('../img/patterns/Changed.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
} */
.ms-product-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(255, 255, 255);
  /* Adjust opacity as needed */
  z-index: -1;
}

/* Large screen adjustments to prevent text disappearing */
@media (min-width: 1401px) {
  .box.mission-box .content {
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
  }

  .box.mission-box .content h2 {
    margin: 0 0 20px 0;
    font-size: 40px;
    line-height: 1.2;
  }

  .box.mission-box .content p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 15px;
  }
}

/* Enhanced Responsive adjustments */
@media (max-width: 1400px) {
  .box {
    width: 900px;
    height: 500px;
    padding: 18px;
  }

  .content {
    font-size: 1.1rem;
    padding-right: 18px;
  }

  .content h2 {
    font-size: 36px;
  }

  .image-wrapper {
    width: 220px;
    height: 360px;
  }
}

@media (max-width: 1200px) {
  .box {
    width: 800px;
    height: 480px;
    padding: 16px;
  }

  .content {
    font-size: 1.05rem;
    padding-right: 16px;
  }

  .content h2 {
    font-size: 34px;
  }

  .image-wrapper {
    width: 200px;
    height: 340px;
  }
}

@media (max-width: 1024px) {
  .row {
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
  }

  .box {
    margin: 12px 0;
    width: 95%;
    max-width: 700px;
    height: 450px;
    padding: 15px;
  }

  .content {
    font-size: 1rem;
    padding-right: 15px;
  }

  .content h2 {
    font-size: 30px;
  }

  .image-wrapper {
    width: 180px;
    height: 300px;
  }
}

@media (max-width: 900px) {
  .box {
    width: 98%;
    max-width: 600px;
    height: 420px;
    padding: 12px;
    border-top-width: 30px;
    border-bottom-width: 30px;
    border-left-width: 30px;
    border-right-width: 30px;
    border-image-slice: 30;
    border-image-width: 10px;
  }

  .content {
    font-size: 0.95rem;
    padding-right: 12px;
    padding-left: 5px;
  }

  .content h2 {
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 8px;
  }

  .content p {
    font-size: 0.95rem !important;
    line-height: 1.4;
  }

  .image-wrapper {
    width: 150px;
    height: 250px;
  }
}

@media (max-width: 768px) {
  .box {
    width: 100%;
    max-width: 500px;
    height: 380px;
    padding: 10px;
    border-top-width: 25px;
    border-bottom-width: 25px;
    border-left-width: 25px;
    border-right-width: 25px;
    border-image-slice: 25;
    border-image-width: 8px;
  }

  .content {
    font-size: 0.9rem;
    padding-right: 10px;
    padding-left: 5px;
  }

  .content h2 {
    font-size: 22px;
    line-height: 1.1;
    margin-bottom: 6px;
  }

  .content p {
    font-size: 0.9rem !important;
    line-height: 1.3;
  }

  .image-wrapper {
    width: 130px;
    height: 220px;
  }
}

@media (max-width: 640px) {
  .box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 95vw;
    height: auto;
    min-height: 280px;
    padding: 15px;
    border-top-width: 20px;
    border-bottom-width: 20px;
    border-left-width: 20px;
    border-right-width: 20px;
    border-image-slice: 20;
    border-image-width: 6px;
    margin: 15px auto;
  }

  .content {
    font-size: 0.85rem;
    padding: 0;
    width: 100%;
    order: 2;
  }

  .content h2 {
    font-size: 20px;
    margin: 15px 0 10px 0;
    line-height: 1.2;
  }

  .content p {
    font-size: 0.85rem !important;
    line-height: 1.4;
    margin-bottom: 10px;
  }

  .image-wrapper {
    width: 100%;
    max-width: 200px;
    height: 150px;
    margin-bottom: 10px;
    order: 1;
  }

  .box.mission-box .content h2 {
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .box {
    max-width: 98vw;
    min-height: 250px;
    padding: 12px;
    border-top-width: 15px;
    border-bottom-width: 15px;
    border-left-width: 15px;
    border-right-width: 15px;
    border-image-slice: 15;
    border-image-width: 5px;
    margin: 12px auto;
  }

  .content {
    font-size: 0.8rem;
  }

  .content h2 {
    font-size: 18px;
    margin: 10px 0 8px 0;
  }

  .content p {
    font-size: 0.8rem !important;
    line-height: 1.3;
  }

  .image-wrapper {
    max-width: 180px;
    height: 130px;
  }
}

@media (max-width: 360px) {
  .box {
    max-width: 100vw;
    min-height: 220px;
    padding: 10px;
    border-top-width: 12px;
    border-bottom-width: 12px;
    border-left-width: 12px;
    border-right-width: 12px;
    border-image-slice: 12;
    border-image-width: 4px;
    margin: 10px auto;
  }

  .content {
    font-size: 0.75rem;
  }

  .content h2 {
    font-size: 16px;
    margin: 8px 0 6px 0;
  }

  .content p {
    font-size: 0.75rem !important;
    line-height: 1.2;
  }

  .image-wrapper {
    max-width: 160px;
    height: 110px;
  }
}

/* ... existing code ... */

/* Additional overflow prevention and text handling */
.box * {
  box-sizing: border-box;
  max-width: 100%;
}

.content p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  text-align: justify;
  margin-bottom: 10px;
}

/* Ensure images in content don't overflow */
.content img {
  max-width: 100%;
  height: auto;
}

/* Additional responsive fixes for very small screens */
@media (max-width: 320px) {
  .box {
    max-width: 100vw;
    min-height: 200px;
    padding: 8px;
    border-top-width: 10px;
    border-bottom-width: 10px;
    border-left-width: 10px;
    border-right-width: 10px;
    border-image-slice: 10;
    border-image-width: 3px;
    margin: 8px auto;
  }

  .content {
    font-size: 0.7rem;
  }

  .content h2 {
    font-size: 14px;
    margin: 6px 0 4px 0;
    line-height: 1.1;
  }

  .content p {
    font-size: 0.7rem !important;
    line-height: 1.1;
  }

  .image-wrapper {
    max-width: 140px;
    height: 90px;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
  .box {
    height: auto;
    min-height: 200px;
    max-height: 80vh;
  }

  .content {
    overflow-y: auto;
  }

  .image-wrapper {
    height: auto;
    max-height: 150px;
  }
}

/* High DPI screen adjustments */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
  .content {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}