#!/usr/bin/env python3
"""Remove the redundant footer [data-i18n-toggle] block.
After Issue #13 the top-right widget owns toggling. The legacy footer button
+ "Maschinell übersetzt" disclaimer line are now redundant — top-right button
has the same disclaimer in its title tooltip, and ai-disclosure.js still
adds the AI footnote.
Two patterns handled:
Pattern A:
...
Pattern B (knzlmgmt, schulfrai):
...
Idempotent — sites without the patterns are skipped.
"""
import re
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
SITES_DIR = ROOT / "sites"
# Pattern A: a div wrapping the button + br + small disclaimer.
# Allow extra style segments after margin-top:16px (some sites add ;opacity:1 etc.)
PATTERN_A = re.compile(
r'\s*