import re
import sys

with open('tmp_home_current.html', 'r', encoding='utf-8') as f:
    html = f.read()

# 1. Update Image
old_img = """<!-- wp:image {"align":"center","width":"275px","className":"is-resized"} -->
<figure class="wp-block-image aligncenter is-resized"><img src="/wp-content/uploads/2026/03/pasted-20260312-192203-5bf6a392.png" alt="Kevin McKeand" style="border-radius:16px;width:275px;max-width:100%;height:auto;"/></figure>
<!-- /wp:image -->"""

new_img = """<!-- wp:image {"align":"center","className":"is-resized"} -->
<figure class="wp-block-image aligncenter is-resized"><img src="/wp-content/uploads/2026/03/pasted-20260312-192203-5bf6a392.png" alt="Kevin McKeand" style="border-radius:16px;width:100%;max-width:1100px;height:350px;object-fit:cover;object-position:center 20%;"/></figure>
<!-- /wp:image -->"""

if old_img in html:
    html = html.replace(old_img, new_img)
else:
    print("Warning: could not find old_img")

# 2. Update Credentials
old_cred = """<!-- wp:paragraph {"style":{"typography":{"fontSize":"16px"},"color":{"text":"#ffffff"}},"textColor":"white"} -->
<p class="has-white-color has-text-color" style="font-size:16px;color:#ffffff"><strong>Credentials</strong></p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>ICF PCC Certified Executive and Life Coach</li><li>Trained in Adaptive Leadership Styles and Personal and Professional Transformations</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph {"style":{"typography":{"fontSize":"14px"},"color":{"text":"#94a3b8"}}} -->
<p style="color:#94a3b8;font-size:14px">Confidential. Insightful. Practical.</p>
<!-- /wp:paragraph -->"""

new_cred = """<!-- wp:paragraph {"style":{"typography":{"fontSize":"18px"},"color":{"text":"#ffffff"}},"textColor":"white"} -->
<p class="has-white-color has-text-color" style="font-size:18px;color:#ffffff"><strong>Credentials</strong></p>
<!-- /wp:paragraph -->

<!-- wp:list {"style":{"typography":{"fontSize":"18px"}}} -->
<ul style="font-size:18px"><li>ICF PCC Certified Executive and Life Coach</li><li>Trained in Adaptive Leadership Styles and Personal and Professional Transformations</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph {"style":{"typography":{"fontSize":"18px"},"color":{"text":"#94a3b8"}}} -->
<p style="color:#94a3b8;font-size:18px">Confidential. Insightful. Practical.</p>
<!-- /wp:paragraph -->"""

if old_cred in html:
    html = html.replace(old_cred, new_cred)
else:
    print("Warning: could not find old_cred")

# 3. Align Pricing and change 550 to 500

old_p1 = """<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"20px"}}} -->
<h3 style="font-size:20px">Initial Assessment</h3>"""
new_p1 = """<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"20px"}}} -->
<h3 style="font-size:20px;min-height:60px">Initial Assessment</h3>"""

old_p2 = """<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"20px"}}} -->
<h3 style="font-size:20px">Coaching</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"typography":{"fontSize":"24px","fontWeight":"700"}}} -->
<p style="font-size:24px;font-weight:700">$550 <span style="font-size:16px;font-weight:400">/ hour</span></p>"""
new_p2 = """<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"20px"}}} -->
<h3 style="font-size:20px;min-height:60px">Coaching</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"typography":{"fontSize":"24px","fontWeight":"700"}}} -->
<p style="font-size:24px;font-weight:700">$500 <span style="font-size:16px;font-weight:400">/ hour</span></p>"""

old_p3 = """<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"20px"}}} -->
<h3 style="font-size:20px">Coaching Package</h3>"""
new_p3 = """<!-- wp:heading {"level":3,"style":{"typography":{"fontSize":"20px"}}} -->
<h3 style="font-size:20px;min-height:60px">Coaching Package</h3>"""

if old_p1 in html:
    html = html.replace(old_p1, new_p1)
else:
    print("Warning: could not find old_p1")

if old_p2 in html:
    html = html.replace(old_p2, new_p2)
else:
    print("Warning: could not find old_p2")

if old_p3 in html:
    html = html.replace(old_p3, new_p3)
else:
    print("Warning: could not find old_p3")

with open('tmp_home_current2.html', 'w', encoding='utf-8') as f:
    f.write(html)
print("Done writing tmp_home_current2.html")
