/* Compact the gaps between public-page sections and above CTA blocks.
   Page styles retain their responsive base values. CTA panel padding,
   spacing below CTAs, heroes, cards and form controls keep their styling. */
#datacrops-site section {
    --dc-section-space-before: 1;
    --dc-section-space-after: 1;
}

/* Ordinary section boundaries; CTA top spacing is handled below. */
:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:not(.dc-header-shell, .book-demo-page, .dc-use-cta, .dc-about-cta, .dc-brochures-cta, .dc-cases-cta, .dc-home-subscribe, .dc-blog-subscribe, .Explore_more):not(:has(h1, .dc-breadcrumb, .dc-theme-cta)):has(+ section):not(:has(+ section:is(.dc-header-shell, .book-demo-page, .dc-use-cta, .dc-about-cta, .dc-brochures-cta, .dc-cases-cta, .dc-home-subscribe, .dc-blog-subscribe, .Explore_more), + section h1, + section .dc-breadcrumb, + section .dc-cta-panel)) {
    --dc-section-space-after: .75;
}

:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:not(.dc-header-shell, .book-demo-page, .dc-use-cta, .dc-about-cta, .dc-brochures-cta, .dc-cases-cta, .dc-home-subscribe, .dc-blog-subscribe, .Explore_more):not(:has(h1, .dc-breadcrumb, .dc-theme-cta)) + section:not(.dc-header-shell, .book-demo-page, .dc-use-cta, .dc-about-cta, .dc-brochures-cta, .dc-cases-cta, .dc-home-subscribe, .dc-blog-subscribe, .Explore_more):not(:has(h1, .dc-breadcrumb, .dc-cta-panel)) {
    --dc-section-space-before: .75;
}

/* Legacy templates use Bootstrap/Tailwind spacing directly on sections.
   Limit these overrides to public section wrappers; nested components retain
   their existing utility styles. */
:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:is(.py-2) {
    padding-top: calc(.5rem * var(--dc-section-space-before, 1)) !important;
    padding-bottom: calc(.5rem * var(--dc-section-space-after, 1)) !important;
}

:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:is(.py-3) {
    padding-top: calc(1rem * var(--dc-section-space-before, 1)) !important;
    padding-bottom: calc(1rem * var(--dc-section-space-after, 1)) !important;
}

:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:is(.py-4) {
    padding-top: calc(1.5rem * var(--dc-section-space-before, 1)) !important;
    padding-bottom: calc(1.5rem * var(--dc-section-space-after, 1)) !important;
}

:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:is(.py-5, .py-12) {
    padding-top: calc(3rem * var(--dc-section-space-before, 1)) !important;
    padding-bottom: calc(3rem * var(--dc-section-space-after, 1)) !important;
}

:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:is(.py-8) {
    padding-top: calc(2rem * var(--dc-section-space-before, 1)) !important;
    padding-bottom: calc(2rem * var(--dc-section-space-after, 1)) !important;
}

:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:is(.py-16) {
    padding-top: calc(4rem * var(--dc-section-space-before, 1)) !important;
    padding-bottom: calc(4rem * var(--dc-section-space-after, 1)) !important;
}

:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section.pt-4 {
    padding-top: calc(1.5rem * var(--dc-section-space-before, 1)) !important;
}

:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section.pt-5 {
    padding-top: calc(3rem * var(--dc-section-space-before, 1)) !important;
}

/* Reduce only the outer space above CTA sections, including the preceding
   content section's bottom padding. Existing CTA bottom spacing is preserved. */
:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:not(:has(h1, .dc-breadcrumb, .dc-theme-cta)):has(
    + section .dc-cta-panel,
    + section:is(.dc-use-cta, .dc-blog-subscribe, .dc-home-subscribe, .Explore_more)
) {
    --dc-section-space-after: .75;
}

:is(#datacrops-site, #datacrops-site main, #datacrops-site .dc-about-reference) > section:is(
    :has(.dc-cta-panel), .dc-use-cta, .dc-blog-subscribe, .dc-home-subscribe, .Explore_more
) {
    --dc-section-space-before: .75;
}

/* About Us groups its content sections in a wrapper before the final CTA. */
#datacrops-site .dc-about-reference:has(+ .dc-about-cta) > section:last-child {
    --dc-section-space-after: .75;
}
