/* ==========================================================================
   WORKLUMO GLOBAL HEADER, SEARCH MODAL & MOBILE DRAWER STYLESHEET
   Version: 1.0.0
   Author: Giuseppe Giorgio
   Scope: Global (Loaded on all pages: Desktop Navbar, Search Overlay, Off-Canvas)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. MAIN DESKTOP & MOBILE HEADER (MASTHEAD) - DEEP GRADIENT (BALANCED 68px)
   -------------------------------------------------------------------------- */
#masthead,
#masthead.site-header,
.site-header,
.site-header-row,
.site-main-header-wrap,
.site-mobile-header-wrap,
.site-top-header-wrap,
.site-bottom-header-wrap,
.site-header-row-container-inner,
.site-main-header-inner-wrap,
.site-mobile-header-inner-wrap {
  border: none !important;
  border-bottom: none !important;
  border-top: none !important;
  outline: none !important;
}

#masthead.site-header,
.site-header {
  background: linear-gradient(180deg, #071949 0%, #030b20 100%) !important;
  box-shadow: 0 4px 25px rgba(2, 6, 23, 0.5) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative;
  z-index: 100;
}

/* Header Row Inner Container */
.site-main-header-wrap .site-header-row-container-inner,
.site-mobile-header-wrap .site-header-row-container-inner {
  padding: 8px 0 !important;
}

.site-main-header-inner-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 68px !important;
}

/* --------------------------------------------------------------------------
   2. BRANDING (LOGO, TITLE & TAGLINE)
   -------------------------------------------------------------------------- */
.site-branding .brand,
.mobile-site-branding .brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 14px !important;
  text-decoration: none !important;
  transition: opacity 0.2s ease !important;
}

.site-branding .brand:hover,
.mobile-site-branding .brand:hover {
  opacity: 0.95 !important;
}

/* Logo Image Icon */
.site-branding .custom-logo,
.mobile-site-branding .custom-logo {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  display: block !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.site-branding .brand:hover .custom-logo,
.mobile-site-branding .brand:hover .custom-logo {
  transform: scale(1.06);
}

/* Site Title Wrap */
.site-branding .site-title-wrap,
.mobile-site-branding .site-title-wrap {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  text-align: left !important;
}

/* Site Title Text (In Risalto, Grande e Luminoso) */
.site-branding .site-title,
.mobile-site-branding .site-title {
  color: #ffffff !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  margin: 0 !important;
  line-height: 1.15 !important;
  transition: color 0.2s ease !important;
}

/* Hover Title Color (Arancione / Ambra Palette) */
.site-branding .brand:hover .site-title,
.mobile-site-branding .brand:hover .site-title,
.site-branding a.brand:hover .site-title,
.site-branding .site-title:hover {
  color: #f59e0b !important;
}

/* Tagline / Site Description */
.site-branding .site-description,
.mobile-site-branding .site-description {
  color: #94a3b8 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.2px !important;
  margin: 2px 0 0 0 !important;
  line-height: 1.2 !important;
}

/* --------------------------------------------------------------------------
   3. DESKTOP PRIMARY NAVIGATION (NAVBAR LINKS)
   -------------------------------------------------------------------------- */
.main-navigation #primary-menu {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.main-navigation #primary-menu > li {
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
}

/* Nav Link Pill Styling */
.main-navigation #primary-menu > li > a {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #cbd5e1 !important;
  padding: 8px 18px !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  letter-spacing: 0.1px !important;
}

/* Hover State */
.main-navigation #primary-menu > li > a:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  transform: translateY(-1px);
}

/* Current Active Page State */
.main-navigation #primary-menu > li.current-menu-item > a,
.main-navigation #primary-menu > li.current_page_item > a {
  color: #60a5fa !important;
  background: rgba(37, 99, 235, 0.2) !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2) !important;
}

/* --------------------------------------------------------------------------
   4. SEARCH TRIGGER BUTTON (HEADER DESKTOP)
   -------------------------------------------------------------------------- */
.site-header-section-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.site-header .search-toggle-open,
.site-header button.search-toggle-open {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  padding: 0 !important;
  margin: 0 0 0 6px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  outline: none !important;
}

.site-header .search-toggle-open .kadence-svg-iconset,
.site-header .search-toggle-open svg {
  width: 17px !important;
  height: 17px !important;
  color: currentColor !important;
  display: block !important;
  transition: transform 0.2s ease !important;
}

/* Search Trigger Hover */
.site-header .search-toggle-open:hover,
.site-header .search-toggle-open:focus-visible {
  background: rgba(37, 99, 235, 0.25) !important;
  border-color: #3b82f6 !important;
  color: #60a5fa !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
}

