import os

# Let's read header from index.html / ministries.html, and assemble each page cleanly
with open('ministries.html', 'r', encoding='utf-8') as f:
    min_content = f.read()

# Extract the standard footer from ministries.html
footer_start = min_content.find('<footer')
footer_end = min_content.find('</html>') + len('</html>')
standard_footer = min_content[footer_start:footer_end]

def rebuild_page(filename, title, hero_badge, hero_title, main_content_inner):
    with open('ministries.html', 'r', encoding='utf-8') as f:
        m = f.read()

    # Get head and header up to <main id="main-content"
    main_start = m.find('<main id="main-content"')
    head_and_header = m[:main_start]

    # Adjust title
    head_and_header = head_and_header.replace('<title>Our Ministries | Franciscan Society TOR - Ranchi Province</title>', f'<title>{title} | Franciscan Society TOR - Ranchi Province</title>')
    head_and_header = head_and_header.replace('<title>Ministries - Franciscan Society</title>', f'<title>{title} | Franciscan Society TOR - Ranchi Province</title>')

    full_page = f"""{head_and_header}<main id="main-content" style="padding-top: 0; background-color: #FFFFFF;">
    <!-- Page Hero -->
    <section style="padding: 11rem 2rem 7rem 2rem; background-image: url('assets/images/new_uploads/ChatGPT_Image_Aug_18_2026_05_51_30_PM.png'); background-size: cover; background-position: center; position: relative; overflow: hidden;">
        <div style="position: absolute; inset: 0; background-color: rgba(12, 11, 10, 0.74);"></div>
        <div style="max-width: 900px; margin: 0 auto; position: relative; z-index: 2; text-align: center;">
            <div style="display: inline-flex; align-items: center; gap: 0.6rem; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); padding: 0.5rem 1.2rem; border-radius: 50px; margin-bottom: 1.5rem; border: 1px solid rgba(255,255,255,0.2);">
                <span style="width: 8px; height: 8px; background-color: #e6c888; border-radius: 50%; display: inline-block;"></span>
                <span style="color: #ffffff; font-size: 0.85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-family: 'Instrument Sans', sans-serif;">{hero_badge}</span>
            </div>
            <h1 style="font-family: 'Phudu', sans-serif; font-size: clamp(2.8rem, 5.2vw, 4.4rem); font-weight: 700; color: #ffffff; text-transform: uppercase; margin: 0; letter-spacing: -0.01em;">{hero_title}</h1>
        </div>
    </section>

{main_content_inner}
</main>

{standard_footer}"""

    with open(filename, 'w', encoding='utf-8') as f:
        f.write(full_page)
    print(f"Rebuilt {filename} with pristine structure!")

