{% extends '@nucleus/partials/particle.html.twig' %}

{% block stylesheets %}
{% if particle.particle_title_color or particle.particle_title_fontsize or particle.title_color or particle.title_fontsize or particle.customize_content_color or particle.customize_content_fontsize or particle.meta_color or particle.meta_fontsize or particle.card_background_color or particle.card_color or particle.card_link_color or particle.slide_color or particle.slide_background or particle.padding_vertical or particle.padding_horizontal or particle.slide_hover_color or particle.slide_hover_background %}
<style>
{% if particle.particle_title_color or particle.particle_title_fontsize %}
#{{ id }}.g5-particle-title { {% if particle.particle_title_color %}color: {{ particle.particle_title_color }};{% endif %}{% if particle.particle_title_fontsize %}font-size: {{particle.particle_title_fontsize}}px;{% endif %} }
{% endif %}
{% if particle.title_color or particle.title_fontsize %}
#{{ id }} .tm-title { {% if particle.title_color %}color: {{particle.title_color}}; {% endif %}{% if particle.title_fontsize %}font-size: {{particle.title_fontsize}}px;{% endif %} }
{% endif %}
{% if particle.customize_content_color or particle.customize_content_fontsize %}
#{{ id }} .tm-content { {% if particle.customize_content_color %}color: {{particle.customize_content_color}} !important;{% endif %}{% if particle.customize_content_fontsize %} font-size: {{particle.customize_content_fontsize}}px;{% endif %} }
{% endif %}
{% if particle.meta_color or particle.meta_fontsize %}
#{{ id }} .tm-meta li span, #{{ id }} .tm-meta li a { {% if particle.meta_color %}color: {{particle.meta_color}};{% endif %}{% if particle.meta_fontsize %} font-size: {{particle.meta_fontsize}}px;{% endif %} text-transform: uppercase; }
{% endif %}
{% if particle.card_background_color or particle.card_color %}
#{{ id }} .jl-card {
    {% if particle.card_background_color %}
    background: {{ particle.card_background_color }};
    {% endif %}
    {% if particle.card_color %}
    color: {{ particle.card_color }};
    {% endif %}
    box-shadow: none;
}
{% endif %}
{% if particle.card_link_color %}
#{{ id }} .jl-card a { color: {{ particle.card_link_color }}; }
{% endif %}
{% if particle.slide_color or particle.slide_background or particle.padding_vertical or particle.padding_horizontal %}
#{{ id }} .jl-slidenav {
    padding: {{ particle.padding_vertical }}px {{ particle.padding_horizontal }}px;
    {% if particle.slide_color %}
    color: {{ particle.slide_color }};
    {% endif %}
    {% if particle.slide_background %}
    background: {{ particle.slide_background }};
    {% endif %}
    transition: .1s ease-in-out;
    transition-property: color,background-color,border-color,box-shadow;
}
{% endif %}
{% if particle.slide_hover_color or particle.slide_hover_background %}
#{{ id }} .jl-slidenav:active,#{{ id }} .jl-slidenav:focus,#{{ id }} .jl-slidenav:hover{
    {% if particle.slide_hover_color %}
    color: {{ particle.slide_hover_color }};
    {% endif %}  
    {% if particle.slide_hover_background %}
    background: {{ particle.slide_hover_background }};
    {% endif %}
}
{% endif %}
</style>
{% endif %}
{% endblock %}

