import re

html_files = [
    'd:\\iss\\Franciscan Society\\index.html',
    'd:\\iss\\Franciscan Society\\about.html',
    'd:\\iss\\Franciscan Society\\gallery.html'
]

new_logo_html = """<a href="index.html" class="header__logo" style="display: flex; align-items: center; gap: 0.8rem; text-decoration: none; flex-shrink: 0; max-width: 50%;">
            <img src="assets/images/logo.svg" alt="Franciscan Society" width="48" height="58">
            <div style="display: flex; flex-direction: column; justify-content: center;">
                <span style="font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: clamp(0.9rem, 1.2vw, 1.15rem); color: #ffffff; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.2; white-space: nowrap;">FRANCISCAN FRIARS OF THE THIRD ORDER REGULAR</span>
                <span style="font-family: 'DM Sans', sans-serif; font-weight: 400; font-size: clamp(0.6rem, 0.9vw, 0.85rem); color: #ffffff; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 0.1rem; white-space: nowrap;">PROVINCE OF ST FRANCIS OF ASSISI RANCHI</span>
            </div>
        </a>"""

for file_path in html_files:
    try:
        with open(file_path, 'r', encoding='utf-8') as f:
            content = f.read()
        
        # Replace the header__logo block
        pattern = r'<a href="index\.html" class="header__logo".*?</a>'
        content = re.sub(pattern, new_logo_html, content, flags=re.DOTALL)
        
        with open(file_path, 'w', encoding='utf-8') as f:
            f.write(content)
        print(f"Updated Logo HTML in {file_path}")
    except Exception as e:
        print(f"Error in {file_path}: {e}")
