/* ================================
   PRELOADER
   Full-screen overlay shown until the page has finished
   loading. Covers the slow initial paint on shared/free
   hosting with a branded loading screen instead of a
   blank flash.
   ================================ */

html.bd-preloading{
  overflow: hidden; /* stop scroll/jump while the overlay is up */
}

#bd-preloader{
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  opacity: 1;
  visibility: visible;
  /* Fast fade-IN so it covers the old page right away when a link is
     clicked; the slower fade-OUT (below) is what gives the clean reveal
     once the new page is actually ready. */
  transition: opacity .15s ease, visibility 0s linear 0s;
}

#bd-preloader .bd-preloader-logo{
  width: 72px;
  height: auto;
  animation: bd-preloader-pulse 1.3s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes bd-preloader-pulse{
  0%, 100% { transform: scale(1);    opacity: .55; }
  50%      { transform: scale(1.08); opacity: 1;   }
}

/* Hidden state, toggled by JS once window "load" fires */
#bd-preloader.bd-preloader-hidden{
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
  pointer-events: none;
}

@media (min-width: 768px){
  #bd-preloader .bd-preloader-logo{
    width: 96px;
  }
}

/* Respect users who've asked for reduced motion: keep the
   overlay but drop the pulsing animation. */
@media (prefers-reduced-motion: reduce){
  #bd-preloader .bd-preloader-logo{
    animation: none;
    opacity: .9;
  }
}
