/* Gallery header styling */
.gallery-header {
  padding: 20px 32px; /* Match row-pg padding for consistency */
  text-align: center; /* Center the heading and text */
  margin-bottom: 20px; /* Space between header and gallery */
}

/* Heading styling */
.gallery-header h2 {
  font-size: 2rem; /* Larger heading for prominence */
  font-weight: bold;
  color: #333; /* Dark color for contrast; adjust to match your theme */
  margin: 0 0 10px 0; /* Space below heading */
}

/* Description text styling */
.gallery-header p {
  font-size: 1.1rem; /* Slightly larger for readability */
  color: #666; /* Lighter color for contrast */
  margin: 0; /* Remove default margin */
  line-height: 1.5; /* Improve readability */
  max-width: 800px; /* Limit width for better readability on large screens */
  margin-left: auto;
  margin-right: auto; /* Center the paragraph */
}

/* Responsive adjustments */
@media screen and (max-width: 800px) {
  .gallery-header {
    padding: 15px; /* Match row-pg padding for medium screens */
  }
  .gallery-header h2 {
    font-size: 1.8rem; /* Slightly smaller for medium screens */
  }
  .gallery-header p {
    font-size: 1rem; /* Slightly smaller for medium screens */
  }
}

@media screen and (max-width: 600px) {
  .gallery-header {
    padding: 15px; /* Match row-pg padding for mobile */
  }
  .gallery-header h2 {
    font-size: 1.5rem; /* Smaller for mobile */
  }
  .gallery-header p {
    font-size: 0.9rem; /* Smaller for mobile */
  }
}




/* Image styling */
.myImages {
  border-radius: 0px;
  cursor: pointer;
  transition: 0.3s;
}

.myImages:hover {
  opacity: 0.7;
}

/* Modal styling */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 10; /* Increased to avoid conflicts */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
  overflow: hidden; /* Prevent scrolling */
  opacity: 0; /* Start hidden for fade effect */
  transition: opacity 0.3s ease; /* Smooth fade for modal */
}

.modal[style*="display: flex"] {
  opacity: 1; /* Fully visible when open */
  display: flex; /* Use flexbox to center content */
  flex-direction: column;
  justify-content: center; /* Center vertically */
  align-items: center; /* Center horizontally */
  z-index: 11111111111111111111111111;
}

.modal-content {
  display: block;
  max-width: 90%; /* Limit width to fit viewport */
  max-height: 80vh; /* Limit height to fit viewport */
  width: auto; /* Allow natural width up to max-width */
  height: auto; /* Allow natural height up to max-height */
  opacity: 1;
  transition: opacity 0.2s ease; /* Smooth fade transition */
  margin: 0; /* Remove default margin */
  border: 30px solid white; /* Add white border */
  box-sizing: border-box; /* Ensure border doesn't affect dimensions */
}

.modal-content.fade {
  opacity: 0; /* Used to trigger fade effect */
}

/* Prevent body scrolling when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Adjust caption positioning */
#caption {
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  margin-top: 10px; /* Space between image and caption */
}

.modal-content,
#caption {
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* Close button */
.close {
  display: none; /* Hidden by default */
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 11; /* Ensure above modal content */
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
}

/* Next/Previous buttons */
.prev,
.next {
  display: block; /* Ensure buttons are visible */
  cursor: pointer;
  position: absolute;
  top: 50%; /* Vertically center relative to modal */
  transform: translateY(-50%); /* Adjust for perfect vertical centering */
  width: auto;
  padding: 16px 20px; /* Consistent touch/click area */
  color: white;
  font-weight: bold;
  font-size: 24px; /* Slightly larger for visibility */
  transition: background-color 0.3s ease;
  border-radius: 3px;
  user-select: none;
  z-index: 11; /* Ensure above modal content */
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background for contrast */
}

.prev {
  left: 10px; /* Fixed distance from left edge */
}

.next {
  right: 10px; /* Fixed distance from right edge */
  border-radius: 3px 0 0 3px; /* Maintain consistent border-radius */
}

.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.8); /* Darker on hover */
}

/* Responsive modal */
@media only screen and (max-width: 700px) {
  .modal-content {
    max-width: 95%; /* Slightly more width on smaller screens */
    max-height: 75vh; /* Adjust height for smaller screens */
  }
  .close {
    top: 10px; /* Adjust for smaller screens */
    right: 20px; /* Adjust for smaller screens */
    font-size: 30px; /* Smaller close button on mobile */
  }
.prev,
  .next {
    font-size: 20px; /* Slightly smaller for mobile */
    padding: 12px 16px; /* Adjust touch area for smaller screens */
  }
  .prev {
    left: 5px; /* Closer to edge on smaller screens */
  }
  .next {
    right: 5px; /* Closer to edge on smaller screens */
  }
}

/* Gallery layout */
* {
  box-sizing: border-box;
}

.row-pg {
  display: flex;
  flex-wrap: wrap;
  padding: 0 20px;
  margin-left: auto;
  padding-left: 32px;
  padding-right: 32px;
}

.column-pg {
  flex: 50%;
  max-width: 50%;
  padding: 0 20px;
  flex-direction: column;
  column-gap: 20px;
}

.column-pg img {
  margin-top: 40px;
  vertical-align: middle;
  width: 100%;
}

/* Responsive layout */
@media screen and (max-width: 800px) {
  .column-pg {
    flex: 50%;
    max-width: 50%;
    column-gap: 5px;
    flex-direction: column;
  }
  .row-pg {
    padding-left: 0px;
    padding-right: 0px;
  }
}

@media screen and (max-width: 600px) {
  .column-pg {
    flex: 100%;
    max-width: 100%;
    column-gap: 10px;
    flex-direction: column;
  }
  .row-pg {
    padding-left: 15px;
    padding-right: 15px;
  }
  .enap-gallery-img {
    padding: 5px;
  }
}