/* ========================================
   WordPress-Specific Styles
   These styles handle WordPress features not covered by Tailwind
   ======================================== */

/* Mobile Menu Toggle Icon Animation */
.hamburger-icon {
  position: relative;
  display: block;
  width: 1rem; 
  height: 1rem;
}

.hamburger-icon .line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: all 200ms ease;
}

.hamburger-icon .line-1 {
  top: 0;
}

.hamburger-icon .line-2 {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-icon .line-3 {
  bottom: 0;
}

.mobile-menu-toggle[aria-expanded='true'] .hamburger-icon .line-1 {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded='true'] .hamburger-icon .line-2 {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded='true'] .hamburger-icon .line-3 {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Mobile Menu States */
.mobile-menu-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

.mobile-navigation.active {
  transform: translateY(0) !important;
}

body.mobile-menu-open {
  overflow: hidden;
}

/* WordPress Navigation Menu Styles */
.menu,
.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Desktop Menu Item with Children */
.menu > li.menu-item-has-children {
  position: relative;
}

.menu > li.menu-item-has-children > a {
  @apply relative inline-flex items-center gap-2 rounded-lg px-4 py-2 text-base font-semibold tracking-wide text-slate-700 transition-all duration-300;
}

.menu > li.menu-item-has-children > a:hover,
.menu > li.current-menu-item > a,
.menu > li.current_page_item > a {
  @apply text-emerald-700;
}

/* Desktop Dropdown Indicator */
.menu > li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 300ms ease;
}

.menu > li.menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
}

/* Desktop Submenu */
.menu .sub-menu {
  @apply invisible absolute top-full left-1/2 z-30 w-72 -translate-x-1/2 translate-y-2 rounded-2xl border border-slate-100 bg-white/95 p-6 opacity-0 shadow-xl backdrop-blur-md transition-all duration-400 ease-out;
  margin-top: 0.75rem;
}

.menu > li:hover .sub-menu,
.menu > li:focus-within .sub-menu {
  @apply visible translate-y-0 opacity-100;
}

.menu .sub-menu li {
  @apply mb-3 last:mb-0;
}

.menu .sub-menu a {
  @apply block rounded-xl px-5 py-4 text-sm font-medium text-slate-700 transition-all duration-300;
}

.menu .sub-menu a:hover,
.menu .sub-menu li.current-menu-item > a {
  @apply translate-x-2 bg-emerald-50 text-emerald-800 shadow-sm;
}

.menu .sub-menu li.current-menu-item > a {
  @apply bg-emerald-100;
}

/* Mobile Menu Styles */
@media (max-width: 767px) {
  .menu > li {
    @apply border-b border-gray-100;
  }

  .menu > li > a {
    @apply block px-6 py-4 text-base font-medium text-gray-900 transition-all duration-200;
  }

  .menu > li > a:hover,
  .menu > li.current-menu-item > a,
  .menu > li.current_page_item > a {
    @apply border-r-4 border-emerald-600 bg-emerald-50 text-emerald-800;
  }

  .menu .sub-menu {
    @apply visible relative left-0 w-full translate-x-0 translate-y-0 border-0 bg-gray-50 p-0 opacity-100 shadow-none;
    display: none;
    border-top: 1px solid theme('colors.gray.100');
  }

  .menu .sub-menu.active {
    display: block;
  }

  .menu .sub-menu li {
    @apply mb-0 border-b border-gray-100;
  }

  .menu .sub-menu a {
    @apply rounded-none px-8 py-3 text-sm text-gray-600;
  }

  .menu .sub-menu a:hover,
  .menu .sub-menu li.current-menu-item > a {
    @apply translate-x-0 border-r-4 border-emerald-600 bg-emerald-100 text-emerald-800;
  }
}

/* Footer Menu Expand Animation */
.footer-nav-menu li.menu-item-has-children.expanded .sub-menu {
  max-height: 10rem;
  margin-top: 0.5rem;
  opacity: 1;
}

.footer-nav-menu li.menu-item-has-children.expanded .sub-menu li {
  opacity: 1;
  transform: translateX(0);
}

/* WordPress Default Classes */
.sticky {
  /* Add your sticky post styles */
}

.bypostauthor {
  /* Add styles for post author comments */
}

.alignleft {
  @apply float-left mr-4 mb-4;
}

.alignright {
  @apply float-right mb-4 ml-4;
}

.aligncenter {
  @apply mx-auto mb-4 block;
}

.wp-caption {
  @apply max-w-full;
}

.wp-caption-text {
  @apply mt-2 text-center text-sm text-slate-600;
}

.gallery-caption {
  @apply mt-2 text-sm text-slate-600;
}

/* Screen Reader Text */
.screen-reader-text {
  @apply clip-[rect(1px,1px,1px,1px)] absolute -m-px h-px w-px overflow-hidden border-0 p-0;
}

.screen-reader-text:focus {
  @apply clip-auto top-2 left-2 z-50 h-auto w-auto bg-gray-100 p-4;
}

/* Custom Logo */
.custom-logo-link {
  @apply flex items-center;
}

.custom-logo {
  @apply h-auto max-h-12 w-auto;
}

/* Clearfix */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* Footer Social Icons - Keep White Color on Hover */
footer a svg {
  color: white !important;
}

footer a:hover svg {
  color: white !important;
}

/* Footer Quick Links Menu Styling */
.footer-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav-menu li {
  margin-bottom: 0.5rem;
}

.footer-nav-menu li:last-child {
  margin-bottom: 0;
}

.footer-nav-menu a {
  display: block;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  transition: color 200ms ease, font-weight 200ms ease;
}

@media (min-width: 640px) {
  .footer-nav-menu a {
    font-size: 1rem;
  }
}

.footer-nav-menu a:hover {
  color: rgb(255, 255, 255);
  font-weight: 600;
}

/* Blog Pagination Styling */
.page-numbers {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.page-numbers li {
  margin: 0;
}

.page-numbers a,
.page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background-color: white;
  font-weight: 500;
  font-size: 0.875rem;
  color: #374151;
  transition: all 200ms ease;
}

.page-numbers a:hover {
  background-color: #059669;
  border-color: #059669;
  color: white;
}

.page-numbers .current {
  background-color: #059669;
  border-color: #059669;
  color: white;
}

.page-numbers .prev,
.page-numbers .next {
  padding: 0 0.5rem;
}

.page-numbers .dots {
  border: none;
  background: none;
  color: #9ca3af;
}