{# Set Title/Meta/Content Text Transform #}
{% set title_text_transform = particle.title_text_transform ? ' jl-text-' ~ particle.title_text_transform|e ~ '' %}
{% set meta_text_transform = particle.meta_text_transform ? ' jl-text-' ~ particle.meta_text_transform|e ~ '' %}
{% set content_text_transform = particle.content_text_transform ? ' jl-text-' ~ particle.content_text_transform|e ~ '' %}

{% set attr_extra = particle.extra|attribute_array %}
{% set article_settings = particle.article %}
{% set filter = article_settings.filter %}
{% set sort = article_settings.sort %}
{% set limit = article_settings.limit %}
{% set display = article_settings.display %}

{# Category Finder #}
{% set category_options = filter.categories ? {id: [filter.categories|split(','), 0]} : {} %}
{% set categories = joomla.finder('category', category_options).published(1).language().limit(0).find() %}

{# Content Finder #}
{% if filter.articles %}
{% set article_options = filter.articles ? {id: [filter.articles|replace(' ', '')|split(',')]} : {} %}
{% set article_finder = joomla.finder('content', article_options).published(1).language() %}
{% else %}
{% set article_finder = joomla.finder('content').category(categories).published(1).language() %}
{% endif %}

{% set featured = filter.featured|default('include') %}
{% if featured == 'exclude' %}
{% do article_finder.featured(false) %}
{% elseif featured == 'only' %}
{% do article_finder.featured(true) %}
{% endif %}

{% set start = limit.start + max(0, ajax.start|int) %}
{% do article_finder.order(sort.orderby, sort.ordering).limit(limit.total).start(start) %}
{% set total = article_finder.count() %}
{% set articles = article_finder.find() %}

{# Set Slider Viewport Height #}
{% if particle.slider_width_mode == 'fixed' %}
{% if particle.slider_viewport == 'full' %}
    {% set slider_viewport = ' jl-height-viewport="offset-top: true; minHeight:' ~ particle.slider_minheight|default('300')|e ~ '"' %}
{% elseif particle.slider_viewport == 'percent' %}
    {% set slider_viewport = ' jl-height-viewport="offset-top: true; offset-bottom: 20; minHeight:' ~ particle.slider_minheight|default('300')|e ~ '"' %}
{% elseif particle.slider_viewport == 'section' %}
    {% set slider_viewport = ' jl-height-viewport="offset-top: true;offset-bottom: 50; minHeight:' ~ particle.slider_minheight|default('300')|e ~ '"' %}
{% endif %}
{% set item_grid_match = particle.slider_viewport != 'auto' ? ' jl-grid-match' %}
{% endif %}

{% set slider_animation_set = particle.slider_animation_set == 'enabled' ? 'sets: 1;' %}
{% set slider_animation_center = particle.slider_animation_center == 'enabled' ? 'center: 1;' %}
{% set slider_animation_finite = particle.slider_animation_finite == 'enabled' ? 'finite: 1;' %}
{% set slider_animation_autoplay = particle.slider_animation_autoplay == 'enabled' ? 'autoplay: 1;' %}
{% set slider_animation_interval = (particle.slider_animation_autoplay == 'enabled' and particle.slider_animation_interval) ? 'autoplay-interval:' ~ particle.slider_animation_interval * 1000 ~ ';' %}
{% set slider_pause_onhover = particle.slider_pause_onhover == 'disabled' ? 'pauseOnHover: false;' %}
{% set velocity = particle.slider_velocity ? 'velocity:' ~ particle.slider_velocity / 100 ~ ';' %}

{# Set Transition for overlay/title/meta/content if overlay on hover is set #}
{% if particle.overlay_hover and particle.overlay_mode != 'none' %}
{% set overlay_transition = ' jl-transition-' ~ particle.overlay_transition|e ~ '' %}
{% set title_transition = particle.title_transition != 'none' ? ' jl-transition-' ~ particle.title_transition|e ~ '' %}
{% set meta_transition = particle.meta_transition != 'none' ? ' jl-transition-' ~ particle.meta_transition|e ~ '' %}
{% set content_transition = particle.content_transition != 'none' ? ' jl-transition-' ~ particle.content_transition|e ~ '' %}
{% set link_transition = particle.link_transition != 'none' ? ' jl-transition-' ~ particle.link_transition|e ~ '' %}
{% endif %}

{# Image Transition #}

{% if particle.link_image or particle.overlay_mode != 'none' %}
{% set image_transition = particle.image_transition != 'none' ? ' jl-transition-' ~ particle.image_transition|e ~ ' jl-transition-opaque' %}
{% endif %}
{% set imagewidth = particle.image_width ? ' width="' ~ particle.image_width ~ '"' %}
{% set imageheight = particle.image_height ? ' height="' ~ particle.image_height ~ '"' %}

{% set card_maxwidth_cls = particle.card_maxwidth != 'none' ? ' jl-margin-auto jl-width-' ~ particle.card_maxwidth|e ~ '' %}

{# Set Animation #}
{% set animation %}
{% if particle.animation != 'inherit' %} jl-scrollspy="cls: jl-animation-{{particle.animation|e}};{% if particle.animation_repeat == 'enabled' %} repeat: true;{% endif %} delay:{% if particle.delay_element_animations %} {{particle.animation_delay|default('200')|e}};{% else %} false;{% endif %}"{% endif %}
{% endset %}

{# Set Max-Width Content #}
{% set content_maxwidth %}
{% if particle.g_maxwidth != 'inherit' %} jl-width-{{particle.g_maxwidth}}{% if particle.g_maxwidth_breakpoint != 'always' %}@{{particle.g_maxwidth_breakpoint}}{% endif %}{% if particle.g_maxwidth_alignment == 'left' %}{% elseif particle.g_maxwidth_alignment == 'center' %} jl-margin-auto{% else %} jl-margin-auto-left{% endif %}{% endif %}
{% endset %}

{# Set Particle Alignment #}
{% set particle_alignment %}
{% if particle.align != 'inherit' %} jl-text-{{particle.align|e}}{% if particle.breakpoint != 'always' %}@{{particle.breakpoint|e}}{% endif %}{% endif %}{% if particle.align != 'inherit' and particle.breakpoint != 'always' %}{% if particle.fallback != 'inherit' %} jl-text-{{particle.fallback|e}}{% endif %}{% endif %}
{% endset %}

{# Set Particle Alignment for Subnav style #}
{% set subnav_alignment %}
{% if particle.align != 'inherit' %} jl-flex-{{particle.align|e}}{% if particle.breakpoint != 'always' %}@{{particle.breakpoint|e}}{% endif %}{% endif %}{% if particle.align != 'inherit' and particle.breakpoint != 'always' %}{% if particle.fallback != 'inherit' %} jl-flex-{{particle.fallback|e}}{% endif %}{% endif %}
{% endset %}

{# set Particle Title Style #}
{% set particle_title_style %}
{% if particle.particle_title %}
<{{particle.particle_title_element|e}} id="{{ id }}" class="g5-particle-title{% if particle.particle_title_align != 'inherit' %} jl-text-{{particle.particle_title_align|e}}{% endif %}{% if particle.particle_predefined_color != 'default' %} jl-text-{{particle.particle_predefined_color|e}}{% endif %}{% if particle.particle_title_style != 'default' %} jl-{{particle.particle_title_style|e}}{% endif %}{% if particle.particle_title_decoration != 'none' %} jl-heading-{{particle.particle_title_decoration|e}}{% endif %}">
{% if particle.particle_title_decoration == 'line' %} <span>{{particle.particle_title|raw}}</span>
{% else %} {{particle.particle_title|raw}}
{% endif %}
</{{particle.particle_title_element|e}}>
{% endif %}
{% endset %}

{# Set Button Class #}
{% set button_cls %}
{% if display.read_more.button_styles == 'link' %}jl-link{% elseif display.read_more.button_styles == 'link-muted' or display.read_more.button_styles == 'link-text' %}jl-{{display.read_more.button_styles|e}}{% else %}jl-button jl-button-{{display.read_more.button_styles|e}}{% endif %}
{% endset %}

{# Set Button Size #}
{% set button_size %}
{% if display.read_more.button_styles == 'link' or display.read_more.button_styles == 'link-muted' or display.read_more.button_styles == 'link-text' or display.read_more.button_styles == 'text' %}{% else %}{% if particle.link_button_size != 'default' %} jl-button-{{particle.link_button_size|e}}{% endif %}{% endif %}
{% endset %}

{% if particle.column_gap is not empty %}
{% set column_gap = particle.column_gap != 'default' ? ' jl-grid jl-grid-' ~ particle.column_gap|e ~ '' : ' jl-grid' %}
{% endif %}

{% set tab_transition = particle.overlay_hover or particle.image_transition != 'none' ? ' tabindex="0"' %}
{% set toggle_transition = particle.overlay_hover or particle.image_transition != 'none' ? ' jl-transition-toggle' %}

{# Set Image Margin Top Class #}
{% if ( ( particle.image_alignment == 'bottom' and particle.image_padding == false ) or ( particle.card_style == 'blank' and particle.image_padding ) or particle.image_alignment == 'between' ) %}
{% if particle.link_image and particle.image_transition != 'none' %}
{% set image_top_cls_transition %}
{% if particle.image_margin_top == 'default' %} jl-margin-top{% else %} jl-margin-{{ particle.image_margin_top|e }}-top{% endif %}
{% endset %}
{% else %}
{% set image_top_cls %}
{% if particle.image_margin_top == 'default' %} jl-margin-top{% else %} jl-margin-{{ particle.image_margin_top|e }}-top{% endif %}
{% endset %}
{% endif %}
{% endif %}

{# Set Image Border Class #}
{% if particle.card_style == 'blank' or ( particle.card_style != 'blank' and particle.image_padding == false ) %}
{% set image_border_cls = particle.image_border != 'none' ? ' jl-border-' ~ particle.image_border|e ~ '' %}
{% endif %}

{% set title_hover = (particle.title_hover ? ' class="jl-link-'~ particle.title_hover ~'"') %}
{% set overlay_color = particle.overlay_color ? ' jl-' ~ particle.overlay_color|e ~ '' %}
{% block particle %}
{% if particle.enabled %}
{{particle_title_style}}

<div id="{{ id }}" class="jc-slider{{content_maxwidth}}{% if particle.class %} {{ particle.class }}{% endif %}{{particle_alignment}}{% if particle.margin == 'inherit' %}{% elseif particle.margin == 'default' %} jl-margin{% else %} jl-margin-{{particle.margin|e}}{% endif %}{% if particle.visibility != 'inherit' %} jl-visible@{{particle.visibility|e}}{% endif %}" jl-slider="{{slider_animation_set}}{{slider_animation_center}}{{slider_animation_finite}}{{velocity}}{{slider_animation_autoplay}}{{slider_animation_interval}}{{slider_pause_onhover}}"{{animation}} {{- attr_extra|raw }}>

<div class="jl-position-relative{% if particle.slidenav_hover == 'enabled' %} jl-visible-toggle{% endif %}">

{# Load Outside container #}

{% if particle.slidenav_position == 'outside' %}
<div class="jl-slider-container">
{% endif %}

{# End outside #}

<ul class="jl-slider-items{% if particle.slider_divider == 'enabled' %} jl-grid-divider{% endif %}{{column_gap}}{{item_grid_match}}"{{slider_viewport|raw}}>

{% for article in articles %}

{# Set Card Item Image #}
{% set item_image %}
    {% if display.image.enabled and article.images.image_intro or article.images.image_fulltext %}
    {% if particle.link_image and particle.overlay_mode == 'none' %}<a href="{{ article.route }}" target="{{ particle.buttontarget|default('_self')|e }}">{% if particle.image_transition != 'none' %}<div class="jl-inline-clip jl-transition-toggle{{image_top_cls_transition}}">{% endif %}{% endif %}
    
    {% if article.images.image_intro and display.image.enabled == 'intro' or display.image.enabled == 'show' %}

    <img{{imagewidth|raw}}{{imageheight|raw}} class="tm-image{{image_top_cls}}{{image_border_cls}}{{image_boxshadow}}{{image_boxshadow_hover}}{{image_transition}}" src="{{ url(article.images.image_intro) }}"{% if article.images.image_intro_alt %} alt="{{article.images.image_intro_alt}}"{% else %} alt="{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}"{% endif %}>

    {% elseif article.images.image_fulltext and display.image.enabled == 'full' %}

    <img{{imagewidth|raw}}{{imageheight|raw}} class="tm-image{{image_top_cls}}{{image_border_cls}}{{image_boxshadow}}{{image_boxshadow_hover}}{{image_transition}}" src="{{ url(article.images.image_fulltext) }}"{% if article.images.image_fulltext_alt %} alt="{{article.images.image_fulltext_alt}}"{% else %} alt="{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}"{% endif %}>

    {% endif %}
    {% if particle.link_image and particle.overlay_mode == 'none' %}{% if particle.image_transition != 'none' %}</div>{% endif %}</a>{% endif %}
    {% endif %}
{% endset %}

{% set article_edit_link %}
{% if display.edit and article.edit %}
    <div class="jl-margin-small"><a class="g-array-item-edit" href="{{ article.edit }}"><i class="fa fa-pencil" aria-hidden="true"></i> {{ 'JGLOBAL_EDIT'|trans }}</a></div>
{% endif %}
{% endset %}

{# Set Meta #}
{% set item_meta %}
{% if display.date.enabled or display.author.enabled or display.category.enabled or display.hits.enabled %}
{% if particle.meta_styles == 'list' %}
<ul class="tm-meta{{meta_text_transform}}{{subnav_alignment}} jl-subnav{% if particle.meta_subnav_style != 'default' %} jl-subnav-{{particle.meta_subnav_style|e}}{% endif %}{% if particle.pre_meta_color != 'default' %} jl-text-{{particle.pre_meta_color|e}}{% endif %}{% if particle.meta_margin_top == 'default' %} jl-margin-top{% else %} jl-margin-{{ particle.meta_margin_top|e }}-top{% endif %}{% if particle.meta_visibility != 'inherit' %} jl-visible@{{particle.meta_visibility|e}}{% endif %}{{meta_transition}}">
    {% if display.date.enabled %}
    <li class="g-array-item-date">
    <span>
    {% if display.date.enabled == 'published' %}
    {{ article.publish_up|date(display.date.format) }}
    {% elseif display.date.enabled == 'modified' %}
    {{ article.modified|date(display.date.format) }}
    {% else %}
    {{ article.created|date(display.date.format) }}
    {% endif %}
    </span>
    </li>
    {% endif %}

    {% if display.author.enabled %}
    <li class="g-array-item-author"><span class="g-array-item-author">{{ article.author.name }}</span></li>
    {% endif %}

    {% if display.category.enabled %}
    {% set category_link = display.category.enabled == 'link' %}
    <li class="g-array-item-category">
    {% set cat = article.categories|last %}
    {% if category_link %}
    <a href="{{ cat.route }}">
    {{ cat.title }}
    </a>
    {% else %}
    <span class="g-array-item-category">{{ cat.title }}</span>
    {% endif %}
    </li>
    {% endif %}

    {% if display.hits.enabled %}
    <li class="g-array-item-hits">
    <span><i class="fa fa-eye" aria-hidden="true"></i>{{ article.hits }}</span>
    </li>
    {% endif %}
</ul>
{% else %}
<p class="{% if particle.meta_margin_top == 'default' %}jl-margin-top{% else %}jl-margin-{{ particle.meta_margin_top|e }}-top{% endif %} jl-margin-remove-bottom jl-article-meta{% if particle.pre_meta_color != 'default' %} jl-text-{{particle.pre_meta_color|e}}{% endif %}{% if particle.meta_visibility != 'inherit' %} jl-visible@{{particle.meta_visibility|e}}{% endif %}{{meta_transition}}">

    {% if display.author.enabled %}
        {{ particle.author_meta|default('Written by')|raw}} {{ article.author.name }}
    {% endif %}

    {% if display.author.enabled and display.date.enabled %}
    {% set meta_date = particle.date_meta|default('on')|raw %}
    {% else %}
    {% set meta_date = particle.date_meta|default('Written on')|raw %}
    {% endif %}

    {% if display.date.enabled %}
        {% if display.date.enabled == 'published' %}
            {{ meta_date }} {{ article.publish_up|date(display.date.format) }}{{ '.'|trim }}
        {% elseif display.date.enabled == 'modified' %}
            {{ meta_date }} {{ article.modified|date(display.date.format) }}{{ '.'|trim }}
        {% else %}
            {{ meta_date }} {{ article.created|date(display.date.format) }}{{ '.'|trim }}
        {% endif %}
    {% endif %}

    {% if display.category.enabled %}
        {% set category_link = display.category.enabled == 'link' %}
        {% set cat = article.categories|last %}
        {% if category_link %}
            {{ particle.category_meta|default('Posted in')|raw}} <a href="{{ cat.route }}">{{ cat.title }}</a>
        {% else %}
            {{ particle.category_meta|default('Posted in')|raw}} {{ cat.title }}
        {% endif %}
    {% endif %}

    {% if display.hits.enabled %}
        <span class="g-array-item-hits">
            <i class="fa fa-eye" aria-hidden="true"></i> {{ article.hits }}
        </span>
    {% endif %}

</p>
{% endif %}
{% endif %}
{% endset %}

{# Set Title #}
{% set item_title %}
{% if display.title.enabled %}
<{{particle.title_element|e}} class="tm-title jl-margin-remove-bottom{{title_text_transform}}{% if particle.title_margin_top == 'default' %} jl-margin-top{% else %} jl-margin-{{ particle.title_margin_top|e }}-top{% endif %}{% if particle.title_style != 'default' %} jl-{{ particle.title_style|e }}{% endif %}{% if particle.predefined_title_color != 'default' %} jl-text-{{ particle.predefined_title_color|e }}{% endif %}{% if particle.title_decoration != 'none' %} jl-heading-{{particle.title_decoration|e}}{% endif %}{% if particle.title_visibility != 'inherit' %} jl-visible@{{particle.title_visibility|e}}{% endif %}{{title_transition}}">
{% if particle.title_decoration == 'line' %}
<span>
{% endif %}
{% if particle.link_title %}
<a{{ title_hover|raw }} href="{{ article.route }}">{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}</a>
{% else %}
{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}
{% endif %}
{% if particle.title_decoration == 'line' %}
</span>
{% endif %}
</{{particle.title_element|e}}>
{% endif %}
{% endset %}

{# Set Content #}
{% set item_content %}
{% if display.text.type %}
{% set article_text = display.text.type == 'intro' ? display.text.prepare ? article.preparedIntroText : article.introtext : display.text.prepare ? article.preparedText : article.text %}
<div class="tm-content jl-panel{{content_text_transform}}{% if particle.content_margin_top == 'default' %} jl-margin-top{% else %} jl-margin-{{ particle.content_margin_top|e }}-top{% endif %}{% if particle.content_style != 'default' %} jl-text-{{ particle.content_style|e }}{% endif %}{% if particle.content_text_color != 'default' %} jl-text-{{ particle.content_text_color|e }}{% endif %}{% if particle.content_visibility != 'inherit' %} jl-visible@{{particle.content_visibility|e}}{% endif %}{{content_transition}}">
{% if display.text.formatting == 'text' %}
{{ article_text|truncate_text(display.text.limit)|raw }}
{% else %}
{{ article_text|truncate_html(display.text.limit)|raw }}
{% endif %}
</div>
{% endif %}
{% endset %}

{# Set Button #}
{% set item_button %}
{% if display.read_more.label %}
<div class="tm-button{% if particle.link_margin_top == 'default' %} jl-margin-top{% else %} jl-margin-{{ particle.link_margin_top|e }}-top{% endif %}{% if particle.button_visibility != 'inherit' %} jl-visible@{{particle.button_visibility|e}}{% endif %}{{link_transition}}">
<a class="{{button_cls}}{{button_size}}" href="{{ article.route }}" target="{{ particle.buttontarget|default('_self')|e }}" title="{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}">{{ display.read_more.label|e }}</a>
</div>
{% endif %}
{% endset %}

{% if particle.slider_width_mode == 'auto' %}
<li class="tm-item">
{% else %}
<li class="tm-item{% if particle.phone_portrait %} jl-width-{{ particle.phone_portrait|e }}{% endif %}{% if particle.phone_landscape != 'inherit' %} jl-width-{{ particle.phone_landscape|e }}@s{% endif %}{% if particle.tablet_landscape != 'inherit' %} jl-width-{{ particle.tablet_landscape|e }}@m{% endif %}{% if particle.desktop != 'inherit' %} jl-width-{{ particle.desktop|e }}@l{% endif %}{% if particle.large_desktop != 'inherit' %} jl-width-{{ particle.large_desktop|e }}@xl{% endif %}">
{% endif %}

{% if particle.overlay_mode == 'cover' or particle.overlay_mode == 'caption' %}

<div class="jl-cover-container{{toggle_transition}}"{{tab_transition|raw}}>

{% if particle.slider_width_mode == 'auto' %}

{% if display.image.enabled and article.images.image_intro or article.images.image_fulltext %}
{% if article.images.image_intro and display.image.enabled == 'intro' or display.image.enabled == 'show' %}

<img{{imagewidth|raw}}{{imageheight|raw}} class="tm-image{{image_transition}}" src="{{ url(article.images.image_intro) }}"{% if article.images.image_intro_alt %} alt="{{article.images.image_intro_alt}}"{% else %} alt="{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}"{% endif %}>

{% elseif article.images.image_fulltext and display.image.enabled == 'full' %}

<img{{imagewidth|raw}}{{imageheight|raw}} class="tm-image{{image_transition}}" src="{{ url(article.images.image_fulltext) }}"{% if article.images.image_fulltext_alt %} alt="{{article.images.image_fulltext_alt}}"{% else %} alt="{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}"{% endif %}>

{% endif %}
{% endif %}

{% else %}

{% if particle.slider_viewport == 'auto' %}

{% if display.image.enabled and article.images.image_intro or article.images.image_fulltext %}
{% if article.images.image_intro and display.image.enabled == 'intro' or display.image.enabled == 'show' %}

<img{{imagewidth|raw}}{{imageheight|raw}} class="tm-image{{image_transition}}" src="{{ url(article.images.image_intro) }}"{% if article.images.image_intro_alt %} alt="{{article.images.image_intro_alt}}"{% else %} alt="{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}"{% endif %}>

{% elseif article.images.image_fulltext and display.image.enabled == 'full' %}

<img{{imagewidth|raw}}{{imageheight|raw}} class="tm-image{{image_transition}}" src="{{ url(article.images.image_fulltext) }}"{% if article.images.image_fulltext_alt %} alt="{{article.images.image_fulltext_alt}}"{% else %} alt="{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}"{% endif %}>

{% endif %}
{% endif %}

{% else %}

{% if particle.image_transition != 'none' %}
<div class="jl-position-cover{{image_transition}}">
{% endif %}

{% if display.image.enabled and article.images.image_intro or article.images.image_fulltext %}
{% if article.images.image_intro and display.image.enabled == 'intro' or display.image.enabled == 'show' %}

<img{{imagewidth|raw}}{{imageheight|raw}} class="tm-image" src="{{ url(article.images.image_intro) }}"{% if article.images.image_intro_alt %} alt="{{article.images.image_intro_alt}}"{% else %} alt="{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}"{% endif %} jl-cover>

{% elseif article.images.image_fulltext and display.image.enabled == 'full' %}

<img{{imagewidth|raw}}{{imageheight|raw}} class="tm-image" src="{{ url(article.images.image_fulltext) }}"{% if article.images.image_fulltext_alt %} alt="{{article.images.image_fulltext_alt}}"{% else %} alt="{{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}"{% endif %} jl-cover>

{% endif %}
{% endif %}

{% if particle.image_transition != 'none' %}

</div>

{% endif %}

{% endif %}

{% endif %}

{# Load Overlay Style #}

{% if particle.overlay_style == 'none' %}
<div class="{% if particle.overlay_position %}jl-position-{{ particle.overlay_position|e }}{% endif %}">
<div class="jl-panel{{overlay_color}}{% if particle.overlay_padding == 'default' %} jl-padding{% else %} jl-padding-{{ particle.overlay_padding|e }}{% endif %}{% if particle.overlay_maxwidth != 'none' %} jl-width-{{ particle.overlay_maxwidth|e }}{% endif %}{{overlay_transition}} jl-margin-remove-first-child">
{% else %}

{% if particle.overlay_mode == 'cover' %}
<div class="jl-position-cover{% if particle.overlay_margin != 'none' %} jl-position-{{ particle.overlay_margin|e }}{% endif %} {{ particle.overlay_style|e }}{{overlay_transition}}"></div>
{% endif %}

<div class="{% if particle.overlay_position %}jl-position-{{ particle.overlay_position|e }}{% endif %}{% if particle.overlay_margin != 'none' %} jl-position-{{ particle.overlay_margin|e }}{% endif %}">

{% if particle.overlay_mode == 'cover' %}
<div class="jl-overlay{{overlay_color}}{% if particle.overlay_padding != 'default' %} jl-padding-{{ particle.overlay_padding|e }}{% endif %}{% if particle.overlay_maxwidth != 'none' %} jl-width-{{ particle.overlay_maxwidth|e }}{% endif %}{% if particle.animate_background == false %}{{overlay_transition}}{% endif %} jl-margin-remove-first-child">
{% else %}
<div class="jl-overlay{{overlay_color}}{% if particle.overlay_padding != 'default' %} jl-padding-{{ particle.overlay_padding|e }}{% endif %}{% if particle.overlay_maxwidth != 'none' %} jl-width-{{ particle.overlay_maxwidth|e }}{% endif %} {{ particle.overlay_style|e }}{{overlay_transition}} jl-margin-remove-first-child">
{% endif %}

{% endif %}

{% if particle.meta_alignment == 'top' %}
{{item_meta}}
{% endif %}

{{item_title}}

{% if particle.meta_alignment == 'bottom' %}
{{item_meta}}
{% endif %}

{{item_content}}

{% if particle.meta_alignment == 'content' %}
{{item_meta}}
{% endif %}

{{item_button}}

</div>
</div>
{# End Overlay Style #}

{% else %}

{# Start Card Style #}

{% if particle.card_style == 'blank' %}

{# Card Blank #}

<div class="jl-panel jl-margin-remove-first-child{{card_maxwidth_cls}}">

{% if particle.image_alignment == 'top' %}
{{item_image}}
{% endif %}

{% if particle.meta_alignment == 'top' %}
{{item_meta}}
{% endif %}

{{item_title}}

{% if particle.meta_alignment == 'bottom' %}
{{item_meta}}
{% endif %}

{% if particle.image_alignment == 'between' %}
{{item_image}}
{% endif %}

{{item_content}}

{% if particle.meta_alignment == 'content' %}
{{item_meta}}
{% endif %}

{{item_button}}
{{article_edit_link}}

{% if particle.image_alignment == 'bottom' %}
{{item_image}}
{% endif %}

</div>

{# End Card Blank #}

{% else %}

{# Card styles #}

{% if particle.image_padding == '1' %}

<div class="jl-card jl-card-{{ particle.card_style }}{% if particle.card_cardsize != 'default' %} jl-card-{{ particle.card_cardsize }}{% endif %}{{card_maxwidth_cls}}">

{% if particle.image_alignment == 'top' %}
<div class="jl-card-media-top">
{{item_image}}
</div>
{% endif %}

<div class="jl-card-body jl-margin-remove-first-child">

{% if particle.meta_alignment == 'top' %}
{{item_meta}}
{% endif %}

{{item_title}}

{% if particle.meta_alignment == 'bottom' %}
{{item_meta}}
{% endif %}

{% if particle.image_alignment == 'between' %}
{{item_image}}
{% endif %}

{{item_content}}

{% if particle.meta_alignment == 'content' %}
{{item_meta}}
{% endif %}

{{item_button}}

{{article_edit_link}}

</div>

{% if particle.image_alignment == 'bottom' %}
<div class="jl-card-media-bottom">
{{item_image}}
</div>
{% endif %}

</div>

{% else %}

<div class="jl-card jl-card-{{ particle.card_style }} jl-card-body{% if particle.card_cardsize != 'default' %} jl-card-{{ particle.card_cardsize }}{% endif %} jl-margin-remove-first-child{{card_maxwidth_cls}}">

{% if particle.image_alignment == 'top' %}
{{item_image}}
{% endif %}

{% if particle.meta_alignment == 'top' %}
{{item_meta}}
{% endif %}

{{item_title}}

{% if particle.meta_alignment == 'bottom' %}
{{item_meta}}
{% endif %}

{% if particle.image_alignment == 'between' %}
{{item_image}}
{% endif %}

{{item_content}}

{% if particle.meta_alignment == 'content' %}
{{item_meta}}
{% endif %}

{{item_button}}

{{article_edit_link}}

{% if particle.image_alignment == 'bottom' %}
{{item_image}}
{% endif %}

</div>

{% endif %}

{# End card style #}

{% endif %}

{# End Card Style #}

{% endif %}

</li>

{% endfor %}

</ul>

{% if particle.slidenav_position == 'outside' %}
</div>
{% endif %}

{% if particle.slidenav_icon_left and particle.slidenav_icon_right %}
{% set slidenav_icon_left = '<i class="' ~ particle.slidenav_icon_left ~ '" aria-hidden="true"></i>' %}
{% set slidenav_icon_right = '<i class="' ~ particle.slidenav_icon_right ~ '" aria-hidden="true"></i>' %}
{% else %}
{% set slidenav_large_style = particle.larger_slidenav ? ' jl-slidenav-large' %}
{% set slidenav_next = 'jl-slidenav-next' %}
{% set slidenav_prev = 'jl-slidenav-previous' %}
{% endif %}

{% set slidenav_text_color = particle.slidenav_color ? ' jl-' ~ particle.slidenav_color ~ '' %}

{# Slidenav #}
{% if particle.slidenav_position != 'none' %}
{% if particle.slidenav_position == 'default' %}
<div class="{% if particle.slidenav_breakpoint != 'always' %}jl-visible@{{particle.slidenav_breakpoint|e}}{% endif %}{{ particle.slidenav_hover == 'enabled' ? ' jl-hidden-hover jl-hidden-touch' : '' }}{{slidenav_text_color}}">
<a class="tm-slidenav{{ slidenav_large_style }}{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-center-left" href="#" {{slidenav_prev}} jl-slider-item="previous">{{slidenav_icon_left|raw}}</a>
<a class="tm-slidenav{{ slidenav_large_style }}{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-center-right" href="#" {{slidenav_next}} jl-slider-item="next">{{slidenav_icon_right|raw}}</a>
</div>
{% elseif particle.slidenav_position == 'outside' %}
<div class="{% if particle.slidenav_breakpoint != 'always' %}jl-visible@{{particle.slidenav_breakpoint|e}}{% endif %}{% if particle.slidenav_outside_color != 'default' %} jl-{{particle.slidenav_outside_color|e}}{% endif %}">
<a class="tm-slidenav{{ slidenav_large_style }}{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-center-left" href="#" {{slidenav_prev}} jl-slider-item="previous" jl-toggle="cls: jl-position-center-left-out jl-position-center-left; mode: media; media:{% if particle.slidenav_outside_breakpoint != 'always' %} @{{particle.slidenav_outside_breakpoint|e}}{% endif %}">{{slidenav_icon_left|raw}}</a>
<a class="tm-slidenav{{ slidenav_large_style }}{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-center-right" href="#" {{slidenav_next}} jl-slider-item="next" jl-toggle="cls: jl-position-center-right-out jl-position-center-right; mode: media; media:{% if particle.slidenav_outside_breakpoint != 'always' %} @{{particle.slidenav_outside_breakpoint|e}}{% endif %}">{{slidenav_icon_right|raw}}</a>
</div>
{% else %}
<div class="jl-slidenav-container{% if particle.slidenav_margin != 'none' %} jl-position-{{ particle.slidenav_margin|e }}{% endif %} jl-position-{{ particle.slidenav_position|e }}{% if particle.slidenav_breakpoint != 'always' %} jl-visible@{{particle.slidenav_breakpoint|e}}{% endif %}{{ particle.slidenav_hover == 'enabled' ? ' jl-hidden-hover jl-hidden-touch' : '' }}{{slidenav_text_color}}">
<a class="tm-slidenav{{ slidenav_large_style }}" href="#" {{slidenav_prev}} jl-slider-item="previous">{{slidenav_icon_left|raw}}</a>
<a class="tm-slidenav{{ slidenav_large_style }}" href="#" {{slidenav_next}} jl-slider-item="next">{{slidenav_icon_right|raw}}</a>
</div>
{% endif %}
{% endif %}

{# End Slidenav #}

</div>

{# Navigation #}
{% if particle.navigation == 'enabled' %}
{% if particle.navigation_color != 'default' %}
<div class="jl-{{particle.navigation_color|e}}">
{% endif %}
<ul class="tm-nav jl-slider-nav jl-dotnav{% if particle.navigation_position %} jl-flex-{{ particle.navigation_position|e }}{% endif %}{% if particle.navigation_margin %} jl-margin-{{ particle.navigation_margin|e }}{% endif %}{% if particle.navigation_breakpoint != 'always' %} jl-visible@{{particle.navigation_breakpoint|e}}{% endif %}" jl-margin>
{% for article in articles %}
<li jl-slider-item="{{ loop.index0 }}"><a href="#"{% if particle.show_tooltip == '1' %}jl-tooltip="title: {{ display.title.limit ? article.title|truncate_text(display.title.limit) : article.title }}"{% endif %}></a></li>
{% endfor %}
</ul>
{% if particle.navigation_color != 'default' %}
</div>
{% endif %}
{% endif %}
{# End Navigation #}

</div>
{% endif %}
{% endblock %}
