body {
  font-family: "Lato", sans-serif;
}

/* Style page content */
.main {
  margin-left: 20%;
  font-size: 22px;
  line-height: 35px;
  padding: 5%;
}

.sidenav {
  height: 100%;
  width: 20%;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  box-shadow: 2px 2px 20px #F0F3F4;
  overflow-x: hidden;
}

.navblock {
  margin: auto;
  width: 100%;
  height: 90%;
  display: flex;
}

.navblock_text {
  margin: auto;
  width: 100%;
  padding-top: 15%;
  padding-bottom: 15%;
}

.navblock_text a {
  padding: 26px 16px;
  text-decoration: none;
  text-align: center;
  font-size: 25px;
  color: #818181;
  display: block;
}

.navblock_text a:hover {
  color: #CFD8DC;
}

.footer {
  position: relative;
  left: 0;
  bottom: 0;
  width: 100%;
  color: #818181;
  text-align: center;
}

.about_accent, .resume_accent, .portfolio_accent, .research_accent, .blog_accent {
  color: green;
}

a {
  color: #3498DB;
  text-decoration: none;
}

.about_photo, .about_logo {
  display: block;
  margin: auto;
  object-fit: cover;
}

.about_photo {
  width: 300px;
  height: 300px;
  border-radius: 50%;
}

.about_logo {
  width: 40%;
}

.about_text, .about_links {
  text-align: center;
  padding: 5%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.about_text h1 {
  font-size: 2.5em;
  color: #333;
  animation: fadeInDown 1s ease-out;
}

.about_link {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  padding: 12px 20px;
  width: 80%;
  max-width: 400px;
  color: #3498db;
  background: #f7f9fa;
  border: 2px solid #3498db;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.about_link:hover {
  background: #3498db;
  color: white;
  transform: scale(1.05);
}

.about_link span {
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.about_link:hover span {
  transform: rotate(20deg) scale(1.2);
}

.about_link::after {
  content: attr(title);
  position: absolute;
  top: -35px; /* Position above the element */
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
  font-size: 0.8em;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.about_link:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-5px);
}

.portfolio-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.portfolio-container > div {
  background-color: white;
  width: 50%;
  margin: 4% 0;
  min-height: 20vh;
  position: relative;
  box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.1);
}

.portfolio-container_text, .portfolio-container_image {
  width: 90%;
  position: absolute;
}

.portfolio-container_text {
  text-align: left;
}

.portfolio-container_image {
  text-align: center;
  color: #8E44AD;
}

.blog-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  box-sizing: border-box; /* Include padding and borders in the width calculation */
  width: 100%;
}

.blog-card {
  background-color: #3498DB;
  color: white;
  width: 45%;
  padding: 20px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-wrap: break-word;
  margin: 2% 0; /* Added margin to increase spacing */
}


.blog-card:hover {
  transform: translateY(-10px) scale(1.1);
  box-shadow: 0px 15px 30px rgba(0, 0, 0, 0.4);
}

.blog_text {
  font-size: 20px;
  color: white;
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
}

.blog_date {
  font-size: 16px;
  color: #CFD8DC;
  text-align: right;
  margin-top: auto;
}

/* Default Gallery Styles */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Creates flexible columns */
  gap: 10px;
}

.gallery-item {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #f0f0f0; /* Optional background color */
}

.gallery-photo {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures the image covers the area properly */
  transition: transform 0.3s ease;
}

.gallery-photo:hover {
  transform: scale(1.05);
}

@keyframes fadeInDown {
  0% {
      opacity: 0;
      transform: translateY(-20px);
  }
  100% {
      opacity: 1;
      transform: translateY(0);
  }
}


/* Mobile styling */
/* Mobile styling */
@media screen and (max-width: 700px) {
  .sidenav {
    width: 100%;
    height: auto;
    position: relative;
    bottom: 0; /* Place the sidenav at the bottom */
    top: auto; /* Remove any top positioning */
    box-shadow: 0px -10px 40px #F0F3F4; /* Add shadow on the top (for bottom placement) */
  }

  .main {
    margin-left: 0;
    padding: 10% 5%;
  }

  .blog-container > * {
    max-width: 100%;
    box-sizing: border-box; /* Avoid overflow from padding or borders */
  }
  
  .blog-card {
    width: 100%;
    margin-bottom: 15px;
  }

  .portfolio-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .portfolio-container > div {
    width: 100%;
    margin-bottom: 15px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); /* Stacks gallery items on mobile */
  }

  .gallery-item {
    height: auto; /* Allow flexible height for the mobile layout */
  }

  .gallery-photo {
    height: auto; /* Ensure the height adjusts for mobile */
  }

  .about_text h1 {
    font-size: 1.8em;
  }

  .about_link {
    width: 100%;
    font-size: 1em;
    margin-top: 10px;
  }
}

