{% load static %}
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="{% block meta_description %}Faktenkompass – Überprüfbare Fakten und Quellen.{% endblock %}">
    <title>{% block title %}Faktenkompass{% endblock %}</title>
    <link rel="icon" href="{% static 'img/favicon.ico' %}" sizes="any">
    <link rel="icon" href="{% static 'img/favicon.svg' %}" type="image/svg+xml">
    <link rel="apple-touch-icon" href="{% static 'img/apple-touch-icon.png' %}">
    <link rel="manifest" href="{% static 'site.webmanifest' %}">
    <link rel="mask-icon" href="{% static 'img/safari-pinned-tab.svg' %}" color="#0d9488">
    <meta name="theme-color" content="#0d9488">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
    <link href="{% static 'css/custom.css' %}" rel="stylesheet">
    <script>
        (function () {
            var t = localStorage.getItem('fk-theme');
            if (!t) {
                t = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
            }
            document.documentElement.setAttribute('data-theme', t);
        })();
    </script>
    <script src="{% static 'js/theme.js' %}" defer></script>
    <script src="{% static 'js/live-search.js' %}" defer></script>
</head>
<body class="d-flex flex-column min-vh-100">
    <header class="fk-nav">
        <div class="container fk-nav-inner">
            <a class="fk-brand" href="{% url 'claims:home' %}">
                <span class="fk-brand-icon">
                    <img src="{% static 'img/logo.svg' %}" width="28" height="28" alt="">
                </span>
                Faktenkompass
            </a>
            <nav class="fk-nav-links" aria-label="Hauptnavigation">
                <a class="fk-nav-link{% if request.resolver_match.url_name == 'home' %} active{% endif %}" href="{% url 'claims:home' %}">Themen</a>
                <a class="fk-nav-link{% if request.resolver_match.url_name == 'search' %} active{% endif %}" href="{% url 'claims:search' %}">Suche</a>
                <button type="button" class="fk-theme-btn" id="fk-theme-toggle" aria-label="Farbschema umschalten">
                    <i class="bi bi-sun fk-icon-sun" aria-hidden="true"></i>
                    <i class="bi bi-moon fk-icon-moon" hidden aria-hidden="true"></i>
                </button>
            </nav>
        </div>
    </header>

    <main class="flex-grow-1 fk-main">
        <div class="container">
            {% block content %}{% endblock %}
        </div>
    </main>

    <footer class="fk-footer">
        <div class="container">
            <p>&copy; {% now "Y" %} Faktenkompass</p>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
    {% block extra_js %}{% endblock %}
</body>
</html>
