/**
 * Equitify — Track 3 Global Responsive CSS
 * Developed by Chris Custer (chris@custaa.com)
 *
 * PURPOSE:
 *   Catch-all overrides that Elementor JSON patching (Track 1) and PHP widget
 *   patches (Track 2) cannot reach. Targets:
 *     1. Inline style= attributes inside Elementor text-editor (editor) fields
 *     2. Theme-level layout utilities (.container, .section, etc.)
 *     3. Any remaining hardcoded inline styles on elements the widget PHP outputs
 *     4. Mobile navigation / hamburger state
 *
 * HOW TO LOAD:
 *   Enqueue from functions.php OR add via Elementor → Site Settings → Custom CSS.
 *   Recommended: wp_enqueue_style( 'equitify-responsive', get_theme_file_uri(
 *       '/assets/css/equitify-responsive-global.css' ), [], '1.0.0' );
 *
 * BREAKPOINTS (matches patched widgets):
 *   Tablet  : max-width: 1024px
 *   Mobile  : max-width: 768px
 *   Micro   : max-width: 480px
 * ─────────────────────────────────────────────────────────────────────────────
 */


/* ═══════════════════════════════════════════════════════════════════════════
   0. CSS CUSTOM PROPERTIES — responsive overrides
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --spacing-section: 6rem;
}

@media (max-width: 1024px) {
    :root {
        --spacing-section: 4.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-section: 3rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   1. CONTAINER & LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }
}

/* Elementor section/column padding reset for mobile */
@media (max-width: 768px) {
    .elementor-section .elementor-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    .elementor-column-gap-default > .elementor-column > .elementor-element-populated {
        padding: 0.75rem !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   2. TEXT-EDITOR INLINE STYLE= OVERRIDES
   These are the "12 manual flags" from the audit — CTA section blocks and
   footer link blocks where the editor field contained hardcoded font-size
   and max-width inline styles. One rule here kills all instances.
   ═══════════════════════════════════════════════════════════════════════════ */

/* CTA text-editor block: font-size:18px;max-width:600px hardcoded inline */
@media (max-width: 768px) {
    .elementor-widget-text-editor [style*="font-size:18px"],
    .elementor-widget-text-editor [style*="font-size: 18px"] {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    .elementor-widget-text-editor [style*="max-width:600px"],
    .elementor-widget-text-editor [style*="max-width: 600px"] {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Footer links / small text — 14px inline */
    .elementor-widget-text-editor [style*="font-size:14px"],
    .elementor-widget-text-editor [style*="font-size: 14px"] {
        font-size: 13px !important;
    }

    /* Generic large inline font sizes in editor fields */
    .elementor-widget-text-editor [style*="font-size:24px"],
    .elementor-widget-text-editor [style*="font-size: 24px"] {
        font-size: 18px !important;
    }

    .elementor-widget-text-editor [style*="font-size:20px"],
    .elementor-widget-text-editor [style*="font-size: 20px"] {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .elementor-widget-text-editor [style*="font-size:18px"],
    .elementor-widget-text-editor [style*="font-size: 18px"] {
        font-size: 14px !important;
    }
    .elementor-widget-text-editor [style*="font-size:24px"],
    .elementor-widget-text-editor [style*="font-size: 24px"] {
        font-size: 16px !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   3. HERO WIDGET FALLBACKS
   The hero widget was patched in Track 2. These are safety-net rules.
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .hero h1 {
        font-size: clamp(2rem, 8vw, 3rem) !important;
        line-height: 1.15 !important;
    }

    .hero-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .hero-actions a,
    .hero-actions button {
        width: 100% !important;
        text-align: center !important;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .hero-content {
        padding-top: 4rem !important;
        padding-bottom: 3rem !important;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        grid-template-columns: 1fr 1fr !important;
    }

    .hero h1 {
        font-size: clamp(1.75rem, 9vw, 2.5rem) !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   4. HEADER / NAV WIDGET
   ═══════════════════════════════════════════════════════════════════════════ */

/* Ensure the nav container stacks properly */
@media (max-width: 768px) {
    .site-header .nav-container {
        flex-wrap: wrap;
        position: relative;
    }

    .site-header nav {
        display: none;
        width: 100%;
        order: 3;
        padding: 1rem 0;
        border-top: 1px solid rgba(255,255,255,0.08);
    }

    .site-header nav.is-open {
        display: block;
    }

    .site-header .nav-links {
        flex-direction: column !important;
        list-style: none;
        padding: 0;
        margin: 0;
        gap: 0 !important;
    }

    .site-header .nav-links li a {
        display: block;
        padding: 0.75rem 0 !important;
        font-size: 15px !important;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .site-header .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: 1px solid rgba(255,255,255,0.2);
        color: inherit;
        padding: 0.4rem 0.7rem;
        cursor: pointer;
        font-size: 1.2rem;
        border-radius: 4px;
        margin-left: auto;
    }
}

@media (min-width: 769px) {
    .site-header .mobile-menu-btn {
        display: none !important;
    }
    .site-header nav {
        display: flex !important;
        align-items: center;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   5. COMPARISON TABLE (widget patched in Track 2)
   Safety net for table overflow on very small screens.
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .table-container,
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table {
        min-width: 480px; /* forces horizontal scroll before content crushes */
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   6. PROCESS WIDGET CTA BOX
   process-cta-box class replaces the old inline style= div.
   ═══════════════════════════════════════════════════════════════════════════ */

.process-cta-box {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 3px solid var(--color-accent, #D4AF37);
    padding: 2.5rem;
    max-width: 36rem;
    margin: 0 auto;
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

@media (max-width: 1024px) {
    .process-cta-box {
        padding: 2rem;
        max-width: 85%;
    }
}

@media (max-width: 768px) {
    .process-cta-box {
        padding: 1.5rem 1.25rem;
        max-width: 100%;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   7. FEATURED PROPERTIES WIDGET
   properties-btn-wrap and properties-btn classes replace old inline styles.
   ═══════════════════════════════════════════════════════════════════════════ */

.properties-btn-wrap {
    text-align: center;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .properties-btn-wrap {
        margin-top: 2rem;
    }

    /* Card grid from 3-col to 1-col handled by Elementor controls,
       but add safety net for 2-col intermediate */
    .properties-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   8. SECTION HEADERS (section-header class used across multiple widgets)
   ═══════════════════════════════════════════════════════════════════════════ */

.section-header {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-bottom: 3.5rem;
}

@media (max-width: 1024px) {
    .section-header {
        margin-bottom: 2.5rem;
    }
}

@media (max-width: 768px) {
    .section-header {
        margin-bottom: 2rem;
        max-width: 100%;
    }

    .section-header h2 {
        font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
    }

    .section-header p {
        font-size: 1rem !important;
        line-height: 1.65 !important;
    }

    .section-header h6 {
        font-size: 0.7rem !important;
        letter-spacing: 1.5px !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   9. BUTTON RESPONSIVENESS
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .btn {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.875rem !important;
    }

    /* Prevent oversized CTA buttons from overflowing */
    .btn-primary,
    .btn-gold,
    .btn-outline {
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   10. TESTIMONIALS GRID SAFETY NET
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .testimonials-grid {
        grid-template-columns: 1fr !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   11. FOOTER RESPONSIVE SAFETY NET
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .eq-footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .eq-footer-brand {
        margin-bottom: 1rem;
    }

    .eq-footer-bottom {
        flex-direction: column !important;
        gap: 0.5rem !important;
        text-align: center !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   12. STATSBAR GRID SAFETY NET
   ═══════════════════════════════════════════════════════════════════════════ */

.statsbar-grid {
    display: grid;
}

@media (max-width: 1024px) {
    .statsbar-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .statsbar-item + .statsbar-item {
        /* Remove vertical dividers when stacked 2-wide */
        border-left: none !important;
    }
}

@media (max-width: 768px) {
    .statsbar-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.5rem !important;
    }

    .statsbar-number {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 480px) {
    .statsbar-grid {
        grid-template-columns: 1fr !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   13. DISCIPLINE STRIP & FOCUS GRID SAFETY NETS
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .disc-grid,
    .fg-grid {
        grid-template-columns: 1fr !important;
        gap: 1.75rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .disc-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .fg-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   14. FORM WIDGETS (apply-form, bov-form)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .apply-form .row,
    .bov-form .row {
        grid-template-columns: 1fr !important;
    }

    .apply-form,
    .bov-form {
        padding: 1.75rem 1.25rem !important;
    }

    .apply-inner,
    .bov-inner {
        max-width: 100% !important;
        padding: 0 !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   15. PROOF CARDS METRICS GRID
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .proof-metrics {
        grid-template-columns: 1fr 1fr 1fr !important; /* keep 3-col on mobile — numbers are small */
        padding: 1rem !important;
        gap: 0.5rem !important;
    }

    .proof-metric-value {
        font-size: 1.5rem !important;
    }

    .proof-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 400px) {
    .proof-metrics {
        grid-template-columns: 1fr !important; /* very small screens: stack */
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   16. CAPITAL NETWORK DIAGRAM
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .cn-diagram {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .cn-connector {
        width: 2px !important;
        height: 30px !important;
        background: linear-gradient(180deg, transparent 0%, var(--color-accent, #D4AF37) 50%, transparent 100%) !important;
        margin: 0 auto !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   17. PHILOSOPHY BLOCK PADDING
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .phil-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .phil-headline {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
    }

    .phil-body {
        font-size: 1rem !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   18. GENERAL ELEMENTOR WIDGET SPACING ON MOBILE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Reduce top/bottom padding on Elementor sections globally */
    .elementor-section.elementor-section-boxed > .elementor-container {
        max-width: 100% !important;
    }

    /* Prevent any reveal animations from causing layout shift */
    .reveal,
    .reveal-up {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    /* Inline transition-delay no longer needed on mobile — zero it out */
    [style*="transition-delay"] {
        transition-delay: 0ms !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   19. ADVANTAGE & COMPLIANCE GRID SAFETY NETS
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .adv-grid,
    .comp-grid {
        grid-template-columns: 1fr !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   20. TEAM GRID SAFETY NET
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr !important;
        max-width: 400px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   21. PLATFORM / WHO WE ARE — image height safety net
   (inline style was removed from widget; height set via Elementor slider)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .platform-grid {
        grid-template-columns: 1fr !important;
    }

    .platform-visual img,
    .platform-visual-placeholder {
        height: 220px !important;
        width: 100% !important;
        object-fit: cover !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   END OF EQUITIFY RESPONSIVE GLOBAL CSS
   ═══════════════════════════════════════════════════════════════════════════ */
