"""Offline Chromium check for real four-theme mobile templates without localhost/file navigation.
Uses page.set_content to work in CI sandboxes that block navigation to localhost/file URLs.
Tests actual rendered HTML, CSS, and JS; external image loading is not asserted.
"""
from pathlib import Path
import json,re,sys
from playwright.sync_api import sync_playwright, expect
ROOT=Path(__file__).resolve().parents[1]
SAMPLE=ROOT/'examples'/'mobile-showcase'
def inline(theme,page_name="index.html"):
path=SAMPLE/theme
html=(path/page_name).read_text('utf-8')
css='\n'.join((path/'assets'/name).read_text('utf-8') for name in
['theme.css','blocks.css','factory.css','pro-base.css','pro.css','commercial.css','custom.css'])
html=re.sub(r']*rel="stylesheet"[^>]*>', '',html)
html=re.sub(r'', '',html)
html=html.replace('','')
js=(path/'assets/pro.js').read_text('utf-8')
html=html.replace('