/* General Styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f7f7f7;
    color: #333333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation Bar */
.nav-logo {
    width: 40px;
    height: auto;
    margin-right: 20px;
}

header {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    padding: 18px 20px;
    border-bottom: 2px solid #2a3b5f;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

header nav {
    display: flex;
    justify-content: center;
    /* Centers the menu options */
    align-items: center;
    width: 100%;
    overflow: visible;
    white-space: normal;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    /* Allows items to wrap if needed */
    width: 100%;
    overflow: visible;
}

nav ul li {
    position: relative;
    flex-shrink: 0;
    overflow: visible;
}

nav ul li a {
    text-decoration: none;
    color: #2a3b5f;
    font-weight: bold;
    font-size: 18px;
    padding: 8px 14px;
    transition: color 0.3s ease, background-color 0.3s ease;
    white-space: nowrap;
}

nav ul li a:hover,
nav ul li a.active {
    color: #ffffff;
    background-color: #2a3b5f;
    border-radius: 5px;
}

/* Default for desktop */
.dropdown .dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    background-color: #fff;
    border: 1px solid #2a3b5f;
    border-radius: 5px;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

/* Mobile override */
@media (max-width: 768px) {
  .mobile-nav .dropdown .dropdown-content {
      position: fixed;
      top: 60px;
      left: 5%;
      right: 5%;
      display: none;
      background-color: #fff;
      border: 1px solid #2a3b5f;
      border-radius: 5px;
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
      z-index: 9999;
  }

  .mobile-nav .dropdown:hover .dropdown-content {
      display: block;
  }
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #2a3b5f;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #2a3b5f;
    color: #ffffff;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 50px 20px;
    background: #2a3b5f;
    color: #ffffff;
}

/* Blog Posts */
.blog-posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Ensure 2 items per row */
    gap: 20px;
    padding: 20px;
    flex-grow: 1;
}

.blog-post {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-5px);
}

.blog-post img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
}

.blog-post h2 {
    font-size: 24px;
    margin: 15px;
}

.blog-post p {
    font-size: 16px;
    margin: 0 15px 15px;
}

.blog-post a {
    display: inline-block;
    margin: 0 15px 15px;
    color: #2a3b5f;
    font-weight: bold;
    text-decoration: none;
    border: 2px solid #2a3b5f;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.blog-post a:hover {
    background-color: #2a3b5f;
    color: #ffffff;
}

/* Blog Article */
.blog-article {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    max-width: 800px;
    display: flex;
    flex-direction: column;
}

.blog-article img {
    width: 40%;
    height: auto;
    object-fit: cover;
    margin-right: 20px;
    float: left;
    margin-bottom: 20px;
}

.blog-article h2 {
    font-size: 28px;
    margin-top: 20px;
    color: #2a3b5f;
}

.blog-article p {
    font-size: 18px;
    line-height: 1.6;
    color: #333333;
    margin-left: 0;
    margin-bottom: 20px;
}

/* Back Button */
.back-button {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.back-button a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2a3b5f;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease;
}

.back-button a:hover {
    background-color: #1f2a4d;
}

/* Scroll Button */
.scroll-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #2a3b5f;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.scroll-button:hover {
    background-color: #1f2a4d;
    transform: translateY(-2px);
}

.scroll-button svg {
    width: 24px;
    height: 24px;
}

/* Footer Styles */
footer {
    background-color: #2a3b5f;
    color: white;
    text-align: center;
    padding: 10px 0;
    position: relative;
    width: 100%;
}

/* Mobile Styles */
@media (max-width: 768px) {
   /* Mobile and Tablet Styles */

    /* Hide desktop nav, show mobile nav */
    .desktop-nav {
      display: none;
    }
  
    .mobile-nav {
      display: block;
    }
  
    .contact-section {
      display: none;
    }
  
    /* Nav Wrapper */
    .nav-scroll-wrapper {
      display: block;
      overflow-x: auto;
      overflow-y: visible;
      position: relative;
      z-index: 1000;
      background-color: #fff;
      isolation: isolate;
    }
  
    .nav-scroll-wrapper::-webkit-scrollbar {
      display: none;
    }
  
    header nav {
      display: flex;
      align-items: center;
      white-space: nowrap;
      width: max-content;
      overflow: visible;
    }
  
    nav ul {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      gap: 20px;
      padding: 0 16px;
      margin: 0;
      list-style: none;
      overflow: visible;
      position: relative;
      z-index: 1001;
      white-space: nowrap;
    }
  
    nav ul li {
      flex-shrink: 0;
      scroll-snap-align: start;
      position: relative;
      overflow: visible;
    }
  
    nav ul li a {
      font-size: 14px;
      padding: 8px 12px;
      white-space: nowrap;
      text-decoration: none;
      font-weight: bold;
      color: #2a3b5f;
      display: inline-block;
    }
  
    nav ul li.dropdown {
      position: relative;
    }
  
    /* Mobile Dropdowns */
    .mobile-nav .dropdown .dropdown-content {
      position: fixed;
      top: 60px; /* adjust to match header height */
      left: 5%;
      right: 5%;
      display: none;
      background-color: #fff;
      border: 1px solid #2a3b5f;
      border-radius: 5px;
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
      z-index: 9999;
    }
  
    .mobile-nav .dropdown:hover .dropdown-content {
      display: block;
    }

    .hero {
        padding-top: 120px;
    }

    .blog-posts {
        grid-template-columns: 1fr; /* Stack blog posts in a single column on mobile */
        padding: 20px 10px; /* Adjust padding */
    }

    .blog-post {
        margin: 0 10px; /* Adjust margin to create a little space around each post */
    }

    .blog-post img {
        width: 100%; /* Ensure the image takes full width */
        height: auto; /* Maintain aspect ratio */
    }

    .blog-post h2 {
        font-size: 20px; /* Adjust the title size */
        margin: 15px 0;
    }

    .blog-post p {
        font-size: 14px; /* Adjust text size */
        margin: 0 15px 15px;
    }

    .blog-post a {
        font-size: 14px;
        padding: 4px 8px; /* Smaller button size */
    }

    .blog-article img {
        width: 80%; /* Adjust image width */
        margin-right: 0;
        float: none;
        margin-bottom: 20px;
    }

    .scroll-button {
        width: 45px;
        height: 45px;
    }
}