From 8f3f58e3010fa7c923b77b7d2050175890b58f9b Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 21 Jul 2026 23:17:56 +0200 Subject: Render PDF headlines as document cards, not lightbox images A starred PDF previously ran through the same crop-and-lightbox path a photo does -- exactly the awkward treatment explicit headline designation was meant to avoid. _headline_image.html.erb now branches on @headline_asset.pdf?: a PDF renders as a linked card (a :medium thumbnail, a file icon, its name), no gallery participation at all. The existing image-headline and gallery-fallback logic is otherwise unchanged, now scoped to an image-specific headline only. Other attached PDFs -- headlined or not -- list below as plain links, same reasoning as why non-headline photos still get a gallery trigger: an attached document shouldn't go invisible just because nothing's been starred yet. headline_image's own render guard needed widening to cover a page with PDFs attached but no images and no headline at all -- the one case none of the existing conditions accounted for. --- public/stylesheets/ccc.css | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'public/stylesheets') diff --git a/public/stylesheets/ccc.css b/public/stylesheets/ccc.css index 96545949..91f7a06a 100644 --- a/public/stylesheets/ccc.css +++ b/public/stylesheets/ccc.css @@ -775,3 +775,60 @@ div.teaser_ruler { .glightbox-clean .gslide-desc { color: CanvasText !important; } + +.headline_document_card { + display: flex; + gap: 1rem; + align-items: flex-start; + border: 1px solid color-mix(in srgb, CanvasText, #808080 25%); + border-radius: 6px; + padding: 1rem; + text-decoration: none; + color: inherit; +} + +.headline_document_card:hover { + border-color: CanvasText; +} + +.headline_document_card_thumb { + max-width: 120px; + max-height: 160px; + border: 1px solid color-mix(in srgb, CanvasText, #808080 25%); + flex-shrink: 0; +} + +.headline_document_card_info { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.headline_document_card_title { + font-weight: bold; +} + +.related_documents { + margin-top: 1rem; +} + +.related_documents_label { + font-style: italic; + font-family: Georgia; + font-size: 0.9rem; + color: color-mix(in srgb, CanvasText, #808080); + margin-bottom: 0.3rem; +} + +.related_documents_list { + list-style: none; + padding: 0; + margin: 0; +} + +.related_document_link { + display: inline-flex; + align-items: center; + gap: 0.4rem; + text-decoration: none; +} -- cgit v1.3