{% extends "@nucleus/page_head.html.twig" %}

{% block head_title -%}
{%- endblock %}

{% block head_application -%}
    {% if gantry.platform.checkVersion(4) %} {# Joomla 4.x #}
    <jdoc:include type="metas" />
    <jdoc:include type="styles" />
    <jdoc:include type="scripts" />
    {% elseif gantry.platform.checkVersion(3) %} {# Joomla 3.x #}
    <jdoc:include type="head" />
    {% endif %}
{%- endblock %}

{% block head_platform -%}
    {{ parent() }}
    {% if gantry.theme.joomla %}
        {% if gantry.platform.checkVersion(4) %} {# Joomla 4.x #}
            {% if gantry.page.direction != 'rtl' %}
            <link rel="stylesheet" href="{{ url('gantry-engine://css-compiled/bootstrap5.css') }}" type="text/css" />
            {% else %}
            <link rel="stylesheet" href="{{ url('gantry-engine://css-compiled/bootstrap5-rtl.css') }}" type="text/css" />
            {% endif %}
            <link rel="stylesheet" href="{{ url('media/system/css/joomla-fontawesome.min.css') }}" type="text/css" />
        {% elseif gantry.platform.checkVersion(3) %} {# Joomla 3.x #}
            <link rel="stylesheet" href="{{ url('gantry-assets://css/bootstrap-gantry.css') }}" type="text/css" />
            <link rel="stylesheet" href="{{ url('gantry-engine://css-compiled/joomla.css') }}" type="text/css" />
            {% if gantry.page.direction == 'rtl' %}
            <link rel="stylesheet" href="{{ url('media/jui/css/bootstrap-rtl.css') }}" type="text/css" />
            {% endif %}
            <link rel="stylesheet" href="{{ url('media/jui/css/icomoon.css') }}" type="text/css" />
        {% endif %}
    {% endif %}

    {% if gantry.theme.joomla %}
        {% if gantry.platform.checkVersion(5) %}
            {# Joomla 5.x #}
            <link rel="stylesheet" href="{{ url('media/plg_system_debug/css/debug.css') }}" type="text/css"/>
        {% elseif gantry.platform.checkVersion(4) %}
            {# Joomla 4.x #}
            <link rel="stylesheet" href="{{ url('media/system/css/debug.css') }}" type="text/css"/>
        {% elseif gantry.platform.checkVersion(3) %}
            {# Joomla 3.x #}
            {% if gantry.debug %}
                <link rel="stylesheet" href="{{ url('media/cms/css/debug.css') }}" type="text/css"/>
            {% endif %}
        {% endif %}
    {% endif %}
{%- endblock %}

{% block head -%}
    {{ parent() }}
{%- endblock %}
