/**
 * Janitorial Reviews loading states — 2026.11.01
 * Load after the component styles and jrstreamcards/cards.css.
 * Native show/hide, busy states, progress values and accessible labels stay owned
 * by Joomla/Helix, SP Page Builder, EasySocial and JBusinessDirectory.
 * Selectors below were checked against the installed component sources.
 */

body.jr-brand {
  --jr-load-track: #d5efdc;
  --jr-load-edge: var(--jr-green-dark, #087824);
  --jr-load-accent: var(--jr-cyan, #57e7ff);
  --jr-load-duration: .9s;
  --jr-load-shimmer: linear-gradient(105deg, #e4f2e8 18%, #f7fcf8 38%, #e5fbfb 48%, #f7fcf8 58%, #e4f2e8 78%);
}

/* Helix's alternate body-class overlay is separate from .sp-pre-loader. */
body.jr-brand.helix-ultimate-preloader::before {
  background: radial-gradient(ellipse at 50% 45%, rgba(234, 247, 237, .98), rgba(255, 255, 255, .98) 65%);
}

body.jr-brand.helix-ultimate-preloader::after {
  box-sizing: border-box;
  content: "";
  width: 48px;
  height: 48px;
  margin-top: -24px;
  margin-left: -24px;
  border: 4px solid var(--jr-load-track);
  border-top-color: var(--jr-load-edge);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  background: transparent;
  color: var(--jr-load-edge);
  font-family: inherit;
  font-size: 0;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .85), 0 0 0 9px rgba(11, 159, 44, .1);
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
}

/* Helix: one ring for every native preloader choice; retain an existing logo. */
body.jr-brand .sp-pre-loader {
  background: radial-gradient(ellipse at 50% 45%, #eaf7ed, #fff 65%);
}

body.jr-brand .sp-pre-loader::before,
body.jr-brand joomla-core-loader::after {
  box-sizing: border-box;
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 56px;
  height: 56px;
  margin: auto;
  border: 4px solid var(--jr-load-track);
  border-top-color: var(--jr-load-edge);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .85), 0 0 0 9px rgba(11, 159, 44, .1);
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
  pointer-events: none;
}

body.jr-brand .sp-pre-loader :is(.sp-loader-clock, .sp-loader-circle, .sp-loader-bubble-loop, .circle-two, .wave-two-wrap, .sp-loader-audio-wave),
body.jr-brand .sp-pre-loader .sp-loader-with-logo .line {
  visibility: hidden;
}

body.jr-brand .sp-pre-loader :is(.sp-loader-clock, .sp-loader-circle, .sp-loader-bubble-loop, .circle-two, .wave-two-wrap, .sp-loader-audio-wave),
body.jr-brand .sp-pre-loader :is(.sp-loader-clock, .sp-loader-circle, .sp-loader-bubble-loop, .circle-two, .wave-two-wrap, .sp-loader-audio-wave) *,
body.jr-brand .sp-pre-loader :is(.sp-loader-clock, .sp-loader-circle, .sp-loader-bubble-loop, .circle-two, .wave-two-wrap, .sp-loader-audio-wave)::before,
body.jr-brand .sp-pre-loader :is(.sp-loader-clock, .sp-loader-circle, .sp-loader-bubble-loop, .circle-two, .wave-two-wrap, .sp-loader-audio-wave)::after,
body.jr-brand .sp-pre-loader .circle-two > span::before,
body.jr-brand .sp-pre-loader .circle-two > span::after,
body.jr-brand .sp-pre-loader .sp-loader-with-logo .line {
  animation: none !important;
}

body.jr-brand .sp-pre-loader:has(.sp-loader-with-logo)::before {
  top: 150px;
}

body.jr-brand .sp-pre-loader .sp-loader-with-logo .logo {
  max-width: min(74vw, 280px);
  transform: translateY(-24px);
}

/* Joomla's core loader contains a decorative logo in a shadow root. Its host
   owns the overlay lifecycle. Cover that decoration without altering the DOM,
   hiding the host, or reaching into Joomla's custom-element implementation. */
body.jr-brand joomla-core-loader {
  opacity: 1 !important;
  background: var(--jr-surface, #fff) !important;
  isolation: isolate;
}

body.jr-brand joomla-core-loader::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, #eaf7ed, #fff 65%);
  pointer-events: none;
}

/* EasySocial's o-loader sizes, centering, text and activation stay native. */
body.jr-brand #es .o-loader::before,
body.jr-brand #es :is(.btn, .es-wf-field__field-edit).is-loading::before,
body.jr-brand #es .es-img-container.is-loading .es-img-container__wrap::before {
  box-sizing: border-box;
  border-color: var(--jr-load-track);
  border-width: 3px;
  background: transparent;
}

body.jr-brand #es .o-loader::after,
body.jr-brand #es :is(.btn, .es-wf-field__field-edit).is-loading::after,
body.jr-brand #es .es-img-container.is-loading .es-img-container__wrap::after {
  box-sizing: border-box;
  border: 3px solid transparent;
  border-top-color: var(--jr-load-edge);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
}

