/**
 * Section Center Fix - Ensures sections stay centered during animations
 * Prevents layout shifts and keeps content fixed at center position
 */

/* Force all sections to be centered */
.section {
    position: relative;
    display: block !important;
    text-align: center !important;
}

.section .container {
    margin-left: auto !important;
    margin-right: auto !important;
    position: relative;
}

/* All section headings must be centered */
.section h2,
section h2,
h2.section-title,
h2 {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    display: block !important;
}

/* Why Ambururu Section */
#why-ambururu,
.section:has(h2:contains("Why Ambururu")) {
    display: block !important;
}

#why-ambururu .container,
#why-ambururu .features {
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
}

/* By the Numbers Section */
#stats-section {
    display: block !important;
    text-align: center !important;
}

#stats-section .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

#stats-section .stats {
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
}

/* Our Journey Section */
#our-journey {
    display: block !important;
    text-align: center !important;
}

#our-journey .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Core Values Section */
#core-values {
    display: block !important;
    text-align: center !important;
}

#core-values .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Featured Experiences Section */
#featured-experiences {
    display: block !important;
    text-align: center !important;
}

#featured-experiences .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Guest Stories Section */
#guest-stories {
    display: block !important;
    text-align: center !important;
}

#guest-stories .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Our Journey Section */
#our-journey {
    display: block !important;
    text-align: center !important;
}

#our-journey .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Conservation Section */
#conservation {
    display: block !important;
    text-align: center !important;
}

#conservation .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Team Section */
#team {
    display: block !important;
    text-align: center !important;
}

#team .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Impact Section */
#our-impact {
    display: block !important;
    text-align: center !important;
}

#our-impact .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Attractions Section */
#attractions {
    display: block !important;
    text-align: center !important;
}

#attractions .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Gallery Section */
#gallery {
    display: block !important;
    text-align: center !important;
}

#gallery .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Carbon Calculator Section */
#carbon-calculator {
    display: block !important;
    text-align: center !important;
}

#carbon-calculator .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Community Spotlights Section */
#community-spotlights {
    display: block !important;
    text-align: center !important;
}

#community-spotlights .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Eco-Certifications Section */
#eco-certifications {
    display: block !important;
    text-align: center !important;
}

#eco-certifications .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Future Roadmap Section */
#future-roadmap {
    display: block !important;
    text-align: center !important;
}

#future-roadmap .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Live Feeds Section */
#live-feeds {
    display: block !important;
    text-align: center !important;
}

#live-feeds .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Team Section - Enhanced */
#team {
    display: block !important;
    text-align: center !important;
}

#team .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

#team .grid {
    justify-items: center;
}

/* Animation fixes - prevent layout shifts */
[data-animate-on-scroll] {
    will-change: opacity, transform;
    transform-origin: center center;
    /* Use scale instead of translate to avoid position shifts */
}

[data-animate-on-scroll]:not(.animated) {
    opacity: 0;
    transform: scale(0.95);
}

[data-animate-on-scroll].animated {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    /* No translateY - keeps elements in place */
}

/* Grid layouts - ensure centered content */
.grid,
.features {
    justify-items: center;
    justify-content: center;
}

/* Scale-in animation - stays centered */
.scale-in {
    transform-origin: center center;
}

.scale-in:not(.animated) {
    opacity: 0;
    transform: scale(0.95);
}

.scale-in.animated {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Remove any translate animations that cause movement */
[data-animate-on-scroll],
.scale-in,
.fade-in-up {
    /* Ensure no translateY in initial state */
    transform: scale(0.95) !important;
}

[data-animate-on-scroll].animated,
.scale-in.animated,
.fade-in-up.animated {
    transform: scale(1) !important;
    /* Only use opacity and scale - no translate */
}

