import re

# 1. Update index.html
with open('index.html', 'r', encoding='utf-8') as f:
    html = f.read()

# Replace everything between <!-- I. Welcome & Mission --> and <!-- Final CTA -->
import re
start_marker = "<!-- I. Welcome & Mission -->"
end_marker = "<!-- Final CTA -->"

new_html_sections = """<!-- I. Welcome & Mission -->
        <section class="section section--manifesto theme--parchment" aria-label="Our Mission">
            <div class="container manifesto__container">
                <div class="manifesto__layout">
                    <div class="section-eyebrow js-reveal-text">
                        <span class="manifesto__chapter-title">Welcome</span>
                    </div>
                    <div class="manifesto__content js-reveal-text">
                        <h2 class="manifesto__text">
                            For centuries, the Franciscan Society has preserved a tradition of humility, compassion, and service while embracing the needs of every generation.
                        </h2>
                        <h2 class="manifesto__text manifesto__text--highlight">
                            Ours is a simple way of life, in which education, charity, and community are not separate callings but a single act of love.
                        </h2>
                        <a href="about.html" class="hero-cta-link" style="margin-top: var(--spacing-16);">Read Our Story</a>
                    </div>
                </div>
            </div>
        </section>

        <!-- II. Heritage -->
        <section class="section section--heritage theme--navy" aria-label="Our Heritage">
            <div class="container">
                <div class="section-eyebrow js-reveal-text">
                    <span class="manifesto__chapter-title" style="color: var(--color-warm-parchment);">Heritage</span>
                </div>

                <div class="heritage__gallery">
                    <article class="heritage__exhibit">
                        <div class="exhibit__year js-parallax-year" aria-hidden="true">1209</div>
                        <div class="exhibit__frame js-reveal-image">
                            <img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1511200903586-f88075762629?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true">
                        </div>
                        <div class="exhibit__content js-reveal-text">
                            <time class="sr-only">1209</time>
                            <h3 class="exhibit__title">The Foundation</h3>
                            <p class="exhibit__desc">A small band of brothers embraced a life of radical simplicity, planting the seed of a movement that would span the world.</p>
                        </div>
                    </article>

                    <article class="heritage__exhibit">
                        <div class="exhibit__year js-parallax-year" aria-hidden="true">1532</div>
                        <div class="exhibit__frame js-reveal-image">
                            <img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1702561642067-a7f87357ed85?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true">
                        </div>
                        <div class="exhibit__content js-reveal-text">
                            <time class="sr-only">1532</time>
                            <h3 class="exhibit__title">The Expansion</h3>
                            <p class="exhibit__desc">Franciscan communities carried their vocation of service across new lands, founding missions, schools, and places of refuge.</p>
                        </div>
                    </article>

                    <article class="heritage__exhibit">
                        <div class="exhibit__year js-parallax-year" aria-hidden="true">Today</div>
                        <div class="exhibit__frame js-reveal-image">
                            <img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1528351655744-27cc30462816?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true">
                        </div>
                        <div class="exhibit__content js-reveal-text">
                            <time class="sr-only">Present Day</time>
                            <h3 class="exhibit__title">A Living Legacy</h3>
                            <p class="exhibit__desc">Today, the Society continues its ancient calling — serving the poor, forming the young, and preserving what has been entrusted to us.</p>
                        </div>
                    </article>
                </div>

                <div style="text-align:center; margin-top: clamp(64px, 10vw, 120px);" class="js-reveal-text">
                    <a href="heritage.html" class="hero-cta-link" style="color: var(--color-warm-parchment);">Discover Our Heritage</a>
                </div>
            </div>
        </section>

        <!-- Quote -->
        <section class="section section--quote theme--parchment" aria-label="Reflection">
            <div class="container">
                <blockquote class="quote-block__text js-reveal-text">
                    &ldquo;In the silence of the heart, the deepest truths are spoken.&rdquo;
                </blockquote>
                <p class="quote-block__cite js-reveal-text">Franciscan Tradition</p>
            </div>
        </section>

        <!-- III. Ministries -->
        <section class="section section--vocation theme--navy" aria-label="Our Ministries">
            <div class="container">
                <div class="section-eyebrow js-reveal-text">
                    <span class="manifesto__chapter-title" style="color: var(--color-warm-parchment);">Our Ministries</span>
                </div>

                <div class="grid grid--3">
                    <article class="ministry-card js-reveal-image">
                        <div class="ministry-card__bg-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1632215861513-130b66fe97f4?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"></div>
                        <div class="ministry-card__content">
                            <h3 class="ministry-card__title">Education</h3>
                            <p class="ministry-card__desc">Nurturing minds through classical teaching and lifelong learning rooted in faith.</p>
                            <a href="ministries.html#education" class="ministry-card__link">Discover <span aria-hidden="true">&rarr;</span></a>
                        </div>
                    </article>
                    <article class="ministry-card js-reveal-image">
                        <div class="ministry-card__bg-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1710092784814-4a6f158913b8?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"></div>
                        <div class="ministry-card__content">
                            <h3 class="ministry-card__title">Charity</h3>
                            <p class="ministry-card__desc">Extending shelter, sustenance, and dignity to those we are called to serve.</p>
                            <a href="ministries.html#charity" class="ministry-card__link">Discover <span aria-hidden="true">&rarr;</span></a>
                        </div>
                    </article>
                    <article class="ministry-card js-reveal-image">
                        <div class="ministry-card__bg-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1613324766451-2d03b2ea8190?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"></div>
                        <div class="ministry-card__content">
                            <h3 class="ministry-card__title">Preservation</h3>
                            <p class="ministry-card__desc">Safeguarding sacred manuscripts, art, and architecture entrusted to us across the centuries.</p>
                            <a href="ministries.html#preservation" class="ministry-card__link">Discover <span aria-hidden="true">&rarr;</span></a>
                        </div>
                    </article>
                    <article class="ministry-card js-reveal-image">
                        <div class="ministry-card__bg-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1593113646773-028c64a8f1b8?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"></div>
                        <div class="ministry-card__content">
                            <h3 class="ministry-card__title">Community Outreach</h3>
                            <p class="ministry-card__desc">Walking alongside neighbors through service, listening, and shared responsibility.</p>
                            <a href="ministries.html#community-outreach" class="ministry-card__link">Discover <span aria-hidden="true">&rarr;</span></a>
                        </div>
                    </article>
                    <article class="ministry-card js-reveal-image">
                        <div class="ministry-card__bg-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1577202356409-c6b24521c92d?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"></div>
                        <div class="ministry-card__content">
                            <h3 class="ministry-card__title">Spiritual Formation</h3>
                            <p class="ministry-card__desc">Guiding hearts toward prayer, discernment, and a deeper life of faith.</p>
                            <a href="ministries.html#spiritual-formation" class="ministry-card__link">Discover <span aria-hidden="true">&rarr;</span></a>
                        </div>
                    </article>
                    <article class="ministry-card js-reveal-image">
                        <div class="ministry-card__bg-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1567057420215-0afa9aa9253a?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"></div>
                        <div class="ministry-card__content">
                            <h3 class="ministry-card__title">Youth Formation</h3>
                            <p class="ministry-card__desc">Forming the next generation in virtue, community, and Franciscan values.</p>
                            <a href="ministries.html#youth-formation" class="ministry-card__link">Discover <span aria-hidden="true">&rarr;</span></a>
                        </div>
                    </article>
                </div>

                <div style="text-align:center; margin-top: clamp(64px, 10vw, 120px);" class="js-reveal-text">
                    <a href="ministries.html" class="hero-cta-link" style="color: var(--color-warm-parchment);">Explore Our Ministries</a>
                </div>
            </div>
        </section>

        <!-- IV. Leadership Preview -->
        <section class="section section--text-block theme--parchment" aria-label="Leadership">
            <div class="container">
                <div class="section-eyebrow js-reveal-text">
                    <span class="manifesto__chapter-title">Leadership</span>
                </div>
                <div class="grid grid--3">
                    <article class="person-card js-reveal-image">
                        <div class="person-card__image-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1680083306526-836fd21c925e?w=1400&q=80&auto=format&fit=crop" alt="Portrait of Br. Anthony Rivas, Minister Provincial"></div>
                        <h3 class="person-card__name">Br. Anthony Rivas</h3>
                        <p class="person-card__title">Minister Provincial</p>
                    </article>
                    <article class="person-card js-reveal-image">
                        <div class="person-card__image-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1685760259914-ee8d2c92d2e0?w=1400&q=80&auto=format&fit=crop" alt="Portrait of Sr. Clare Whitfield, Director of Charity"></div>
                        <h3 class="person-card__name">Sr. Clare Whitfield</h3>
                        <p class="person-card__title">Director of Charity</p>
                    </article>
                    <article class="person-card js-reveal-image">
                        <div class="person-card__image-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1740414289827-3332d41cb11a?w=1400&q=80&auto=format&fit=crop" alt="Portrait of Fr. Matthew Okafor, Director of Education"></div>
                        <h3 class="person-card__name">Fr. Matthew Okafor</h3>
                        <p class="person-card__title">Director of Education</p>
                    </article>
                </div>
                <div style="text-align:center; margin-top: clamp(64px, 10vw, 120px);" class="js-reveal-text">
                    <a href="leadership.html" class="hero-cta-link">Meet Our Community</a>
                </div>
            </div>
        </section>

        <!-- V. Gallery Preview -->
        <section class="section section--text-block theme--navy" aria-label="Gallery">
            <div class="container">
                <div class="section-eyebrow js-reveal-text">
                    <span class="manifesto__chapter-title" style="color: var(--color-warm-parchment);">Gallery</span>
                </div>
                <div class="gallery-grid js-reveal-image">
                    <div class="gallery-item gallery-item--wide"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1696280549633-915b98255785?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"><span class="gallery-item__caption">Heritage — The Motherhouse at dawn</span></div>
                    <div class="gallery-item"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1476873282730-9018f17bdf4e?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"><span class="gallery-item__caption">Worship — Morning prayer</span></div>
                    <div class="gallery-item"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1632215861513-130b66fe97f4?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"><span class="gallery-item__caption">Ministries — Classroom instruction</span></div>
                    <div class="gallery-item"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1593113646773-028c64a8f1b8?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"><span class="gallery-item__caption">Community — Shared meals</span></div>
                </div>
                <div style="text-align:center; margin-top: clamp(64px, 10vw, 120px);" class="js-reveal-text">
                    <a href="gallery.html" class="hero-cta-link" style="color: var(--color-warm-parchment);">View the Full Gallery</a>
                </div>
            </div>
        </section>

        <!-- VI. Latest News -->
        <section class="section section--text-block theme--parchment" aria-label="Latest News">
            <div class="container">
                <div class="section-eyebrow js-reveal-text">
                    <span class="manifesto__chapter-title">News &amp; Events</span>
                </div>
                <div class="grid grid--3">
                    <article class="news-card js-reveal-text">
                        <div class="news-card__image-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1528351655744-27cc30462816?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"></div>
                        <div class="news-card__meta"><span>Feast Day</span><time datetime="2026-10-04">Oct 4, 2026</time></div>
                        <h3 class="news-card__title">Feast of St. Francis Draws Pilgrims from Across the Region</h3>
                        <p class="news-card__excerpt">Communities gathered for the annual celebration marking the life and legacy of Francis of Assisi.</p>
                        <a href="news.html" class="news-card__link">Read More</a>
                    </article>
                    <article class="news-card js-reveal-text">
                        <div class="news-card__image-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1632215861513-130b66fe97f4?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"></div>
                        <div class="news-card__meta"><span>Education</span><time datetime="2026-08-14">Aug 14, 2026</time></div>
                        <h3 class="news-card__title">New Literacy Program Launches for Underserved Youth</h3>
                        <p class="news-card__excerpt">The Society expands its education ministry with a free after-school literacy initiative.</p>
                        <a href="news.html" class="news-card__link">Read More</a>
                    </article>
                    <article class="news-card js-reveal-text">
                        <div class="news-card__image-wrap"><img class="media-fill" loading="lazy" src="https://images.unsplash.com/photo-1640273837947-ea830d50c191?w=1400&q=80&auto=format&fit=crop" alt="" aria-hidden="true"></div>
                        <div class="news-card__meta"><span>Preservation</span><time datetime="2026-06-02">Jun 2, 2026</time></div>
                        <h3 class="news-card__title">Restoration of the Motherhouse Chapel Completed</h3>
                        <p class="news-card__excerpt">A two-year restoration preserves centuries-old frescoes for future generations.</p>
                        <a href="news.html" class="news-card__link">Read More</a>
                    </article>
                </div>
                <div style="text-align:center; margin-top: clamp(64px, 10vw, 120px);" class="js-reveal-text">
                    <a href="news.html" class="hero-cta-link">View All News</a>
                </div>
            </div>
        </section>

        <!-- VII. Vocations -->
        <section class="section section--manifesto theme--navy" aria-label="Vocations">
            <div class="container manifesto__container">
                <div class="manifesto__layout">
                    <div class="section-eyebrow js-reveal-text">
                        <span class="manifesto__chapter-title" style="color: var(--color-warm-parchment);">Vocations</span>
                    </div>
                    <div class="manifesto__content js-reveal-text">
                        <h2 class="manifesto__text" style="color: var(--color-warm-parchment);">
                            Is God calling you to a life of simplicity, prayer, and service?
                        </h2>
                        <h2 class="manifesto__text manifesto__text--highlight">
                            We invite you to discern a Franciscan vocation in community with us.
                        </h2>
                        <a href="vocations.html" class="hero-cta-link" style="color: var(--color-warm-parchment); margin-top: var(--spacing-16);">Begin Your Journey</a>
                    </div>
                </div>
            </div>
        </section>

        """

pattern = re.compile(re.escape(start_marker) + ".*?" + re.escape(end_marker), re.DOTALL)
new_html = pattern.sub(new_html_sections + end_marker, html)

with open('index.html', 'w', encoding='utf-8') as f:
    f.write(new_html)

print("Updated index.html")
