<!DOCTYPE html>
<html
  <% if @framed %>class="hframed"
  <% end %>>
  <head>
    <title><%= content_for(:title) || "Hack Club Mail" %></title>
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <%= csrf_meta_tags %>
  <%= csp_meta_tag %>
  <%= vite_client_tag %>
  <%= vite_javascript_tag 'public' %>
  <%= vite_stylesheet_tag 'public.scss' %>
  <%= vite_stylesheet_tag '98.css' %>
  <%= yield :head %>
</head>
<body
  data-turbo="false"
  <% if @framed %>class="framed"
  <% end %>>
<% unless @framed %>
    <%= render 'public/backend_controls' %>
    <div class="window" style="min-width: calc(min(516px, 100vw - 40px)); max-width: fit-content <%=yield :additional_style %>">
  <div class="title-bar">
    <div class="title-bar-text"><%= yield :window_title %></div>
    <div class="title-bar-controls">
      <button aria-label="Close" onclick="window.location.href='<%= @return_path || my_mail_path %>'"></button>
    </div>
  </div>
  <div class="window-body">
  <% end %>
  <%= render 'shared/flash' %>
  <%= yield %>
  <% unless @framed %>
  </div>
</div>
<% end %>
</body>
</html> 