/*
 Theme Name:   Neve Child - Solutions360
 Theme URI:    https://solutions360.com
 Description:  Custom child theme for Solutions360 built on Neve.
 Author:       Solutions360
 Author URI:   https://solutions360.com
 Template:     neve
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  neve-child-s360
*/

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  --s360-bg: #FAFAFA;
  --s360-bg-alt: #FFFFFF;
  --s360-bg-elevated: #FFFFFF;
  --s360-text: #0A0A0A;
  --s360-text-secondary: #404040;
  --s360-text-muted: #6B6B6B;
  --s360-primary: #FEC10D;
  --s360-primary-dark: #D4A00A;
  --s360-primary-light: #FFF8E1;
  --s360-accent: #0A0A0A;
  --s360-accent-light: #F5F5F5;
  --s360-border: #E5E5E5;
  --s360-border-light: #F0F0F0;
  --s360-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --s360-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --s360-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --s360-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
  --s360-gradient-primary: linear-gradient(135deg, #FEC10D 0%, #D4A00A 100%);
  --s360-radius-sm: 6px;
  --s360-radius-md: 12px;
  --s360-radius-lg: 20px;
  --s360-radius-xl: 28px;
}

/* Dark Mode */
body.s360-dark {
  --s360-bg: #0A0A0A;
  --s360-bg-alt: #111111;
  --s360-bg-elevated: #1A1A1A;
  --s360-text: #FAFAFA;
  --s360-text-secondary: #CCCCCC;
  --s360-text-muted: #888888;
  --s360-primary-light: #2A2308;
  --s360-accent: #FAFAFA;
  --s360-accent-light: #1A1A1A;
  --s360-border: #333333;
  --s360-border-light: #222222;
  --s360-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --s360-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
  --s360-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
  --s360-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.4), 0 10px 10px -5px rgba(0,0,0,0.3);
}

/* ============================================
   BASE / RESET
   ============================================ */
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--s360-bg);
  color: var(--s360-text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--s360-primary);
  color: #0A0A0A;
  font-weight: 600;
  border-radius: var(--s360-radius-md);
  z-index: 10000;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

*:focus-visible {
  outline: 2px solid var(--s360-primary);
  outline-offset: 2px;
}

/* ============================================
   HEADER
   ============================================ */
.s360-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 24px;
  transition: all 0.3s ease;
  background: transparent;
}

.s360-header.scrolled {
  background: var(--s360-bg-elevated);
  box-shadow: var(--s360-shadow-md);
  padding: 12px 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.s360-header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.s360-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.s360-logo:hover { transform: scale(1.02); }
.s360-logo img { height: 40px; width: auto; }

/* Navigation */
.s360-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.s360-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.s360-nav-item {
  position: relative;
  list-style: none;
}

.s360-nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--s360-text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: var(--s360-radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.s360-nav-link:hover,
.s360-nav-link:focus,
.s360-nav-link.active {
  color: var(--s360-text);
  background: var(--s360-bg-alt);
}

.s360-nav-link svg { transition: transform 0.2s ease; }
.s360-nav-link.active svg { transform: rotate(180deg); }

/* Dropdown Panels (simple dropdown) — the <ul> rendered by the walker */
.s360-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: var(--s360-bg-elevated);
  border: 1px solid var(--s360-border);
  border-radius: var(--s360-radius-md);
  box-shadow: var(--s360-shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
  list-style: none;
  margin: 0;
}

/* Invisible hover bridge — fills gap between nav item and fixed mega panel */
.s360-has-mega::after,
.s360-has-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 30px;
  display: none;
}
.s360-has-mega.open::after,
.s360-has-dropdown.open::after {
  display: block;
}

.s360-nav-item.open > .s360-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(8px);
}

/* Mega Menu: override position/size when parent has .s360-has-mega */
.s360-has-mega > .s360-dropdown-panel {
  position: fixed !important;
  top: 70px !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(-10px) !important;
  width: 900px;
  max-width: calc(100vw - 48px);
  border-radius: var(--s360-radius-lg);
  box-shadow: var(--s360-shadow-xl);
  padding: 32px !important;
  display: flex !important;
  flex-wrap: nowrap;
  gap: 40px;
}

/* Each mega column takes equal space */
.s360-has-mega > .s360-dropdown-panel > .s360-mega-col {
  flex: 1;
  min-width: 0;
}

