<?php
/**
 * GushOfLove — Matrimony Homepage Shortcodes  v2.0 PREMIUM
 *
 * All shortcodes accept fully customisable attributes so every word,
 * image and URL can be edited in Elementor's Shortcode widget panel
 * OR in the raw page template.
 *
 * @package GushOfLove
 */

if ( ! defined( 'ABSPATH' ) ) exit;

/* ── URL helpers ──────────────────────────────────────────── */
if ( ! function_exists( 'gol_register_url' ) ) {
    function gol_register_url() {
        return eros_get_register_url();
    }
    function gol_browse_url() {
        return get_permalink( get_page_by_path( 'browse-members' ) )
            ?: home_url( '/browse-members/' );
    }
}

/* ════════════════════════════════════════════════════════════
   1. FULL HERO (fallback page / non-Elementor usage)
      [gol_matri_hero]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_hero', 'gol_sc_matri_hero' );
function gol_sc_matri_hero( $atts = [] ) {
    $a = shortcode_atts( [
        'badge'       => '&#x1F48D; Kerala\'s Most Trusted Matrimony Service',
        'headline'    => 'Find Your <em>Life Partner</em> With Confidence',
        'sub'         => 'Thousands of verified profiles across Kerala and the diaspora. Matching families, values, and hearts — with respect and trust.',
        'btn1_text'   => 'Find Your Match Free',
        'btn2_text'   => 'Browse Profiles',
        'proof_text'  => '50,000+ happy families &nbsp;&#183;&nbsp; 4.9&#9733; rated',
    ], $atts );

    $register_url = gol_register_url();
    $browse_url   = gol_browse_url();

    ob_start(); ?>
    <section class="gol-hero">
        <div class="gol-hero-shapes" aria-hidden="true">
            <span class="gol-shape gol-shape-1"></span>
            <span class="gol-shape gol-shape-2"></span>
            <span class="gol-shape gol-shape-3"></span>
        </div>
        <div class="gol-hero-inner">

            <!-- Left: Copy -->
            <div class="gol-hero-text">
                <div class="gol-hero-badge">
                    <?php echo wp_kses( $a['badge'], [ 'em'=>[], 'strong'=>[] ] ); ?>
                </div>
                <h1 class="gol-hero-headline">
                    <?php echo wp_kses( $a['headline'], [ 'em'=>[], 'strong'=>[], 'br'=>[] ] ); ?>
                </h1>
                <p class="gol-hero-sub"><?php echo esc_html( $a['sub'] ); ?></p>

                <div class="gol-hero-actions">
                    <a href="<?php echo esc_url( $register_url ); ?>"
                       class="gol-btn gol-btn-primary gol-btn-lg">
                        <?php echo esc_html( $a['btn1_text'] ); ?> &rarr;
                    </a>
                    <a href="<?php echo esc_url( $browse_url ); ?>"
                       class="gol-btn gol-btn-outline-hero gol-btn-lg">
                        <?php echo esc_html( $a['btn2_text'] ); ?>
                    </a>
                </div>

                <div class="gol-hero-proof">
                    <div class="gol-proof-avatars" aria-hidden="true">
                        <span class="gol-pav" style="background:linear-gradient(135deg,#8B1A1A,#C0392B)">P</span>
                        <span class="gol-pav" style="background:linear-gradient(135deg,#92400E,#D97706)">A</span>
                        <span class="gol-pav" style="background:linear-gradient(135deg,#065F46,#059669)">S</span>
                        <span class="gol-pav" style="background:linear-gradient(135deg,#1E3A5F,#2563EB)">R</span>
                        <span class="gol-pav" style="background:linear-gradient(135deg,#581C87,#7C3AED)">M</span>
                    </div>
                    <p class="gol-proof-text">
                        <?php echo wp_kses_post( $a['proof_text'] ); ?>
                    </p>
                </div>
            </div><!-- /hero-text -->

        </div><!-- /hero-inner -->
    </section>
    <?php
    return ob_get_clean();
}

/* ════════════════════════════════════════════════════════════
   2. FEATURES  [gol_matri_features]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_features', 'gol_sc_matri_features' );
function gol_sc_matri_features( $atts = [] ) {
    $a = shortcode_atts( [
        'tag'      => 'Why GushOfLove',
        'title'    => 'Your Partner Deserves the Best Start',
        'subtitle' => 'Built for Kerala families who value trust, tradition and a meaningful life together.',
    ], $atts );

    $features = [
        [ '&#9989;',   'Verified Profiles Only',     'Every profile is manually reviewed and verified with ID and selfie before activation. No fake accounts.' ],
        [ '&#128267;', 'Horoscope Matching',          'Detailed Kundali / Jathakam matching with compatibility score across all 36 Gunas — right inside the app.' ],
        [ '&#127968;', 'Family-Centred Approach',     'Parental and family profiles supported. Search by family background, income, and community openly.' ],
        [ '&#127775;', 'NRI & Gulf Community',        'Largest database of Kerala NRI and Gulf-based profiles. Filter by country, visa type and annual income.' ],
        [ '&#128274;', 'Privacy & Security',          'Photo privacy controls, contact visible only after mutual interest, encrypted data — your safety is non-negotiable.' ],
        [ '&#127891;', 'Advanced Filters',            'Filter by caste, sub-caste, education, profession, height, complexion, diet, mangalik, and more.' ],
    ];

    ob_start(); ?>
    <section class="gol-section gol-features-section">
        <div class="gol-container">
            <div class="gol-section-header">
                <span class="gol-section-tag"><?php echo esc_html( $a['tag'] ); ?></span>
                <h2 class="gol-section-title"><?php echo esc_html( $a['title'] ); ?></h2>
                <p class="gol-section-sub"><?php echo esc_html( $a['subtitle'] ); ?></p>
            </div>
            <div class="gol-features-grid">
                <?php foreach ( $features as [ $icon, $title, $desc ] ) : ?>
                <div class="gol-feature-card">
                    <span class="gol-feature-icon"><?php echo $icon; ?></span>
                    <h3 class="gol-feature-title"><?php echo esc_html( $title ); ?></h3>
                    <p class="gol-feature-desc"><?php echo esc_html( $desc ); ?></p>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>
    <?php return ob_get_clean();
}

/* ════════════════════════════════════════════════════════════
   3. HOW IT WORKS  [gol_matri_steps]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_steps', 'gol_sc_matri_steps' );
function gol_sc_matri_steps( $atts = [] ) {
    $a = shortcode_atts( [
        'tag'      => 'Simple Steps',
        'title'    => 'Finding Your Life Partner is Simple',
        'subtitle' => 'A respectful, guided process designed for you and your family.',
        's1_icon'  => '&#128100;', 's1_title' => 'Create Your Profile',
        's1_desc'  => 'Register free in minutes. Add your biodata, family details, horoscope and photos.',
        's2_icon'  => '&#128269;', 's2_title' => 'Discover Matches',
        's2_desc'  => 'Browse verified profiles filtered by community, education, location and horoscope.',
        's3_icon'  => '&#128140;', 's3_title' => 'Express Interest',
        's3_desc'  => 'Send interest respectfully. When both sides accept, connect directly and proceed.',
        's4_icon'  => '&#128141;', 's4_title' => 'Begin Your Journey',
        's4_desc'  => 'Meet in person, involve families, and begin a lifetime of shared joy.',
    ], $atts );

    $steps = [
        [ '01', $a['s1_icon'], $a['s1_title'], $a['s1_desc'] ],
        [ '02', $a['s2_icon'], $a['s2_title'], $a['s2_desc'] ],
        [ '03', $a['s3_icon'], $a['s3_title'], $a['s3_desc'] ],
        [ '04', $a['s4_icon'], $a['s4_title'], $a['s4_desc'] ],
    ];

    ob_start(); ?>
    <section class="gol-section gol-steps-section">
        <div class="gol-container">
            <div class="gol-section-header">
                <span class="gol-section-tag"><?php echo esc_html( $a['tag'] ); ?></span>
                <h2 class="gol-section-title"><?php echo esc_html( $a['title'] ); ?></h2>
                <p class="gol-section-sub"><?php echo esc_html( $a['subtitle'] ); ?></p>
            </div>
            <div class="gol-steps-grid">
                <?php foreach ( $steps as [ $num, $icon, $title, $desc ] ) : ?>
                <div class="gol-step-card">
                    <div class="gol-step-num"><?php echo esc_html( $num ); ?></div>
                    <span class="gol-step-icon"><?php echo $icon; ?></span>
                    <h3 class="gol-step-title"><?php echo esc_html( $title ); ?></h3>
                    <p class="gol-step-desc"><?php echo esc_html( $desc ); ?></p>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>
    <?php return ob_get_clean();
}

/* ════════════════════════════════════════════════════════════
   4. STATS BAR  [gol_matri_stats]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_stats', 'gol_sc_matri_stats' );
function gol_sc_matri_stats( $atts = [] ) {
    $a = shortcode_atts( [
        'stat1_num' => '85,000+', 'stat1_label' => 'Verified Profiles',
        'stat2_num' => '18,400+', 'stat2_label' => 'Marriages Facilitated',
        'stat3_num' => '4.9&#9733;', 'stat3_label' => 'Member Rating',
        'stat4_num' => '26',     'stat4_label' => 'Kerala Districts Covered',
        'stat5_num' => '40+',    'stat5_label' => 'Communities Represented',
    ], $atts );

    $stats = [
        [ $a['stat1_num'], $a['stat1_label'] ],
        [ $a['stat2_num'], $a['stat2_label'] ],
        [ $a['stat3_num'], $a['stat3_label'] ],
        [ $a['stat4_num'], $a['stat4_label'] ],
        [ $a['stat5_num'], $a['stat5_label'] ],
    ];

    ob_start(); ?>
    <section class="gol-stats-section">
        <div class="gol-container">
            <div class="gol-stats-grid">
                <?php foreach ( $stats as [ $num, $label ] ) : ?>
                <div class="gol-stat-item">
                    <span class="gol-stat-num"><?php echo wp_kses( $num, [ 'em'=>[], 'strong'=>[] ] ); ?></span>
                    <div class="gol-stat-label"><?php echo esc_html( $label ); ?></div>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>
    <?php return ob_get_clean();
}

/* ════════════════════════════════════════════════════════════
   5. SUCCESS STORIES  [gol_matri_success_stories]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_success_stories', 'gol_sc_matri_success_stories' );
function gol_sc_matri_success_stories( $atts = [] ) {
    $a = shortcode_atts( [
        'tag'      => 'Success Stories',
        'title'    => 'Families Joined, Hearts United',
        'subtitle' => 'Real couples who found their life partner through GushOfLove.',
        's1_couple' => 'Ananya & Vishnu',
        's1_loc'    => 'Thrissur · Hindu · Brahmin',
        's1_date'   => 'Married — March 2024',
        's1_quote'  => 'We connected within a week of registering. The horoscope match was 28/36 and our families immediately felt it was right. Engaged in 3 months, married in 6.',
        's1_img'    => 'https://images.unsplash.com/photo-1583939411023-14783179e581?w=300&q=80&auto=format&fit=crop',
        's2_couple' => 'Reena & Thomas',
        's2_loc'    => 'Kochi · Christian · Catholic',
        's2_date'   => 'Married — September 2023',
        's2_quote'  => 'As a working professional in Dubai, I didn\'t expect to find someone back home so easily. GushOfLove\'s NRI filter and verified profiles gave our families the confidence to move forward.',
        's2_img'    => 'https://images.unsplash.com/photo-1519741497674-611481863552?w=300&q=80&auto=format&fit=crop',
        's3_couple' => 'Fathima & Rashid',
        's3_loc'    => 'Kozhikode · Muslim · Mappila',
        's3_date'   => 'Married — January 2024',
        's3_quote'  => 'My parents were hesitant about online matrimony. But the parental profile feature and detailed family background section made them feel this was no different from a traditional approach.',
        's3_img'    => 'https://images.unsplash.com/photo-1529543544282-ea669407fca3?w=300&q=80&auto=format&fit=crop',
        's4_couple' => 'Sreelakshmi & Arun',
        's4_loc'    => 'Trivandrum · Hindu · Ezhava',
        's4_date'   => 'Married — June 2024',
        's4_quote'  => 'We are from the same district but would never have crossed paths otherwise. The compatibility score was 89% and everything the algorithm suggested was absolutely right.',
        's4_img'    => 'https://images.unsplash.com/photo-1537633552985-df8429e8048b?w=300&q=80&auto=format&fit=crop',
    ], $atts );

    $stories = [
        [ $a['s1_couple'], $a['s1_loc'], $a['s1_date'], $a['s1_quote'], $a['s1_img'] ],
        [ $a['s2_couple'], $a['s2_loc'], $a['s2_date'], $a['s2_quote'], $a['s2_img'] ],
        [ $a['s3_couple'], $a['s3_loc'], $a['s3_date'], $a['s3_quote'], $a['s3_img'] ],
        [ $a['s4_couple'], $a['s4_loc'], $a['s4_date'], $a['s4_quote'], $a['s4_img'] ],
    ];

    ob_start(); ?>
    <section class="gol-section gol-stories-section">
        <div class="gol-container">
            <div class="gol-section-header">
                <span class="gol-section-tag"><?php echo esc_html( $a['tag'] ); ?></span>
                <h2 class="gol-section-title"><?php echo esc_html( $a['title'] ); ?></h2>
                <p class="gol-section-sub"><?php echo esc_html( $a['subtitle'] ); ?></p>
            </div>
            <div class="gol-stories-grid">
                <?php foreach ( $stories as [ $couple, $loc, $date, $quote, $img ] ) : ?>
                <div class="gol-story-card">
                    <div class="gol-story-photo-wrap">
                        <?php if ( $img ) : ?>
                        <img class="gol-story-photo" src="<?php echo esc_url( $img ); ?>"
                             alt="<?php echo esc_attr( $couple ); ?>" loading="lazy">
                        <?php endif; ?>
                        <div class="gol-story-photo-badge">&#128141; Married</div>
                    </div>
                    <div class="gol-story-body">
                        <div class="gol-story-stars">&#9733;&#9733;&#9733;&#9733;&#9733;</div>
                        <blockquote class="gol-story-quote"><?php echo esc_html( $quote ); ?></blockquote>
                        <div class="gol-story-meta">
                            <strong class="gol-story-couple"><?php echo esc_html( $couple ); ?></strong>
                            <span class="gol-story-loc"><?php echo esc_html( $loc ); ?></span>
                            <span class="gol-story-date">&#128197; <?php echo esc_html( $date ); ?></span>
                        </div>
                    </div>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>
    <?php return ob_get_clean();
}

/* ════════════════════════════════════════════════════════════
   6. FEATURED PROFILES  [gol_matri_featured_profiles]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_featured_profiles', 'gol_sc_matri_featured_profiles' );
function gol_sc_matri_featured_profiles( $atts = [] ) {
    $a = shortcode_atts( [
        'tag'      => 'Featured Profiles',
        'title'    => 'Today\'s Highlighted Matches',
        'subtitle' => 'A glimpse of who is searching. Register to view full profiles and contact.',
        'btn_text' => 'View All Profiles',
        'btn_url'  => '',
        'p1_name' => 'Priyanka, 25',   'p1_city' => 'Ernakulam',
        'p1_details' => 'M.Com · Bank Officer · Hindu · Nair · 5\'4"',
        'p1_img' => 'https://images.unsplash.com/photo-1531746020798-e6953c6e8e04?w=320&q=80&auto=format&fit=crop',
        'p2_name' => 'Arjun, 29',      'p2_city' => 'Thrissur',
        'p2_details' => 'B.Tech · Software Engineer · Hindu · Nair · 5\'10"',
        'p2_img' => 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=320&q=80&auto=format&fit=crop',
        'p3_name' => 'Maria, 27',      'p3_city' => 'Kottayam',
        'p3_details' => 'MCA · IT Professional · Christian · Jacobite · 5\'5"',
        'p3_img' => 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=320&q=80&auto=format&fit=crop',
        'p4_name' => 'Siddique, 31',   'p4_city' => 'Kozhikode',
        'p4_details' => 'MBA · Business Owner · Muslim · Mappila · 5\'9"',
        'p4_img' => 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=320&q=80&auto=format&fit=crop',
        'p5_name' => 'Sreelakshmi, 24','p5_city' => 'Trivandrum',
        'p5_details' => 'MBBS · Doctor · Hindu · Ezhava · 5\'3"',
        'p5_img' => 'https://images.unsplash.com/photo-1517841905240-472988babdf9?w=320&q=80&auto=format&fit=crop',
        'p6_name' => 'Suresh, 33',     'p6_city' => 'Kannur (NRI-Dubai)',
        'p6_details' => 'B.Tech · Civil Engineer (UAE) · Hindu · Thiyya · 5\'11"',
        'p6_img' => 'https://images.unsplash.com/photo-1463453091185-61582044d556?w=320&q=80&auto=format&fit=crop',
    ], $atts );

    $profiles = [
        [ $a['p1_name'], $a['p1_city'], $a['p1_details'], $a['p1_img'] ],
        [ $a['p2_name'], $a['p2_city'], $a['p2_details'], $a['p2_img'] ],
        [ $a['p3_name'], $a['p3_city'], $a['p3_details'], $a['p3_img'] ],
        [ $a['p4_name'], $a['p4_city'], $a['p4_details'], $a['p4_img'] ],
        [ $a['p5_name'], $a['p5_city'], $a['p5_details'], $a['p5_img'] ],
        [ $a['p6_name'], $a['p6_city'], $a['p6_details'], $a['p6_img'] ],
    ];

    $btn_url      = $a['btn_url'] ?: gol_browse_url();
    $register_url = gol_register_url();

    ob_start(); ?>
    <section class="gol-section gol-profiles-section">
        <div class="gol-container">
            <div class="gol-section-header">
                <span class="gol-section-tag"><?php echo esc_html( $a['tag'] ); ?></span>
                <h2 class="gol-section-title"><?php echo esc_html( $a['title'] ); ?></h2>
                <p class="gol-section-sub"><?php echo esc_html( $a['subtitle'] ); ?></p>
            </div>
            <div class="gol-profiles-grid">
                <?php foreach ( $profiles as [ $name, $city, $details, $img ] ) : ?>
                <div class="gol-prof-card">
                    <div class="gol-prof-photo-wrap">
                        <?php if ( $img ) : ?>
                        <img class="gol-prof-photo" src="<?php echo esc_url( $img ); ?>"
                             alt="<?php echo esc_attr( $name ); ?>" loading="lazy">
                        <?php else : ?>
                        <div class="gol-prof-photo-placeholder">
                            <?php echo esc_html( mb_substr( $name, 0, 1 ) ); ?>
                        </div>
                        <?php endif; ?>
                        <div class="gol-prof-overlay">
                            <a href="<?php echo esc_url( $register_url ); ?>" class="gol-prof-cta">View Profile</a>
                        </div>
                        <span class="gol-prof-badge">&#9989; Verified</span>
                    </div>
                    <div class="gol-prof-body">
                        <h4 class="gol-prof-name"><?php echo esc_html( $name ); ?></h4>
                        <p class="gol-prof-city">&#128205; <?php echo esc_html( $city ); ?></p>
                        <p class="gol-prof-details"><?php echo esc_html( $details ); ?></p>
                        <a href="<?php echo esc_url( $register_url ); ?>" class="gol-prof-interest-btn">
                            &#128140; Send Interest
                        </a>
                    </div>
                </div>
                <?php endforeach; ?>
            </div>
            <div class="gol-profiles-footer">
                <a href="<?php echo esc_url( $btn_url ); ?>" class="gol-btn gol-btn-primary">
                    <?php echo esc_html( $a['btn_text'] ); ?> &rarr;
                </a>
            </div>
        </div>
    </section>
    <?php return ob_get_clean();
}

/* ════════════════════════════════════════════════════════════
   7. BROWSE BY COMMUNITY  [gol_matri_community]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_community', 'gol_sc_matri_community' );
function gol_sc_matri_community( $atts = [] ) {
    $a = shortcode_atts( [
        'tag'      => 'Browse by Community',
        'title'    => 'Your Community, Your Choice',
        'subtitle' => 'Thousands of profiles across every Kerala community and religion.',
    ], $atts );

    $communities = [
        [ '&#127774;', 'Hindu Matrimony',    'Nair, Ezhava, Brahmin, Thiyya, Kshatriya & all communities',   '#8B1A1A' ],
        [ '&#9812;',   'Christian Matrimony','Catholic, CSI, Jacobite, Marthomite, Pentecostal & more',       '#1E3A5F' ],
        [ '&#9728;',   'Muslim Matrimony',   'Mappila, Sunni, Shia & all Muslim communities in Kerala',       '#065F46' ],
        [ '&#128170;', 'NRI & Gulf',         'Profiles from UAE, Saudi, Qatar, UK, USA, Canada & beyond',     '#92400E' ],
        [ '&#127979;', 'Doctor & Engineer',  'Professional profiles — doctors, engineers, government officers','#581C87' ],
        [ '&#127960;', 'Divorced / Widowed', 'Compassionate, verified matches with complete family support',   '#78716C' ],
    ];

    $browse_url = gol_browse_url();

    ob_start(); ?>
    <section class="gol-section gol-community-section">
        <div class="gol-container">
            <div class="gol-section-header">
                <span class="gol-section-tag"><?php echo esc_html( $a['tag'] ); ?></span>
                <h2 class="gol-section-title"><?php echo esc_html( $a['title'] ); ?></h2>
                <p class="gol-section-sub"><?php echo esc_html( $a['subtitle'] ); ?></p>
            </div>
            <div class="gol-community-grid">
                <?php foreach ( $communities as [ $icon, $title, $desc, $color ] ) : ?>
                <a href="<?php echo esc_url( $browse_url ); ?>"
                   class="gol-community-card"
                   style="--cc:<?php echo esc_attr( $color ); ?>">
                    <span class="gol-community-icon"><?php echo $icon; ?></span>
                    <h3 class="gol-community-title"><?php echo esc_html( $title ); ?></h3>
                    <p class="gol-community-desc"><?php echo esc_html( $desc ); ?></p>
                    <span class="gol-community-arrow">&rarr;</span>
                </a>
                <?php endforeach; ?>
            </div>
        </div>
    </section>
    <?php return ob_get_clean();
}

/* ════════════════════════════════════════════════════════════
   8. TRUST & SAFETY  [gol_matri_trust]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_trust', 'gol_sc_matri_trust' );
function gol_sc_matri_trust( $atts = [] ) {
    $a = shortcode_atts( [
        'title'    => 'Safe. Verified. Trusted.',
        'subtitle' => 'Your privacy and security are at the core of everything we do.',
    ], $atts );

    $badges = [
        [ '&#128274;', 'Aadhaar Verified',    'Profiles verified against Aadhaar or government ID for 100% authenticity.' ],
        [ '&#128247;', 'Selfie Verification', 'Live selfie check ensures the person behind the profile is real and genuine.' ],
        [ '&#128100;', 'Manual Review',       'Each profile is reviewed by our team before being shown to other members.' ],
        [ '&#128220;', 'SSL Encrypted',       'All data is encrypted end-to-end. Your personal details are never shared without consent.' ],
        [ '&#128499;', 'Privacy Controls',    'Hide your photo, set contact preferences, and control exactly who can reach you.' ],
        [ '&#128241;', 'Phone Verified',      'Mobile OTP verification ensures every registered number is active and genuine.' ],
    ];

    ob_start(); ?>
    <section class="gol-section gol-trust-section">
        <div class="gol-container">
            <div class="gol-section-header">
                <h2 class="gol-section-title"><?php echo esc_html( $a['title'] ); ?></h2>
                <p class="gol-section-sub"><?php echo esc_html( $a['subtitle'] ); ?></p>
            </div>
            <div class="gol-trust-grid">
                <?php foreach ( $badges as [ $icon, $title, $desc ] ) : ?>
                <div class="gol-trust-card">
                    <div class="gol-trust-icon"><?php echo $icon; ?></div>
                    <div class="gol-trust-body">
                        <strong><?php echo esc_html( $title ); ?></strong>
                        <p><?php echo esc_html( $desc ); ?></p>
                    </div>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>
    <?php return ob_get_clean();
}

/* ════════════════════════════════════════════════════════════
   9. KERALA HERITAGE  [gol_matri_kerala_heritage]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_kerala_heritage', 'gol_sc_matri_kerala_heritage' );
function gol_sc_matri_kerala_heritage( $atts = [] ) {
    $a = shortcode_atts( [
        'headline'   => 'Rooted in Kerala\'s Rich Traditions',
        'sub'        => 'We celebrate every community\'s customs, rituals, and values. From the backwaters of Alleppey to the Gulf diaspora — GushOfLove honours Kerala\'s heritage in every match.',
        'btn_text'   => 'Start Your Journey',
        'btn_url'    => '',
        'photo1'     => 'https://images.unsplash.com/photo-1602216056096-3b40cc0c9944?w=500&q=80&auto=format&fit=crop',
        'photo2'     => 'https://images.unsplash.com/photo-1582645737714-8f2acc3d3d16?w=500&q=80&auto=format&fit=crop',
        'photo3'     => 'https://images.unsplash.com/photo-1570168007204-dfb528c6958f?w=500&q=80&auto=format&fit=crop',
        'photo4'     => 'https://images.unsplash.com/photo-1587474260584-136574528ed5?w=500&q=80&auto=format&fit=crop',
        'photo1_alt' => 'Kerala backwaters — Alleppey houseboats',
        'photo2_alt' => 'Traditional Kerala wedding ceremony',
        'photo3_alt' => 'Kathakali — Kerala classical art',
        'photo4_alt' => 'Kerala temple procession',
    ], $atts );

    $btn_url = $a['btn_url'] ?: gol_register_url();

    ob_start(); ?>
    <section class="gol-kerala-section">
        <div class="gol-kerala-inner">
            <div class="gol-kerala-text">
                <span class="gol-section-tag">Our Heritage</span>
                <h2 class="gol-kerala-headline"><?php echo esc_html( $a['headline'] ); ?></h2>
                <p class="gol-kerala-sub"><?php echo esc_html( $a['sub'] ); ?></p>
                <a href="<?php echo esc_url( $btn_url ); ?>" class="gol-btn gol-btn-primary">
                    <?php echo esc_html( $a['btn_text'] ); ?> &rarr;
                </a>
            </div>
            <div class="gol-kerala-mosaic">
                <?php for ( $n = 1; $n <= 4; $n++ ) :
                    $src = $a[ "photo{$n}" ];
                    $alt = $a[ "photo{$n}_alt" ];
                    if ( ! $src ) continue;
                ?>
                <div class="gol-kerala-photo gol-kerala-photo-<?php echo $n; ?>">
                    <img src="<?php echo esc_url( $src ); ?>"
                         alt="<?php echo esc_attr( $alt ); ?>" loading="lazy">
                </div>
                <?php endfor; ?>
            </div>
        </div>
    </section>
    <?php return ob_get_clean();
}

/* ════════════════════════════════════════════════════════════
   10. FINAL CTA  [gol_matri_cta]
   ════════════════════════════════════════════════════════════ */
