.defect-img {
  display: block;
  margin: 0 auto 30px auto; /* centers horizontally */
  max-width: 100%;
  height: auto; /* keeps aspect ratio */
  width: 400px; /* common width for all images */
  max-height: 300px; /* ensures same height range */
  object-fit: cover; /* crops while keeping proportion */
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 576px) {
  .defect-img {
    width: 100%;
    max-width: 350px;
    max-height: 250px;
  }
}
/* Back To Top Button styles */
.button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgb(20, 20, 20);
  border: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px rgba(180, 160, 255, 0.25);
  cursor: pointer;
  transition: width 0.3s ease, background-color 0.3s ease;
  position: fixed;
  bottom: 40px;
  right: 30px;
  z-index: 9999;
  overflow: hidden;
  padding: 0;
}

.svgIcon {
  width: 12px;
  transition: transform 0.3s ease;
}

.svgIcon path {
  fill: white;
}

.button:hover {
  width: 140px;
  border-radius: 50px;
  background-color: rgb(181, 160, 255);
  align-items: center;
}

.button:hover .svgIcon {
  transform: translateY(-200%);
}

.button::before {
  position: absolute;
  bottom: -180px;
  content: "Back to Top";
  color: white;
  font-size: 0;
  opacity: 0;
  transition: font-size 0.3s ease, opacity 0.3s ease, bottom 0.3s ease;
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.button:hover::before {
  font-size: 13px;
  opacity: 1;
  bottom: 50%;
}

.back-button-container {
  text-align: center;
  margin: 30px 0 10px;
}
.back-button {
  display: inline-block;
  padding: 10px 20px;
  background-color: rgb(20, 20, 20);
  color: white;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 0 0 4px rgba(180, 160, 255, 0.25);
  transition: background-color 0.3s ease;
}
.back-button:hover {
  background-color: rgb(181, 160, 255);
  color: white;
}

/* Prevent horizontal scroll on mobile */
.magnesium-section{
  overflow-x: hidden;
}
/* Disable hover width expand on small screens */
@media (max-width: 576px) {
  .button {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
  .button:hover {
    width: 45px;
    border-radius: 50%;
  }
  .button:hover::before {
    font-size: 0;
    opacity: 0;
    bottom: -180px;
  }
}

/* Container padding adjustments for smaller devices */
@media (max-width: 992px) {
  .magnesium-section .container {
    padding: 30px 20px;
  }
}

@media (max-width: 768px) {
  .magnesium-section h2 {
    font-size: 1.8rem;
  }

  .qa-block h5 {
    font-size: 1rem;
  }

  .qa-block .answer,
  .qa-block .explanation {
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  .magnesium-section .container {
    padding: 20px 15px;
  }

  .magnesium-section h2 {
    font-size: 1.5rem;
  }

  .qa-block {
    padding: 15px;
  }

  /* Slightly smaller paragraph text for better fit */
  .magnesium-section p,
  .qa-section p,
  .qa-block p,
  .qa-block .answer,
  .qa-block .explanation {
    font-size: 0.95rem;
  }
}

.paragraph-block {
  background-color: #eef6f0;
  border-left: 6px solid #0f4621;
  padding: 20px;
  margin-bottom: 25px;
  border-radius: 10px;
}

.paragraph-block p {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 0;
  text-align: justify;
}