/*
 * Bone Hammer Extras. Each block is scoped to the body class of its switch
 * (bhx-menu-underline, bhx-progress-bar, ...), set by bonehammer-extras.php.
 * Motion is turned off for visitors who ask for reduced motion.
 */

:root {
  --bhx-accent: #c21816;
  --bhx-ink: #0d0d0d;
  --bhx-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --bhx-progress: 0;
  /* The WordPress toolbar of signed-in users sits above the page. */
  --bhx-top: var(--wp-admin--admin-bar--height, 0px);
}

/* ------------------------------------------------------------------------- */
/* Menu links: an underline that draws in from the left                       */
/* ------------------------------------------------------------------------- */
.bhx-menu-underline #ast-desktop-header .main-header-menu > .menu-item > .menu-link {
  position: relative;
}
.bhx-menu-underline #ast-desktop-header .main-header-menu > .menu-item > .menu-link::after {
  content: '';
  position: absolute;
  left: 1em;
  right: 1em;
  bottom: 0.9em;
  height: 2px;
  background: var(--bhx-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.35s var(--bhx-ease);
}
.bhx-menu-underline #ast-desktop-header .main-header-menu > .menu-item > .menu-link:hover::after,
.bhx-menu-underline #ast-desktop-header .main-header-menu > .menu-item > .menu-link:focus-visible::after,
.bhx-menu-underline #ast-desktop-header .main-header-menu > .current-menu-item > .menu-link::after {
  transform: scaleX(1);
}

/* ------------------------------------------------------------------------- */
/* Reading progress                                                          */
/* ------------------------------------------------------------------------- */
.bhx-progress {
  position: fixed;
  inset: var(--bhx-top) 0 auto 0;
  height: 3px;
  z-index: 100001;
  background: var(--bhx-accent);
  transform: scaleX(var(--bhx-progress));
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ------------------------------------------------------------------------- */
/* Back to top: a ring that fills as the page is read                         */
/* ------------------------------------------------------------------------- */
.bhx-scroll-top #ast-scroll-top {
  color: #fff;
  width: 48px;
  height: 48px;
  line-height: 48px;
  border-radius: 50%;
  background: conic-gradient(var(--bhx-accent) calc(var(--bhx-progress) * 360deg), rgba(255, 255, 255, 0.14) 0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: translate 0.3s var(--bhx-ease), bottom 0.45s var(--bhx-ease);
}
.bhx-scroll-top #ast-scroll-top::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bhx-ink);
}
.bhx-scroll-top #ast-scroll-top .ast-icon {
  position: relative;
}
.bhx-scroll-top #ast-scroll-top .ast-icon svg {
  fill: currentColor;
}
.bhx-scroll-top #ast-scroll-top:hover {
  translate: 0 -4px;
}

/* ------------------------------------------------------------------------- */
/* Scroll reveal: content rises into place as it scrolls into view            */
/* ------------------------------------------------------------------------- */
.bhx-reveal .bhx-rises {
  opacity: 0;
  translate: 0 28px;
  transition: opacity 0.8s var(--bhx-ease) var(--bhx-delay, 0ms), translate 0.8s var(--bhx-ease) var(--bhx-delay, 0ms);
  will-change: opacity, translate;
}
.bhx-reveal .bhx-rises.bhx-in {
  opacity: 1;
  translate: 0 0;
  will-change: auto;
}

/* ------------------------------------------------------------------------- */
/* Opening section: headline, copy and button rise in on load (no script)     */
/* ------------------------------------------------------------------------- */
.bhx-hero-rise .entry-content > .elementor > :is(.e-con, .elementor-section):first-child .elementor-widget {
  animation: bhx-rise 0.9s var(--bhx-ease) 0.45s both;
}
.bhx-hero-rise .entry-content > .elementor > :is(.e-con, .elementor-section):first-child .elementor-widget-heading {
  animation-delay: 0.3s;
}
.bhx-hero-rise .entry-content > .elementor > :is(.e-con, .elementor-section):first-child .elementor-widget-heading:first-child {
  animation-delay: 0.1s;
}
.bhx-hero-rise .entry-content > .elementor > :is(.e-con, .elementor-section):first-child .elementor-widget-button {
  animation-delay: 0.6s;
}
@keyframes bhx-rise {
  from {
    opacity: 0;
    translate: 0 26px;
  }
}

/* ------------------------------------------------------------------------- */
/* Header: sticky, glassy once the page has scrolled, tucks away going down   */
/* ------------------------------------------------------------------------- */
.bhx-sticky-header #masthead {
  position: sticky;
  top: var(--bhx-top);
  z-index: 9990;
  transition: transform 0.4s var(--bhx-ease);
}
.bhx-header-hidden .bhx-sticky-header #masthead {
  transform: translateY(calc(-100% - var(--bhx-top)));
}
.bhx-sticky-header #masthead .ast-primary-header-bar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.bhx-scrolled .bhx-sticky-header #masthead .ast-primary-header-bar {
  background-color: rgba(13, 13, 13, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------------------- */
/* Phone: call to action within thumb reach                                  */
/* ------------------------------------------------------------------------- */
.bhx-cta-bar {
  display: none;
}
@media (max-width: 767px) {
  .bhx-mobile-cta .bhx-cta-bar {
    display: block;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9980;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(13, 13, 13, 0.96) 60%, transparent);
    translate: 0 110%;
    transition: translate 0.45s var(--bhx-ease);
    pointer-events: none;
  }
  .bhx-mobile-cta .bhx-cta-bar.is-visible {
    translate: 0 0;
    pointer-events: auto;
  }
  .bhx-mobile-cta .bhx-cta-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7em;
    padding: 1.05em 1em;
    border-radius: 999px;
    background: var(--bhx-accent);
    color: #fff;
    font: 600 0.82rem/1 'Inter', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(194, 24, 22, 0.45);
  }
  .bhx-mobile-cta .bhx-cta-bar a:hover,
  .bhx-mobile-cta .bhx-cta-bar a:focus {
    color: #fff;
  }
  .bhx-mobile-cta .bhx-arrow {
    flex: none;
    transition: translate 0.3s var(--bhx-ease);
  }
  .bhx-mobile-cta .bhx-cta-bar a:active .bhx-arrow {
    translate: 4px 0;
  }
  /* Keep "back to top" clear of the bar while it is up. */
  .bhx-cta-shown #ast-scroll-top {
    bottom: 84px;
  }
}

/* ------------------------------------------------------------------------- */
/* Calm and print versions                                                   */
/* ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bhx-hero-rise .entry-content .elementor-widget {
    animation: none !important;
  }
  .bhx-reveal .bhx-rises {
    opacity: 1;
    translate: none;
  }
  .bhx-header-hidden .bhx-sticky-header #masthead {
    transform: none;
  }
  .bhx-menu-underline #ast-desktop-header .main-header-menu > .menu-item > .menu-link::after,
  .bhx-mobile-cta .bhx-cta-bar {
    transition: none;
  }
}

@media print {
  .bhx-progress,
  .bhx-cta-bar,
  #ast-scroll-top {
    display: none !important;
  }
  .bhx-reveal .bhx-rises {
    opacity: 1 !important;
    translate: none !important;
  }
}
