upskill-event-manager/assets/css/hvac-navigation-enhanced.css
Ben 4367f6a395 feat: implement professional navigation with smooth dropdowns and best practices
- Created hvac-navigation-enhanced.css with modern dropdown styles
  - Pure CSS hover dropdowns for desktop (no JS needed)
  - Smooth animations with 300ms transitions
  - Professional hover effects with bottom border animation
  - Proper z-index layering (z-index: 9999 for dropdowns)
  - Keyboard navigation support

- Added hvac-navigation-enhanced.js for enhanced UX
  - Mobile hamburger menu with smooth animations
  - Keyboard navigation (arrow keys, escape, enter)
  - Click outside to close
  - Accessibility improvements with ARIA attributes
  - Smooth scroll for anchor links

- Fixed menu toggle visibility issue
  - Removed conflicting Astra theme buttons
  - Using pure CSS :hover for desktop dropdowns
  - Better mobile responsive behavior

- Updated class-hvac-scripts-styles.php
  - Added new CSS and JS files to build pipeline
  - Proper dependency management

Best practices implemented:
- WCAG 2.1 AA compliant keyboard navigation
- Focus management for accessibility
- Smooth 300ms transitions for professional feel
- Mobile-first responsive design
- No JavaScript required for desktop dropdowns
2025-08-20 23:10:53 -03:00

394 lines
No EOL
8.4 KiB
CSS