# 1. Pastoral Ministry
pastoral_inner = """    <!-- Main Content: 2-Section Paragraph UI with Images -->
    <section style="padding: clamp(3.5rem, 6vw, 6rem) 0; background: #FFFFFF; color: #1c1917;">
        <div style="max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem);">
            
            <!-- Section 1 -->
            <div style="display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; margin-bottom: clamp(3.5rem, 6vw, 5.5rem);" class="responsive-ministry-grid">
                <div>
                    <div style="display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;">
                        <span style="width: 6px; height: 6px; background-color: #4A2A18; border-radius: 50%;"></span>
                        <span style="color: #4A2A18; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-family: 'Instrument Sans', sans-serif;">OUR MINISTRIES</span>
                    </div>
                    <h2 style="font-family: 'Phudu', sans-serif; font-size: clamp(1.8rem, 2.8vw, 2.3rem); font-weight: 700; color: #1c1917; text-transform: uppercase; line-height: 1.25; margin: 0 0 1.5rem 0;">
                        Pastoral Ministry
                    </h2>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                        St. Francis gathered brothers around him to become heralds of the Good News. Inspired by this vision, the TOR Franciscans of the Province actively engage in pastoral ministry in parishes. Through this vital service to the Church, the friars dedicate themselves wholeheartedly to the mission of evangelization by their pastoral presence and ministry.
                    </p>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin: 0;">
                        Through their participation in the life and mission of the Church, the friars seek to continue the zeal of St. Francis by inviting the faithful to an ongoing conversion to Gospel values. Their ministry extends beyond the celebration of the sacraments to a compassionate and attentive presence among the people. Through family visits, care for the sick and the elderly, pastoral counseling, and sacramental ministry, they strive to plant the seeds of the Gospel in the hearts of those they serve.
                    </p>
                </div>

                <div style="border-radius: 20px; overflow: hidden; box-shadow: 0 15px 40px rgba(74,42,24,0.12); border: 2px solid rgba(230,200,136,0.3); background: #FAF7F0;">
                    <img loading="lazy" decoding="async" src="assets/images/gallery/WhatsApp Image 2026-08-07 at 1.39.44 PM.jpeg" alt="Pastoral Ministry in Parishes" style="width: 100%; height: 460px; object-fit: cover; display: block; transition: transform 0.5s ease;" onmouseover="this.style.transform='scale(1.03)'" onmouseout="this.style.transform='scale(1)'">
                </div>
            </div>

            <!-- Section 2 -->
            <div style="display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center;" class="responsive-ministry-grid">
                <div style="border-radius: 20px; overflow: hidden; box-shadow: 0 15px 40px rgba(74,42,24,0.12); border: 2px solid rgba(230,200,136,0.3); background: #FAF7F0;">
                    <img loading="lazy" decoding="async" src="assets/images/gallery/WhatsApp Image 2026-08-10 at 2.17.24 PM.jpeg" alt="Pastoral Presence in Communities" style="width: 100%; height: 460px; object-fit: cover; display: block; transition: transform 0.5s ease;" onmouseover="this.style.transform='scale(1.03)'" onmouseout="this.style.transform='scale(1)'">
                </div>

                <div>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                        Faithful to the Franciscan spirit of fraternity and service, the friars make themselves available to all, listening to people’s joys and struggles and responding with compassion and care. In this way, they seek not only to proclaim the Gospel but also to witness it through lives of humble service, bringing Christ’s love and hope to the communities entrusted to their care.
                    </p>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin: 0;">
                        The TOR Franciscans of St. Francis Province, Ranchi, currently serve in various dioceses and parishes both in India and abroad. In India, they minister in fifteen parishes across the dioceses of Ranchi, Khunti, Simdega, Gumla, Rourkela, Purnea, Bagdogra, Jalpaiguri, and Bongaigaon, particularly in areas where a Franciscan presence is most needed. Beyond India, the friars are actively engaged in pastoral ministry in the Archdiocese of Freiburg, Germany.
                    </p>
                </div>
            </div>

        </div>
    </section>

    <style>
        @media (max-width: 900px) {
            .responsive-ministry-grid {
                grid-template-columns: 1fr !important;
                gap: 2rem !important;
            }
            .responsive-ministry-grid:nth-child(2) > div:first-child {
                order: 2 !important;
            }
            .responsive-ministry-grid:nth-child(2) > div:last-child {
                order: 1 !important;
            }
        }
    </style>"""