.s360-has-mega.open > .s360-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) !important;
}

/* Dropdown panel <li> items — remove bullet styling */
.s360-dropdown-panel > li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Mega column <li> — each "mega-col-title" li becomes a grid column */
.s360-mega-col {
  list-style: none;
}

.s360-mega-column-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--s360-primary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--s360-primary);
}
/* Clickable column title (mega-col-title without sub-items) */
.s360-mega-column-title--link {
  display: block;
  text-decoration: none;
  transition: color 0.2s ease;
}
.s360-mega-column-title--link:hover {
  color: var(--s360-primary-dark, #D4A00A);
}

/* Sub-items inside a mega column */
.s360-mega-subitems {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Ensure these are always visible when panel is open */
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  position: static !important;
}
.s360-mega-subitems > li {
  list-style: none;
  margin: 0;
  padding: 0;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Dropdown items (shared between simple and mega) */
.s360-dropdown-item {
  display: block;
  padding: 10px 12px;
  color: var(--s360-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: var(--s360-radius-sm);
  transition: all 0.15s ease;
}
.s360-dropdown-item:hover,
.s360-dropdown-item:focus {
  background: var(--s360-primary-light);
  color: var(--s360-text);
}

/* Items with subtitle/description */
.s360-has-subtitle { padding: 12px; }
.s360-dropdown-label {
  display: block;
  font-weight: 600;
  color: var(--s360-text);
  margin-bottom: 2px;
}
.s360-dropdown-subtitle {
  display: block;
  font-size: 0.8rem;
  color: var(--s360-text-muted);
}

/* Highlighted mega item */
li.s360-mega-highlight > .s360-dropdown-item {
  background: var(--s360-primary);
  color: #0A0A0A;
  font-weight: 600;
}
li.s360-mega-highlight > .s360-dropdown-item:hover {
  background: var(--s360-primary-dark);
  color: #0A0A0A;
}

/* Nav Actions */
.s360-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme Toggle */
.s360-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--s360-radius-md);
  border: 1px solid var(--s360-border);
  background: var(--s360-bg-elevated);
  color: var(--s360-text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.s360-theme-toggle:hover {
  border-color: var(--s360-primary);
  color: var(--s360-primary);
  transform: rotate(15deg);
}

/* Buttons */
.s360-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--s360-radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.s360-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}
.s360-btn:hover::before { left: 100%; }

.s360-btn-primary {
  background: var(--s360-primary);
  color: #0A0A0A;
}
.s360-btn-primary:hover {
  background: var(--s360-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254,193,13,0.4);
}

.s360-btn-secondary {
  background: var(--s360-bg-elevated);
  color: var(--s360-text);
  border: 1px solid var(--s360-border);
}
.s360-btn-secondary:hover {
  border-color: var(--s360-primary);
  background: var(--s360-primary-light);
}

.s360-btn-dark {
  background: var(--s360-accent);
  color: var(--s360-bg);
}
.s360-btn-dark:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ============================================
   MOBILE MENU
   ============================================ */
.s360-mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--s360-text);
  cursor: pointer;
  border-radius: var(--s360-radius-sm);
  transition: background 0.2s ease;
}
.s360-mobile-menu-btn:hover { background: var(--s360-accent-light); }

.s360-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.s360-mobile-overlay.open { display: block; opacity: 1; }

.s360-mobile-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: var(--s360-bg-elevated);
  z-index: 999;
  padding: 24px;
  overflow-y: auto;
  transition: right 0.3s ease;
}
.s360-mobile-panel.open { right: 0; }

.s360-mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--s360-text);
  cursor: pointer;
  margin-left: auto;
  margin-bottom: 24px;
}

.s360-mobile-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.s360-mobile-nav-item { border-bottom: 1px solid var(--s360-border-light); }

.s360-mobile-nav-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  color: var(--s360-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}
.s360-mobile-nav-link svg { transition: transform 0.2s ease; }
.s360-mobile-nav-link.active svg { transform: rotate(180deg); }

.s360-mobile-submenu {
  display: none;
  list-style: none;
  padding: 0 0 16px 16px;
  margin: 0;
}
.s360-mobile-submenu.open { display: block; }

