/*
Theme Name:   Astra Child — GeoSIG Ingenieros
Theme URI:    https://geosigingenieros.com.pe
Description:  Tema hijo de Astra para geosigingenieros.com.pe
Author:       GeoSIG Ingenieros
Author URI:   https://geosigingenieros.com.pe
Template:     astra
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  astra-child
*/

/* ==========================================================================
   OPTIMIZACIONES DE RENDIMIENTO — GeoSIG Ingenieros
   ========================================================================== */

/* --- 1. Tipografía crítica — evitar layout shift (CLS) --- */
html {
    font-display: swap;
}

/* --- 2. Deshabilitar animaciones para usuarios que lo prefieren (accesibilidad) --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- 3. Imágenes — prevenir layout shift y mejorar LCP --- */
img,
video {
    height: auto;
    max-width: 100%;
}

/* Lazy load placeholder para evitar CLS */
img[loading="lazy"] {
    min-height: 1px;
}

/* --- 4. Eliminar outline innecesario en Elementor en desktop --- */
.elementor-widget-wrap > .elementor-element {
    will-change: auto;
}

/* --- 5. Optimización del header — reducir repaint --- */
.site-header,
.ast-primary-header-bar {
    transform: translateZ(0);
}

/* --- 6. CSS crítico para Above the Fold — evitar FOUC --- */

/* Hero / sección inicial */
.elementor-section.elementor-top-section:first-of-type {
    contain: layout style;
}

/* --- 7. Scroll suave nativo (sin JS) --- */
html {
    scroll-behavior: smooth;
}

/* --- 8. Optimización de fuentes — si usas Google Fonts vía Elementor --- */
/* Asegura que el texto sea visible durante la carga */
.elementor-heading-title,
.elementor-widget-text-editor p,
h1, h2, h3, h4, h5, h6 {
    font-display: swap;
}

/* --- 9. Botones — mejorar paint performance --- */
.elementor-button,
.ast-button,
button,
input[type="submit"] {
    contain: layout;
    -webkit-tap-highlight-color: transparent;
}

/* --- 10. Eliminar margin/padding innecesario en Elementor mobile --- */
@media (max-width: 767px) {
    .elementor-section .elementor-container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Reducir tamaño de imágenes hero en móvil */
    .elementor-widget-image img {
        max-height: 60vh;
        object-fit: cover;
    }
}

/* --- 11. Deshabilitar polyfill flexbox (innecesario en 2026) --- */
/* flexibility.min.js se puede desactivar desde functions.php */

/* --- 12. Mejoras visuales específicas GeoSIG --- */

/* Asegurar que mapas e imágenes técnicas se rendericen nítidas */
.elementor-widget-image img[src*="MAPA"],
.elementor-widget-image img[src*="mapa"],
.elementor-widget-image img[src*="plano"] {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Contenedor de formulario Contact Form 7 — consistencia visual */
.wpcf7-form {
    max-width: 600px;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
    width: 100%;
    box-sizing: border-box;
}

/* --- 13. Print styles — evitar imprimir elementos innecesarios --- */
@media print {
    .site-header,
    .site-footer,
    .elementor-section[data-element_type="section"]:last-of-type,
    nav,
    .ast-mobile-header-wrap {
        display: none !important;
    }
}
