{{define "base"}}
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="https://unpkg.com/htmx.org@1.9.2"></script>
  <script>
    // HTMX CSRF token support
    document.body.addEventListener('htmx:configRequest', function(event) {
      const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
      if (csrfToken) {
        event.detail.headers['X-CSRF-Token'] = csrfToken;
      }
    });
  </script>
  <title>{{.Title}}</title>
  <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
  {{if .CSRFToken}}
  <meta name="csrf-token" content="{{.CSRFToken}}">
  {{end}}
</head>
<body class="bg-gray-100">
  <main class="container mx-auto p-4">
    {{template "content" .}}
  </main>
</body>
</html>
{{end}}
