<?php
// Galatians Bible Study

$galatiansBibleStudy = [
    "title" => "Bible Study on Galatians",
    
    "background_context" => [
        "author" => "Paul the Apostle",
        "recipients" => "Churches in Galatia (region in modern-day Turkey)",
        "purpose" => [
            "Address the influence of Judaizers (teachers insisting Gentile believers follow the Mosaic Law, especially circumcision)",
            "Reaffirm the truth of the gospel: salvation by faith in Jesus Christ, not by works of the Law"
        ],
        "key_theme" => "Freedom in Christ vs. bondage to the Law",
        "discussion_starter" => "Why do you think some people try to mix works with faith for salvation? How do you see this happening today?"
    ],
    
    "structure_main_points" => [
        [
            "section" => "Introduction & Defense of Apostleship (Galatians 1:1–10)",
            "summary" => "Paul asserts his authority and defends the gospel he preaches.",
            "key_verse" => "Galatians 1:6–7 – 'I am astonished that you are so quickly deserting the one who called you…'",
            "discussion" => "Why is the gospel so easily distorted? What does this tell us about spiritual vigilance?"
        ],
        [
            "section" => "Paul’s Personal Testimony (Galatians 1:11–2:21)",
            "summary" => "Paul recounts his conversion and calling. Shows that the gospel comes directly from Christ, not human authority.",
            "key_verse" => "Galatians 2:20 – 'I have been crucified with Christ… the life I now live in the flesh I live by faith in the Son of God.'",
            "discussion" => "How does Paul’s personal example strengthen his argument?"
        ],
        [
            "section" => "Justification by Faith, Not Works (Galatians 3:1–4:31)",
            "summary" => "Faith in Christ fulfills the promise of Abraham; the Law was temporary. The Law reveals sin but cannot save.",
            "key_verse" => "Galatians 3:11 – 'The righteous will live by faith.'",
            "discussion" => "How does faith free us from trying to earn God’s favor?"
        ],
        [
            "section" => "Freedom in Christ & Living by the Spirit (Galatians 5:1–6:10)",
            "summary" => "Freedom = responsibility to love and serve, not indulge the flesh. The fruit of the Spirit vs. works of the flesh.",
            "key_verse" => "Galatians 5:13 – 'For you were called to freedom, brothers. Only do not use your freedom as an opportunity for the flesh, but through love serve one another.'",
            "discussion" => "How can we live in freedom without falling into selfishness?"
        ],
        [
            "section" => "Conclusion & Final Instructions (Galatians 6:11–18)",
            "summary" => "Emphasis on boasting in the cross, not human effort. Reminder of God’s grace and mercy.",
            "key_verse" => "Galatians 6:14 – 'May I never boast except in the cross of our Lord Jesus Christ…'",
            "discussion" => "What does 'boasting in the cross' mean practically in our daily lives?"
        ]
    ],
    
    "key_themes" => [
        "Freedom vs. Bondage" => "Freedom in Christ is real but requires spiritual maturity to handle.",
        "Faith vs. Works" => "Salvation is by faith alone. Works flow from faith, not the other way around.",
        "Spirit-led Life" => "Living by the Spirit produces love, joy, peace, patience, and all other fruit.",
        "Unity in Christ" => "Jew and Gentile, old law and new covenant – all are one in Christ."
    ],
    
    "practical_application" => [
        "Identify areas in your life where you rely on your own efforts rather than faith.",
        "Reflect on your freedom in Christ: how can it be used to serve others?",
        "Examine the fruit of the Spirit in your life. Which areas need growth?",
        "Avoid spiritual 'shortcuts' or legalism, even if they seem easier or more impressive."
    ],
    
    "group_discussion_questions" => [
        "Why do you think Paul was so passionate about defending the gospel?",
        "How can we discern truth from distortion in today’s teachings?",
        "How do we balance freedom in Christ with living responsibly?",
        "What does living by faith look like in your personal daily life?",
        "Which fruit of the Spirit do you find hardest to cultivate? Why?"
    ]
];

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?php echo $galatiansBibleStudy['title']; ?></title>
    <style>
        body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; max-width: 900px; }
        h1, h2, h3 { color: #2c3e50; }
        ul { margin-bottom: 20px; }
        li { margin-bottom: 10px; }
        .section { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #ccc; }
        .key-verse { font-style: italic; color: #34495e; }
    </style>
</head>
<body>

<h1><?php echo $galatiansBibleStudy['title']; ?></h1>

<h2>1. Background & Context</h2>
<p><strong>Author:</strong> <?php echo $galatiansBibleStudy['background_context']['author']; ?></p>
<p><strong>Recipients:</strong> <?php echo $galatiansBibleStudy['background_context']['recipients']; ?></p>
<p><strong>Purpose:</strong></p>
<ul>
    <?php foreach ($galatiansBibleStudy['background_context']['purpose'] as $purpose) {
        echo "<li>$purpose</li>";
    } ?>
</ul>
<p><strong>Key Theme:</strong> <?php echo $galatiansBibleStudy['background_context']['key_theme']; ?></p>
<p><strong>Discussion Starter:</strong> <?php echo $galatiansBibleStudy['background_context']['discussion_starter']; ?></p>

<h2>2. Structure & Main Points</h2>
<?php foreach ($galatiansBibleStudy['structure_main_points'] as $point) { ?>
    <div class="section">
        <h3><?php echo $point['section']; ?></h3>
        <p><?php echo $point['summary']; ?></p>
        <p class="key-verse">Key Verse: <?php echo $point['key_verse']; ?></p>
        <p><strong>Discussion:</strong> <?php echo $point['discussion']; ?></p>
    </div>
<?php } ?>

<h2>3. Key Themes</h2>
<ul>
<?php foreach ($galatiansBibleStudy['key_themes'] as $theme => $description) {
    echo "<li><strong>$theme:</strong> $description</li>";
} ?>
</ul>

<h2>4. Practical Application</h2>
<ul>
<?php foreach ($galatiansBibleStudy['practical_application'] as $action) {
    echo "<li>$action</li>";
} ?>
</ul>

<h2>5. Group Discussion Questions</h2>
<ul>
<?php foreach ($galatiansBibleStudy['group_discussion_questions'] as $question) {
    echo "<li>$question</li>";
} ?>
</ul>



<br><br><br><br><br><br>
</body>
</html>