add_shortcode( 'gol_matri_cta', 'gol_sc_matri_cta' );
function gol_sc_matri_cta( $atts = [] ) {
    $a = shortcode_atts( [
        'headline'  => 'Begin Your Search for a Life Partner Today',
        'sub'       => 'Register free. Browse thousands of verified profiles. Find someone who shares your values, your roots, and your vision for a beautiful life together.',
        'btn1_text' => 'Create Free Profile',
        'btn2_text' => 'Browse Profiles',
        'note'      => '&#10003; Free to join &nbsp;&bull;&nbsp; &#10003; No credit card &nbsp;&bull;&nbsp; &#10003; Kerala\'s most trusted matrimony service',
    ], $atts );

    $register_url = gol_register_url();
    $browse_url   = gol_browse_url();

    ob_start(); ?>
    <section class="gol-cta-section">
        <div class="gol-cta-ring gol-cta-ring-1" aria-hidden="true"></div>
        <div class="gol-cta-ring gol-cta-ring-2" aria-hidden="true"></div>
        <div class="gol-container">
            <div class="gol-cta-inner">
                <h2 class="gol-cta-headline"><?php echo esc_html( $a['headline'] ); ?></h2>
                <p class="gol-cta-sub"><?php echo esc_html( $a['sub'] ); ?></p>
                <div class="gol-cta-actions">
                    <a href="<?php echo esc_url( $register_url ); ?>"
                       class="gol-btn gol-btn-white gol-btn-lg">
                        <?php echo esc_html( $a['btn1_text'] ); ?> &rarr;
                    </a>
                    <a href="<?php echo esc_url( $browse_url ); ?>"
                       class="gol-btn gol-btn-cta-outline gol-btn-lg">
                        <?php echo esc_html( $a['btn2_text'] ); ?>
                    </a>
                </div>
                <p class="gol-cta-note"><?php echo wp_kses_post( $a['note'] ); ?></p>
            </div>
        </div>
    </section>
    <?php return ob_get_clean();
}
