/* Establish the grid width before AJAX cards and their element CSS arrive. */
.breakdance .bde-div.bde-div-446-122 {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
}

.breakdance .bde-post-loop.projects-list {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
}

.breakdance .bde-post-loop.projects-list > .bde-loop-grid {
  width: 100%;
  min-width: 0;
}

/* Infinite Scroll still observes and clicks this button internally. Keep its
   layout box; display:none would prevent the loading trigger from intersecting. */
.page-id-446 .wpgb-facet .wpgb-load-more.re4-infinite-loader {
  visibility: hidden !important;
  pointer-events: none !important;
}

.re4-grid-loading {
  position: fixed;
  z-index: 999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 16px 20px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  color: #333;
  box-shadow: 0 4px 24px #0000000d;
  font-size: 16px;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.re4-grid-loading[hidden] { display: none; }
.re4-grid-loading.is-visible { opacity: 1; }

.re4-grid-loading__spinner {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: re4-grid-spin 900ms linear infinite;
}

@keyframes re4-grid-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .re4-grid-loading { transition: none; }
  .re4-grid-loading__spinner { animation: none; }
}
