diff --git a/src/pages/index.astro b/src/pages/index.astro index 5eaaabd..902b828 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -40,7 +40,21 @@ const videoHeading = cms?.videoHeading || DEFAULTS.videoHeading; const videoBody = cms?.videoBody || DEFAULTS.videoBody; const videoYoutubeId = cms?.videoYoutubeId || DEFAULTS.videoYoutubeId; const sponsorHeading = cms?.sponsorHeading || DEFAULTS.sponsorHeading; -const ctaCards = cms?.ctaCards?.length ? cms.ctaCards : DEFAULTS.ctaCards; +// Always produce 3 cards; merge Sanity data per-slot over defaults so a +// partially-filled CMS (e.g. only 2 cards) never hides the third card or +// leaves a card with an empty href. +const sanityCards = cms?.ctaCards ?? []; +const ctaCards = DEFAULTS.ctaCards.map((def, i) => { + const s = sanityCards[i]; + if (!s) return def; + return { + label: s.label || def.label, + title: s.title || def.title, + description: s.description || def.description, + image: s.image || def.image, + href: s.href || def.href, + }; +}); const sponsors = cms?.sponsors?.length ? cms.sponsors : DEFAULTS.sponsors; --- @@ -103,7 +117,7 @@ const sponsors = cms?.sponsors?.length ? cms.sponsors : DEFAULTS.sponsor .cta-card:hover .cta-more { opacity: 1; } @media (max-width: 767px) { - .cta-editorial { flex-direction: column; height: auto; } + .cta-editorial { flex-direction: column; height: auto; overflow: visible; } .cta-card { flex: none; height: 280px; } .cta-sub { opacity: 1 !important; } .cta-more { opacity: 1 !important; } @@ -347,7 +361,7 @@ const sponsors = cms?.sponsors?.length ? cms.sponsors : DEFAULTS.sponsor loading="lazy" decoding="async" /> -
+

{card.label}