# 2. Formation Ministry
formation_inner = """    <!-- Main Content: 2-Section Paragraph UI with Images -->
    <section style="padding: clamp(3.5rem, 6vw, 6rem) 0; background: #FFFFFF; color: #1c1917;">
        <div style="max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem);">
            
            <!-- Section 1 -->
            <div style="display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; margin-bottom: clamp(3.5rem, 6vw, 5.5rem);" class="responsive-ministry-grid">
                <div>
                    <div style="display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;">
                        <span style="width: 6px; height: 6px; background-color: #4A2A18; border-radius: 50%;"></span>
                        <span style="color: #4A2A18; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-family: 'Instrument Sans', sans-serif;">OUR MINISTRIES</span>
                    </div>
                    <h2 style="font-family: 'Phudu', sans-serif; font-size: clamp(1.8rem, 2.8vw, 2.3rem); font-weight: 700; color: #1c1917; text-transform: uppercase; line-height: 1.25; margin: 0 0 1.5rem 0;">
                        Formation Ministry
                    </h2>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin: 0;">
                        Formation is the foundational ministry through which the Franciscan TOR charism and spirituality are creatively and faithfully proposed to and shared with successive generations. In accordance with the mind of the Church and the Order, our primary objective is to prepare candidates for the total consecration of themselves to God in the following of Christ, at the service of the Church’s mission. As Pope John Paul II emphasizes in Vita Consecrata, formation is a dynamic, lifelong process that leads to ongoing conversion and helps individuals discover the signs of God in earthly realities. For this formation to be truly complete, it must be holistic—encompassing and integrating every aspect of Christian life. Ultimately, it is a sacred sharing in the work of the Father who, through the Spirit, fashions the inner attitudes of the Son in the hearts of young men.
                    </p>
                </div>

                <div style="border-radius: 20px; overflow: hidden; box-shadow: 0 15px 40px rgba(74,42,24,0.12); border: 2px solid rgba(230,200,136,0.3); background: #FAF7F0;">
                    <img loading="lazy" decoding="async" src="assets/images/gallery/WhatsApp Image 2025-09-17 at 11.30.25 AM (1).jpeg" alt="Franciscan Formation Ministry" style="width: 100%; height: 460px; object-fit: cover; display: block; transition: transform 0.5s ease;" onmouseover="this.style.transform='scale(1.03)'" onmouseout="this.style.transform='scale(1)'">
                </div>
            </div>

            <!-- Section 2 -->
            <div style="display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center;" class="responsive-ministry-grid">
                <div style="border-radius: 20px; overflow: hidden; box-shadow: 0 15px 40px rgba(74,42,24,0.12); border: 2px solid rgba(230,200,136,0.3); background: #FAF7F0;">
                    <img loading="lazy" decoding="async" src="assets/images/gallery/WhatsApp Image 2025-09-10 at 4.28.51 AM.jpeg" alt="Formation Centres in Ranchi Province" style="width: 100%; height: 460px; object-fit: cover; display: block; transition: transform 0.5s ease;" onmouseover="this.style.transform='scale(1.03)'" onmouseout="this.style.transform='scale(1)'">
                </div>

                <div>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin: 0;">
                        By placing formation at the very heart of its life and mission, the TOR St. Francis Province, Ranchi, strives to form committed, mature, and joyful Franciscan religious who are fully consecrated to God and dedicated to the service of the Church and society in the spirit of St. Francis. This vision is nurtured through a well-structured network of formation centres: two Minor Seminaries located in Dorma, Khunti, Jharkhand and in Ranchi, Jharkhand; the Novitiate House in Bichna, Khunti, Jharkhand; and the Clericate at Purulia Road, Ranchi.
                    </p>
                </div>
            </div>

        </div>
    </section>

    <style>
        @media (max-width: 900px) {
            .responsive-ministry-grid {
                grid-template-columns: 1fr !important;
                gap: 2rem !important;
            }
            .responsive-ministry-grid:nth-child(2) > div:first-child {
                order: 2 !important;
            }
            .responsive-ministry-grid:nth-child(2) > div:last-child {
                order: 1 !important;
            }
        }
    </style>"""

