#!/usr/bin/env python3
"""Generate styled PDF from markdown for LAUNCHED brand"""

import subprocess
import sys

# Read markdown content
with open('workspace-oliver/launched-supplier-brief-2026-04-05.md', 'r') as f:
    md_content = f.read()

# Simple HTML template with LAUNCHED branding
html = f"""
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {{
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    font-size: 11pt;
    line-height: 1.6;
    color: #4A4A4A;
    max-width: 800px;
    margin: 40px auto;
    padding: 60px;
}}

h1 {{
    font-size: 36pt;
    color: #1A1A1A;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 5px;
}}

h2 {{
    font-size: 20pt;
    color: #1A1A1A;
    font-weight: 600;
    margin-top: 40px;
    border-bottom: 2px solid #0066FF;
    padding-bottom: 8px;
}}

h3 {{
    font-size: 16pt;
    color: #1A1A1A;
    font-weight: 600;
    margin-top: 25px;
}}

h4 {{
    font-size: 13pt;
    color: #0066FF;
    font-weight: 600;
}}

table {{
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}}

th, td {{
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #E5E5E5;
}}

th {{
    background: #F8F9FA;
    color: #1A1A1A;
    font-weight: 600;
}}

strong {{
    color: #1A1A1A;
    font-weight: 600;
}}

ul {{
    padding-left: 20px;
}}

code {{
    background: #F8F9FA;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10pt;
}}

hr {{
    border: none;
    border-top: 1px solid #E5E5E5;
    margin: 30px 0;
}}
</style>
</head>
<body>
<pre>{md_content}</pre>
</body>
</html>
"""

# Write HTML file
with open('workspace-oliver/launched-supplier-brief-2026-04-05.html', 'w') as f:
    f.write(html)

print("HTML generated: workspace-oliver/launched-supplier-brief-2026-04-05.html")
print("Use browser to print to PDF or install wkhtmltopdf")
