"""
Patch-Skript für mrt-termin-hero
Führe aus: python3 patch_hero.py
Erwartet: mrt-termin-hero.html im gleichen Ordner
Erzeugt: mrt-termin-hero-v2.html
"""
import re
INPUT = "mrt-termin-hero.html" # ← Dateiname anpassen falls nötig
OUTPUT = "mrt-termin-hero-v2.html"
with open(INPUT, "r", encoding="utf-8") as f:
html = f.read()
# ── 1. #ap-rule margin-bottom 18px → 23px ─────────────────────────────────
html = html.replace(
"width:24px;margin-bottom:18px!important;",
"width:24px;margin-bottom:23px!important;"
)
# ── 2. #ap-eye margin-bottom 10px → 13px ─────────────────────────────────
html = html.replace(
"color:#B8860B!important;margin-bottom:10px!important;padding:0!important;",
"color:#B8860B!important;margin-bottom:13px!important;padding:0!important;"
)
# ── 3. #ap-sub font-family Syne → Cormorant Garamond ─────────────────────
html = html.replace(
"font-family:'Syne',sans-serif!important;\n font-size:15px!important;font-weight:400!important;\n letter-spacing:.03em!important;line-height:1.85!important;\n color:#666!important;margin:14px 0 26px!important;padding:0!important;",
"font-family:'Cormorant Garamond',Georgia,serif!important;\n font-size:15px!important;font-weight:400!important;\n letter-spacing:.03em!important;line-height:1.85!important;\n color:#666!important;margin:18px 0 34px!important;padding:0!important;"
)
# Fallback falls Whitespace anders ist
if "font-family:'Syne',sans-serif!important;" in html:
html = html.replace(
"font-family:'Syne',sans-serif!important;",
"font-family:'Cormorant Garamond',Georgia,serif!important;"
)
# ── 4. #ap-sub margin 14px 0 26px → 18px 0 34px ──────────────────────────
html = html.replace(
"margin:14px 0 26px!important;",
"margin:18px 0 34px!important;"
)
# ── 5. #ap-cta padding 12px 28px → 16px 36px ─────────────────────────────
html = html.replace(
"padding:12px 28px!important;background:#1a4a2e;",
"padding:16px 36px!important;background:#1a4a2e;"
)
# ── 6. #ap-body padding 52px → 68px ───────────────────────────────────────
html = html.replace(
"padding:0 0 52px!important;z-index:5;",
"padding:0 0 68px!important;z-index:5;"
)
# ── 7. Mobile #ap-body padding 36px → 47px ────────────────────────────────
html = html.replace(
"padding:0 0 36px!important; }",
"padding:0 0 47px!important; }"
)
# ── Prüfen ob alle Änderungen angewandt wurden ───────────────────────────────
checks = {
"ap-rule 23px": "margin-bottom:23px!important;" in html,
"ap-eye 13px": "margin-bottom:13px!important;" in html,
"ap-sub Cormorant": "'Cormorant Garamond'" in html,
"ap-sub 34px": "margin:18px 0 34px!important;" in html,
"ap-cta 36px": "padding:16px 36px!important;" in html,
"ap-body 68px": "padding:0 0 68px!important;" in html,
"mobile 47px": "padding:0 0 47px!important;" in html,
}
print("\n── Patch-Ergebnis ──────────────────────────────")
all_ok = True
for label, ok in checks.items():
status = "✓" if ok else "✗ FEHLER"
print(f" {status} {label}")
if not ok:
all_ok = False
print()
if all_ok:
with open(OUTPUT, "w", encoding="utf-8") as f:
f.write(html)
print(f" Gespeichert: {OUTPUT}")
else:
print(" Einige Ersetzungen fehlgeschlagen.")
print(" Prüfe den Dateinamen und versuche es erneut.")
print("────────────────────────────────────────────────\n")