/**
 * Header styles
 */

#masthead {
  .header-wrapper {
    display: flex;
    flex-direction: row;  
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
}

.site-branding {
  margin-right: auto;
}

.main-navigation,
.social-navigation {
  display: inline-block;
}

/* Menu styling */
#primary-menu,
#social-menu {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  
  li {
    margin: 0 0.5rem;
    display: inline-block;
  }
}

/* Social menu specific */
.social-navigation {
  margin-left: 1rem;
  
  li a {
    font-size: 0;  /* Hide text */
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-blue-light);
    position: relative;
    transition: background-color 0.25s ease;
    
    &:hover {
      background-color: var(--color-blue-dark);
    }
  }
  
  /* Individual social icons */
  .instagram-icon a {
    background-image: url('../../../assets/svg/instagram-icon.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
  }
  
  .facebook-icon a {
    background-image: url('../../../assets/svg/facebook-icon.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
  }
  
  .x-icon a {
    background-image: url('../../../assets/svg/x-icon.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
  }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-blue-light);
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0;
  transition: background-color 0.25s ease;
  
  &:hover {
    background-color: var(--color-blue-dark);
  }
  
  .hamburger-lines {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
  }
  
  .hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background-color: white;
    margin: 2px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  
  &.active {
    background-color: var(--color-blue-dark);
    
    .hamburger-line:nth-child(1) {
      transform: translateY(4px) rotate(45deg);
    }
    
    .hamburger-line:nth-child(2) {
      opacity: 0;
    }
    
    .hamburger-line:nth-child(3) {
      transform: translateY(-4px) rotate(-45deg);
    }
  }
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-blue-dark);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  
  /* Close button */
  .mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-blue-light);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.25s ease;
    z-index: 1001;
    
    &:hover {
      background-color: var(--color-gold);
    }
    
    .close-icon {
      position: relative;
      display: block;
      width: 100%;
      height: 100%;
      
      &::before,
      &::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 2px;
        background-color: white;
      }
      
      &::before {
        transform: translate(-50%, -50%) rotate(45deg);
      }
      
      &::after {
        transform: translate(-50%, -50%) rotate(-45deg);
      }
    }
  }
  
  &.active {
    opacity: 1;
  }
  
  .mobile-nav-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: var(--spacing-lg);
  }
  
  .mobile-main-nav {
    margin-bottom: var(--spacing-lg);
    width: 100%;
    text-align: center;
    
    ul {
      list-style: none;
      padding: 0;
      margin: 0;
      
      li {
        margin-bottom: var(--spacing-md);
        
        a {
          color: white;
          font-size: 1.5rem;
          text-decoration: none;
          font-weight: 700;
          transition: color 0.2s ease;
          
          &:hover {
            color: var(--color-gold);
            text-decoration: none;
          }
        }
      }
    }
  }
  
  .mobile-social-nav {
    ul {
      display: flex;
      justify-content: center;
      list-style: none;
      padding: 0;
      margin: 0;
      gap: var(--spacing-md);
    }
  }
  
  /* Style for social icons in mobile menu */
  #mobile-social-menu li a {
    font-size: 0;  /* Hide text */
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-gold);  /* Gold background */
    position: relative;
    transition: background-color 0.25s ease;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
  }
  
  /* Individual social icons in mobile menu */
  #mobile-social-menu .instagram-icon a {
    background-image: url('../../../assets/svg/instagram-icon.svg');
  }
  
  #mobile-social-menu .facebook-icon a {
    background-image: url('../../../assets/svg/facebook-icon.svg');
  }
  
  #mobile-social-menu .x-icon a {
    background-image: url('../../../assets/svg/x-icon.svg');
  }
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .site-branding img {
    max-height: 50px;
    width: auto;
  }
}

@media (max-width: 768px) {
  #primary-menu,
  #social-menu {
    justify-content: center;
    
    li {
      margin: 0.25rem;
    }
  }
}