<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
	<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
	<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap-icons.min.css') }}">
	<link rel="preload" href="{{ url_for('static', filename='fonts/bootstrap-icons.woff2') }}" as="font" type="font/woff2" crossorigin>
	<link rel="preload" href="{{ url_for('static', filename='fonts/rubik.woff2') }}" as="font" type="font/woff2" crossorigin>

	<!-- favicon -->
	<link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='icons/favicon/apple-touch-icon.png') }}">
	<link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='icons/favicon/favicon-32x32.png') }}">
	<link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='icons/favicon/favicon-16x16.png') }}">
	<link rel="mask-icon" href="{{ url_for('static', filename='icons/favicon/safari-pinned-tab.svg') }}" color="#5bbad5">
	<link rel="shortcut icon" href="{{ url_for('static', filename='icons/favicon/favicon.ico') }}">

	<!-- metadata -->
	<!-- Primary Meta Tags -->
	<meta name="title" content="{{ metadata.title }}" />
	<meta name="description" content="{{ metadata.description }}" />

	<!-- Open Graph / Facebook -->
	<meta property="og:type" content="website" />
	<meta property="og:url" content="{{ metadata.url }}" />
	<meta property="og:title" content="{{ metadata.title }}" />
	<meta property="og:description" content="{{ metadata.description }}" />
	<meta property="og:image" content="{{ metadata.image }}" />

	<!-- Twitter -->
	<meta property="twitter:card" content="summary_large_image" />
	<meta property="twitter:url" content="{{ metadata.url }}" />
	<meta property="twitter:title" content="{{ metadata.title }}" />
	<meta property="twitter:description" content="{{ metadata.description }}" />
	<meta property="twitter:image" content="{{ metadata.image }}" />

	<script src="{{ url_for('static', filename='js/color-modes.js') }}"></script>
	{% block additionalHeadItems %}{% endblock %}
	<title>{% block title %}{% endblock %} | {{ cfg.instanceTitle }}</title>
</head>
<body class="ms-2 me-2 mb-2">
	<a class="visually-hidden-focusable" href="#main-content">Skip to content</a>
	<div class="container-fluid">
		<div class="d-flex {% if logged_in %}justify-content-between {% endif %}align-items-center mt-3 {% if logged_in %}mb-3{% endif %}">
			<ul class="nav nav-underline position-relative">
				<li class="nav-item d-flex align-items-center"><a href="{{ url_for('index') }}" aria-label="{{ cfg.instance.title }}'s icon"><img src="{{ url_for('static', filename='icons/catask.svg') }}" width="32" height="32" alt="{{ cfg.instance.title }}'s icon"></a></li>
				<li class="nav-item"><a class="nav-link {{ homeLink }}" id="home-link" href="{{ url_for('index') }}">Home</a>
				{% if logged_in %}
				<li class="nav-item"><a class="nav-link {{ inboxLink }}" id="inbox-link" href="{{ url_for('inbox') }}">Inbox</a>
				</li>
				<li class="nav-item"><a class="nav-link {{ adminLink }}" id="admin-link" href="{{ url_for('admin.index') }}">Admin</a></li>
				{% endif %}
			</ul>
			{% if logged_in %}
			<ul class="nav nav-underline m-0">
				<li><a class="nav-link" href="{{ url_for('admin.logout') }}">Logout</a></li>
			</ul>
			{% endif %}
		</div>
		{% with messages = get_flashed_messages(with_categories=True) %}
			{% if messages %}
				{% for category, message in messages %}
				<div class="alert alert-{{ category }} alert-dismissible" role="alert">
					<div>{{ message }}</div>
					<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
				</div>
				{% endfor %}
			{% endif %}
		{% endwith %}
		<div id="main-content">
		{% block content %}{% endblock %}
		</div>
	<script src="{{ url_for('static', filename='js/htmx.min.js') }}"></script>
	<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
	<!-- <script src="https://cdn.jsdelivr.net/npm/eruda" onload="eruda.init()"></script> -->
	{% block scripts %}{% endblock %}
	<footer class="py-3 my-4 text-center d-flex justify-content-between align-items-center">
		<div class="row">
			<div class="dropdown bd-mode-toggle">
				<button class="btn py-2 dropdown-toggle fs-5"
						id="bd-theme"
						type="button"
						aria-expanded="false"
						data-bs-toggle="dropdown"
						data-bs-auto-close="outside"
						aria-label="Toggle theme (auto)">
					<i class="bi bi-circle-half my-1" id="theme-icon-active"></i>
					<span class="visually-hidden" id="bd-theme-text">Toggle theme</span>
				</button>
				<ul class="dropdown-menu" aria-labelledby="bd-theme-text">
					<li>
						<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false">
							<i class="bi me-2 opacity-50 bi-sun-fill"></i> Light
							<i class="bi ms-auto d-none bi-check2 theme-check"></i>
						</button>
					</li>
					<li>
						<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="false">
							<i class="bi me-2 opacity-50 bi-moon-stars-fill"></i> Dark
							<i class="bi ms-auto d-none bi-check2 theme-check"></i>
						</button>
					</li>
					<li>
						<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="auto" aria-pressed="false">
							<i class="bi me-2 opacity-50 bi-circle-half"></i> Auto
							<i class="bi ms-auto d-none bi-check2 theme-check"></i>
						</button>
					</li>
				</ul>
			</div>
		</div>
		<div class="d-inline-block">
			<a href="https://git.gay/mst/catask" target="_blank" class="text-body-secondary text-decoration-none">{{ const.appName }} {{ version }}{{ version_id }}</a>
		</div>
	</footer>
	</div>
</body>
</html>
