.overlay {
  position: fixed; /* Changed from absolute to fixed to cover the entire viewport */
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  transition: opacity 200ms ease-in-out, visibility 200ms ease-in-out;
  visibility: hidden;
  opacity: 0;
  z-index: 1000; /* Ensure overlay is on top of other elements */
}

.overlay.light {
  background: rgba(255, 255, 255, 0.5);
}

.overlay .cancel {
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: default;
}

.overlay:target {
  visibility: visible;
  opacity: 1;
}

.popup {
  margin: 70px auto;
  padding: 20px;
  background: #fff;
  border: 1px solid #666;
  width: 80%;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  position: relative;
  transform: translateY(-20px);
  transition: transform 200ms ease-in-out;
  z-index: 1001; /* Ensure popup is above the overlay */
}

.overlay:target .popup {
  transform: translateY(0);
}

.light .popup {
  border-color: #aaa;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.popup h2 {
  margin-top: 0;
  color: #970000;
  font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
  font-size: 24px;
}

.popup h3 {
  margin-top: 0;
  color: #417d14;
  font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
  font-size: 24px;
}

.popup .close {
  position: absolute;
  width: 20px;
  height: 20px;
  top: 20px;
  right: 20px;
  opacity: 0.8;
  transition: all 200ms ease-in-out;
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  color: #666;
  z-index: 1002; /* Ensure close button is above everything */
}

.popup .close:hover {
  opacity: 1;
  color: #970000;
}

.popup .content {
  max-height: 400px;
  overflow: auto;
}

.popup p {
  margin: 0 0 1em;
}

.popup p:last-child {
  margin: 0;
}

.modimage-box {
  position: absolute;
  margin: 0 auto;
  left: 0;
  right: 0;
  top: -50px;
  width: 95px;
  height: 95px;
  border-radius: 50%;
  z-index: 10;
  padding: 0px;
  text-align: center;
  box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
  z-index: 1002; /* Ensures image is above other content */
}

.modimage-box img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.modimage-box i {
  font-size: 58px;
  position: relative;
  top: 3px;
}

.buttonbig, .buttonsmall {
  font-family: "Raleway", sans-serif;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
  display: inline-block;
  border: none;
  border-radius: 4px;
  transition: 0.5s;
  color: #fff;
}

.buttonbig {
  font-size: 12px;
  padding: 12px 40px;
  background: var(--main-color);
  margin-top: 40px;
  margin-right: 10px;
  margin-left: 10px;
}

.buttonbig:hover {
  background: #850000; /* Slightly darker shade on hover */
}

.buttonsmall {
  font-size: 12px;
  padding: 5px 10px;
  background: var(--main-color);
  margin-bottom: 5px;
}

.buttonsmall:hover {
  background: #850000; /* Slightly darker shade on hover */
}