body.jr-brand #es .o-loader.o-loader--xs::before,
body.jr-brand #es .o-loader.o-loader--xs::after {
  border-width: 2px;
}

body.jr-brand #es .btn-es-primary.is-loading::after {
  border-top-color: #fff;
  border-right-color: var(--jr-load-accent);
}

/* Native legacy avatar/cover upload icons contain no label text. */
body.jr-brand #es .es-loading-icon {
  background: transparent !important;
  vertical-align: -.2em;
}

body.jr-brand #es .es-loading-icon::after {
  box-sizing: border-box;
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--jr-load-track);
  border-top-color: var(--jr-load-edge);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  background: transparent;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
}

body.jr-brand #es .es-loading-icon::before {
  content: none;
}

/* Legacy content/photo/explorer indicators use positioned native wrappers.
   Give those wrappers a ring without replacing their state or label content. */
body.jr-brand #es .es-container .es-content > .loading-indicator,
body.jr-brand #es .es-photo-item .es-photo-content .loading-indicator,
body.jr-brand #es .es-media-browser > i.loading-indicator,
body.jr-brand #es .es-album-item.layout-item .es-album-more-button.loading i.loading-indicator,
body.jr-brand #es .es-explorer :is(.fd-explorer-browser-action, .es-explorer-browser-action) i.es-loading-indicator.fd-small {
  background-image: none !important;
}

body.jr-brand #es .es-media-browser > i.loading-indicator,
body.jr-brand #es .es-album-item.layout-item .es-album-more-button.loading i.loading-indicator {
  position: relative;
  min-height: 40px;
}

body.jr-brand #es .es-container .es-content > .loading-indicator::after,
body.jr-brand #es .es-photo-item .es-photo-content .loading-indicator::after,
body.jr-brand #es .es-media-browser > i.loading-indicator::after,
body.jr-brand #es .es-album-item.layout-item .es-album-more-button.loading i.loading-indicator::after,
body.jr-brand #es .es-explorer :is(.fd-explorer-browser-action, .es-explorer-browser-action) i.es-loading-indicator.fd-small::after {
  box-sizing: border-box;
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid var(--jr-load-track);
  border-top-color: var(--jr-load-edge);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
  pointer-events: none;
}

body.jr-brand #es .es-media-loader {
  background: rgba(6, 23, 13, .6);
}

body.jr-brand #es .es-media-loader::after {
  box-sizing: border-box;
  content: "";
  position: absolute;
  inset: 0;
  width: 40px;
  height: 40px;
  margin: auto;
  border: 3px solid rgba(255, 255, 255, .3);
  border-top-color: var(--jr-green, #20d443);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
}

body.jr-brand #es .swiper-lazy-preloader {
  animation: none;
}

body.jr-brand #es .swiper-lazy-preloader::after {
  box-sizing: border-box;
  border: 3px solid var(--jr-load-track);
  border-top-color: var(--jr-load-edge);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  background: none !important;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
}

body.jr-brand #es .vjs-loading-spinner {
  border-color: rgba(255, 255, 255, .25);
}

body.jr-brand #es :is(.vjs-seeking, .vjs-waiting) .vjs-loading-spinner::before {
  border-top-color: var(--jr-green, #20d443);
}

body.jr-brand #es :is(.vjs-seeking, .vjs-waiting) .vjs-loading-spinner::after {
  border-top-color: var(--jr-load-accent);
}

/* Only real SP form request icons are replaced; animated-heading .is-loading
   and ordinary Font Awesome icons are deliberately outside these selectors. */
body.jr-brand :is(.sppb-ajaxt-contact-form, .sppb-addon-form-builder-form, .sppb-optin-form) .fa-spinner.fa-spin {
  box-sizing: border-box;
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-inline-end: .4em;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: currentColor;
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  vertical-align: -.12em;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
}

body.jr-brand :is(.sppb-ajaxt-contact-form, .sppb-addon-form-builder-form, .sppb-optin-form) .fa-spinner.fa-spin::before {
  content: "";
}

/* JBusinessDirectory keeps its own button/page/slider geometry and state. */
body.jr-brand .jbd-container .page-loader {
  background: rgba(255, 255, 255, .97);
}

body.jr-brand .jbd-container .loader::after,
body.jr-brand .jbd-container .loader.dark::after,
body.jr-brand .jbd-container .loader.dark:hover::after,
body.jr-brand .jbd-container .slider-loader .loader::after,
body.jr-brand .jbd-container .page-loader .loader::after {
  box-sizing: border-box;
  border: 3px solid var(--jr-load-track);
  border-top-color: var(--jr-load-edge);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
  transition: none;
}

