/*
Theme Name: LE Custom
Description: A modern WordPress theme featuring structured data support, quick edit meta descriptions, customizable link components, and an elegant navigation system with dropdown menus
Version: 1.1
Author: Minh and Duc
*/

/* CSS Custom Properties for Dynamic Colors */
:root {
  --primary-color: #059669;
  --primary-color-light: #ecfdf5;
  --secondary-color: #0ea5e9;
  --secondary-color-light: #f0f9ff;
}

/* Custom Navigation Styles */
.nav-link {
  position: relative;
  /* padding: 0.5rem 0; */
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Dropdown positioning */
.has-children {
  position: relative;
}

.submenu {
  position: absolute;
  left: 0;
  top: 100%;
  background: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.5rem 0;
  min-width: 12rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.3s ease;
  z-index: 50;
}

.submenu li {
  position: relative;
}

.submenu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.submenu a:hover {
  background-color: var(--primary-color-light);
  color: var(--primary-color);
}

/* Nested submenus */
.sub-submenu {
  position: absolute;
  left: 100%;
  top: 0;
  background: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.5rem 0;
  min-width: 12rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: all 0.3s ease;
}

.submenu li:hover .sub-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Mobile menu improvements */
@media (max-width: 1023px) {
  .mobile-menu .has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-menu .has-children > a::after {
    content: '▼';
    font-size: 0.75rem;
    transition: transform 0.3s ease;
  }

  .mobile-menu .submenu-open > a::after {
    transform: rotate(180deg);
  }

  .mobile-menu ul {
    transition: all 0.3s ease;
  }

  .mobile-menu .has-children ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .mobile-menu .submenu-open ul {
    max-height: 500px;
  }
}

/* Active state styling */
.current-menu-item > a {
  color: var(--primary-color) !important;
  border-bottom: 2px solid var(--primary-color);
  padding: 4px;
}

/* Contact information styling */
.contact-info a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-info a:hover {
  text-decoration-thickness: 2px;
}

/* Logo styling */
.custom-logo-link {
  display: flex;
  align-items: center;
}

.custom-logo-link img {
  /* Responsive logo sizing */
  max-height: 44px;
  width: auto;
  height: auto;
}

@media (min-width: 768px) {
  .custom-logo-link img {
    max-height: 56px;
  }
}

@media (min-width: 1024px) {
  .custom-logo-link img {
    max-height: 100px;
  }
}

/* Logo hover / focus effect: scale and subtle shadow without affecting layout */
.custom-logo-link img {
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 220ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.custom-logo-link:hover img,
.custom-logo-link:focus img,
.custom-logo-link:focus-visible img {
  transform: scale(1.08);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .custom-logo-link img {
    transition: none;
  }
}

/* Company name styling */
.custom-logo-link + a {
  text-decoration: none;
  color: inherit;
  /* Limit company name width so it doesn't push the nav; allow wrapping to two lines */
  max-width: 260px;
  display: inline-block;
  vertical-align: middle;
  overflow-wrap: break-word;
}

/* Smooth transitions for all interactive elements */
* {
  transition-property: color, background-color, border-color,
    text-decoration-color, fill, stroke, opacity, box-shadow,
    transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Focus states for accessibility */
.nav-link:focus,
button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading animation for forms */
.form-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Multi-column submenu styles - Better positioning to prevent off-screen */
.multi-column-submenu {
  display: flex;
  flex-direction: row;
  gap: 12px;
  min-width: 900px;
  max-width: 1100px;
  width: max-content;
  padding: 16px;
  /* Better positioning to prevent going off-screen */
  left: 360px !important; /* Move 160px to the left */
  right: auto;
}

/* Adjust positioning for items near the right edge of screen */
@media (max-width: 1400px) {
  .multi-column-submenu {
    left: 3200px !important; /* Move even more left on smaller screens */
  }
}

@media (max-width: 1200px) {
  .multi-column-submenu {
    left: 320px !important;
    min-width: 600px;
    max-width: 750px;
  }
}

/* Column containers for even distribution */
.submenu-column {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 260px;
  max-width: 320px;
}

.multi-column-submenu li {
  position: relative;
  margin: 0;
  width: 100%;
}

.multi-column-submenu a {
  display: block;
  padding: 10px 14px;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  border-radius: 6px;
  margin: 2px 0;
  /* Allow wrapping so long labels are fully visible */
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: 14px;
  line-height: 1.5;
}

.multi-column-submenu a:hover {
  background-color: #f3f4f6;
  color: #1f2937;
  transform: translateX(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1024px) {
  .multi-column-submenu {
    left: -80px !important;
    min-width: 500px;
    max-width: 650px;
  }

  .submenu-column {
    min-width: 220px;
    max-width: 280px;
  }
}

@media (max-width: 768px) {
  .multi-column-submenu {
    left: 0 !important; /* Reset to normal position on mobile */
    flex-direction: column;
    min-width: 280px;
    max-width: 320px;
  }

  .submenu-column {
    min-width: auto;
    max-width: none;
  }
}
