{% import 'macros.twig' as macros %}
{# === HEADER ===
header.main_logo -> asset (logo branco)
header.menu -> matriz: menu_text, link_href
header.btn_text -> plain text
header.btn_link -> entry link
#}
{% set main_logo = header.main_logo.one() ?? null %}
{% set secondary_logo = header.secondary_logo.one() ?? null %}
{% set btn_href = header.btn_link.url ?? (header.btn_link ?? '#') %}
{# Home e Contactos: header claro (transparente sobre fundo escuro).
Restantes subpáginas: header dark — variante `.w` (logo/texto escuros sobre fundo claro). #}
{% set is_home = craft.app.request.segments|length == 0 %}
{% set is_contacts = entry is defined and entry and entry.section.handle == 'contacts' %}
{% set dark = not is_home and not is_contacts %}
{% set w = dark ? ' w' : '' %}
{% else %}
{% endif %}
{% elseif main_logo %}
{% endif %}
{# === MENU PRINCIPAL === #}
{% if header.menu|length %}
{% endif %}