/* ===== OnePress Nav Premium Enhancement v2 ===== */

/* --- Header Base: Glassmorphism --- */
#masthead.site-header {
  background: rgba(255,255,255,.92) !important;
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid rgba(0,0,0,.06) !important;
  box-shadow: 0 1px 20px rgba(0,0,0,.04) !important;
  transition: background .35s ease, box-shadow .35s ease;
}
#masthead.site-header.header-scroll {
  background: rgba(255,255,255,.97) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,.07) !important;
}

/* --- Top-level Items: Typography --- */
.onepress-menu > li > a {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: .03em !important;
  text-transform: none !important;
  color: #2d3548 !important;
  padding: 0 18px !important;
  line-height: 72px !important;
  position: relative;
  transition: color .3s ease !important;
}

/* --- Gold Underline Hover (all items, use ::before to avoid conflict) --- */
.onepress-menu > li > a::before {
  content: '';
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  height: 2.5px;
  background: linear-gradient(90deg, #c9a353, #e0c068);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  z-index: 1;
}
.onepress-menu > li:hover > a::before {
  transform: scaleX(1);
}
.onepress-menu > li:hover > a {
  color: #1a1f2e !important;
}

/* --- Separator Dots (desktop) --- */
@media(min-width:1141px) {
  .onepress-menu > li + li::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #d4d0c8;
    opacity: .5;
    pointer-events: none;
  }
}

/* --- Dropdown Arrow (items with children) --- */
@media(min-width:1141px) {
  .onepress-menu > li.menu-item-has-children > a {
    padding-right: 30px !important;
  }
  .onepress-menu > li.menu-item-has-children > a::after {
    content: '' !important;
    position: absolute !important;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid #b0a898;
    transition: transform .3s ease, border-color .3s ease;
    background: none !important;
    bottom: auto !important;
    left: auto !important;
  }
  .onepress-menu > li.menu-item-has-children:hover > a::after {
    transform: translateY(-50%) rotate(180deg);
    border-top-color: #c9a353;
  }
}

/* --- Dropdown Panel --- */
.onepress-menu ul {
  background: rgba(255,255,255,.96) !important;
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(0,0,0,.06) !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 48px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04) !important;
  padding: 10px 6px !important;
  min-width: 280px !important;
  /* Smooth entrance */
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease !important;
}
.onepress-menu li:hover > ul,
.onepress-menu li.sfHover > ul {
  transform: translateY(0);
}

/* --- 3rd-level nested --- */
.onepress-menu ul ul {
  left: calc(100% + 4px) !important;
  top: 0 !important;
  border-radius: 12px !important;
}

/* --- Dropdown Items --- */
.onepress-menu ul li {
  white-space: normal !important;
}
.onepress-menu ul li a {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #4b5563 !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  line-height: 1.5 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  background: transparent !important;
  border: none !important;
  border-top: none !important;
  position: relative;
  overflow: hidden;
  transition: all .25s ease !important;
}
.onepress-menu ul li a::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: linear-gradient(180deg, #c9a353, #e0c068);
  border-radius: 10px 0 0 10px;
  transition: width .25s ease;
}
.onepress-menu ul li a:hover {
  background: #faf8f3 !important;
  color: #1a1f2e !important;
  padding-left: 22px !important;
}
.onepress-menu ul li a:hover::before {
  width: 3.5px;
}

/* --- Mobile Menu --- */
@media(max-width:1140px) {
  /* Hamburger button */
  #nav-toggle {
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
    background: #f8f6f2 !important;
    transition: background .25s ease !important;
  }
  #nav-toggle:hover {
    background: #f0ece4 !important;
  }
  #nav-toggle span,
  #nav-toggle span::before,
  #nav-toggle span::after {
    background: #2d3548 !important;
    border-radius: 2px !important;
    height: 2px !important;
  }

  /* Menu panel */
  #site-navigation {
    background: rgba(255,255,255,.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0 0 16px 16px !important;
    box-shadow: 0 16px 48px rgba(0,0,0,.1) !important;
    border-top: 1px solid rgba(0,0,0,.06) !important;
  }

  .onepress-menu > li > a {
    line-height: 52px !important;
    font-size: 15px !important;
    border-bottom: 1px solid rgba(0,0,0,.04) !important;
  }
  .onepress-menu > li > a::before {
    display: none !important;
  }
  .onepress-menu > li > a:hover {
    background: #faf8f3 !important;
    padding-left: 24px !important;
  }

  /* Mobile sub-menu */
  .onepress-menu ul {
    background: #faf8f3 !important;
    backdrop-filter: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 4px 0 8px !important;
    position: static !important;
    min-width: auto !important;
    transform: none !important;
  }
  .onepress-menu ul li a {
    padding: 8px 16px 8px 32px !important;
    font-size: 13.5px !important;
    border-radius: 0 !important;
  }
  .onepress-menu ul li a::before {
    display: none !important;
  }
  .onepress-menu ul li a:hover {
    background: #f0ece4 !important;
    padding-left: 36px !important;
  }

  /* Hide separator dots */
  .onepress-menu > li + li::before {
    display: none !important;
  }
}

/* --- Logo subtle enhance --- */
.site-branding .site-title a,
.site-branding .site-text-logo {
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}