/* Responsive design improvements */

/* Mobile menu container */
.mobile-menu-container {
  display: none;
}

/* Mobile menu enhancements */
@media (max-width: 768px) {
  /* Show mobile menu container */
  .mobile-menu-container {
    display: block;
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 1100;
  }
  
  /* Hamburger menu styling */
  .hamburger-menu {
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }
  
  .hamburger-text {
    font-size: 14px;
    font-weight: bold;
    margin-left: 5px;
  }
  
  .hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 16px;
  }

  .hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
  }

  /* Hamburger menu animation */
  .hamburger-menu.is-active {
    background-color: var(--primary-color-dark);
  }
  
  .hamburger-menu.is-active .hamburger-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .hamburger-menu.is-active .hamburger-icon span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu.is-active .hamburger-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Dark mode styles */
  body.dark .hamburger-menu {
    background-color: var(--primary-color-light);
  }
  
  body.dark .hamburger-menu.is-active {
    background-color: var(--primary-color);
  }

  /* Menu styling for mobile */
  nav {
    justify-content: space-between;
  }
  
  .logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  #menu {
    display: none; /* Hide by default on mobile */
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--background-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    padding: 10px 0;
    margin: 0;
    flex-direction: column;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  #menu.show {
    display: flex !important;
  }

  #menu li {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
  }

  #menu li a {
    display: block;
    padding: 15px 20px;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
  }

  #menu li:last-child a {
    border-bottom: none;
  }

  #menu li a:hover {
    background-color: var(--accent-color);
  }
  
  /* Dark mode menu styling */
  body.dark #menu {
    background-color: var(--primary-color-dark);
  }
  
  body.dark #menu li a {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Make the header sticky on mobile */
  .header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--background-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  /* Adjust logo and nav for better mobile display */
  .nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 15px;
  }

  .logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
}

/* General responsive improvements */
@media (max-width: 576px) {
  .post-entry {
    padding: 15px;
  }

  .entry-header h2 {
    font-size: 1.5rem;
  }

  .home-info {
    padding: 15px !important;
  }

  .home-info h1 {
    font-size: 1.8rem;
  }

  .post-description {
    font-size: 0.9rem;
  }
}

/* Fix for high-dpi screens */
@media (min-resolution: 192dpi) {
  body {
    text-rendering: optimizeLegibility;
  }
}

/* Fix for dark mode on mobile */
@media (prefers-color-scheme: dark) {
  :root:not(.light) .menu-trigger span,
  :root:not(.light) .menu-trigger span::before,
  :root:not(.light) .menu-trigger span::after {
    background-color: var(--accent-color);
  }
  
  :root:not(.light) #menu {
    background-color: var(--primary-color-dark);
  }
}
