import re

html_file = 'd:\\iss\\Franciscan Society\\index.html'
with open(html_file, 'r', encoding='utf-8') as f:
    content = f.read()

# Replace btn-view-all and its long inline styles with btn-fill-animation
content = re.sub(
    r'class="btn-view-all" style="[^"]+"',
    r'class="btn-fill-animation"',
    content
)

# Remove the inline margin on btn-arrow inside these buttons if it exists
content = content.replace('<span class="btn-arrow" style="margin-left: 0.5rem;">', '<span class="btn-arrow">')

with open(html_file, 'w', encoding='utf-8') as f:
    f.write(content)

# Now fix the mobile header padding in styles.css
css_file = 'd:\\iss\\Franciscan Society\\css\\styles.css'
css_append = """
/* Fix mobile header padding and logo truncation */
@media (max-width: 768px) {
    .header {
        padding: 1.2rem 1.5rem !important;
    }
    .header__logo img {
        object-fit: contain !important;
        max-width: 100% !important;
    }
}
"""

with open(css_file, 'a', encoding='utf-8') as f:
    f.write(css_append)

print("Updated button styles and mobile header padding.")
