# TekDek Documentation Site — PHP Framework

Built by **Talos** (Technical Coder, TekDek).

## Structure

```
public/
├── index.php          — Main router (all requests)
├── config.php         — Menu structure, site settings, content mapping
├── .htaccess          — Apache URL rewriting
├── includes/
│   ├── top.php        — HTML head, header, navigation
│   ├── bottom.php     — Footer, closing tags
│   ├── menu.php       — Navigation renderer (config-driven)
│   └── functions.php  — Markdown renderer, utilities
├── pages/
│   ├── home.php       — Landing page with card grid
│   ├── about.php      — Vision & Strategy
│   ├── projects.php   — Active projects
│   ├── tools.php      — Tools & Tech stack
│   ├── team.php       — Links to team.html
│   ├── decisions.php  — Decision checklist
│   └── 404.php        — Error page
├── css/
│   ├── base.css       — Colors, typography, resets
│   ├── components.css — Header, nav, cards, buttons, footer
│   └── responsive.css — Mobile/tablet breakpoints
├── js/
│   └── main.js        — Mobile menu toggle
├── content/           — Drop .md files here for auto-rendering
└── assets/            — Images, icons
```

## Setup

1. Point Apache/Nginx document root to `public/`
2. Ensure `mod_rewrite` is enabled (Apache)
3. Adjust `SITE_BASE_URL` in `config.php` if not at root

### Nginx Alternative

```nginx
location / {
    try_files $uri $uri/ /index.php?$query_string;
}
```

## How It Works

- **Routing**: All URLs go through `index.php` → matches slug against `$MENU` in `config.php` → loads `pages/{slug}.php`
- **Content**: Pages can embed HTML directly or call `load_content('slug')` to render a markdown file from `content/`
- **Navigation**: Rendered automatically from `$MENU` config — add/remove pages by editing one array
- **Markdown**: Built-in renderer (no Composer, no dependencies) — supports headings, lists, code blocks, links, images, bold, italic, blockquotes
- **404**: Unknown slugs get a clean 404 page

## Adding a Page

1. Add entry to `$MENU` in `config.php`
2. Optionally add content mapping in `$CONTENT_MAP`
3. Create `pages/{slug}.php` (or just drop a `.md` file in `content/`)

## For Icarus (CSS)

The CSS files are ready for customization:
- `base.css` — CSS variables at `:root`, override colors/fonts here
- `components.css` — All component styles, well-commented
- `responsive.css` — Breakpoints at 768px and 480px

Dark theme variables are already set. The framework uses semantic class names throughout.

## Requirements

- PHP 7.4+
- Apache with mod_rewrite (or Nginx with try_files)
- No Composer, no external dependencies
