import re
import os

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

for file_path in html_files:
    if not os.path.exists(file_path):
        continue
        
    with open(file_path, 'r', encoding='utf-8') as f:
        content = f.read()
    
    # 1. Hide Desktop Nav
    content = content.replace(
        '<nav class="desktop-nav" style="display: flex;', 
        '<nav class="desktop-nav" style="display: none !important;'
    )
    
    # 2. Show Mobile Toggle always
    content = content.replace(
        '<button class="mobile-toggle" aria-label="Toggle Navigation" onclick="document.querySelector(\'.mobile-nav-drawer\').classList.toggle(\'active\')" style="display: none;', 
        '<button class="mobile-toggle" aria-label="Toggle Navigation" onclick="document.querySelector(\'.mobile-nav-drawer\').classList.toggle(\'active\')" style="display: flex !important; transition: none !important;'
    )
    
    # 3. Increase Logo Text Size and prevent hover animations
    # Change max-width from 50% to 70% and add transition: none !important
    content = content.replace(
        '<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%;">',
        '<a href="index.html" class="header__logo" style="display: flex; align-items: center; gap: 0.8rem; text-decoration: none; flex-shrink: 0; max-width: 70%; transition: none !important;">'
    )
    
    # Increase Title Font Size
    content = content.replace(
        "font-size: clamp(0.9rem, 1.2vw, 1.15rem);",
        "font-size: clamp(1.1rem, 1.6vw, 1.45rem);"
    )
    
    # Increase Tagline Font Size
    content = content.replace(
        "font-size: clamp(0.6rem, 0.9vw, 0.85rem);",
        "font-size: clamp(0.75rem, 1.1vw, 0.95rem);"
    )
    
    with open(file_path, 'w', encoding='utf-8') as f:
        f.write(content)
    print(f"Updated header in {file_path}")

# Add CSS rules to ensure no hover animations apply to the logo and hamburger
css_file = 'd:\\iss\\Franciscan Society\\css\\styles.css'
css_append = """
/* Force hide desktop nav and show hamburger */
@media (min-width: 1px) {
    .desktop-nav {
        display: none !important;
    }
    .mobile-toggle {
        display: flex !important;
    }
}
/* Disable hover animations for logo and ham menu */
.header__logo:hover, .mobile-toggle:hover {
    transform: none !important;
    opacity: 1 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
"""

with open(css_file, 'a', encoding='utf-8') as f:
    f.write(css_append)
print("Updated CSS in styles.css")

