');
w.document.close();
w.focus();
w.print();
});// Download handlers: by default they are placeholders; update href to actual hosted assets
downloadAllBtn.addEventListener('click', () => {
// prefer landscape if visible, else portrait
const visibleImg = document.querySelector('.card:not([style*="display:none"]) .visual') || document.getElementById('portraitImg');
if (!visibleImg || visibleImg.src.includes('PLACEHOLDER')) {
return alert('Please replace placeholder images with final assets or set download links first.');
}
// open image in new tab so user can right-click or save
window.open(visibleImg.src, '_blank');
});// Wire direct download buttons to current src (will trigger browser save dialog if same-origin)
function wireDirectDownloads() {
const p = document.getElementById('portraitImg');
const l = document.getElementById('landscapeImg');
if (p && p.src && !p.src.includes('PLACEHOLDER')) {
downloadPortrait.href = p.src;
}
if (l && l.src && !l.src.includes('PLACEHOLDER')) {
downloadLandscape.href = l.src;
}
}
wireDirectDownloads();// Developer helper: replace placeholder images quickly for demo
// Example usage in console:
// document.getElementById('portraitImg').src = 'https://yourcdn.com/pmai_portrait_hd.png'
// document.getElementById('landscapeImg').src = 'https://yourcdn.com/pmai_landscape_hd.png'
// document.getElementById('crestImg').src = 'https://yourcdn.com/pmai_crest.png'