<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class FrontController extends Controller
{
    private function blogPosts(): array
    {
        return [
            [
                'slug' => 'why-global-citizenship-is-the-ultimate-wealth-protection',
                'category' => 'Strategy',
                'title' => 'Why Global Citizenship Is the Ultimate Wealth Protection',
                'excerpt' => 'A practical look at how second citizenship can diversify risk, preserve mobility, and safeguard family legacy in uncertain economic times.',
                'date' => 'April 1, 2026',
                'read_time' => '6 min read',
                'author' => 'Across Editorial Team',
                'hero_image' => 'https://images.unsplash.com/photo-1560518883-ce09059eeffa?auto=format&fit=crop&w=1600&q=80',
                'hero_alt' => 'Luxury global property and wealth planning concept',
                'intro' => 'Wealth protection today is no longer only about asset allocation. For globally active families, resilience also depends on mobility, legal optionality, and the ability to relocate capital and operations efficiently when policy or market conditions shift.',
                'sections' => [
                    [
                        'heading' => 'Mobility Is Now a Strategic Asset',
                        'body' => [
                            'A second citizenship can reduce dependence on a single jurisdiction and create practical flexibility in moments of disruption. Families with international business interests increasingly see mobility as part of their long-term risk framework, not just a lifestyle benefit.',
                            'When travel restrictions, banking friction, or political instability affect one market, a broader legal identity can preserve access to opportunity and keep personal and commercial plans moving forward.',
                        ],
                    ],
                    [
                        'heading' => 'Diversification Beyond Traditional Portfolios',
                        'body' => [
                            'Investors often diversify across currencies, property classes, and geographies. Citizenship and residency planning extend that same logic to personal rights and long-term family positioning.',
                            'The strongest strategies combine financial structuring with jurisdictional diversification, especially for founders, family offices, and internationally educated children who may need future flexibility in residence, business formation, or succession planning.',
                        ],
                    ],
                    [
                        'heading' => 'Legacy Planning for the Next Generation',
                        'body' => [
                            'Second citizenship can support education access, international expansion, and smoother inheritance planning across borders. It gives future generations more pathways rather than forcing them into a single legal or tax environment.',
                            'That matters most when families are planning over decades rather than reacting quarter by quarter. The value is not only in where you can go today, but in what choices your children can make later.',
                        ],
                    ],
                ],
                'highlights' => [
                    'Reduces concentration risk tied to a single jurisdiction',
                    'Improves optionality for travel, relocation, and business continuity',
                    'Supports generational planning, education access, and global expansion',
                ],
            ],
            [
                'slug' => 'top-citizenship-programs-investors-are-choosing-in-2026',
                'category' => 'Market',
                'title' => 'Top Citizenship Programs Investors Are Choosing in 2026',
                'excerpt' => 'Explore the citizenship and residency routes drawing the most attention from investors seeking speed, family inclusion, and strong international access.',
                'date' => 'March 22, 2026',
                'read_time' => '5 min read',
                'author' => 'Across Research Desk',
                'hero_image' => 'https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=80',
                'hero_alt' => 'International destination and mobility planning concept',
                'intro' => 'Investor demand in 2026 is increasingly focused on program certainty, practical mobility outcomes, and routes that balance family objectives with efficient processing timelines.',
                'sections' => [
                    [
                        'heading' => 'Speed Still Matters',
                        'body' => [
                            'Fast and predictable processing remains a major decision factor. Applicants are prioritizing jurisdictions where due diligence is clear, timelines are well managed, and supporting advisors understand the documentation path from start to finish.',
                        ],
                    ],
                    [
                        'heading' => 'Family Eligibility Is Driving Demand',
                        'body' => [
                            'Programs that accommodate spouses, children, and in some cases parents continue to outperform. Families want structures that solve mobility planning for the full household rather than just the principal applicant.',
                        ],
                    ],
                    [
                        'heading' => 'Investors Want Real Strategic Utility',
                        'body' => [
                            'The most attractive programs are those that combine reputable processing, strong visa-free access, and a credible long-term positioning story. Buyers are becoming more selective and less interested in headline marketing alone.',
                        ],
                    ],
                ],
                'highlights' => [
                    'Processing clarity remains a top selection factor',
                    'Family-inclusive structures continue to lead demand',
                    'Investors increasingly favor credible, utility-driven programs',
                ],
            ],
            [
                'slug' => 'navigating-new-residency-program-requirements',
                'category' => 'Legal',
                'title' => 'Navigating New Residency Program Requirements',
                'excerpt' => 'An overview of recent regulatory updates and what applicants should consider before entering a residency-by-investment process.',
                'date' => 'March 8, 2026',
                'read_time' => '4 min read',
                'author' => 'Across Legal Advisory',
                'hero_image' => 'https://images.unsplash.com/photo-1520607162513-77705c0f0d4a?auto=format&fit=crop&w=1600&q=80',
                'hero_alt' => 'Legal documents and residency planning',
                'intro' => 'Residency programs are evolving quickly, with governments tightening documentation, source-of-funds review, and compliance expectations. Preparation quality now has an even greater effect on timelines and outcomes.',
                'sections' => [
                    [
                        'heading' => 'Documentation Standards Are Rising',
                        'body' => [
                            'Applicants should expect more detailed requests around source of wealth, business history, and supporting legal documentation. Files that are clearly structured from the beginning tend to move more smoothly through review.',
                        ],
                    ],
                    [
                        'heading' => 'Program Fit Matters More Than Ever',
                        'body' => [
                            'Not every residency route fits every client profile. Selection should account for family composition, intended time on the ground, exit plans, and whether the residency is part of a broader citizenship pathway.',
                        ],
                    ],
                    [
                        'heading' => 'Advisory Quality Reduces Friction',
                        'body' => [
                            'Strong case preparation can prevent delays, inconsistent submissions, and avoidable re-requests from authorities. Clients benefit most when legal, investment, and administrative support are coordinated early.',
                        ],
                    ],
                ],
                'highlights' => [
                    'Compliance scrutiny is increasing across residency routes',
                    'Program selection should match the client’s actual objectives',
                    'Thorough preparation reduces delays and review friction',
                ],
            ],
        ];
    }

    private function newsPosts(): array
    {
        return [
            [
                'slug' => 'new-citizenship-program-in-the-caribbean-announced',
                'category' => 'Program Update',
                'title' => 'New Citizenship Program in the Caribbean Announced',
                'excerpt' => 'New regulations aim to enhance security while maintaining efficiency for investors seeking Caribbean mobility options.',
                'date' => 'April 5, 2026',
                'read_time' => '4 min read',
                'author' => 'Across News Desk',
                'hero_image' => 'https://lh3.googleusercontent.com/aida-public/AB6AXuB6Q4t0OY7EcibnfJpY-hVWVe-oyL8tRDl-nDR-FGcED1TEWvDeiJ20wBgeSwKmh5CV8UMGt3PKPeBcFQiCKT8ogUapz2Y_Gw3nsV3bzIEWnhGHT99pfobvwwaRDR0gOwFLWBAfNZDCBQQukpxAOW_if6QBs85YM5-LGAd1VYiQYfDzvuznOt1XkrX4wclIF6pukWkbGv2ELabGIzqAMNm7byqH5QCqo9sMz6S-_wNMLHXxI1q8dPR8Xlpj4_mXlUVwVe4pW_OTvCgu',
                'hero_alt' => 'Caribbean program announcement and market update',
                'intro' => 'A newly announced Caribbean citizenship route is attracting immediate attention from global investors and advisory firms. Authorities are positioning the framework as a balance between stronger compliance and a more efficient investor experience.',
                'sections' => [
                    [
                        'heading' => 'A Stronger Compliance Narrative',
                        'body' => [
                            'Officials have emphasized enhanced due diligence, clearer source-of-funds expectations, and a more structured review process. The goal is to improve international credibility while keeping the pathway commercially competitive.',
                            'For applicants, that means preparation quality will matter even more. Clean file assembly and clear supporting evidence are likely to shape both timing and outcome.',
                        ],
                    ],
                    [
                        'heading' => 'Why the Market Is Watching Closely',
                        'body' => [
                            'Caribbean programs remain highly relevant because they combine relatively fast timelines with practical travel benefits and family inclusion. Any new entrant immediately changes the decision matrix for both applicants and advisors.',
                            'The real test will be whether the program delivers consistency in practice, not just on launch materials. Early case handling and international reception will be critical indicators.',
                        ],
                    ],
                    [
                        'heading' => 'What Investors Should Do Next',
                        'body' => [
                            'Interested applicants should avoid rushing into submissions before eligibility, documentation demands, and long-term positioning are fully assessed. The best next step is comparative program review rather than reacting to the headline alone.',
                        ],
                    ],
                ],
                'highlights' => [
                    'Compliance standards appear stricter from day one',
                    'The program may reshape Caribbean comparisons for 2026 applicants',
                    'Early strategic review matters more than headline speed',
                ],
            ],
            [
                'slug' => 'european-residency-what-investors-need-to-know',
                'category' => 'Regulation',
                'title' => 'European Residency: What Investors Need to Know',
                'excerpt' => 'Recent updates to European residency programs are reshaping the landscape for international investors seeking flexibility and long-term optionality.',
                'date' => 'March 28, 2026',
                'read_time' => '5 min read',
                'author' => 'Across Legal Advisory',
                'hero_image' => 'https://lh3.googleusercontent.com/aida-public/AB6AXuDm0G0f01NliB31Vvq3JZOJFojeWGMOqRsDDDvkCH61pg4KFPe43Hlz0hTM7TE8HFvpHpHpV1-vd4YwG3kKeqYmEFBX6ix7GTXXLuKKUHp57y8yrFqCzFEinTnVk1Hzdq6mW8u6H-WIr2yOJk_05n89AAsi-bXJG5WH79MQyTR7PTxWSTqnl4NZIm4JopydNX7LbEHMgIYg21U_N2hyvP7KLu3pv8sLWC6ztNqvrCDGxNj5qEsYeJ9lS84yRMfxSzga39k_nCghuEra',
                'hero_alt' => 'European residency legal and investor update',
                'intro' => 'Residency planning across Europe continues to evolve as governments refine eligibility, investment thresholds, and presence requirements. For investors, the conversation is shifting from broad opportunity to highly selective route matching.',
                'sections' => [
                    [
                        'heading' => 'Policy Changes Are Narrowing the Field',
                        'body' => [
                            'Several European markets have adjusted or reduced popular residency pathways, especially in segments tied to residential property. These changes are pushing applicants toward more tailored strategies and earlier planning.',
                        ],
                    ],
                    [
                        'heading' => 'Physical Presence Is a Bigger Strategic Question',
                        'body' => [
                            'Investors should now look beyond entry approval and examine renewal conditions, tax exposure, and the practical realities of maintaining status. Some routes remain attractive only if the applicant can align with real on-the-ground obligations.',
                        ],
                    ],
                    [
                        'heading' => 'Route Selection Should Be Objective-Led',
                        'body' => [
                            'Whether the goal is relocation, travel flexibility, family planning, or a pathway to citizenship, the right program depends on the client’s actual priorities. Speed alone is no longer enough to justify a recommendation.',
                        ],
                    ],
                ],
                'highlights' => [
                    'Policy shifts are reducing one-size-fits-all options',
                    'Renewal and presence rules now carry more weight',
                    'Program choice should follow the client objective, not the trend',
                ],
            ],
            [
                'slug' => 'wealth-management-and-global-mobility-trends',
                'category' => 'Market',
                'title' => 'Wealth Management & Global Mobility Trends',
                'excerpt' => 'Citizenship diversification is becoming a core component of modern wealth planning for internationally exposed families.',
                'date' => 'March 12, 2026',
                'read_time' => '4 min read',
                'author' => 'Across Strategy Desk',
                'hero_image' => 'https://lh3.googleusercontent.com/aida-public/AB6AXuDgeOK8ryUF0df54khvlurnRBrPZ1F2IauvyriP9W8yfyyq_unz_C7eJDriYuB9ZgO-7VmxBi_4Tabop80E6OThGBUz7BII-suSX0mDy9Wqi4NHbhIjJOc1GNx7QY3rzaIvOMr3vHAR2mmSw0-hfNAt1ZeX_8XxWGii-i4pXWZ5WauvZgTiEwe0gvPJCYQS_2fiRBfRb0RxofDlx3J9S8ASdlwxnM01Dv9J6TED80jrC3sKxC3bUnAt8_zGm8TKHRKGZ6iQKqI1hNOo',
                'hero_alt' => 'Wealth management and mobility planning concept',
                'intro' => 'Advisors in private wealth, tax structuring, and family office strategy are increasingly treating mobility planning as part of the same conversation as diversification and continuity. Clients are asking not only where to invest, but where they can operate safely and flexibly over time.',
                'sections' => [
                    [
                        'heading' => 'Mobility Has Moved Into the Core Advisory Mix',
                        'body' => [
                            'Families with international businesses, distributed assets, or cross-border heirs now view citizenship and residency solutions as practical planning tools. These decisions are being integrated earlier in the advisory cycle rather than added later as a lifestyle consideration.',
                        ],
                    ],
                    [
                        'heading' => 'Jurisdictional Risk Is More Visible',
                        'body' => [
                            'Banking access, tax change risk, regional instability, and travel disruption have made single-jurisdiction dependency more uncomfortable for many clients. Mobility planning helps reduce concentration at the legal and personal level.',
                        ],
                    ],
                    [
                        'heading' => 'Execution Quality Still Determines Value',
                        'body' => [
                            'Even when the strategy is sound, poor execution can create delays or reputational concerns. The strongest outcomes come from coordinated planning across legal, compliance, and investment workstreams.',
                        ],
                    ],
                ],
                'highlights' => [
                    'Mobility planning is becoming part of mainstream wealth strategy',
                    'Cross-border clients are more sensitive to jurisdictional concentration risk',
                    'Integrated execution remains the difference-maker',
                ],
            ],
        ];
    }

    public function index()
    {
        return view('front.index');
    }

    public function about()
    {
        return view('front.about');
    }

    public function contact()
    {
        return view('front.contact');
    }

    public function services()
    {
        return view('front.services');
    }

    public function singleService()
    {
        return view('front.single-service');
    }

    public function faq()
    {
        return view('front.faq');
    }

    public function programs()
    {
        return view('front.programs');
    }

    public function program($slug)
    {
        // For now, just return a view with the slug
        return view('front.program', compact('slug'));
    }

    public function insights()
    {
        return view('front.insights');
    }

    public function blog()
    {
        return view('front.blog', [
            'posts' => $this->blogPosts(),
        ]);
    }

    public function singleBlog($slug)
    {
        $posts = $this->blogPosts();
        $post = collect($posts)->firstWhere('slug', $slug);

        abort_unless($post, 404);

        $relatedPosts = collect($posts)
            ->reject(fn ($item) => $item['slug'] === $slug)
            ->take(2)
            ->values()
            ->all();

        return view('front.single-blog', [
            'post' => $post,
            'relatedPosts' => $relatedPosts,
        ]);
    }

    public function news()
    {
        return view('front.news', [
            'posts' => $this->newsPosts(),
        ]);
    }

    public function singleNews($slug)
    {
        $posts = $this->newsPosts();
        $post = collect($posts)->firstWhere('slug', $slug);

        abort_unless($post, 404);

        $relatedPosts = collect($posts)
            ->reject(fn ($item) => $item['slug'] === $slug)
            ->take(2)
            ->values()
            ->all();

        return view('front.single-news', [
            'post' => $post,
            'relatedPosts' => $relatedPosts,
        ]);
    }

    public function downloadCenter()
    {
        return view('front.download-center');
    }

    public function events()
    {
        return view('front.events');
    }

    public function event($slug)
    {
        // For now, just return a view with the slug
        return view('front.event', compact('slug'));
    }
}
