/* Base CSS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: block;
  background-color: rgb(240, 240, 240);
  font-family: "Merriweather Sans", sans-serif;
  font-size: 14px;
}

.container {
  margin-top: 1.5vh;
  margin-bottom: 1.5vh;
  width: 85vw;
  min-height: 100vh;
}

.nav-brand {
  width: 35vw;
  margin-left: 2.5vw;
  margin-top: 2.5vw;
}

.navbar-light .navbar-toggler {
  color: transparent;
  border-color: transparent;
}

.animated-icon {
  width: 30px;
  height: 20px;
  margin-top: 2.5vw;
  position: relative;
  transform: rotate(0deg);
  transition: 0.5s ease-in-out;
  cursor: pointer;
}

.animated-icon span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  border-radius: 9px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
  background: rgb(0, 0, 80);
}

.animated-icon span:nth-child(1) {
  top: 0px;
}

.animated-icon span:nth-child(2),
.animated-icon span:nth-child(3) {
  top: 10px;
}

.animated-icon span:nth-child(4) {
  top: 20px;
}

.animated-icon.open span:nth-child(1),
.animated-icon.open span:nth-child(4) {
  top: 11px;
  width: 0%;
  left: 50%;
}

.animated-icon.open span:nth-child(2) {
  transform: rotate(45deg);
}

.animated-icon.open span:nth-child(3) {
  transform: rotate(-45deg);
}

.nav-item {
  font-family: "Lato", sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 4px;
  margin-top: 2.5vw;
  margin-left: 4vw;
}

.navbar-light .navbar-nav .nav-link {
  color: rgb(0, 0, 80);
}

.nav-link {
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.25vw;
  text-underline-offset: 4px;
}

.footer {
  width: 100vw;
  margin-top: 1vh;
  background-color: rgb(0, 0, 80);
  color: rgb(160, 160, 160);
  text-align: center;
  font-size: 10px;
}

.footer a {
  color: rgb(240, 240, 240);
  font-size: 10px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.footer a:hover {
  color: rgb(160, 160, 160);
  text-decoration-color: rgb(160, 160, 160);
}

h2 {
  font-family: "Lato", sans-serif;
  color: rgb(0, 0, 80);
  text-shadow: 0.1vw 0 #000;
  font-size: 18px;
  letter-spacing: 0.2vw;
  text-decoration: none;
  text-transform: uppercase;
}

a {
  color: rgb(0, 0, 80);
}

a:hover {
  color: rgb(0, 0, 80);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.media-heading,
.pub-link {
  background-color: rgb(240, 240, 240);
  font-size: 14px;
  border: none;
  text-decoration: underline;
}

.media-heading:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.info {
  font-size: 14px;
  padding: 0;
  width: 100%;
}


/* Large screens */
@media only screen and (min-width: 1024px) {
  body {
    font-size: 18px;
  }

  .nav-brand {
    width: 18vw;
  }

  .navbar-nav {
    margin-left: auto;
    margin-right: auto;
  }

  .nav-item {
    font-size: 18px;
    letter-spacing: 0.5vw;
  }

  .nav-link:hover {
    text-underline-offset: 8px;
  }

  h2 {
    font-size: 24px;
  }

  a:hover {
    text-underline-offset: 4px;
  }

  ul {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
  }

  .footer {
    font-size: 14px;
  }

  .footer a {
    font-size: 12px;
  }

  .media-heading {
    font-size: 18px;
  }

  .media-heading:hover {
      text-underline-offset: 4px;
  }

  .info {
    font-size: 14px;
  }

  .fas,
  .fab {
    color: rgb(0, 0, 80);
  }

  .fas:hover,
  .fab:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .socials {
    vertical-align: bottom;
  }
}

/* Additional responsive improvements */
@media only screen and (max-width: 768px) {
  .container {
    width: 95vw;
    margin-top: 1vh;
    margin-bottom: 1vh;
  }
  
  .nav-brand {
    width: 40vw;
    max-width: 200px;
  }
  
  h2 {
    font-size: 20px;
    margin-bottom: 0.5rem;
  }
  
  .funding img {
    max-width: 120px;
    margin: 0.5rem;
  }
  
  #lab-photo {
    max-width: 100%;
    height: auto;
  }
}

/* Image responsiveness */
img {
  max-width: 100%;
  height: auto;
}

.funding {
  max-width: 150px;
  margin: 1rem 0.5rem;
  filter: grayscale(20%);
  transition: filter 0.3s ease;
}

.funding:hover {
  filter: grayscale(0%);
}

/* Improved accessibility and contrast */
a:focus {
  outline: 2px solid rgb(0, 0, 80);
  outline-offset: 2px;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 2px rgb(0, 0, 80);
}

/* Better spacing and typography */
.row {
  margin-bottom: 2rem;
}

p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Loading performance */
.nav-brand {
  object-fit: contain;
}

#lab-photo {
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