.site-header .search-toggle-open:hover svg {
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   5. MOBILE HEADER TOGGLE (BURGER BUTTON)
   -------------------------------------------------------------------------- */
.site-header #mobile-toggle,
.site-header button.menu-toggle-open {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  padding: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.site-header #mobile-toggle svg {
  width: 20px !important;
  height: 20px !important;
  color: #ffffff !important;
  display: block !important;
}

.site-header #mobile-toggle:hover {
  background: rgba(37, 99, 235, 0.25) !important;
  border-color: #3b82f6 !important;
  color: #60a5fa !important;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   6. SPOTLIGHT SEARCH OVERLAY / MODAL (#search-drawer) - TOP COMMAND PALETTE
   -------------------------------------------------------------------------- */
#search-drawer:not(.show-drawer),
#search-drawer:not(.active) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -9999 !important;
}

/* Mostra il modal ESCLUSIVAMENTE quando Kadence lo attiva */
body.showing-popup-drawer-from-full #search-drawer.show-drawer.active,
#search-drawer.popup-drawer.show-drawer.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
}

/* Ultra Glassmorphic Backdrop */
#search-drawer .drawer-inner {
  background: radial-gradient(circle at 50% 20%, rgba(15, 38, 95, 0.8) 0%, rgba(3, 8, 22, 0.92) 100%) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

#search-drawer .drawer-overlay {
  background: transparent !important;
}

/* Close Button (Circle X in Top Right) */
#search-drawer .drawer-header {
  position: absolute !important;
  top: 24px !important;
  right: 24px !important;
  z-index: 100 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

#search-drawer .search-toggle-close,
#search-drawer button.search-toggle-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #f1f5f9 !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding: 0 !important;
}

#search-drawer .search-toggle-close:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #f87171 !important;
  transform: rotate(90deg) scale(1.08) !important;
}

#search-drawer .search-toggle-close svg {
  width: 18px !important;
  height: 18px !important;
}

/* Search Content Container: Top Spotlight Positioning (15vh) */
#search-drawer .drawer-inner .drawer-content,
#search-drawer .drawer-content {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding-top: 15vh !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  padding-bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

/* Floating Spotlight Capsule Form */
#search-drawer .search-form,
#search-drawer .drawer-inner form {
  position: relative !important;
  width: 100% !important;
  max-width: 640px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  background: rgba(11, 23, 56, 0.95) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 999px !important;
  padding: 0 56px 0 24px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
}

#search-drawer .search-form:focus-within,
#search-drawer .drawer-inner form:focus-within {
  border-color: #3b82f6 !important;
  background: rgba(11, 23, 56, 0.98) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.35), 0 25px 60px rgba(0, 0, 0, 0.75) !important;
  transform: translateY(-2px);
}

#search-drawer .search-form label,
#search-drawer .drawer-inner form label {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
}

/* Modern Large Input Perfectly Centered */
#search-drawer input.search-field,
#search-drawer .drawer-inner input.search-field {
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  line-height: normal !important;
}

#search-drawer input.search-field::placeholder,
#search-drawer .drawer-inner form ::-webkit-input-placeholder,
#search-drawer .drawer-inner form ::-moz-placeholder {
  color: #94a3b8 !important;
  opacity: 1 !important;
  font-weight: 400 !important;
}

/* Hide Generic Submit Button */
#search-drawer .search-submit,
#search-drawer .drawer-inner .search-submit[type=submit] {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* Styled Floating Magnifier Pill (Centrato al Pixel in Altezza) */
#search-drawer .kadence-search-icon-wrap,
#search-drawer .drawer-inner .kadence-search-icon-wrap {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  bottom: auto !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4) !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  z-index: 5 !important;
}

#search-drawer .kadence-search-icon-wrap svg,
#search-drawer .drawer-inner .kadence-search-icon-wrap svg {
  width: 18px !important;
  height: 18px !important;
  color: #ffffff !important;
  display: block !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}

@media (max-width: 768px) {
  #search-drawer .drawer-inner .drawer-content,
  #search-drawer .drawer-content {
    padding-top: 10vh !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  #search-drawer .search-form,
  #search-drawer .drawer-inner form {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    padding: 0 50px 0 20px !important;
  }
  #search-drawer .kadence-search-icon-wrap,
  #search-drawer .drawer-inner .kadence-search-icon-wrap {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    right: 7px !important;
  }
  #search-drawer input.search-field,
  #search-drawer .drawer-inner input.search-field {
    font-size: 16px !important;
  }
}

/* --------------------------------------------------------------------------
   7. MOBILE OFF-CANVAS SLIDE-OUT DRAWER (#mobile-drawer)
   -------------------------------------------------------------------------- */
