import re

def fix_file(file_path):
    try:
        with open(file_path, 'r', encoding='utf-8') as f:
            content = f.read()
            
        # 1. Fix the footer text that was broken
        content = content.replace(
            "(Exact Reference Screenshot Inset Rounded Card with Dark Texture, Links, Socials & Map) -->\n         style=",
            "<!-- 6. Footer (Exact Reference Screenshot Inset Rounded Card with Dark Texture, Links, Socials & Map) -->\n        <footer style="
        )
        
        # 2. Remove .blog-padded-card from VanillaTilt
        content = content.replace(
            '".blog-padded-card, .mission-tilt"',
            '".mission-tilt"'
        )
        
        # 3. Add arrow rotation on hover
        # Let's just add a small style block inside the blogs-section
        if 'transform: rotate(45deg)' not in content and 'id="blogs-section"' in content:
            style_injection = """
<style>
.blog-padded-card:hover .news-text-link .btn-arrow {
    transform: rotate(45deg) !important;
}
</style>
"""
            content = content.replace('<section id="blogs-section"', style_injection + '<section id="blogs-section"')

        with open(file_path, 'w', encoding='utf-8') as f:
            f.write(content)
        print(f"Fixed {file_path}")
    except Exception as e:
        print(f"Failed on {file_path}: {e}")

fix_file('d:\\iss\\Franciscan Society\\index.html')
fix_file('d:\\iss\\Franciscan Society\\about.html')
