"""mgf-brand-web — the Magogi Foundation brand-web kit as an installable package.

The CSS implementation of the Magogi Brand Book (tokens, base, components) plus
the self-hosted fonts, logo marks, Federation-Lattice patterns, the 42-icon
sprite, and — since 0.4.0 — the ``.mgf-console`` operator shell with its Jinja
template pack. Shipped as package data so any MGF web surface consumes ONE
source of truth instead of copying CSS (the drift the federation kept hitting).
``mgf-brand`` itself ships only design tokens + prose; this package fills the
component gap.

Consume it (FastAPI example)::

    from fastapi.staticfiles import StaticFiles
    from fastapi.templating import Jinja2Templates
    from mgf.brand_web import static_dir, templates_dir

    app.mount("/static/brand", StaticFiles(directory=static_dir()), name="brand")
    templates = Jinja2Templates(directory=[str(MY_TEMPLATES), str(templates_dir())])

then load ``/static/brand/{tokens,fonts,base,components}.css`` in your ``<head>``
(see the kit README for the exact snippet). Operator tools additionally load
``instruments.css`` (control-surface components: state chips, the streaming
console, the telemetry live-pane, …) and ``console.css`` (the ``.mgf-console``
app shell) — or simply ``{% extends "mgf/console.html" %}`` from the template
pack, which links everything in canonical order. The template pack is plain
package data: this package still imports no web framework (PEP 420 sibling of
``mgf-common`` under the ``mgf.*`` namespace; enforced by import-linter).
"""

from __future__ import annotations

from pathlib import Path

__all__ = ["__version__", "static_dir", "templates_dir"]

__version__ = "0.5.2"


def static_dir() -> Path:
    """Absolute path to the brand-web static asset directory.

    Mount this directory at ``/static/brand`` (or wherever your ``<head>`` links
    point) to serve the kit's CSS, fonts, logos, icons, and patterns.
    """
    return Path(__file__).parent / "static"


def templates_dir() -> Path:
    """Absolute path to the kit's Jinja template pack (plain package data).

    Add it to your template loader's search path (e.g.
    ``Jinja2Templates(directory=[str(app_templates), str(templates_dir())])``)
    and the kit templates resolve under the ``mgf/`` namespace:
    ``{% extends "mgf/console.html" %}`` for the operator shell,
    ``{% import "mgf/macros.html" as mgf %}`` for the shared macros
    (state chips, icons, origin/derived marks, honest absence), and
    ``mgf/styleguide.html`` — the living styleguide the demo app serves.
    """
    return Path(__file__).parent / "templates"