#mobile-drawer.popup-drawer {
  z-index: 99999 !important;
}

/* Blurred Overlay */
#mobile-drawer .drawer-overlay {
  background: rgba(3, 7, 18, 0.72) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Slide-out Panel */
#mobile-drawer .drawer-inner {
  background: linear-gradient(180deg, #071949 0%, #030b20 100%) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6) !important;
  width: 310px !important;
  max-width: 85vw !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
}

/* Drawer Header */
#mobile-drawer .drawer-header {
  padding: 22px 20px 18px 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

/* Close Button */
#mobile-drawer .menu-toggle-close,
#mobile-drawer button.menu-toggle-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: all 0.2s ease !important;
}

#mobile-drawer .menu-toggle-close .toggle-close-bar {
  background: #ffffff !important;
  height: 2px !important;
}

#mobile-drawer .menu-toggle-close:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

#mobile-drawer .menu-toggle-close:hover .toggle-close-bar {
  background: #f87171 !important;
}

/* Drawer Navigation Content */
#mobile-drawer .drawer-content {
  padding: 24px 18px !important;
  flex-grow: 1 !important;
  text-align: left !important;
}

#mobile-drawer ul#mobile-menu {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

#mobile-drawer ul#mobile-menu>li {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* Modern Card-Style Mobile Links */
#mobile-drawer ul#mobile-menu>li>a {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 15px 20px !important;
  font-size: 16.5px !important;
  font-weight: 600 !important;
  color: #e2e8f0 !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  letter-spacing: 0.1px !important;
}

#mobile-drawer ul#mobile-menu>li>a:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  transform: translateX(4px);
}

/* Active Page on Mobile */
#mobile-drawer ul#mobile-menu>li.current-menu-item>a,
#mobile-drawer ul#mobile-menu>li.current_page_item>a {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28) 0%, rgba(59, 130, 246, 0.14) 100%) !important;
  border-color: rgba(59, 130, 246, 0.45) !important;
  color: #60a5fa !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2) !important;
}

/* Brand Signature at Bottom of Drawer */
#mobile-drawer .drawer-content::after {
  content: "WORKLUMO\A Less hype, more signal." !important;
  white-space: pre-wrap !important;
  display: block !important;
  margin-top: 36px !important;
  padding-top: 20px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.6px !important;
  color: #64748b !important;
  line-height: 1.6 !important;
  text-align: center !important;
}

/* --------------------------------------------------------------------------
   8. HOMEPAGE HERO SECTION - MOBILE VIEWPORT OPTIMIZATION (FIRST FRAME)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Elimina l'eccessivo padding-top di 130px sul primo blocco rowlayout */
  .entry-content > .wp-block-kadence-rowlayout:first-child,
  .kt-row-layout-inner-8_hero_revamp,
  .wp-block-kadence-rowlayout.kt-row-layout-inner-8_hero_revamp,
  .kt-row-layout-inner-8_hero_revamp > .kt-row-column-wrap,
  .wp-block-kadence-rowlayout:first-child > .kt-row-column-wrap {
    padding-top: 34px !important;
    padding-bottom: 44px !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
    min-height: auto !important;
  }

  /* Badge Tech, Business & Tools that matter */
  .kt-adv-heading8_hero_badge,
  .wp-block-kadence-advancedheading.kt-adv-heading8_hero_badge {
    margin-bottom: 12px !important;
    font-size: 11px !important;
    letter-spacing: 1.2px !important;
    padding: 5px 12px !important;
    display: inline-block !important;
  }

  /* Titolo H1 Hero */
  .kt-adv-heading8_hero_h1,
  .wp-block-kadence-advancedheading.kt-adv-heading8_hero_h1,
  h1.kt-adv-heading8_hero_h1 {
    font-size: 34px !important;
    line-height: 1.15 !important;
    margin-bottom: 14px !important;
    letter-spacing: -0.02em !important;
  }

  /* Sottotitolo Hero */
  .kt-adv-heading8_hero_sub,
  .wp-block-kadence-advancedheading.kt-adv-heading8_hero_sub,
  p.kt-adv-heading8_hero_sub {
    font-size: 15px !important;
    line-height: 1.5 !important;
    margin-bottom: 22px !important;
    color: #cbd5e1 !important;
  }

  /* Pulsanti Esplora Pillars */
  .kt-row-layout-inner-8_hero_revamp .wp-block-buttons,
  .wp-block-kadence-rowlayout:first-child .wp-block-buttons {
    gap: 8px !important;
  }

  .kt-row-layout-inner-8_hero_revamp .wp-block-button__link,
  .wp-block-kadence-rowlayout:first-child .wp-block-button__link {
    font-size: 12.5px !important;
    padding: 7px 13px !important;
  }
}