body.jr-brand .jbd-container .btn.loader::after {
  border-color: rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-right-color: var(--jr-load-accent);
}

body.jr-brand .jbd-modal-spinner {
  box-sizing: content-box;
  width: 36px;
  height: 36px;
  padding: 18px;
  border: 1px solid var(--jr-border, #d5dfd8);
  border-radius: 20px;
  background: var(--jr-surface, #fff);
  box-shadow: var(--jr-shadow, 0 14px 36px rgba(6, 23, 13, .12));
}

body.jr-brand .jbd-modal-spinner > div {
  display: none;
  animation: none;
}

body.jr-brand .jbd-modal-spinner::after {
  box-sizing: border-box;
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--jr-load-track);
  border-top-color: var(--jr-load-edge);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
}

/* Actual legacy GIF hooks only. content replaces the image pixels, preserving
   the original node, alt/ARIA attributes and native display/hidden lifecycle.
   data-jr-loader-image is an explicit opt-in for other confirmed native GIFs. */
body.jr-brand img[data-jr-loader-image],
body.jr-brand .jbd-container .search-loading > img,
body.jr-brand .jbd-container img[src*="/assets/images/loading.gif"],
body.jr-brand .jbd-container :is(.loading-quote-requests, .loading-quote-messages) .spinner {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='19' fill='none' stroke='%23d5efdc' stroke-width='4'/%3E%3Cpath d='M24 5a19 19 0 0 1 19 19' fill='none' stroke='%23087824' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M43 24a19 19 0 0 1-5.56 13.44' fill='none' stroke='%2357e7ff' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  box-sizing: border-box;
  width: 44px !important;
  max-width: 100%;
  height: 44px !important;
  margin: 8px;
  object-fit: contain;
  vertical-align: middle;
  background: none !important;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
}

/* The native category selector inserts its loading image in a 20px wrapper. */
body.jr-brand .jbd-container img[src*="/assets/images/loading.gif"] {
  width: 20px !important;
  height: 20px !important;
  margin: 0;
}

/* Slick's GIF background appears only during its native .slick-loading state. */
body.jr-brand :is(.sppb-addon-wrapper, .jbd-container) .slick-loading .slick-list {
  background: var(--jr-surface-tint, #eaf7ed);
}

body.jr-brand :is(.sppb-addon-wrapper, .jbd-container) .slick-loading .slick-list::after,
body.jr-brand .mfp-preloader::before {
  box-sizing: border-box;
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--jr-load-track);
  border-top-color: var(--jr-load-edge);
  border-right-color: var(--jr-load-accent);
  border-radius: 50%;
  animation: jr-load-turn var(--jr-load-duration) linear infinite;
  pointer-events: none;
}

body.jr-brand :is(.sppb-addon-wrapper, .jbd-container) .slick-loading .slick-list::after {
  position: absolute;
  inset: 0;
  margin: auto;
}

/* Magnific Popup's real loading text remains readable and keyboard accessible. */
body.jr-brand .mfp-preloader {
  box-sizing: border-box;
  left: 50%;
  right: auto;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 16px 22px;
  border: 1px solid var(--jr-border, #d5dfd8);
  border-radius: 18px;
  background: var(--jr-surface, #fff);
  color: var(--jr-text, #17221b);
  box-shadow: var(--jr-shadow, 0 14px 36px rgba(6, 23, 13, .12));
  transform: translateX(-50%);
  line-height: 1.6;
}

body.jr-brand .mfp-preloader::before {
  margin-inline-end: 12px;
  vertical-align: middle;
}

body.jr-brand .mfp-preloader a,
body.jr-brand .mfp-preloader a:hover {
  color: var(--jr-green-dark, #087824);
  text-decoration: underline;
}

/* Existing EasySocial continuation skeleton: animation requires its real state. */
body.jr-brand #es .jr-stream-loading {
  isolation: isolate;
  border-color: #c9e5d1;
  background: var(--jr-surface-soft, #f4f8f5);
  box-shadow: 0 8px 24px rgba(6, 23, 13, .045);
}

body.jr-brand #es .jr-stream-loading::before {
  background: linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, .8) 42%, rgba(87, 231, 255, .12) 50%, transparent 75%);
  animation: none;
}

body.jr-brand #es .jr-stream-loading:not([hidden])::before {
  animation: jr-load-sweep 1.8s ease-in-out infinite;
}

body.jr-brand #es .jr-stream-loading :is(.jr-skeleton-avatar, .jr-skeleton-line) {
  background: #dcefe1;
}

body.jr-brand #es .jr-stream-loading .jr-skeleton-avatar {
  box-shadow: 0 0 0 1px #c9e5d1;
}

