:root {
  --brand-color: #7E36FD;
  --primary-color: #222222;
  --seconday-color: gray;
  --seconday-color-on-secondary-background-color: #696969;
  --background-color: white;
  --background-secondary-color: #F6F5F8;
  --background-border-secondary-color: #E0E0E0;
  --header-height: 60px;
  --full-content-horizontal-padding: 50px;
  --small-content-horizontal-padding: 20px;
  --max-nav-bar-width: 1100px;
  --max-content-width: 840px;
  --full-content-top-padding: 10px;
  --small-content-top-padding: 0px;
  --full-content-bottom-padding: 20px;
  --small-content-bottom-padding: 20px;
}

body, html {
  margin: 0;
  padding: 0;
  font-family: -apple-system, Roboto, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* full viewport height so footer snaps at the bottom */
}

header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000; /* Ensures the header stays above other content */
  background-color: var(--background-secondary-color);
  border-bottom: 1px solid var(--background-border-secondary-color);
}

nav {
  display: flex;
  height: var(--header-height); /* Fixed height for larger screens */
  justify-content: space-between;
  align-items: center;
  padding-top: max(0px, env(safe-area-inset-top));
  padding-left: max(var(--full-content-horizontal-padding), env(safe-area-inset-left));
  padding-right: max(var(--full-content-horizontal-padding), env(safe-area-inset-right));
  max-width: var(--max-nav-bar-width);  /* limit the width */
  margin: 0 auto; /* center the nav element within its container */
}

ul {
  padding-left: 8px; /* Default padding is too big */
  list-style-position: inside; /* Makes it so padding affects the list marker too. */
}

main {
  flex: 1;
  overflow: auto; /* Allows main to be scrollable without overlapping the footer */
}

.logo {
  padding-top: 6px;
  padding-bottom: 6px;
}

.logo a {
  font-size: 30px;
  font-weight: bold;
  color: var(--primary-color);
  display: flex;
  align-items: center; /* This should vertically center the items */
  text-decoration: none; /* removes link underline */
}

.logo img {
  height: auto;
  width: 48px; 
  margin-right: 8px;
}

.logo-and-menu-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Center vertically */
}

.nav-links a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: bold;
  padding: 10px 10px;
  margin: 0; /* Reset vertical spacing set for small screens */
}

/* Hover effect */
.nav-links a:hover {
  color: var(--brand-color);
}

.nav-links .cta {
  background-color: var(--brand-color);
  border-radius: 5px;
  color: white;
  font-weight: medium;
  padding: 10px 20px; /* a bit of extra horizontal padding for the button background to breathe */
}

.nav-links .cta:hover {
  color: white; /* Ensure the text color remains the same on hover */
}

.menu-toggle {
  display: none; /* hide the menu toggle for big screens */
  flex-direction: column; /* stack icon bars vertically */
  cursor: pointer;
  padding: 2px; /* just to increase the clickable area a bit */
}

.menu-toggle span {
  height: 3px;
  width: 25px;
  background-color: var(--primary-color);
  margin: 4px 0;  /* separation between bars */
}

#menu-toggle.active span:nth-child(1) {
/*  transform: rotate(45deg) translate(0px, 7.8px);*/
transform: translate(0px, 5.5px) rotate(45deg);
}

#menu-toggle.active span:nth-child(2) {
/*  transform: rotate(-45deg) translate(0px, -7.5px);*/
transform: translate(0px, -5.5px) rotate(-45deg);
}

.nav-links {
  display: flex;
  gap: 20px; /* Add spacing between nav buttons */
}

.seconday-text {
  color: var(--seconday-color);
  font-size: 0.9em;
}

.padded-content {
  padding-left: calc(var(--full-content-horizontal-padding) + env(safe-area-inset-left));
  padding-right: calc(var(--full-content-horizontal-padding) + env(safe-area-inset-right));
}

footer {
  background-color: var(--background-secondary-color);
  border-top: 1px solid var(--background-border-secondary-color);
  color: var(--seconday-color);
  text-align: center;
  padding-top: 5px;
  padding-bottom: max(15px, env(safe-area-inset-bottom));
}

footer a {
  text-decoration: none;
  padding: 0px 6px 0px;
  color: var(--seconday-color);
}

footer a:hover {
  color: var(--brand-color);
  text-decoration: underline;
}

/* Adds smooth transitions when navigating to different pages within the website. */
@view-transition {
  navigation: auto;
}

@media screen and (max-width: 768px) {

  header {
    position: static;
  }

  nav {
    height: auto; /* Remove fixed height for smaller screens */
    flex-direction: column;
    align-items: flex-start;
    padding-left: max(var(--small-content-horizontal-padding), env(safe-area-inset-left));
    padding-right: max(var(--small-content-horizontal-padding), env(safe-area-inset-right));
  }

  .logo-and-menu-toggle {
    width: 100%; /* Ensure full width to utilize space */
  }

  .nav-links a {
    display: block; /* Make each link take its own row */
    margin: 10px 0; /* Add some vertical spacing */
  }

  .nav-links .cta {
    background-color: transparent; /* Reset background color for cta */
    color: var(--primary-color); /* Reset text color for cta */
    font-weight: bold; /* Reset font weight for cta */
    padding: 10px 10px; /* Reset padding for cta */
  }

  .nav-links .cta:hover {
    color: var(--brand-color); /* Reset text color for cta */
  }

  .menu-toggle {
    display: flex;
    align-items: center; /* Center vertically */
    justify-content: flex-end; /* Align to the right */
  }

  .nav-links {
    display: none;  /* hide the nav bar buttons on small screens, until the menu toggle is clicked */
    flex-direction: column;  /* Stack items vertically */
    text-align: left; /* Center-align the text and links */
    width: 100%;
    gap: 0px; /* Reduce spacing between nav buttons now that they are listed vertically */
    padding-bottom: 0px;
  }

  #nav-links.show {
    display: flex;
    padding-bottom: 6px;  /* a bit extra below the last button */
  }

  .padded-content {
    padding-left: calc(var(--small-content-horizontal-padding) + env(safe-area-inset-left));
    padding-right: calc(var(--small-content-horizontal-padding) + env(safe-area-inset-right));
  }
}
