/*
Theme Name: KUHS Sticky Header Theme
Theme URI: https://beta.kuhscommunications.com/
Description: KUHS branded lightweight theme layer with sticky navigation, Elementor header support, and back-to-top arrow.
Author: KUHS Communications
Version: 1.0.4
License: GPL-2.0-or-later
Text Domain: kuhs-sticky-header-theme
*/

:root {
  --kuhs-red: #ed1c24;
  --kuhs-black: #050505;
  --kuhs-panel: #171717;
  --kuhs-white: #ffffff;
}

html { scroll-behavior: smooth; }
body { background: var(--kuhs-black); }

body.kuhs-sticky-enabled {
  --kuhs-sticky-offset: 0px;
  --kuhs-sticky-height: 0px;
}

body.kuhs-sticky-enabled.kuhs-has-fixed-header {
  padding-top: var(--kuhs-sticky-height) !important;
}

body.kuhs-sticky-enabled .kuhs-sticky-active {
  position: fixed !important;
  top: var(--kuhs-sticky-offset) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 2147483000 !important;
  width: 100% !important;
  max-width: 100vw !important;
  transform: none !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

body.admin-bar.kuhs-sticky-enabled { --kuhs-sticky-offset: 32px; }

body.kuhs-sticky-enabled .kuhs-sticky-scrolled {
  background: rgba(5, 5, 5, 0.96) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.kuhs-sticky-enabled .kuhs-sticky-active,
body.kuhs-sticky-enabled .kuhs-sticky-active * {
  transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

#kuhs-back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: var(--kuhs-red);
  color: var(--kuhs-white);
  font-size: 28px;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
  z-index: 9999999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease, background .2s ease;
}

#kuhs-back-to-top:hover,
#kuhs-back-to-top:focus {
  background: #b91218;
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 3px;
}

#kuhs-back-to-top.kuhs-show-top {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 782px) {
  body.admin-bar.kuhs-sticky-enabled { --kuhs-sticky-offset: 46px; }
  #kuhs-back-to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; line-height: 42px; font-size: 25px; }
}

/* KUHS horizontal scroll fix */
html,
body {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body.kuhs-sticky-enabled {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

body.kuhs-sticky-enabled .kuhs-sticky-active {
  left: 0 !important;
  right: 0 !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.kuhs-sticky-enabled .kuhs-sticky-active > *,
body.kuhs-sticky-enabled .elementor-section,
body.kuhs-sticky-enabled .elementor-container,
body.kuhs-sticky-enabled .e-con,
body.kuhs-sticky-enabled .e-container {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

/* Common Elementor full-width elements sometimes create a 100vw overflow on desktop. */
body.kuhs-sticky-enabled [style*="width: 100vw"],
body.kuhs-sticky-enabled .elementor-section-stretched {
  max-width: 100% !important;
}
