ul {
  display: flex; /* Use flexbox for layout */
  justify-content: center; /* Align items to the right */
  list-style-type: none;
  margin: 0;
  border-style: solid;
  border-color: blue;
  padding: 0;
  background-color: #333;
  width: 60%; /* Set width to 60% of its parent container */
  max-width: 600px; /* Optional: set a maximum width */
  margin-left: auto; /* This moves the entire UL to the right */
  margin-top: 20px; /* Adjust this number until the overlap disappears */
  clear: both;      /* Ensures no floating elements interfere */
}
.centre {
	justify-content: center;
}
li {
  /* No need for float here */
  margin-left: 0px; /* Add margin for spacing between items */
}

li a, .dropbtn {
  font-family: Arial;
  display: inline-block;
  color: white;
  text-align: center;
  padding: 4px 16px;
  text-decoration: none;
}

li a:hover, .dropdown:hover .dropbtn {
  background-color: red;
}

li.dropdown {
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 560px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* This class mimics your menu link style */
.custom-link {
  font-family: Arial, sans-serif;
  display: inline-block;
  background-color: #333; /* The dark gray from your menu */
  color: white !important; /* Forces text to stay white */
  padding: 4px 16px;
  text-decoration: none;
  text-align: center;
  border-radius: 4px; /* Optional: slightly rounds the corners */
  transition: background-color 0.3s; /* Makes the color change smooth */
}

/* The Hover Effect */
.custom-link:hover {
  background-color: red; /* Matches your menu hover */
  color: white !important;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
  ul {
    width: 100% !important; /* Take up the full width of the phone */
    max-width: none;
    flex-wrap: wrap; /* Allow items to drop to a second line if they don't fit */
    justify-content: space-around; /* Space items out evenly */
  }

  li a, .dropbtn {
    padding: 8px 10px; /* Smaller padding so they fit side-by-side */
    font-size: 14px;   /* Slightly smaller text for mobile */
  }

  .dropdown-content {
    min-width: 100%; /* Instead of 560px, make it the width of the parent */
    position: relative; /* Changing to relative prevents it from 'floating' off-screen */
    box-shadow: none;
    background-color: #444; /* Slightly different color so user knows it's a sub-menu */
  }

  .dropdown-content a {
    color: white;
    padding: 10px 20px;
    border-bottom: 1px solid #555;
  }
}