# 3. Education Ministry
education_inner = """    <!-- Main Content: 2-Section Paragraph UI with Images -->
    <section style="padding: clamp(3.5rem, 6vw, 6rem) 0; background: #FFFFFF; color: #1c1917;">
        <div style="max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem);">
            
            <!-- Section 1 -->
            <div style="display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; margin-bottom: clamp(3.5rem, 6vw, 5.5rem);" class="responsive-ministry-grid">
                <div>
                    <div style="display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;">
                        <span style="width: 6px; height: 6px; background-color: #4A2A18; border-radius: 50%;"></span>
                        <span style="color: #4A2A18; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-family: 'Instrument Sans', sans-serif;">OUR MINISTRIES</span>
                    </div>
                    <h2 style="font-family: 'Phudu', sans-serif; font-size: clamp(1.8rem, 2.8vw, 2.3rem); font-weight: 700; color: #1c1917; text-transform: uppercase; line-height: 1.25; margin: 0 0 1.5rem 0;">
                        Education Ministry
                    </h2>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                        Education is one of the principal ministries of St. Francis Province, Ranchi. Inspired by the vision of St. Francis of Assisi and the educational mission of the Catholic Church, the Province is committed to forming young people who are intellectually competent, morally upright, spiritually grounded, and socially responsible.
                    </p>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                        Guided by the motto, “Peace and Joy to the World,” the Province’s educational ministry seeks to promote God’s love among all people and foster the values of equality, justice, peace, and human dignity, irrespective of caste, creed, religion, language, or social status. Through its educational institutions, the Province strives to contribute to the creation of a more just, compassionate, and harmonious society.
                    </p>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin: 0;">
                        The primary objective of the Province’s educational ministry is the holistic formation of the human person. To achieve this goal, its schools provide a balanced education that nurtures the moral, intellectual, physical, emotional, and spiritual dimensions of students’ lives. By helping young people discover and develop their God-given talents, the institutions prepare them to face the challenges of life with confidence, integrity, and a sense of responsibility toward society.
                    </p>
                </div>

                <div style="border-radius: 20px; overflow: hidden; box-shadow: 0 15px 40px rgba(74,42,24,0.12); border: 2px solid rgba(230,200,136,0.3); background: #FAF7F0;">
                    <img loading="lazy" decoding="async" src="assets/images/gallery/WhatsApp Image 2026-08-07 at 8.39.44 AM (1).jpeg" alt="Students in Franciscan Schools" style="width: 100%; height: 500px; object-fit: cover; display: block; transition: transform 0.5s ease;" onmouseover="this.style.transform='scale(1.03)'" onmouseout="this.style.transform='scale(1)'">
                </div>
            </div>

            <!-- Section 2 -->
            <div style="display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center;" class="responsive-ministry-grid">
                <div style="border-radius: 20px; overflow: hidden; box-shadow: 0 15px 40px rgba(74,42,24,0.12); border: 2px solid rgba(230,200,136,0.3); background: #FAF7F0;">
                    <img loading="lazy" decoding="async" src="assets/images/gallery/WhatsApp Image 2026-08-07 at 8.42.19 AM (4).jpeg" alt="Franciscan Educational Institutions" style="width: 100%; height: 500px; object-fit: cover; display: block; transition: transform 0.5s ease;" onmouseover="this.style.transform='scale(1.03)'" onmouseout="this.style.transform='scale(1)'">
                </div>

                <div>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                        To carry out this mission, the Province operates a network of educational institutions across Jharkhand, Bihar, and West Bengal, serving approximately 20,000 students. Our academic framework is diverse, operating five Hindi-medium high schools and eleven middle schools affiliated with their respective state education boards, alongside six English-medium schools—four of which are affiliated with the CISCE, one with the CBSE, and one currently awaiting affiliation.
                    </p>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                        These institutions are staffed by dedicated and qualified priests, religious sisters, and lay teachers who work together to provide quality education in both English and regional languages. Open to students of all faiths, communities, and social backgrounds, the schools reflect the inclusive spirit of the Gospel and the Franciscan tradition of service.
                    </p>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin: 0;">
                        While they have a special responsibility toward the Christian community, the Province’s schools remain firmly committed to serving the wider society. Through academic excellence, value-based education, and the promotion of human dignity, they continue to make a meaningful contribution to the educational and social development of the nation.
                    </p>
                </div>
            </div>

        </div>
    </section>

    <style>
        @media (max-width: 900px) {
            .responsive-ministry-grid {
                grid-template-columns: 1fr !important;
                gap: 2rem !important;
            }
            .responsive-ministry-grid:nth-child(2) > div:first-child {
                order: 2 !important;
            }
            .responsive-ministry-grid:nth-child(2) > div:last-child {
                order: 1 !important;
            }
        }
    </style>"""

