Replace apropos/licence/charte sticky nav with responsive details/summary TOC

- Convert .apropos-toc <nav> to <details class="toc" open> in all three templates
- Add caret-down icon to summary (visible only on mobile via media queries)
- Desktop (≥768px): sticky sidebar via CSS grid, force-open via pointer-events:none, hide caret
- Mobile (≤767px): single column, collapsible TOC with rotating caret, margin-top below search bar
- Rename .apropos-toc-link to .toc-sidebar-link
- Merge 900px and 600px breakpoints into single 600px mobile media query
- Rename apropos.css → content-page.css; update 3 controller references
This commit is contained in:
Pontoporeia
2026-06-22 15:25:15 +02:00
parent 0a2b4781d1
commit cca3d08f05
7 changed files with 132 additions and 84 deletions

View File

@@ -33,9 +33,9 @@ function renderEntries(array $entries): string
} ?>
<main class="page-content" id="main-content">
<!-- LEFT: sticky table of contents -->
<nav class="apropos-toc" aria-label="Sections de la page">
<p class="apropos-toc-label">PARTIES</p>
<!-- Table of contents: collapsible on mobile, force-open on desktop -->
<details class="toc" open>
<summary><?= icon('caret-down', 0, 'toc-caret') ?> PARTIES</summary>
<ul>
<li><a href="#apropos-intro">À propos</a></li>
<?php if (!empty($contacts)): ?>
@@ -45,14 +45,14 @@ function renderEntries(array $entries): string
</ul>
<?php if (!empty($sidebarLinks)): ?>
<?php foreach ($sidebarLinks as $sl): ?>
<div class="apropos-toc-link">
<div class="toc-sidebar-link">
<a href="<?= htmlspecialchars($sl['url'] ?? '#') ?>" target="_blank" rel="noopener">
<?= htmlspecialchars($sl['label'] ?? 'Lien') ?> ↗
</a>
</div>
<?php endforeach; ?>
<?php endif; ?>
</nav>
</details>
<!-- Intro text from DB -->
<section class="content-section" id="apropos-intro">

View File

@@ -1,15 +1,15 @@
<main class="page-content" id="main-content">
<!-- LEFT: sticky table of contents -->
<!-- Table of contents: collapsible on mobile, force-open on desktop -->
<?php if (!empty($tocItems)): ?>
<nav class="apropos-toc" aria-label="Sections de la page">
<p class="apropos-toc-label">PARTIES</p>
<details class="toc" open>
<summary><?= icon('caret-down', 0, 'toc-caret') ?> PARTIES</summary>
<ul>
<?php foreach ($tocItems as $item): ?>
<li><a href="<?= htmlspecialchars($item['href']) ?>"><?= htmlspecialchars($item['label']) ?></a></li>
<?php endforeach; ?>
</ul>
</nav>
</details>
<?php endif; ?>
<div class="content">

View File

@@ -1,15 +1,15 @@
<main class="page-content" id="main-content">
<!-- LEFT: sticky table of contents -->
<!-- Table of contents: collapsible on mobile, force-open on desktop -->
<?php if (!empty($tocItems)): ?>
<nav class="apropos-toc" aria-label="Sections de la page">
<p class="apropos-toc-label">PARTIES</p>
<details class="toc" open>
<summary><?= icon('caret-down', 0, 'toc-caret') ?> PARTIES</summary>
<ul>
<?php foreach ($tocItems as $item): ?>
<li><a href="<?= htmlspecialchars($item['href']) ?>"><?= htmlspecialchars($item['label']) ?></a></li>
<?php endforeach; ?>
</ul>
</nav>
</details>
<?php endif; ?>
<div class="content">