/* General Styles */
html {
  scroll-padding-top: 70px; /* Account for sticky header height */
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll when menu slides in */
}

.container {
  width: 90%;
  max-width: 1200px; /* Same max-width for header and main */
  margin: 0 auto; /* Center the container */
  display: flex;
  justify-content: space-between; /* Space between h1 and nav */
  align-items: baseline; /* Align h1 and nav to the baseline */
}

header {
  background: #333;
  color: #fff;
  padding: 10px 0;
  position: sticky; /* Make header sticky */
  top: 0; /* Stick to the top of the viewport */
  z-index: 100; /* Ensure header stays above other content */
  transition: top 1s ease-in-out; /* Smooth transition for sliding effect */
}

header h1 {
  margin: 0;
  font-size: 1.5rem; /* Smaller font size for h1 */
}

nav {
  display: flex;
  align-items: center;
}

#menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

#menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

#menu li {
  margin-left: 20px;
}

#menu a {
  color: #fff;
  text-decoration: none;
}

/* Hide close menu container on desktop */
#close-menu-container {
  display: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
  #menu-toggle {
    display: block;
  }

  #menu {
    position: fixed;
    top: 0;
    right: -250px; /* Hide menu off-screen */
    width: 250px;
    height: 100vh;
    background: #333;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
    padding-top: 60px; /* Space for the toggle button */
    z-index: 3; /* Ensure menu is above overlay */
  }

  #menu li {
    margin: 0;
    text-align: left;
    padding: 15px 20px;
    border-bottom: 1px solid #444;
  }

  #menu.active {
    right: 0; /* Slide menu into view */
  }

  /* Show close menu container on mobile */
  #close-menu-container {
    display: block;
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: none;
    padding: 0;
  }

  /* Ensure the close button container has no bottom border */
  #close-menu-container,
  #close-menu-container li {
    border-bottom: none !important; /* Remove bottom border */
  }

  #close-menu {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 24px; /* Same size as hamburger menu */
    height: 24px; /* Same size as hamburger menu */
  }

  .cross-line {
    width: 24px;
    height: 2px;
    background: #fff;
    position: absolute; /* Position lines absolutely within the button */
    transform-origin: center;
  }

  .cross-line:first-child {
    transform: rotate(45deg); /* Rotate first line by 45 degrees */
  }

  .cross-line:last-child {
    transform: rotate(-45deg); /* Rotate second line by -45 degrees */
  }

  /* Overlay when menu is open */
  #overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2; /* Ensure overlay is below menu */
  }

  #overlay.active {
    display: block;
  }
}

/* Main Content */
main {
  padding: 20px 10px; /* Add 10px padding to left and right */
  margin: 0 auto; /* Center the main content */
  width: 90%; /* Same width as header */
  max-width: 1200px; /* Same max-width as header */
}

section {
  margin-bottom: 40px;
  padding-top: 70px; /* Add padding to account for sticky header */
  margin-top: -70px; /* Offset the padding to maintain layout */
}

/* Remove margins from section content */
section h2,
section p {
  margin-left: 0; /* Remove left margin */
  margin-right: 0; /* Remove right margin */
}

/* Reduce space between headings and paragraphs by 50% */
section h2 {
  margin-bottom: 5px; /* Reduced from 10px to 5px */
}

footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  margin-top: 20px;
}