/* ── HumaScript Loader — Base Styles ── */

.hsl-wrap {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* Full-width breakout — escapes Elementor container constraints */
.hsl-wrap.hsl-full-width {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  overflow-x: clip;
}

/*
 * Force ALL Elementor ancestors to not break position:sticky.
 * overflow:hidden creates a new scroll context which kills sticky.
 * overflow:clip does the same visual clipping without breaking sticky.
 */
.elementor-widget-humascript_loader {
  max-width: 100% !important;
  width: 100% !important;
  overflow: visible !important;
}

.elementor-widget-humascript_loader > .elementor-widget-container {
  overflow: visible !important;
  max-width: none !important;
}

.elementor-widget-humascript_loader .hsl-wrap,
.elementor-widget-humascript_loader .hsl-wrap * {
  /* Never let overflow:hidden sneak in and kill sticky */
}

/* Elementor parent containers — prevent them from breaking sticky */
.elementor-element:has(.elementor-widget-humascript_loader) {
  overflow: visible !important;
}

.e-con:has(.elementor-widget-humascript_loader) {
  overflow: visible !important;
}

/* Ensure inner sections respect their own widths */
.hsl-wrap.hsl-full-width > section {
  box-sizing: border-box;
}

/* Sections that should NOT be full-width can use this class */
.hsl-wrap.hsl-full-width > .hsl-contained,
.hsl-wrap.hsl-full-width > section.hsl-contained {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Elementor editor empty state */
.hsl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 2px dashed #ccd0d4;
  border-radius: 8px;
  background: #f8f9fa;
  color: #555d66;
  text-align: center;
  padding: 40px 20px;
}

.hsl-empty p {
  margin: 4px 0;
  font-size: 14px;
}

.hsl-empty p:first-child {
  font-size: 16px;
  color: #1e1e1e;
}

/* Loading state for dynamic flavor sections */
[data-flavor].hsl-loading {
  position: relative;
  min-height: 60px;
  pointer-events: none;
}

[data-flavor].hsl-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 10;
}

[data-flavor].hsl-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid #e0e0e0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  z-index: 11;
  animation: hsl-spin 0.7s linear infinite;
}

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

/* Loaded state — smooth reveal */
[data-flavor].hsl-loaded {
  animation: hsl-fadeIn 0.3s ease-out;
}

@keyframes hsl-fadeIn {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* ── Section editing in Elementor editor ── */
.elementor-editor-active .hsl-section-content {
  position: relative;
  transition: outline 0.15s ease;
}

.elementor-editor-active .hsl-section-content:hover {
  outline: 2px dashed rgba(124, 58, 237, 0.3);
  outline-offset: 4px;
}

.elementor-editor-active .hsl-section-content:focus,
.elementor-editor-active .hsl-section-content.elementor-inline-editing {
  outline: 2px solid rgba(124, 58, 237, 0.6);
  outline-offset: 4px;
}

.elementor-editor-active .hsl-section-content::before {
  content: attr(data-hsl-section);
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7c3aed;
  background: rgba(255, 255, 255, 0.9);
  padding: 1px 8px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.elementor-editor-active .hsl-section-content:hover::before {
  opacity: 1;
}
