themes-magazine-bold/blocks/cover_story.ninjatpl
Alex Dunmow 921fa33f6b fix(magazine-bold): remediate layout/whitespace + mobile responsiveness
Layout/whitespace:
- cover_story: fix hero deck ragged one-word-per-line wrap (44px text-deck in
  a narrow 3-col rail) via a right-sized inline standfirst; keep proven grid
  spans; trim doubled vertical padding.
- card: story titles were rendered by .mb-caps at 0.72rem tracked mono-caps,
  reading as cramped tiny strips; restore a real Archivo Black headline size.
- newsletter-signup: replace the twin stray dash artifact (two mb-rule bars)
  with a single fluoro accent bar; tighten padding.
- landing: constrain the story river to a cohesive editorial column (mb-river)
  instead of full 80rem (killed the dead space beside text-only cards); trim
  stacked section padding across lead/river/drop_calendar/lookbook/newsletter.

Empty-media graceful states (demo seed ships no images):
- hero (split): stop rendering the min-h-[320px] bg-muted half-panel when no
  backgroundImage; text takes full width instead.
- video-embed: gate the whole aspect frame on url|media (was a full empty box
  with a dead play button).
- image: guard the sizing box on src so an absent image collapses.
- logo-strip / hero trustLogos: defensive {% if logo.image %} guards.

Mobile responsiveness (JIT does not reliably scan theme .ninjatpl, so
layout-critical responsive rules are literal manifest CSS, not theme utility
classes):
- text-folio: break-word + lower clamp floor (54px) to prevent horizontal
  overflow of giant headlines at ~375px.
- lookbook grid + river column driven by guaranteed .mb-grid-resp/.mb-river.
- stats: drop divide-x (spurious divider on row-wrap on mobile).

Scroll-reveal hardening (.mb-reveal was opacity:0 with the observer script only
in cover_story, so lookbook on /about stayed permanently hidden; .no-js
fallback was dead): default visible, JS opts in to hide-then-reveal, safety-net
full reveal on timeout + window load, reduced-motion/no-JS/no-observer all show.

No version bump. Build + verify + check-safety all exit 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 17:27:53 +08:00

31 lines
2.4 KiB
Plaintext

{# cover_story (magazine-bold) — asymmetric cover: mono folio kicker, massive condensed headline, deck, duotone cover image, shop/read CTA. Fields: kicker, headline (richtext), deck (richtext), image (media), link, linkLabel. Image via {% img %} (media filter not registered in block render path). MID motion: mb-reveal + duotone hover, reduced-motion safe. #}
<section data-block="magazine-bold:cover_story" class="w-full overflow-hidden py-10 md:py-12">
<div class="mx-auto max-w-6xl px-4 sm:px-6">
<div class="grid grid-cols-1 gap-6 lg:grid-cols-12 lg:items-end">
<div class="lg:col-span-2">{% if kicker %}<div class="mb-caps text-muted-foreground">{{ kicker }}</div>{% endif %}</div>
<div class="lg:col-span-7"><h1 class="text-folio text-foreground">{% if headline %}{{ headline|safe }}{% else %}Cover story{% endif %}</h1></div>
<div class="lg:col-span-3">{% if deck %}<div class="text-muted-foreground" style="font-family:var(--font-body, 'Inter', system-ui, sans-serif);font-size:clamp(1.05rem,1.6vw,1.5rem);line-height:1.3;">{{ deck|safe }}</div>{% endif %}</div>
</div>
{% if image %}<div class="mb-reveal mb-duotone mt-8 aspect-[16/9] w-full overflow-hidden">{% img image alt="" class="h-full w-full object-cover" layout="hero" %}</div>{% endif %}
{% if link %}<div class="mt-7"><a href="{{ link }}" class="mb-button">{{ linkLabel|default:"Read the story" }}</a></div>{% endif %}
</div>
</section>
<script>
(function(){
if(window.__mbReveal)return;window.__mbReveal=1;
function run(){
var reduce=window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var els=document.querySelectorAll('.mb-reveal');
if(!els.length)return;
if(reduce||!('IntersectionObserver' in window)){els.forEach(function(el){el.classList.add('mb-in');});return;}
els.forEach(function(el){el.classList.add('mb-armed');});
var io=new IntersectionObserver(function(entries){entries.forEach(function(e){if(e.isIntersecting){e.target.classList.add('mb-in');io.unobserve(e.target);}});},{threshold:0.12,rootMargin:'0px 0px -8% 0px'});
els.forEach(function(el){io.observe(el);});
var revealAll=function(){els.forEach(function(el){el.classList.add('mb-in');});};
setTimeout(revealAll,900);
window.addEventListener('load',revealAll,{once:true});
}
if(document.readyState!='loading')run();else document.addEventListener('DOMContentLoaded',run);
})();
</script>