body.jr-brand #es .jr-stream-loading .jr-skeleton-line:last-child {
  width: 48%;
}

/* Directory listings/offers/events already toggle .loading and render these
   exact placeholders. Do not animate a normal card or a ready result list. */
body.jr-brand .jbd-container .shimmer-container .shimmer-bg {
  background: var(--jr-load-shimmer);
  background-size: 240% 100%;
  border-radius: 10px;
  animation: none;
}

body.jr-brand .jbd-container .loading .shimmer-container .shimmer-bg {
  animation: jr-load-shimmer 1.8s ease-in-out infinite;
}

body.jr-brand .jbd-container .shimmer-container :is(.jitem-card, .shimmer-list-item) {
  border-color: #c9e5d1;
  border-radius: var(--jr-radius, 16px);
  background: var(--jr-surface, #fff);
  box-shadow: 0 8px 24px rgba(6, 23, 13, .045);
}

body.jr-brand .jbd-container .shimmer-container .logo {
  border-radius: 16px;
}

body.jr-brand .sp-pre-loader[hidden],
body.jr-brand joomla-core-loader[hidden],
body.jr-brand #es .jr-stream-loading[hidden],
body.jr-brand img[data-jr-loader-image][hidden] {
  display: none !important;
}

@keyframes jr-load-turn {
  to { transform: rotate(360deg); }
}

@keyframes jr-load-sweep {
  from { transform: translateX(-110%); }
  to { transform: translateX(110%); }
}

@keyframes jr-load-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

@media (max-width: 600px) {
  body.jr-brand .sp-pre-loader::before,
  body.jr-brand joomla-core-loader::after {
    width: 48px;
    height: 48px;
  }

  body.jr-brand .jbd-container .page-loader .loader::after {
    width: 64px;
    height: 64px;
    left: -32px;
    top: -32px;
  }
}

/* A stationary asymmetric ring and solid placeholders still convey waiting.
   Existing loading/status text and native aria-busy values remain available. */
@media (prefers-reduced-motion: reduce) {
  body.jr-brand.helix-ultimate-preloader::after,
  body.jr-brand .sp-pre-loader::before,
  body.jr-brand joomla-core-loader::after,
  body.jr-brand #es .o-loader::after,
  body.jr-brand #es :is(.btn, .es-wf-field__field-edit).is-loading::after,
  body.jr-brand #es .es-img-container.is-loading .es-img-container__wrap::after,
  body.jr-brand #es .es-loading-icon::after,
  body.jr-brand #es .es-container .es-content > .loading-indicator::after,
  body.jr-brand #es .es-photo-item .es-photo-content .loading-indicator::after,
  body.jr-brand #es .es-media-browser > i.loading-indicator::after,
  body.jr-brand #es .es-album-item.layout-item .es-album-more-button.loading i.loading-indicator::after,
  body.jr-brand #es .es-explorer :is(.fd-explorer-browser-action, .es-explorer-browser-action) i.es-loading-indicator.fd-small::after,
  body.jr-brand #es .es-media-loader::after,
  body.jr-brand #es .swiper-lazy-preloader::after,
  body.jr-brand #es .vjs-loading-spinner::before,
  body.jr-brand #es .vjs-loading-spinner::after,
  body.jr-brand :is(.sppb-ajaxt-contact-form, .sppb-addon-form-builder-form, .sppb-optin-form) .fa-spinner.fa-spin,
  body.jr-brand .jbd-container .loader::after,
  body.jr-brand .jbd-container .loader.dark::after,
  body.jr-brand .jbd-container .loader.dark:hover::after,
  body.jr-brand .jbd-container .slider-loader .loader::after,
  body.jr-brand .jbd-container .page-loader .loader::after,
  body.jr-brand .jbd-modal-spinner::after,
  body.jr-brand img[data-jr-loader-image],
  body.jr-brand .jbd-container .search-loading > img,
  body.jr-brand .jbd-container img[src*="/assets/images/loading.gif"],
  body.jr-brand .jbd-container :is(.loading-quote-requests, .loading-quote-messages) .spinner,
  body.jr-brand :is(.sppb-addon-wrapper, .jbd-container) .slick-loading .slick-list::after,
  body.jr-brand .mfp-preloader::before,
  body.jr-brand #es .jr-stream-loading:not([hidden])::before,
  body.jr-brand .jbd-container .loading .shimmer-container .shimmer-bg {
    animation: none !important;
    transition: none !important;
  }

  body.jr-brand #es .jr-stream-loading::before {
    transform: none;
    opacity: .25;
  }

  body.jr-brand .jbd-container .shimmer-container .shimmer-bg {
    background: #dcefe1;
  }
}

@media (forced-colors: active) {
  body.jr-brand {
    --jr-load-track: GrayText;
    --jr-load-edge: CanvasText;
    --jr-load-accent: Highlight;
  }
}

