{% extends "_layouts/main.html" %} {% import 'macros.twig' as macros %} {% block main %} {# Projeto individual (channel `projects`) — `entry` é o próprio projeto. Campos: title, location, text, image, image_2, gallery, state, features (Table) #} {% set p_image = entry.image.one() ?? null %} {% set p_image_2 = entry.image_2.one() ?? null %} {% set p_gallery = entry.gallery.all() ?? [] %} {% set contacts_page = craft.entries().section('contacts').one() ?? null %} {% set contact_href = contacts_page ? contacts_page.url : '#' %} {# === HERO — nome + estado === #}

{{ macros.limpar_paragrafos(entry.title) }}

{% if entry.state.value %} {% set state_colors = { '0': 'cccccc', '1': '00d52e', '2': 'ffb820', '3': 'e90a0a' } %} {% set state_color = state_colors[entry.state.value] ?? '00d52e' %}

{{ entry.state.label|t }}

{% endif %}
{# === IMAGEM PRINCIPAL (ou visualizador 360 se houver image_3d) === #} {% set p_3d = entry.image_3d.one() ?? null %} {% if p_3d or p_image %}
{% if p_3d %}
{% elseif p_image %} {{ p_image.title ?: entry.title }} {% endif %}
{% endif %} {# === COMODIDADES — imagem + descrição + vantagens (features) === #}

{{ 'title.comodidades'|t|raw }}

{% if p_image_2 %}
{{ p_image_2.title ?: entry.title }}
{% endif %}
{% if entry.text %}

{{ macros.limpar_paragrafos(entry.text) }}

{% endif %} {{ 'btn.entrar_contacto'|t }}
{% if entry.features is defined and entry.features|length %}
{% for row in entry.features %} {% set f_label = row.label ?? row.col1 ?? '' %} {% set f_text = row.text ?? row.col2 ?? '' %} {% if f_label or f_text %}

{{ f_label ?: f_text }}

{% endif %} {% endfor %}
{% endif %}
{# === GALERIA === #} {% if p_gallery|length %}

{{ 'title.galeria'|t }}

{% for img in p_gallery %} {{ img.title }} {% endfor %}
{% endif %} {# === CONTACTO (bloco de formulário fixo do template) === Heading via tradução; imagens decorativas estáticas em /uploads/. Formulário Webflow mantido como está. ========================= #}

{{ 'title.mensagem_direta'|t|raw }}

{{ freeform.form('contacto').render }}
{% endblock %}