/* ==================================================================
   Owlyn Events: global header and footer (Owlyn Builder templates).
   Loads on every front-end page. Hooks are element IDs set in Elementor:
   #oe-site-header (header bar), #oe-site-nav (links), #oe-nav-toggle (menu button).
   ================================================================== */

html { scroll-padding-top: 88px; }

/* Elementor Full Width pages run edge to edge: drop Astra's boxed content container. */
.page-template-elementor_header_footer #content > .ast-container { max-width: none; padding-left: 0; padding-right: 0; }

/* Owlyn Builder footer replaces Astra's: hide Astra's footer builder bar if it still prints. */
body:has(#oe-site-footer) #colophon { display: none; }

/* The Elementor document that holds the header sticks; the demo bar above the
   header scrolls away (site.js sets --oe-head-top to minus its height). */
.elementor:has(> #oe-site-header) { position: sticky; top: var(--oe-head-top, 0px); z-index: 100; }
.admin-bar .elementor:has(> #oe-site-header) { top: calc(var(--oe-head-top, 0px) + var(--wp-admin--admin-bar--height, 32px)); }
#oe-site-header { position: relative; transition: box-shadow .3s; }
#oe-site-header.is-stuck { box-shadow: 0 1px 0 #2F2852, 0 18px 40px -24px rgba(0, 0, 0, .8); }

#oe-nav-toggle > * { transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
#oe-site-header.is-open #oe-nav-toggle > :first-child { transform: translateY(4px) rotate(45deg); }
#oe-site-header.is-open #oe-nav-toggle > :last-child { transform: translateY(-4px) rotate(-45deg); }
#oe-nav-toggle:focus-visible { outline: 2px solid #F3B63F; outline-offset: 3px; }

@media (max-width: 1024px) {
  /* Anchor the dropdown to the full-width header, not Elementor's inner row. */
  #oe-site-header > * { position: static; }
  #oe-site-header #oe-site-nav {
    display: flex; flex-direction: column; gap: 2px;
    position: absolute; top: 100%; left: 0; right: 0; width: auto;
    padding: 12px 24px 20px; background-color: rgba(18, 14, 36, .97);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 #2F2852, 0 24px 40px -24px rgba(0, 0, 0, .8);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s, transform .25s cubic-bezier(.2, .7, .2, 1), visibility .25s;
  }
  #oe-site-header.is-open #oe-site-nav { opacity: 1; visibility: visible; transform: none; }
  #oe-site-header #oe-site-nav > * { padding: 14px 12px; font-size: 19px; color: #F4F0FA; }
}
@media (max-width: 767px) {
  #oe-site-header #oe-site-nav { padding: 8px 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #oe-site-header #oe-site-nav, #oe-nav-toggle > * { transition: none; }
}
