<!DOCTYPE html>
<html lang="<%= controller_name == 'languages' ? accept_language : I18n.locale %>">
  <head>
    <title><%= content_for?(:title) ? yield(:title) : t(:project_name) %></title>
    
    <%= tag :meta, name: 'description', content: content_for?(:meta_description) ? yield(:meta_description) : (@node.present?? @node.page_description : '') %>
    <meta name="viewport" content="width=device-width,initial-scale=1">
    
    <link rel="apple-touch-icon" href="/ikea-favicon-300x300.png">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" sizes="16x16 32x32">
    <link rel="icon" sizes="192x192" href="/ikea-favicon-300x300.png">    
        
    <%= stylesheet_link_tag "application" %>
    <%= frontend_javascript_importmap_tags %>
    
  </head>
  <body>
    <header>
      <%= link_to svg('ikea-foundation-logo'), root_url %>
      <div>
        <% if controller_name == 'languages' %>
        <% I18n.available_locales.each do |l| %>
          <%= tag.div t('can_you_spot_the_link', locale: l).html_safe, data: {locale: l} %>
        <% end %>
        <% else %>
          <%= t('can_you_spot_the_link').html_safe %>
        <% end %>
      </div>
    </header>

    <main>
      <%= yield %>
    </main>

    <footer>© Inter IKEA Systems B.V. 2024</footer>
  </body>
</html>
