@foreach ($sliders as $sliderItem)
@php
$title = $sliderItem->title;
$description = $sliderItem->description;
$subtitle = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('subtitle', true) ?: null)
: null;
$buttonLabel = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('button_label', true) ?: null)
: null;
$alignment = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('alignment', true) ?: 'center')
: 'center';
$alignClass = 'text-' . (in_array($alignment, ['left', 'center', 'right'], true) ? $alignment : 'center');
// ---- Per-slide design knobs (set by SimpleSliderSeeder) ----
// text_color: 'white' (default) or 'dark'. Drives the text-white class
// on subtitle/title. Use 'dark' for sliders with light backgrounds
// (auto, cosmetic, fashion light, jewelry, organic-light, etc.).
$textColorRaw = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('text_color', true) ?: 'white')
: 'white';
$textColor = $textColorRaw === 'dark' ? 'dark' : 'white';
$textColorCls = $textColor === 'dark' ? '' : 'text-white';
// button_style: 'pill-white' (default) | 'pill-dark' | 'outline-white' | 'outline-dark' | 'animate-btn'
// Maps to actual button class names used by the demo HTML.
$btnStyleRaw = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('button_style', true) ?: 'pill-white')
: 'pill-white';
$btnClassMap = [
'pill-white' => 'tf-btn btn-white',
'pill-dark' => 'tf-btn animate-btn',
'animate-btn' => 'tf-btn animate-btn',
'animate-dark' => 'tf-btn btn-white animate-btn animate-dark',
'outline-white' => 'tf-btn btn-line style-white',
'outline-dark' => 'tf-btn btn-line',
];
$btnClass = $btnClassMap[$btnStyleRaw] ?? 'tf-btn btn-white';
// title_tag: 'h1' (semantic primary heading) | 'p' (default, matches
// most demo variants where heading uses
).
$titleTag = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('title_tag', true) ?: 'p')
: 'p';
$titleTag = in_array($titleTag, ['h1', 'h2', 'div', 'p'], true) ? $titleTag : 'p';
$subtitleTag = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('subtitle_tag', true) ?: 'p')
: 'p';
$subtitleTag = in_array($subtitleTag, ['h6', 'p'], true) ? $subtitleTag : 'p';
// subtitle_class: full utility class set for the .sub-text_sld
// span. Defaults preserve legacy style-1 behavior.
$subtitleExtra = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('subtitle_class', true) ?: 'text-body-1 mb-15')
: 'text-body-1 mb-15';
// heading_class_extra: appended to the .heading wrapper
// (e.g. "mb-xl-32" for auto demo).
$headingExtra = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('heading_class', true) ?: '')
: '';
// title_class: full utility class set for .title_sld. Defaults
// preserve legacy display sizing; HomeAuto overrides to match
// html/home-auto.html exactly.
$titleExtraRaw = method_exists($sliderItem, 'getMetaData')
? $sliderItem->getMetaData('title_class', true)
: null;
$titleExtra = $titleExtraRaw === 'none' ? '' : ($titleExtraRaw ?: 'text-display fw-medium');
$titleBaseClass = $titleTag === 'div' ? '' : 'title_sld';
$descriptionExtra = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('description_class', true) ?: 'text-body-1 mb-32')
: 'text-body-1 mb-32';
$imageClass = method_exists($sliderItem, 'getMetaData')
? ($sliderItem->getMetaData('image_class', true) ?: ($shortcodeImageClass ?: 'w-100'))
: ($shortcodeImageClass ?: 'w-100');
$imageWidth = method_exists($sliderItem, 'getMetaData')
? ((int) ($sliderItem->getMetaData('image_width', true) ?: 1920))
: 1920;
$imageHeight = method_exists($sliderItem, 'getMetaData')
? ((int) ($sliderItem->getMetaData('image_height', true) ?: 730))
: 730;
$useContentContainer = ! method_exists($sliderItem, 'getMetaData')
|| ($sliderItem->getMetaData('content_container', true) ?: 'yes') !== 'no';
// slide_wrapper_class: extra classes on the inner slide wrapper div
// (e.g. "slider-wrap rounded-20 overflow-hidden" for construction demo).
$slideWrapExtra = method_exists($sliderItem, 'getMetaData')
? trim((string) ($sliderItem->getMetaData('slide_wrapper_class', true) ?: ''))
: '';
// Whether to show description below the title (when both subtitle
// AND description exist). fade-item numbering shifts accordingly.
$hasDescBelow = ! empty($subtitle) && ! empty($description);
$btnFadeItem = $hasDescBelow ? 'fade-item-4' : 'fade-item-3';
// title_first: when true, render title ABOVE subtitle/description
// (matches html/home-mental.html where h1 is fade-item-1 and
// sub-text is fade-item-2).
$titleFirst = method_exists($sliderItem, 'getMetaData')
? (($sliderItem->getMetaData('title_first', true) ?: 'no') === 'yes')
: false;
@endphp
@endforeach