.s360-mobile-submenu a {
  display: block;
  padding: 10px 0;
  color: var(--s360-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}
.s360-mobile-submenu a:hover { color: var(--s360-primary); }

/* ============================================
   FOOTER
   ============================================ */
.s360-footer {
  background: var(--s360-bg-alt);
  border-top: 1px solid var(--s360-border);
  padding: 80px 24px 40px;
}

.s360-footer-content {
  max-width: 1400px;
  margin: 0 auto;
}

.s360-footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.s360-footer-brand { max-width: 300px; }
.s360-footer-logo { margin-bottom: 20px; }
.s360-footer-logo img { height: 40px; width: auto; }

.s360-footer-tagline {
  color: var(--s360-text-secondary);
  margin-bottom: 24px;
  line-height: 1.7;
}

.s360-footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--s360-text-secondary);
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.s360-footer-contact-item svg {
  color: var(--s360-primary);
  flex-shrink: 0;
  margin-top: 2px;
}
.s360-footer-contact-item a {
  color: var(--s360-text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}
.s360-footer-contact-item a:hover { color: var(--s360-primary); }

.s360-footer-social {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.s360-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--s360-accent-light);
  color: var(--s360-text-secondary);
  transition: all 0.2s ease;
}
.s360-social-link:hover {
  background: var(--s360-primary);
  color: #0A0A0A;
  transform: translateY(-2px);
}

/* Footer Widget Columns */
.s360-footer-column .widget-title,
.s360-footer-column h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--s360-text);
  margin-bottom: 20px;
}

.s360-footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.s360-footer-column li { margin-bottom: 12px; }

.s360-footer-column a {
  color: var(--s360-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.s360-footer-column a:hover,
.s360-footer-column a:focus { color: var(--s360-primary); }

/* Footer Bottom */
.s360-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 40px;
  border-top: 1px solid var(--s360-border);
}

.s360-footer-copyright {
  color: var(--s360-text-muted);
  font-size: 0.9rem;
}

.s360-footer-legal {
  display: flex;
  gap: 24px;
}

.s360-footer-legal a {
  color: var(--s360-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.s360-footer-legal a:hover { color: var(--s360-primary); }

/* Footer legal as <nav> with <ul> from wp_nav_menu */
.s360-footer-legal-list {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.s360-footer-legal-list li { list-style: none; }
.s360-footer-legal-list a {
  color: var(--s360-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.s360-footer-legal-list a:hover { color: var(--s360-primary); }

/* Footer column link menus from wp_nav_menu */
.s360-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.s360-footer-links li {
  list-style: none;
  margin-bottom: 12px;
}
.s360-footer-links a {
  color: var(--s360-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.s360-footer-links a:hover { color: var(--s360-primary); }

/* ============================================
   PAGE LAYOUTS
   ============================================ */
.s360-page-content {
  padding-top: 80px; /* account for fixed header */
}

/* Override Neve's container for full-width pages */
body.page-template-page-fullwidth .nv-single-page-wrap,
body.page-template-page-fullwidth .nv-content-wrap {
  max-width: 100%;
  padding: 0;
}

body.page-template-page-fullwidth .neve-main > .container {
  max-width: 100%;
  padding: 0;
}

/* ============================================
   NEVE OVERRIDES
   ============================================ */

/* Hide Neve's default header when our custom header is active */
body.s360-custom-header .nv-navbar,
body.s360-custom-header header.header {
  display: none !important;
}

/* Hide Neve's default footer when our custom footer is active */
body.s360-custom-footer .site-footer,
body.s360-custom-footer footer.site-footer {
  display: none !important;
}

/* Ensure content starts below fixed header */
body.s360-custom-header .neve-main,
body.s360-custom-header #content {
  padding-top: 80px;
}

/* Full width override for S360 pages */
body.s360-fullwidth .neve-main > .container,
body.s360-fullwidth .nv-single-page-wrap {
  max-width: 100%;
  padding: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .s360-nav-links,
  .s360-nav-actions .s360-theme-toggle {
    display: none;
  }
  .s360-mobile-menu-btn { display: flex; }

  .s360-footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .s360-footer-brand {
    grid-column: 1 / -1;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .s360-header { padding: 12px 16px; }
  .s360-logo img { height: 32px; }

  .s360-footer { padding: 48px 16px 32px; }
  .s360-footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .s360-footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  .s360-footer-legal { flex-wrap: wrap; justify-content: center; }

  .s360-dropdown-panel { display: none !important; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
