<!--
Copyright (C) 2026 Stefy Lanza <stefy@nexlab.net>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
-->
{% extends "base.html" %}

{% block title %}{{ title }} - AISBF Dashboard{% endblock %}

{% block content %}
<style>
    .markdown-content {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
        line-height: 1.6;
        color: var(--color-text);
        max-width: 100%;
        overflow-x: auto;
    }
    .markdown-content pre {
        background: var(--bg-accent);
        padding: 16px;
        border-radius: 6px;
        overflow-x: auto;
        border: 1px solid var(--color-border);
        font-family: 'Courier New', Consolas, Monaco, monospace;
        font-size: 13px;
        line-height: 1.45;
        color: var(--color-text);
    }
    .markdown-content code {
        background: var(--bg-accent);
        padding: 2px 6px;
        border-radius: 3px;
        font-family: 'Courier New', Consolas, Monaco, monospace;
        font-size: 13px;
        color: var(--color-text);
    }
    .markdown-content h1 {
        font-size: 2em;
        border-bottom: 2px solid var(--color-primary);
        padding-bottom: 0.3em;
        margin-top: 24px;
        margin-bottom: 16px;
        color: var(--color-text);
    }
    .markdown-content h2 {
        font-size: 1.5em;
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 0.3em;
        margin-top: 24px;
        margin-bottom: 16px;
        color: var(--color-text);
    }
    .markdown-content h3 {
        font-size: 1.25em;
        margin-top: 24px;
        margin-bottom: 16px;
        color: var(--color-text);
    }
    .markdown-content h4, .markdown-content h5, .markdown-content h6 {
        color: var(--color-text);
    }
    .markdown-content ul, .markdown-content ol {
        padding-left: 2em;
        margin-bottom: 16px;
    }
    .markdown-content li {
        margin-bottom: 4px;
    }
    .markdown-content p {
        margin-bottom: 16px;
    }
    .markdown-content a {
        color: var(--color-primary);
        text-decoration: none;
    }
    .markdown-content a:hover {
        text-decoration: underline;
    }
    .markdown-content blockquote {
        padding: 0 1em;
        color: var(--color-muted);
        border-left: 4px solid var(--color-primary);
        margin-bottom: 16px;
    }
    .markdown-content table {
        border-collapse: collapse;
        width: 100%;
        margin-bottom: 16px;
    }
    .markdown-content table th,
    .markdown-content table td {
        padding: 6px 13px;
        border: 1px solid var(--color-border);
    }
    .markdown-content table th {
        background: var(--bg-accent);
        font-weight: 600;
    }
    .markdown-content table tr:nth-child(2n) {
        background: var(--bg-accent)55;
    }
    .markdown-content hr {
        border: none;
        border-top: 1px solid var(--color-border);
        margin: 24px 0;
    }
    .markdown-content img {
        max-width: 100%;
        border-radius: 4px;
    }
    /* Inline code that isn't in a pre block */
    .markdown-content p > code,
    .markdown-content li > code {
        background: var(--bg-accent);
        padding: 2px 6px;
        border-radius: 3px;
        color: var(--color-primary);
    }
</style>

<h2>{{ title }}</h2>

<div class="markdown-content">
    {{ content|safe }}
</div>
<script>
    if (location.hash) {
        const el = document.querySelector(location.hash);
        if (el) el.scrollIntoView();
    }
</script>
{% endblock %}