# 4. Our History
history_inner = """    <!-- Hero Banner Card with Vine Watermark -->
    <section class="page-hero" style="position: relative; background-color: #FFFFFF; padding: 3rem 2rem 0 2rem; box-sizing: border-box;">
        <div class="has-vine-watermark" style="position: relative; width: 100%; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box; background: linear-gradient(135deg, #4A2A18 0%, #6b3d28 100%); min-height: 320px; border-radius: 24px; padding: clamp(3rem, 5vw, 4rem) clamp(2rem, 5vw, 3.5rem); max-width: 1400px; margin: 0 auto; overflow: hidden; box-shadow: 0 15px 35px rgba(74,42,24,0.18);">
            <img src="assets/images/shapes/vine-corner-watermark.png" class="vine-corner-watermark" alt="" aria-hidden="true" style="opacity: 0.38; filter: brightness(1.6) contrast(1.1);">
            <div style="position: relative; z-index: 2;">
                <div style="display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1.2rem;">
                    <span style="width: 6px; height: 6px; background-color: #e6c888; border-radius: 50%; display: inline-block;"></span>
                    <span style="color: #ffffff; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-family: 'Instrument Sans', sans-serif;">OUR HERITAGE</span>
                </div>
                <h2 style="font-family: 'Phudu', sans-serif; font-size: clamp(2.2rem, 3.8vw, 48px); font-weight: 600; color: #ffffff; text-transform: uppercase; line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 1.2rem; max-width: 800px;">
                    A LEGACY OF FAITH AND SERVICE
                </h2>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.1rem; font-weight: 400; color: rgba(255, 255, 255, 0.9); line-height: 1.7; max-width: 650px; margin: 0;">
                    Tracing our origins from the ancient 4th-century Order of Penance, to St. Francis of Assisi, to thirty years of dedicated growth in Ranchi Province.
                </p>
            </div>
        </div>
    </section>

    <!-- Structured Historical Narrative -->
    <section style="padding: clamp(3.5rem, 6vw, 6rem) 0; background: #FFFFFF; color: #1c1917;">
        <div style="max-width: 1140px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem);">

            <!-- Era 1: Ancient Roots & St. Francis -->
            <div style="background: #FAF7F0; border-radius: 24px; padding: clamp(2rem, 5vw, 3.5rem); border: 1px solid rgba(74,42,24,0.08); margin-bottom: 3rem;">
                <div style="display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;">
                    <span style="width: 6px; height: 6px; background-color: #4A2A18; border-radius: 50%;"></span>
                    <span style="color: #4A2A18; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-family: 'Instrument Sans', sans-serif;">ORIGINS &amp; ROOTS</span>
                </div>
                <h3 style="font-family: 'Phudu', sans-serif; font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; color: #1c1917; text-transform: uppercase; margin: 0 0 1.5rem 0;">
                    The Order of Penance &amp; St. Francis of Assisi
                </h3>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                    The Third Order Regular (TOR) of St. Francis traces its origins to the ancient Order of Penance, which dates back to the fourth century AD. Men and women voluntarily embraced lives of penance for the sake of the Kingdom of God and their own spiritual growth. Some penitents were married and lived with their families, while others chose the life of hermits or formed communities dedicated to the service of the Church.
                </p>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                    During his early conversion experience, St. Francis of Assisi (1181–1226) became associated with the Order of Penance, an itinerant movement known as the Penitents of Assisi. He addressed them through an Exhortation, encouraging them to lead holy lives of penance. It is within this movement that the Third Order Regular of St. Francis finds its roots. The penitents received a way of life from St. Francis around 1209–1210, and their Rule was formally approved by the Church through <em>Supra Montem</em>, promulgated by Pope Nicholas IV in 1289.
                </p>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin: 0;">
                    Among the early Franciscan penitents were both Seculars (Third Order Seculars), who continued to live with their families, and Regulars, who lived according to a <em>regula</em> (rule of life). The Regulars embraced religious life characterized by the profession of vows, observance of the Third Order Rule, and communal living in hermitages or communities devoted to works of mercy. The practice of professing the vows of poverty, chastity, and obedience received papal approval in 1321 through Pope John XXII’s letter <em>Altissimo in Divinis</em>.
                </p>
            </div>

            <!-- Era 2: Papal Unification & Generalate -->
            <div style="display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; margin-bottom: 3rem;" class="responsive-ministry-grid">
                <div>
                    <div style="display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;">
                        <span style="width: 6px; height: 6px; background-color: #4A2A18; border-radius: 50%;"></span>
                        <span style="color: #4A2A18; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-family: 'Instrument Sans', sans-serif;">PAPAL CONFIRMATION</span>
                    </div>
                    <h3 style="font-family: 'Phudu', sans-serif; font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; color: #1c1917; text-transform: uppercase; margin: 0 0 1.5rem 0;">
                        Unification &amp; The Generalate in Rome
                    </h3>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                        In 1447, Pope Nicholas V, through the bull <em>Pastoralis Officii</em>, united approximately sixty communities of male Franciscan tertiaries in Italy under a single Minister General. This marked the formal beginning of the Third Order Regular of St. Francis. In 1512, the Order established its headquarters at the Basilica of Saints Cosmas and Damian in Rome, where its Generalate remains to this day.
                    </p>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin: 0;">
                        The Third Order Regular received a revised Rule from Pope Pius XI in 1927 through the document <em>Rerum Conditio</em>. This Rule was renewed on 8 December 1982 by Pope John Paul II through the apostolic letter <em>Franciscanum Vitae Propositum</em>, becoming the Rule and Life of nearly four hundred Franciscan Third Order congregations of men and women throughout the world.
                    </p>
                </div>
                <div style="border-radius: 20px; overflow: hidden; box-shadow: 0 15px 35px rgba(74,42,24,0.12); border: 2px solid rgba(230,200,136,0.3); background: #FAF7F0;">
                    <img loading="lazy" decoding="async" src="assets/images/new_uploads/ChatGPT_Image_Aug_18_2026_05_24_08_PM.png" alt="Franciscan Heritage" style="width: 100%; height: 420px; object-fit: cover; display: block;">
                </div>
            </div>

            <!-- Franciscan Identity Highlight Box -->
            <div style="background: linear-gradient(135deg, #FAF7F0, #f2ece1); border-left: 5px solid #4A2A18; border-radius: 16px; padding: 2.2rem 2.5rem; margin-bottom: 3rem; box-shadow: 0 8px 25px rgba(74,42,24,0.05);">
                <h4 style="font-family: 'Phudu', sans-serif; font-size: 1.3rem; font-weight: 700; color: #4A2A18; text-transform: uppercase; margin: 0 0 0.8rem 0;">
                    Franciscan Identity &amp; Global Presence
                </h4>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1rem;">
                    Conversion, contemplation, poverty, and humility lie at the heart of Franciscan identity. The fundamental charism of the Third Order Regular, however, is penance, understood as ongoing conversion. This involves turning to God in love, reconciliation with Him, harmony with oneself, and charity toward one’s neighbour.
                </p>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.02rem; color: #57534e; line-height: 1.85; margin: 0;">
                    Today, the Order comprises three provinces in India; two provinces each in Italy and the United States; one province each in Sri Lanka, Spain and Croatia; vice provinces in South Africa, Brazil, Paraguay, and Mexico; delegations in the Philippines, France, Sweden, and Bangladesh; and a commissariat of the Spanish Province in Peru.
                </p>
            </div>

            <!-- Era 3: History in India and Ranchi Province -->
            <div style="background: #FAF7F0; border-radius: 24px; padding: clamp(2rem, 5vw, 3.5rem); border: 1px solid rgba(74,42,24,0.08); margin-bottom: 4rem;">
                <div style="display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;">
                    <span style="width: 6px; height: 6px; background-color: #4A2A18; border-radius: 50%;"></span>
                    <span style="color: #4A2A18; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-family: 'Instrument Sans', sans-serif;">THE INDIAN MISSION</span>
                </div>
                <h3 style="font-family: 'Phudu', sans-serif; font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; color: #1c1917; text-transform: uppercase; margin: 0 0 1.5rem 0;">
                    The History of the TOR in India &amp; Ranchi Province
                </h3>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                    The history of the TOR in India began in 1938 when missionaries from the Province of the Sacred Heart of Jesus, USA, arrived in Bhagalpur, Bihar. The mission steadily grew and was established as a Commissariat in 1945. In 1971, it was elevated to the status of a Province under the title Province of St. Thomas the Apostle.
                </p>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                    In 1996, the Commissariat of St. Francis was established at Ranchi. On 4 October 1999, the Most Rev. Bonaventure Midili, TOR, Minister General, elevated it to the status of a Vice Province. The Vice Province of St. Francis was formally inaugurated by him in Ranchi on 8 December 1999.
                </p>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                    Recognizing the remarkable growth and expansion of the Vice Province between 1999 and 2005, as well as the strategic importance of India for the future of the Order, the Most Rev. Ilija Živković, TOR, Minister General, elevated it to a full-fledged Province on 20 March 2006. The ceremony took place in Ranchi during a Eucharistic celebration presided over by the Most Rev. Dr. Vincent Barwa, Auxiliary Bishop of Ranchi.
                </p>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin-bottom: 1.25rem;">
                    The Province presently has 104 professed friars, including 84 solemnly professed and 19 temporarily professed members. Among them are 71 priests and 3 brothers. The Province has 28 major seminarians, 4 novices, 9 pre-novices, and 36 candidates.
                </p>
                <p style="font-family: 'Instrument Sans', sans-serif; font-size: 1.05rem; color: #57534e; line-height: 1.85; margin: 0;">
                    The Province maintains four houses in the Archdiocese of Ranchi, four in Khunti, three in Simdega, two in Rourkela, two in Jalpaiguri, and one each in the dioceses of Bagdogra, Gumla, Purnea, and Bongaigaon. The friars serve the People of God through ministry in 14 parishes and 22 schools. Two friars are currently engaged in ministry abroad. The Province has three formation houses: one in Ranchi, one in Dorma, and one in Bichna.
                </p>
            </div>

            <!-- General Council Section -->
            <div style="text-align: center; margin-bottom: 2.5rem;">
                <div style="display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem;">
                    <span style="width: 6px; height: 6px; background-color: #4A2A18; border-radius: 50%;"></span>
                    <span style="color: #4A2A18; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; font-family: 'Instrument Sans', sans-serif;">LEADERSHIP &amp; GOVERNANCE</span>
                </div>
                <h2 style="font-family: 'Phudu', sans-serif; font-size: clamp(2rem, 3vw, 2.5rem); font-weight: 700; color: #1c1917; text-transform: uppercase;">GENERAL COUNCIL</h2>
            </div>
            
            <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem;">
                <!-- Member 1 -->
                <div style="text-align: center; background: #FAF7F0; padding: 2rem 1.2rem; border-radius: 20px; border: 1px solid rgba(74,42,24,0.06);">
                    <div style="width: 130px; height: 130px; border-radius: 50%; overflow: hidden; margin: 0 auto 1.2rem auto; box-shadow: 0 10px 25px rgba(74,42,24,0.12); border: 2px solid #e6c888;">
                        <img loading="lazy" decoding="async" src="assets/images/gallery/IMG_1013.JPG" alt="Minister General" style="width: 100%; height: 100%; object-fit: cover;">
                    </div>
                    <h4 style="font-family: 'Phudu', sans-serif; font-size: 1rem; font-weight: 700; color: #4A2A18; margin: 0 0 0.4rem 0;">Most Rev. Fr. Armando Trujillo, TOR</h4>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 0.82rem; color: #78716c; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;">1. Minister General</p>
                </div>
                
                <!-- Member 2 -->
                <div style="text-align: center; background: #FAF7F0; padding: 2rem 1.2rem; border-radius: 20px; border: 1px solid rgba(74,42,24,0.06);">
                    <div style="width: 130px; height: 130px; border-radius: 50%; overflow: hidden; margin: 0 auto 1.2rem auto; box-shadow: 0 10px 25px rgba(74,42,24,0.12); border: 2px solid #e6c888;">
                        <img loading="lazy" decoding="async" src="assets/images/gallery/IMG_1016.JPG" alt="Vicar General" style="width: 100%; height: 100%; object-fit: cover;">
                    </div>
                    <h4 style="font-family: 'Phudu', sans-serif; font-size: 1rem; font-weight: 700; color: #4A2A18; margin: 0 0 0.4rem 0;">Very Rev. Fr. Sean Sheridan, TOR</h4>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 0.82rem; color: #78716c; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;">2. Vicar General</p>
                </div>

                <!-- Member 3 -->
                <div style="text-align: center; background: #FAF7F0; padding: 2rem 1.2rem; border-radius: 20px; border: 1px solid rgba(74,42,24,0.06);">
                    <div style="width: 130px; height: 130px; border-radius: 50%; overflow: hidden; margin: 0 auto 1.2rem auto; box-shadow: 0 10px 25px rgba(74,42,24,0.12); border: 2px solid #e6c888;">
                        <img loading="lazy" decoding="async" src="assets/images/gallery/IMG_1017.JPG" alt="First Councilor" style="width: 100%; height: 100%; object-fit: cover;">
                    </div>
                    <h4 style="font-family: 'Phudu', sans-serif; font-size: 1rem; font-weight: 700; color: #4A2A18; margin: 0 0 0.4rem 0;">Very Rev. Fr. Zvonimir Brusac, TOR</h4>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 0.82rem; color: #78716c; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;">3. First Councilor</p>
                </div>

                <!-- Member 4 -->
                <div style="text-align: center; background: #FAF7F0; padding: 2rem 1.2rem; border-radius: 20px; border: 1px solid rgba(74,42,24,0.06);">
                    <div style="width: 130px; height: 130px; border-radius: 50%; overflow: hidden; margin: 0 auto 1.2rem auto; box-shadow: 0 10px 25px rgba(74,42,24,0.12); border: 2px solid #e6c888;">
                        <img loading="lazy" decoding="async" src="assets/images/gallery/IMG_1018.JPG" alt="Second Councilor" style="width: 100%; height: 100%; object-fit: cover;">
                    </div>
                    <h4 style="font-family: 'Phudu', sans-serif; font-size: 1rem; font-weight: 700; color: #4A2A18; margin: 0 0 0.4rem 0;">Very Rev. Fr. Shibin Kurian, TOR</h4>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 0.82rem; color: #78716c; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;">4. Second Councilor</p>
                </div>

                <!-- Member 5 -->
                <div style="text-align: center; background: #FAF7F0; padding: 2rem 1.2rem; border-radius: 20px; border: 1px solid rgba(74,42,24,0.06);">
                    <div style="width: 130px; height: 130px; border-radius: 50%; overflow: hidden; margin: 0 auto 1.2rem auto; box-shadow: 0 10px 25px rgba(74,42,24,0.12); border: 2px solid #e6c888;">
                        <img loading="lazy" decoding="async" src="assets/images/gallery/IMG_1019.JPG" alt="Third Councilor" style="width: 100%; height: 100%; object-fit: cover;">
                    </div>
                    <h4 style="font-family: 'Phudu', sans-serif; font-size: 1rem; font-weight: 700; color: #4A2A18; margin: 0 0 0.4rem 0;">Very Rev. Fr. Massimo Cucinotta, TOR</h4>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 0.82rem; color: #78716c; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;">5. Third Councilor</p>
                </div>

                <!-- Member 6 -->
                <div style="text-align: center; background: #FAF7F0; padding: 2rem 1.2rem; border-radius: 20px; border: 1px solid rgba(74,42,24,0.06);">
                    <div style="width: 130px; height: 130px; border-radius: 50%; overflow: hidden; margin: 0 auto 1.2rem auto; box-shadow: 0 10px 25px rgba(74,42,24,0.12); border: 2px solid #e6c888;">
                        <img loading="lazy" decoding="async" src="assets/images/gallery/IMG_1020.JPG" alt="Fourth Councilor" style="width: 100%; height: 100%; object-fit: cover;">
                    </div>
                    <h4 style="font-family: 'Phudu', sans-serif; font-size: 1rem; font-weight: 700; color: #4A2A18; margin: 0 0 0.4rem 0;">Very Rev. Fr. Bijay Prakash Tirkey, TOR</h4>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 0.82rem; color: #78716c; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;">6. Fourth Councilor</p>
                </div>

                <!-- Member 7 -->
                <div style="text-align: center; background: #FAF7F0; padding: 2rem 1.2rem; border-radius: 20px; border: 1px solid rgba(74,42,24,0.06);">
                    <div style="width: 130px; height: 130px; border-radius: 50%; overflow: hidden; margin: 0 auto 1.2rem auto; box-shadow: 0 10px 25px rgba(74,42,24,0.12); border: 2px solid #e6c888;">
                        <img loading="lazy" decoding="async" src="assets/images/gallery/IMG_1157.JPG" alt="Secretary General" style="width: 100%; height: 100%; object-fit: cover;">
                    </div>
                    <h4 style="font-family: 'Phudu', sans-serif; font-size: 1rem; font-weight: 700; color: #4A2A18; margin: 0 0 0.4rem 0;">Very Rev. Fr. Shibin Vallattuthundathil, TOR</h4>
                    <p style="font-family: 'Instrument Sans', sans-serif; font-size: 0.82rem; color: #78716c; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;">7. Secretary General</p>
                </div>
            </div>

        </div>
    </section>"""

rebuild_page('ministries-pastoral.html', 'Pastoral Ministry', 'OUR MINISTRIES', 'PASTORAL MINISTRY', pastoral_inner)
rebuild_page('ministries-formation.html', 'Formation Ministry', 'OUR MINISTRIES', 'FORMATION MINISTRY', formation_inner)
rebuild_page('ministries-education.html', 'Education Ministry', 'OUR MINISTRIES', 'EDUCATION MINISTRY', education_inner)
rebuild_page('community-history.html', 'Our History', 'COMMUNITY HERITAGE', 'OUR HISTORY', history_inner)
