{{/* Hugo Blox: CTA Card */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $title := $block.content.title | emojify | $page.RenderString }} {{ $text := $block.content.text | emojify | $page.RenderString | safeHTML }} {{ $card_class := $block.design.card.css_class }} {{ $card_style := $block.design.card.css_style }} {{/* Contrast and accessibility controls */}} {{ $text_color_mode := $block.design.card.text_color | default "auto" }} {{ $overlay_opacity := $block.design.card.overlay_opacity | default 0.15 }} {{/* Auto-detect text color based on background */}} {{ $text_classes := "" }} {{ $button_classes := "" }} {{ if eq $text_color_mode "light" }} {{ $text_classes = "text-white" }} {{ $button_classes = "text-gray-900" }} {{ else if eq $text_color_mode "dark" }} {{ $text_classes = "text-gray-900" }} {{ $button_classes = "text-gray-900" }} {{ else }} {{/* Auto mode - detect based on gradient colors */}} {{ $is_dark_bg := false }} {{ with $block.design.background.gradient.start }} {{ if or (hasPrefix . "primary-7") (hasPrefix . "primary-8") (hasPrefix . "primary-9") (hasPrefix . "secondary-7") (hasPrefix . "secondary-8") (hasPrefix . "secondary-9") }} {{ $is_dark_bg = true }} {{ end }} {{ end }} {{ if $is_dark_bg }} {{ $text_classes = "text-white" }} {{ $button_classes = "text-gray-900" }} {{ else }} {{ $text_classes = "text-gray-900 dark:text-white" }} {{ $button_classes = "text-gray-900 dark:text-gray-100" }} {{ end }} {{ end }} {{/* Modern 2025 CTA Card - Background controlled via design.background in front matter */}} {{ $custom_style := printf "--glassmorphism-opacity: %s;" (string $overlay_opacity) }} {{ if $card_style }} {{ $custom_style = printf "%s%s" $custom_style $card_style }} {{ end }}
{{/* Modern Typography Hierarchy - Responsive text colors */}}

{{ $title }}

{{/* Enhanced Text with Better Spacing - Responsive colors */}}
{{ $text }}
{{ with $block.content.button }} {{/* Modern 2025 Button Container */}}
{{ $button_link := .url }} {{ $button_scheme := (urls.Parse $button_link).Scheme }} {{ $button_target := "" }} {{ if not $button_scheme }} {{/* Check if it's a hash fragment (page anchor) */}} {{ if hasPrefix $button_link "#" }} {{/* Keep hash fragments as-is */}} {{ $button_link = $button_link }} {{ else }} {{/* Apply relLangURL for relative paths */}} {{ $button_link = $button_link | relLangURL }} {{ end }} {{ else if in (slice "http" "https") $button_scheme }} {{ $button_target = "target=\"_blank\" rel=\"noopener\"" }} {{ end }} {{/* 2025 Glassmorphism Button */}} {{/* Button Background with Glassmorphism */}}
{{/* Button Content */}} {{ .text }} {{ with .icon }} {{ partial "functions/get_icon" (dict "name" . "attributes" "style=\"height: 1.25em\" class='inline-block'") }} {{ end }} {{/* Subtle glow effect */}}
{{ end }}