/* =========================== */
/* Responsive Styles - Media Queries */
/* =========================== */

/* Mobile First Approach */

/* General Styles for All Screens */
body {
  margin: 0;
  font-family: Arial, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Smartphones (portrait and landscape) */
@media only screen and (max-width: 768px) {
  #header .logo {
    max-width: 80%;
    margin: 0 auto;
  }

  #nav {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #nav li {
    margin-bottom: 10px;
  }

  .pagecontent {
    padding: 10px;
  }

  .sidebar-main {
    flex-direction: column;
  }

  .sidebar-main .leftcolumn,
  .sidebar-main #sidebar {
    width: 100%;
  }
}

/* Tablets */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
  #nav {
    display: flex;
    justify-content: space-around;
  }

  .sidebar-main {
    display: flex;
    flex-wrap: wrap;
  }

  .sidebar-main .leftcolumn {
    width: 70%;
  }

  .sidebar-main #sidebar {
    width: 30%;
  }
}

/* Large Screens */
@media only screen and (min-width: 1025px) {
  #nav {
    display: flex;
    justify-content: space-between;
  }

  .sidebar-main {
    display: flex;
    flex-wrap: nowrap;
  }

  .sidebar-main .leftcolumn {
    width: 75%;
  }

  .sidebar-main #sidebar {
    width: 25%;
  }
}

/* Menu Styles - Fix for Dropdown */
#nav, #nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#nav {
  display: flex;
  justify-content: space-between;
  background-color: #333; /* Adjust as needed */
}

#nav li {
  position: relative;
}

#nav li a {
  display: block;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
}

#nav li a:hover {
  background-color: #555;
}

/* Hide dropdown menus by default */
#nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #333;
  padding: 0;
  list-style: none;
  min-width: 200px;
}

/* Show dropdown menus on hover */
#nav li:hover ul {
  display: block;
}

/* Dropdown menu item styles */
#nav li ul li {
  border-bottom: 1px solid #555;
}

#nav li ul li a {
  padding: 10px;
  color: white;
}

#nav li ul li a:hover {
  background-color: #777;
}

/* Improve Spacing and Alignment */
#nav li {
  margin: 0 10px; /* Add space between menu items */
}

#nav li a {
  padding: 10px 20px; /* Adjust padding for better spacing */
}

/* Ensure Dropdowns Display Correctly */
#nav li ul {
  display: none;
  position: absolute;
  top: 100%; /* Position directly below parent item */
  left: 0;
  background-color: #444; /* Match or contrast menu background */
  padding: 0;
  list-style: none;
  min-width: 150px; /* Ensure dropdowns have enough width */
}

#nav li:hover ul {
  display: block; /* Show dropdown on hover */
}

#nav li ul li {
  padding: 10px;
  border-bottom: 1px solid #555; /* Optional separator */
}

#nav li ul li:last-child {
  border-bottom: none; /* Remove last item's border */
}

#nav li ul li a {
  color: #fff;
  text-decoration: none;
}

#nav li ul li a:hover {
  background-color: #666; /* Highlight dropdown items on hover */
}
