/* Force logo display based on page class - highest priority approach */

/* Hide all logos by default */
.mil-logo img,
.mil-logo-png img {
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

/* Show the correct logo for each page */
.index-page .mil-logo img,
.index-page .mil-logo-png img {
  content: url('../img/logo-dark.png') !important;
  opacity: 1 !important;
}

.hk-live-page .mil-logo img,
.hk-live-page .mil-logo-png img {
  content: url('../img/logo_light.png') !important;
  opacity: 1 !important;
}

/* Ensure proper z-index and positioning */
.mil-logo, .mil-logo-png {
  z-index: 9999 !important;
  position: relative !important;
}

/* Responsive logo positioning */

/* Desktop: Logo scrolls with content */
@media screen and (min-width: 769px) {
  .mil-logo {
    position: absolute !important;
    top: 30px !important;
    left: 60px !important;
    z-index: 9999 !important;
    pointer-events: all !important;
  }
  
  /* Hide logo in frame on desktop but keep frame-top visible for menu button */
  .mil-frame-top .mil-logo {
    display: none !important;
  }
  
  /* Ensure frame and frame-top are visible for menu button */
  .mil-frame {
    pointer-events: none !important;
  }
  
  .mil-frame-top {
    pointer-events: all !important;
  }
  
  /* Position the logo in content for desktop */
  .mil-content > .mil-logo {
    display: block !important;
  }
}

/* Mobile: Logo stays fixed at top */
@media screen and (max-width: 768px) {
  /* Show logo in frame on mobile */
  .mil-frame-top .mil-logo {
    display: block !important;
    pointer-events: all !important;
    z-index: 9999 !important;
  }
  
  /* Hide content logo on mobile */
  .mil-content > .mil-logo {
    display: none !important;
  }
  
  .mil-frame-top {
    padding: 15px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
}

/* Common logo styling */
.mil-logo img,
.mil-logo-png img {
  height: 50px !important;
  width: auto !important;
  display: block !important;
}

/* Menu button styling - ensure it's on the right */
.mil-menu-btn {
  pointer-events: all !important;
  z-index: 9999 !important;
  margin-left: auto !important;
}

/* Menu button color - yellow theme color */
.mil-menu-btn span,
.mil-menu-btn span:after,
.mil-menu-btn span:before {
  background-color: #FFA500 !important; /* Bright yellow/orange color from theme */
}

/* Fix logo overlapping hero text on desktop screens.
   The logo is absolutely positioned at top:30px, ~50px tall (bottom ~80px).
   On shorter viewports the bottom-aligned banner content reaches the logo.
   Fix: scale down the H1 font size so content doesn't grow into the logo zone. */
@media screen and (min-width: 769px) and (max-height: 750px) {
  .mil-banner .mil-banner-content h1 {
    font-size: 48px !important;
    line-height: 1.15 !important;
  }
}
@media screen and (min-width: 769px) and (max-height: 650px) {
  .mil-banner .mil-banner-content h1 {
    font-size: 40px !important;
    line-height: 1.15 !important;
  }
}

/* Back to top button fix */
.mil-back-to-top {
  position: fixed !important;
  bottom: 30px !important;
  right: 30px !important;
  z-index: 9999 !important;
}

@media screen and (max-width: 768px) {
  .mil-back-to-top {
    bottom: 20px !important;
    right: 20px !important;
  }
}

/* Completely disable Swup transitions */
.swup-transition-main {
  transition: none !important;
  opacity: 1 !important;
}

/* Ensure no logo transfer during page load */
.mil-preloader-frame .mil-logo,
.mil-preloader-frame .mil-logo-png {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Footer logo fix */
footer .mil-logo {
  margin-bottom: 15px !important;
  display: flex !important;
  align-items: center !important;
}

footer .mil-logo img {
  height: 40px !important;
  margin-right: 10px !important;
}

/* Ensure footer logo is correct on HK_Live page */
.hk-live-page footer .mil-logo img {
  content: url('../img/logo_light.png') !important;
  opacity: 1 !important;
}

/* Ensure footer logo is correct on index page */
.index-page footer .mil-logo img {
  content: url('../img/logo-dark.png') !important;
  opacity: 1 !important;
}

/* Align footer content */
footer .mil-light-soft {
  margin-top: 5px !important;
  display: block !important;
}

/* Ensure all logos in HK_Live are correct */
.hk-live-page .mil-logo img,
.hk-live-page .mil-logo-png img,
.hk-live-page footer .mil-logo img {
  content: url('../img/logo_light.png') !important;
  opacity: 1 !important;
}

/* Direct fix for HK_Live footer logo - highest priority */
.hk-live-page footer .mil-logo img,
.hk-live-page footer .mil-logo-png img,
.hk-live-page footer .mil-logo .mil-logo-img {
  content: url('../img/logo_light.png') !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  height: 40px !important;
  width: auto !important;
  background: none !important;
  filter: none !important;
  -webkit-filter: none !important;
}

/* Prevent any black background or mask */
.hk-live-page footer .mil-logo,
.hk-live-page footer .mil-logo-png {
  background: none !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
  filter: none !important;
  -webkit-filter: none !important;
}

/* Ensure footer logo container doesn't interfere */
.hk-live-page footer .mil-muted.mil-logo {
  opacity: 1 !important;
  visibility: visible !important;
  background: none !important;
  color: transparent !important;
}
