#!/usr/bin/env python3
"""Buat image FB DAS Bengkel Indonesia 1 Sep 2026 — Bengkel Resmi vs Spesialis vs Umum
1080x1350, bg #1a1a2e, teks putih, aksen orange #f97316 (pola das_fb_20260828.py)
Layout aman: bullet terakhir berakhir ~1185, footer di 1220+.
"""
from PIL import Image, ImageDraw, ImageFont
import os

W, H = 1080, 1350
BG = (26, 26, 46)        # #1a1a2e
TXT = (255, 255, 255)    # white
ORANGE = (249, 115, 22)  # #f97316
MUTED = (200, 200, 210)

def font(sz, bold=False):
    for p in ["/usr/share/fonts/truetype/poppins/Poppins-Bold.ttf",
              "/usr/share/fonts/truetype/poppins/Poppins-SemiBold.ttf",
              "/usr/share/fonts/truetype/poppins/Poppins-Regular.ttf",
              "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf",
              "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"]:
        if os.path.exists(p):
            try:
                return ImageFont.truetype(p, sz)
            except Exception:
                continue
    return ImageFont.load_default()

img = Image.new("RGB", (W, H), BG)
d = ImageDraw.Draw(img)

SZ = 65

# Header
d.text((SZ, SZ), "DAS BENGKEL INDONESIA", font=font(34, True), fill=ORANGE)
d.text((W-SZ, SZ), "OTOMOTIF", font=font(30, True), fill=TXT, anchor="ra")

# Accent line under header
d.line([(SZ, SZ+70), (W-SZ, SZ+70)], fill=ORANGE, width=4)

# Title (big, bold)
title = "BENGKEL RESMI\nvs SPESIALIS\nvs UMUM"
d.multiline_text((SZ, 230), title, font=font(88, True), fill=TXT, spacing=12)

# Subtitle (2 baris)
d.text((SZ, 700), "Mana yang paling cocok", font=font(44, True), fill=ORANGE)
d.text((SZ, 770), "untuk mobil Anda?", font=font(44, True), fill=ORANGE)

# Body points — 3 item, spacing 115, mulai y=870 (berakhir ~1185, footer di 1220)
y = 870
points = [
    ("Resmi: standar pabrikan", "Tapi biaya tinggi & antre panjang"),
    ("Spesialis: keahlian mendalam", "Jago overhaul & transmisi matic"),
    ("Umum: fleksibel & terjangkau", "Kualitas tergantung teknisi"),
]
for t, s in points:
    d.text((SZ, y), "\u2713  " + t, font=font(36, True), fill=TXT)
    d.text((SZ+45, y+52), s, font=font(28), fill=MUTED)
    y += 115

# Footer
d.line([(SZ, H-130), (W-SZ, H-130)], fill=(70,70,100), width=3)
d.text((SZ, H-108), "www.dasindonesia.com", font=font(30, True), fill=ORANGE)
d.text((W-SZ, H-108), "#PilihBengkelBijak", font=font(30, True), fill=TXT, anchor="ra")

img.save("das_fb_20260901.png")
print("saved das_fb_20260901.png")
