<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title><%= seoMeta.title || page.title || 'Page' %></title>
  <% if (seoMeta.description) { %>
  <meta name="description" content="<%= seoMeta.description %>">
  <% } %>
  <% if (seoMeta.keywords) { %>
  <meta name="keywords" content="<%= seoMeta.keywords %>">
  <% } %>
  <% if (seoMeta.ogImage) { %>
  <meta property="og:image" content="<%= seoMeta.ogImage %>">
  <% } %>
  <% if (seoMeta.canonicalUrl) { %>
  <link rel="canonical" href="<%= seoMeta.canonicalUrl %>">
  <% } %>
  <meta property="og:title" content="<%= seoMeta.title || page.title || 'Page' %>">
  <% if (seoMeta.description) { %>
  <meta property="og:description" content="<%= seoMeta.description %>">
  <% } %>
  <script src="https://cdn.tailwindcss.com"></script>
  <style>
    <% if (customCss) { %>
    <%= customCss %>
    <% } %>
  </style>
</head>
<body class="min-h-screen bg-white">
  <%- include('../partials/header.ejs', { page, pageContext, req }) %>
  
  <main>
    <%- include('../templates/' + (templatePath ? templatePath.replace('pages/templates/', '') : 'default.ejs'), { 
      page, 
      blocks, 
      seoMeta,
      pageContext,
      req 
    }) %>
  </main>
  
  <%- include('../partials/footer.ejs', { page, pageContext, req }) %>
  
  <% if (customJs) { %>
  <script>
    <%= customJs %>
  </script>
  <% } %>
</body>
</html>