/**
* HVAC Navigation Enhanced
* Professional dropdown navigation with smooth animations and best practices
*
* @version 2.0.0
* @since 2025-08-21
*/
/* ===== BASE NAVIGATION STRUCTURE ===== */
.hvac-trainer-menu-wrapper {
background: #ffffff;
border-bottom: 2px solid #f0f0f0;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
position: relative;
z-index: 1000;
width: 100%;
}
.hvac-trainer-nav {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
/* ===== MAIN MENU ===== */
.hvac-trainer-menu {
display: flex;
align-items: center;
list-style: none;
margin: 0;
padding: 0;
gap: 0;
}
.hvac-trainer-menu > .menu-item {
position: relative;
margin: 0;
padding: 0;
}
/* ===== MENU LINKS ===== */
.hvac-trainer-menu .menu-item > a {
display: inline-flex;
align-items: center;
padding: 18px 16px;
color: #374151;
font-size: 14px;
font-weight: 500;
text-decoration: none;
white-space: nowrap;
transition: all 0.2s ease;
position: relative;
}
/* Hover effect with bottom border */
.hvac-trainer-menu .menu-item > a::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 3px;
background: var(--hvac-primary-500, #0274be);
transition: all 0.3s ease;
transform: translateX(-50%);
}
.hvac-trainer-menu .menu-item > a:hover::after,
.hvac-trainer-menu .menu-item.current-menu-item > a::after {
width: calc(100% - 32px);
}
.hvac-trainer-menu .menu-item > a:hover {
color: var(--hvac-primary-500, #0274be);
background: rgba(2, 116, 190, 0.05);
}
/* ===== DROPDOWN TOGGLE ARROWS ===== */
.hvac-trainer-menu .menu-item-has-children > a {
padding-right: 30px;
}
.hvac-trainer-menu .menu-item-has-children > a::before {
content: '▾';
position: absolute;
right: 12px;
top: 50%;
transform: translateY(-50%);
font-size: 12px;
transition: transform 0.3s ease;
color: #9ca3af;
}
.hvac-trainer-menu .menu-item-has-children:hover > a::before,
.hvac-trainer-menu .menu-item-has-children.menu-open > a::before {
transform: translateY(-50%) rotate(180deg);
color: var(--hvac-primary-500, #0274be);
}
/* Hide Astra's toggle buttons - we use CSS hover instead */
.hvac-trainer-menu .ast-menu-toggle {
display: none !important;
}
/* ===== DROPDOWN MENUS ===== */
.hvac-trainer-menu .sub-menu {
position: absolute;
top: 100%;
left: 0;
min-width: 220px;
background: #ffffff;
border: 1px solid #e5e7eb;
border-radius: 8px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
padding: 8px 0;
margin: 0;
list-style: none;
opacity: 0;
visibility: hidden;
transform: translateY(-10px);
transition: all 0.3s ease;
z-index: 9999;
}
/* Show dropdown on hover */
.hvac-trainer-menu .menu-item-has-children:hover > .sub-menu {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
/* Dropdown menu items */
.hvac-trainer-menu .sub-menu .menu-item {
margin: 0;
width: 100%;
}
.hvac-trainer-menu .sub-menu .menu-item > a {
display: block;
padding: 10px 20px;
color: #4b5563;
font-size: 14px;
font-weight: 400;
text-decoration: none;
transition: all 0.2s ease;
position: relative;
overflow: hidden;
}
/* Sliding hover effect for dropdown items */
.hvac-trainer-menu .sub-menu .menu-item > a::before {
content: '';
position: absolute;
left: 0;
top: 0;
width: 3px;
height: 100%;
background: var(--hvac-primary-500, #0274be);
transform: translateX(-3px);
transition: transform 0.3s ease;
}
.hvac-trainer-menu .sub-menu .menu-item > a:hover {
color: var(--hvac-primary-500, #0274be);
background: rgba(2, 116, 190, 0.05);
padding-left: 24px;
}
.hvac-trainer-menu .sub-menu .menu-item > a:hover::before {
transform: translateX(0);
}
/* ===== ICONS IN MENU ===== */
.hvac-trainer-menu .dashicons {
margin-right: 8px;
font-size: 16px;
line-height: 1;
vertical-align: middle;
}
/* ===== SPECIAL MENU ITEMS ===== */
/* Help menu positioned to the right */
.hvac-trainer-menu .hvac-help-menu-item {
margin-left: auto;
}
.hvac-trainer-menu .hvac-help-menu-item > a {
padding: 18px 12px;
min-width: 44px;
justify-content: center;
}
.hvac-trainer-menu .hvac-help-menu-item .dashicons {
margin-right: 0;
font-size: 18px;
}
/* Current/active menu items */
.hvac-trainer-menu .current-menu-item > a,
.hvac-trainer-menu .current-menu-ancestor > a {
color: var(--hvac-primary-500, #0274be);
font-weight: 600;
}
/* ===== MOBILE NAVIGATION ===== */
.hvac-hamburger-menu {
display: none;
background: none;
border: none;
padding: 10px;
cursor: pointer;
position: relative;
z-index: 1001;
}
.hvac-hamburger-line {
display: block;
width: 25px;
height: 2px;
background: #374151;
margin: 6px 0;
transition: all 0.3s ease;
border-radius: 2px;
}
/* Hamburger animation */
.hvac-hamburger-menu.active .hvac-hamburger-line:nth-child(1) {
transform: rotate(45deg) translate(5px, 5px);
}
.hvac-hamburger-menu.active .hvac-hamburger-line:nth-child(2) {
opacity: 0;
transform: translateX(-10px);
}
.hvac-hamburger-menu.active .hvac-hamburger-line:nth-child(3) {
transform: rotate(-45deg) translate(7px, -6px);
}
@media (max-width: 992px) {
.hvac-hamburger-menu {
display: block;
}
.hvac-trainer-nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
}
.hvac-trainer-menu {
display: none;
position: absolute;
top: 100%;
left: 0;
right: 0;
flex-direction: column;
background: #ffffff;
border-top: 1px solid #e5e7eb;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
max-height: calc(100vh - 60px);
overflow-y: auto;
}
.hvac-trainer-menu.active {
display: flex;
}
.hvac-trainer-menu > .menu-item {
width: 100%;
border-bottom: 1px solid #f3f4f6;
}
.hvac-trainer-menu .menu-item > a {
padding: 16px 20px;
width: 100%;
}
.hvac-trainer-menu .menu-item > a::after {
display: none;
}
/* Mobile dropdowns */
.hvac-trainer-menu .menu-item-has-children > a::before {
content: '▾';
right: 20px;
}
.hvac-trainer-menu .sub-menu {
position: static;
opacity: 1;
visibility: visible;
transform: none;
box-shadow: none;
border: none;
border-radius: 0;
background: #f9fafb;
display: none;
padding: 0;
}
.hvac-trainer-menu .menu-item-has-children.menu-open > .sub-menu {
display: block;
}
.hvac-trainer-menu .sub-menu .menu-item > a {
padding-left: 40px;
}
.hvac-trainer-menu .sub-menu .menu-item > a:hover {
padding-left: 44px;
}
}
/* ===== ACCESSIBILITY ===== */
.hvac-trainer-menu a:focus {
outline: 2px solid var(--hvac-primary-500, #0274be);
outline-offset: 2px;
border-radius: 4px;
}
/* Skip to content link */
.skip-link:focus {
position: fixed;
top: 20px;
left: 20px;
z-index: 10000;
padding: 10px 20px;
background: var(--hvac-primary-500, #0274be);
color: white;
text-decoration: none;
border-radius: 4px;
}
/* ===== LOADING STATE ===== */
.hvac-trainer-menu.loading {
opacity: 0.5;
pointer-events: none;
}
/* ===== ANIMATION KEYFRAMES ===== */
@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* ===== OVERRIDE THEME CONFLICTS ===== */
/* Ensure our styles take precedence over Astra theme */
.hvac-page-wrapper .hvac-trainer-menu a,
.hvac-plugin-page .hvac-trainer-menu a {
box-shadow: none !important;
text-shadow: none !important;
}
/* Remove any unwanted theme button styles */
.hvac-trainer-menu button.ast-menu-toggle {
display: none !important;
}
/* Ensure dropdowns work without JavaScript */
.hvac-trainer-menu .menu-item-has-children:hover > .sub-menu,
.hvac-trainer-menu .menu-item-has-children:focus-within > .sub-menu {
opacity: 1;
visibility: visible;
transform: translateY(0);
}