/* Sandbox /stage — sfondo (--color-stage-bg in color.css) */
html:has(> body.body-stage) {
  background-color: var(--color-stage-bg);
  overflow-x: clip;
}

body.body-stage {
  background-color: var(--color-stage-bg);
  min-height: 100vh;
  color: #000;
  overflow-x: clip;
  --stage-space-section-y: 128px;
  --stage-space-layout: 64px;
  --stage-space-text: 16px;
  --stage-space-cta: 32px;
  /* Copy flow — 3 livelli di gap, nessun margin/padding sui figli */
  --stage-copy-gap-sm: 0.5rem;  /* 8px  — intro → titolo   */
  --stage-copy-gap-md: 1rem;    /* 16px — titolo → desc, tra CTA */
  --stage-copy-gap-lg: 1.5rem;  /* 24px — desc → CTA        */
}

@media (max-width: 56.25rem) {
  body.body-stage {
    --stage-space-section-y: 64px;
    --stage-space-layout: 32px;
  }

  body.body-stage main :where(h1, h2, h3, h4, h5, h6, p, li, a, label, span, small, strong, em) {
    text-align: left;
  }

  body.body-stage main .text-center {
    text-align: left;
  }

  body.body-stage .section-hero-center-wrapper {
    align-items: flex-start;
  }

  body.body-stage .section-hero-button-wrapper {
    justify-content: flex-start;
  }
}

/* ─── Section & layout rhythm ─── */
body.body-stage .stage-section {
  padding-block: var(--stage-space-section-y);
}

body.body-stage .stage-layout-gap {
  gap: var(--stage-space-layout);
}

/* ═══════════════════════════════════════════════════════════
   COPY FLOW — solo gap, zero margin, zero padding sui figli.

   Struttura:
     container-top  (gap: 8px)   → intro + titolo
     container-body (gap: 16px)  → titolo + desc-group
     container-desc (gap: 24px)  → descrizione + CTA

   Dove c'è solo 1 coppia di elementi, 1 solo container
   con il gap corretto.
   ═══════════════════════════════════════════════════════════ */

body.body-stage .stage-copy-flow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--stage-copy-gap-sm); /* default: 8px (intro → titolo) */
}

/* Reset margin su tutti i figli diretti di ogni flow */
body.body-stage .stage-copy-flow > *,
body.body-stage .section-hero-center-wrapper > *,
body.body-stage .section-hero-body > *,
body.body-stage .section-steps-stage__copy-body > *,
body.body-stage .section-personalize__acc-actions > *,
body.body-stage .stage-copy-head-body > *,
body.body-stage .stage-copy-desc > *,
body.body-stage .stage-realization-row__copy-body > *,
body.body-stage .stage-realization-row__copy-desc > *,
body.body-stage .stage-design-path-card__copy-body > *,
body.body-stage .stage-design-path-card__copy-desc > *,
body.body-stage .stage-design-success__head-body > *,
body.body-stage .stage-design-use-card__copy-desc > * {
  margin: 0;
}

body.body-stage .stage-copy-head-body {
  display: flex;
  flex-direction: column;
  gap: var(--stage-copy-gap-md);
}

body.body-stage .stage-copy-desc {
  display: flex;
  flex-direction: column;
  gap: var(--stage-copy-gap-lg);
}

/* ── CTA interni: gap 8px tra bottoni/link ── */
body.body-stage :is(
  .section-basic__actions,
  .section-hero-button-wrapper,
  .section-templates__actions,
  .section-steps-stage__actions,
  .section-why-stage__actions,
  .section-personalize__actions,
  .section-faq-stage__actions,
  .stage-copy-cta
) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--stage-copy-gap-md);
  margin: 0;
}

/* ─── Reveal animation ─── */
body.body-stage [data-stage-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body.body-stage [data-stage-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  body.body-stage [data-stage-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}

/* ─── Page enter (load) ─── */
body.body-stage [data-stage-enter] {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 640ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body.body-stage [data-stage-enter='fade'] {
  transform: none;
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.body-stage [data-stage-enter='soft'] {
  transform: translateY(12px) scale(0.992);
  transition:
    opacity 720ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.body-stage [data-stage-enter].is-entered {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  body.body-stage [data-stage-enter] {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}
