source: Klonkt/src/views/pages/post.ejs@ 3a2c9d3

main
Last change on this file since 3a2c9d3 was 3a2c9d3, checked in by Robin Genis <roboburr@…>, 3 months ago

style(activitypub): match fediverse section to native comment styling

Reuse .comment/.comments-list/.comment-reply markup so inbound replies look
identical to native comments; our reply nests as a comment-reply; reply toggle
is a plain 'Reageer' action (no card/box).

Co-Authored-By: Claude <noreply@…>

  • Property mode set to 100644
File size: 27.5 KB
Line 
1<%
2// In hub mode the site is accessible under /user/<slug>; all site-scoped links
3// (tag, edit, delete, comments) must carry that prefix otherwise they fall back
4// to the primary site → 404 / wrong site. In solo mode _base = ''.
5const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
6%>
7<article class="container post-page">
8
9 <%# Navigation across ALL posts — ABOVE the post (shared partial). %>
10 <%- include('../partials/post-nav', { newerPost: newerPost, olderPost: olderPost }) %>
11
12 <% if (post.cover_image_url) { %>
13 <figure class="post-cover">
14 <img src="<%= post.cover_image_url %>" alt="">
15 </figure>
16 <% } %>
17
18 <header class="post-header">
19 <h1 class="post-title"><%= post.title %></h1>
20 <div class="post-meta">
21 <a class="author" href="/users/<%= encodeURIComponent(post.author_username) %>"
22 hx-get="/users/<%= encodeURIComponent(post.author_username) %>?partial=1"
23 hx-target="#pcms-main" hx-swap="innerHTML"
24 hx-push-url="/users/<%= encodeURIComponent(post.author_username) %>"
25 hx-indicator="#pcms-loading"><%= post.author_username %></a>
26 <span class="meta-sep">·</span>
27 <time datetime="<%= post.published_at || post.created_at %>"><%= formatDate(post.published_at || post.created_at) %></time>
28 <% if (post.status !== 'published') { %>
29 <span class="meta-sep">·</span>
30 <span class="status-badge status-<%= post.status %>"><%= post.status %></span>
31 <% } %>
32 </div>
33 <% if (post.status === 'published') { %>
34 <div class="post-like-row">
35 <%- include('../partials/like-button', { post: post, likedByMe: (typeof likedByMe !== 'undefined' && likedByMe), likeCount: (typeof likeCount !== 'undefined' ? likeCount : 0), loggedIn: !!user, loginNext: _base + '/' + post.slug }) %>
36 </div>
37 <% } %>
38 </header>
39
40 <div class="post-content">
41 <%- post.content_html %>
42 </div>
43
44 <% if (post.tags && post.tags.length > 0) { %>
45 <div class="post-tags">
46 <% post.tags.forEach(t => { %>
47 <a class="tag" href="<%= _base %>/tag/<%= encodeURIComponent(t) %>"
48 hx-get="<%= _base %>/tag/<%= encodeURIComponent(t) %>?partial=1"
49 hx-target="#pcms-main" hx-swap="innerHTML"
50 hx-push-url="<%= _base %>/tag/<%= encodeURIComponent(t) %>"
51 hx-indicator="#pcms-loading">#<%= t %></a>
52 <% }); %>
53 </div>
54 <% } %>
55
56 <!-- Inline admin actions: only visible if user has permission -->
57 <% if (user && (permissions.canEditPost(user, post, site) || permissions.canDeletePost(user, post, site))) { %>
58 <aside class="post-actions">
59 <% if (permissions.canEditPost(user, post, site)) { %>
60 <a href="<%= _base %>/posts/<%= post.slug %>/edit" class="btn"
61 hx-get="<%= _base %>/posts/<%= post.slug %>/edit?partial=1" hx-target="#pcms-main"
62 hx-push-url="<%= _base %>/posts/<%= post.slug %>/edit" hx-indicator="#pcms-loading">
63 ✏️ Edit
64 </a>
65 <% } %>
66 <% if (permissions.canDeletePost(user, post, site)) { %>
67 <form method="post" action="<%= _base %>/posts/<%= post.slug %>/delete" style="display:inline" onsubmit="return confirm('Delete this post?')">
68 <button type="submit" class="btn btn-danger">🗑 Delete</button>
69 </form>
70 <% } %>
71 </aside>
72 <% } %>
73
74 <!-- Fediverse interactions (inbound replies / likes / boosts via ActivityPub) -->
75 <!-- Mirrors the native comment markup/classes so it looks identical. -->
76 <% if (typeof fediverse !== 'undefined' && fediverse && fediverse.total > 0) { %>
77 <section class="post-fediverse post-comments" id="fediverse">
78 <h2 class="comments-heading"><%= t('fedi.heading') %></h2>
79 <p class="fedi-stats">
80 <span title="<%= t('fedi.likes') %>">⭐ <%= fediverse.likeCount %></span>
81 <span title="<%= t('fedi.boosts') %>">🔁 <%= fediverse.announceCount %></span>
82 <span title="<%= t('fedi.replies') %>">💬 <%= fediverse.replies.length %></span>
83 </p>
84 <% if (fediverse.replies.length) { %>
85 <ol class="comments-list">
86 <% fediverse.replies.forEach(function(r) { %>
87 <li class="comment">
88 <div class="comment-avatar">
89 <% if (r.actor_icon) { %><img src="<%= r.actor_icon %>" alt="" loading="lazy">
90 <% } else { %><span><%= (r.actor_name || '?').charAt(0).toUpperCase() %></span><% } %>
91 </div>
92 <div class="comment-body">
93 <div class="comment-meta">
94 <a class="comment-author" href="<%= r.actor_url %>" rel="nofollow noopener" target="_blank"><%= r.actor_name %></a>
95 <span class="fedi-handle"><%= r.actor_handle %></span>
96 <% if (r.published || r.created_at) { %><span class="comment-time"><%= formatDateTime(r.published || r.created_at) %></span><% } %>
97 </div>
98 <div class="comment-content"><%- r.content %></div>
99
100 <% if (typeof canManageSite !== 'undefined' && canManageSite) { %>
101 <details class="fedi-replybox">
102 <summary class="comment-reply-btn fedi-reply-toggle"><%= t('fedi.reply') %></summary>
103 <form method="post" action="<%= _base %>/posts/<%= post.slug %>/fedi-reply" class="comment-reply-form">
104 <input type="hidden" name="interaction_id" value="<%= r.id %>">
105 <textarea name="text" rows="3" required placeholder="<%= t('fedi.reply_ph') %>"></textarea>
106 <div class="comment-reply-form-actions">
107 <button type="submit" class="btn btn-primary"><%= t('fedi.send') %></button>
108 </div>
109 </form>
110 </details>
111 <% } %>
112
113 <% var mine = (typeof fediverse.outReplies !== 'undefined' ? fediverse.outReplies : []).filter(function(o){ return o.in_reply_to && o.in_reply_to === r.object_uri; }); %>
114 <% if (mine.length) { %>
115 <ol class="comment-replies">
116 <% mine.forEach(function(o){ %>
117 <li class="comment comment-reply">
118 <div class="comment-avatar"><span><%= t('fedi.you').charAt(0).toUpperCase() %></span></div>
119 <div class="comment-body">
120 <div class="comment-meta"><span class="comment-author"><%= t('fedi.you') %></span></div>
121 <div class="comment-content"><%- o.content %></div>
122 </div>
123 </li>
124 <% }); %>
125 </ol>
126 <% } %>
127 </div>
128 </li>
129 <% }); %>
130 </ol>
131 <% } %>
132 </section>
133 <% } %>
134
135 <!-- Comments -->
136 <section class="post-comments" id="comments">
137 <h2 class="comments-heading">
138 <%= t(totalComments === 1 ? 'comments.heading_one' : 'comments.heading_other', { n: totalComments }) %>
139 </h2>
140
141 <% if (typeof currentPath === 'string' && currentPath && currentPath.indexOf('/' + post.slug) === 0) { %>
142 <% /* If the URL has ?pending=1, the previous submit landed in the moderation queue */ %>
143 <% } %>
144 <script>
145 (function() {
146 if (location.search.indexOf('pending=1') !== -1) {
147 var s = document.createElement('div');
148 s.className = 'comments-pending-flash';
149 s.textContent = <%- JSON.stringify(t('comments.pending')) %>;
150 document.currentScript.parentNode.insertBefore(s, document.currentScript);
151 }
152 })();
153 </script>
154
155 <% if (!comments || !comments.length) { %>
156 <p class="comments-empty"><%= t('comments.empty') %><% if (!user) { %> <a href="/auth/login?next=<%= encodeURIComponent(_base + '/' + post.slug + '#comments') %>"><%= t('nav.login') %></a> <%= t('comments.to_start') %><% } %></p>
157 <% } else { %>
158 <ol class="comments-list">
159 <% comments.forEach(function(c) { %>
160 <li class="comment" id="comment-<%= c.id %>">
161 <div class="comment-avatar">
162 <% if (c.author_avatar) { %>
163 <img src="<%= c.author_avatar %>" alt="">
164 <% } else { %>
165 <span><%= c.author_username.charAt(0).toUpperCase() %></span>
166 <% } %>
167 </div>
168 <div class="comment-body">
169 <div class="comment-meta">
170 <a class="comment-author" href="/users/<%= encodeURIComponent(c.author_username) %>"><%= c.author_username %></a>
171 <span class="comment-time" title="<%= c.created_at %>"><%= formatDateTime(c.created_at) %></span>
172 </div>
173 <div class="comment-content"><%= c.content %></div>
174 <div class="comment-actions">
175 <% if (user && canMutate) { %>
176 <button type="button" class="comment-reply-btn" data-reply-to="<%= c.id %>"><%= t('comments.reply') %></button>
177 <% } %>
178 <% if (user && permissions.canDeleteComment(user, c, site)) { %>
179 <form method="post" action="<%= _base %>/comments/<%= c.id %>/delete" onsubmit="return confirm('<%= t('comments.delete_confirm') %>')">
180 <button type="submit" class="comment-delete-btn"><%= t('comments.delete') %></button>
181 </form>
182 <% } %>
183 </div>
184
185 <!-- Inline reply form (hidden by default) -->
186 <% if (user && canMutate) { %>
187 <form method="post" action="<%= _base %>/comments" class="comment-reply-form" hidden data-reply-form-for="<%= c.id %>">
188 <input type="hidden" name="post_slug" value="<%= post.slug %>">
189 <input type="hidden" name="parent_comment_id" value="<%= c.id %>">
190 <textarea name="content" rows="3" maxlength="4000" placeholder="<%= t('comments.reply_to', { name: c.author_username }) %>" required></textarea>
191 <div class="comment-reply-form-actions">
192 <button type="submit" class="btn btn-primary"><%= t('comments.reply') %></button>
193 <button type="button" class="btn comment-cancel-reply"><%= t('comments.cancel') %></button>
194 </div>
195 </form>
196 <% } %>
197
198 <!-- Replies (1 level deep) -->
199 <% if (c.replies && c.replies.length) { %>
200 <ol class="comment-replies">
201 <% c.replies.forEach(function(r) { %>
202 <li class="comment comment-reply" id="comment-<%= r.id %>">
203 <div class="comment-avatar">
204 <% if (r.author_avatar) { %>
205 <img src="<%= r.author_avatar %>" alt="">
206 <% } else { %>
207 <span><%= r.author_username.charAt(0).toUpperCase() %></span>
208 <% } %>
209 </div>
210 <div class="comment-body">
211 <div class="comment-meta">
212 <a class="comment-author" href="/users/<%= encodeURIComponent(r.author_username) %>"><%= r.author_username %></a>
213 <span class="comment-time"><%= formatDateTime(r.created_at) %></span>
214 </div>
215 <div class="comment-content"><%= r.content %></div>
216 <div class="comment-actions">
217 <% if (user && canMutate) { %>
218 <button type="button" class="comment-reply-btn" data-reply-to="<%= r.id %>"><%= t('comments.reply') %></button>
219 <% } %>
220 <% if (user && permissions.canDeleteComment(user, r, site)) { %>
221 <form method="post" action="<%= _base %>/comments/<%= r.id %>/delete" onsubmit="return confirm('<%= t('comments.delete_confirm') %>')">
222 <button type="submit" class="comment-delete-btn"><%= t('comments.delete') %></button>
223 </form>
224 <% } %>
225 </div>
226
227 <%# Replying to a reply — lands (via resolvedParent on the
228 server) in the same thread, so the 1-level depth is preserved. %>
229 <% if (user && canMutate) { %>
230 <form method="post" action="<%= _base %>/comments" class="comment-reply-form" hidden data-reply-form-for="<%= r.id %>">
231 <input type="hidden" name="post_slug" value="<%= post.slug %>">
232 <input type="hidden" name="parent_comment_id" value="<%= r.id %>">
233 <textarea name="content" rows="3" maxlength="4000" placeholder="<%= t('comments.reply_to', { name: r.author_username }) %>" required></textarea>
234 <div class="comment-reply-form-actions">
235 <button type="submit" class="btn btn-primary"><%= t('comments.reply') %></button>
236 <button type="button" class="btn comment-cancel-reply"><%= t('comments.cancel') %></button>
237 </div>
238 </form>
239 <% } %>
240 </div>
241 </li>
242 <% }); %>
243 </ol>
244 <% } %>
245 </div>
246 </li>
247 <% }); %>
248 </ol>
249 <% } %>
250
251 <!-- Top-level comment form (only for logged-in users for now) -->
252 <% if (user && canMutate) { %>
253 <form method="post" action="<%= _base %>/comments" class="comment-form">
254 <input type="hidden" name="post_slug" value="<%= post.slug %>">
255 <label class="comment-form-label">
256 <span><%= t('comments.add_as') %> <strong><%= user.username %></strong></span>
257 <textarea name="content" rows="3" maxlength="4000" placeholder="<%= t('comments.placeholder') %>" required></textarea>
258 </label>
259 <button type="submit" class="btn btn-primary"><%= t('comments.post') %></button>
260 </form>
261 <% } else if (!user) { %>
262 <p class="comments-login-cta">
263 <a href="/auth/login?next=<%= encodeURIComponent(_base + '/' + post.slug + '#comments') %>" class="btn"><%= t('comments.login_to_comment') %></a>
264 </p>
265 <% } else { %>
266 <p class="comments-login-cta" style="color:var(--ink-muted)">👁️ Kijker-modus — reageren is uitgeschakeld.</p>
267 <% } %>
268 </section>
269
270 <!-- Reply form toggle -->
271 <script>
272 (function() {
273 document.querySelectorAll('.comment-reply-btn').forEach(function(btn) {
274 btn.addEventListener('click', function() {
275 var id = btn.dataset.replyTo;
276 var form = document.querySelector('[data-reply-form-for="' + id + '"]');
277 if (form) {
278 form.hidden = !form.hidden;
279 if (!form.hidden) form.querySelector('textarea').focus();
280 }
281 });
282 });
283 document.querySelectorAll('.comment-cancel-reply').forEach(function(btn) {
284 btn.addEventListener('click', function() {
285 btn.closest('.comment-reply-form').hidden = true;
286 });
287 });
288 })();
289 </script>
290
291 <%# ── Related posts (3-card grid) ─────────────────────────────
292 Always shown if at least one related post exists. Selection logic
293 lives server-side: same-tag posts ranked by overlap, falling back
294 to most-recent if there's no tag overlap. %>
295 <% if (relatedPosts && relatedPosts.length > 0) { %>
296 <section class="post-related" aria-labelledby="related-heading">
297 <h2 class="post-related-heading" id="related-heading"><%= t('related.title') %></h2>
298 <ul class="post-related-grid">
299 <% relatedPosts.forEach(function(rp) { %>
300 <li class="post-related-card">
301 <a href="<%= rp._urlBase || '' %>/<%= rp.slug %>"<% if (!rp._urlBase) { %>
302 hx-get="/<%= rp.slug %>?partial=1" hx-target="#pcms-main"
303 hx-push-url="/<%= rp.slug %>" hx-indicator="#pcms-loading"<% } %>>
304 <% if (rp.cover_image_url) { %>
305 <span class="post-related-cover"
306 style="background-image: url('<%= rp.cover_image_url %>')"
307 aria-hidden="true"></span>
308 <% } else { %>
309 <span class="post-related-cover post-related-cover--empty" aria-hidden="true"></span>
310 <% } %>
311 <span class="post-related-meta">
312 <span class="post-related-date"><%= formatDate(rp.published_at) %></span>
313 <span class="post-related-title"><%= rp.title %></span>
314 </span>
315 </a>
316 </li>
317 <% }); %>
318 </ul>
319 </section>
320 <% } %>
321
322</article>
323<style>
324.post-page { max-width: 720px; margin: 0.5rem auto 2rem; padding: 0 1rem; }
325.post-cover { margin: 0 0 2rem; border-radius: 8px; overflow: hidden; }
326.post-cover img { width: 100%; height: auto; display: block; }
327.post-header { margin-bottom: 2rem; }
328.post-title { font-family: var(--font-display, serif); font-size: 2.5rem; line-height: 1.1; margin: 0 0 1rem; }
329@media (max-width: 600px) { .post-title { font-size: 1.85rem; } }
330.post-meta { font-size: 0.9rem; color: var(--ink-muted); }
331.author { font-weight: 500; color: var(--ink-soft); text-decoration: none; }
332.author:hover { color: var(--accent); }
333.post-content { font-family: var(--font-body, serif); font-size: 1.1rem; line-height: 1.7; color: var(--ink); }
334.post-content p { margin: 1.2em 0; }
335.post-like-row { margin-top: 1rem; }
336.like-btn {
337 display: inline-flex; align-items: center; gap: 0.45rem;
338 padding: 0.4rem 0.85rem; border: 1px solid var(--rule); border-radius: 999px;
339 background: var(--paper-2); color: var(--ink); font: inherit; font-size: 0.95rem;
340 cursor: pointer; text-decoration: none; transition: border-color 120ms, color 120ms, background 120ms;
341}
342.like-btn:hover { border-color: var(--accent); }
343.like-btn .like-heart { font-size: 1.1rem; line-height: 1; }
344.like-btn.is-liked { border-color: var(--accent); color: var(--accent); }
345.like-btn.is-liked .like-heart { color: var(--accent); }
346.like-btn .like-count { font-variant-numeric: tabular-nums; }
347.post-content h2 { font-family: var(--font-display, serif); font-size: 1.6rem; margin: 2rem 0 1rem; }
348.post-content h3 { font-family: var(--font-display, serif); font-size: 1.3rem; margin: 1.5rem 0 0.75rem; }
349.post-content a { color: var(--accent); }
350.post-content code { background: var(--paper-2); padding: 0.1em 0.4em; border-radius: 3px; font-family: var(--font-mono, monospace); font-size: 0.9em; }
351.post-content pre { background: var(--paper-2); padding: 1rem; border-radius: 6px; overflow-x: auto; }
352.post-content blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; margin: 1.5rem 0; color: var(--ink-soft); font-style: italic; }
353.post-content img { max-width: 100%; height: auto; border-radius: 6px; }
354.post-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 2rem 0; }
355.tag { background: var(--paper-2); color: var(--ink-soft); padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.85rem; text-decoration: none; transition: background 120ms, color 120ms; }
356.tag:hover { background: var(--accent); color: white; }
357.post-actions { display: flex; gap: 0.5rem; margin: 2rem 0; padding: 1rem; background: var(--paper-2); border-radius: 6px; flex-wrap: wrap; }
358
359/* ============================================================
360 Comments
361 ============================================================ */
362.post-comments {
363 margin-top: 3rem;
364 padding-top: 2rem;
365 border-top: 1px solid var(--rule);
366}
367.comments-heading {
368 font-family: var(--font-display, serif);
369 font-size: 1.5rem;
370 margin: 0 0 1.5rem;
371}
372.comments-empty { color: var(--ink-muted, var(--ink-soft)); margin: 0 0 1.5rem; }
373.comments-pending-flash {
374 background: rgba(40, 160, 90, 0.15);
375 color: #2a9d5e;
376 border: 1px solid rgba(40, 160, 90, 0.3);
377 padding: 0.75rem 1rem;
378 border-radius: 6px;
379 margin-bottom: 1rem;
380 font-size: 0.9rem;
381}
382.comments-empty a { color: var(--accent); }
383
384.comments-list, .comment-replies {
385 list-style: none;
386 padding: 0;
387 margin: 0 0 2rem;
388}
389
390.comment {
391 display: flex;
392 gap: 0.85rem;
393 padding: 1rem 0;
394 border-top: 1px solid var(--rule);
395}
396.comments-list > .comment:first-child { border-top: 0; padding-top: 0; }
397
398.comment-avatar {
399 flex-shrink: 0;
400 width: 40px;
401 height: 40px;
402 border-radius: 50%;
403 background: var(--paper-2);
404 border: 1px solid var(--rule);
405 overflow: hidden;
406 display: inline-flex;
407 align-items: center;
408 justify-content: center;
409}
410.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
411.comment-avatar span {
412 font-family: var(--font-display, serif);
413 font-weight: 700;
414 color: var(--accent);
415}
416
417.comment-body { flex: 1; min-width: 0; }
418.comment-meta {
419 display: flex;
420 gap: 0.5rem;
421 align-items: baseline;
422 font-size: 0.85rem;
423 margin-bottom: 0.3rem;
424}
425.comment-author { color: var(--ink); font-weight: 600; text-decoration: none; }
426.comment-author:hover { color: var(--accent); }
427.comment-time { color: var(--ink-muted, var(--ink-soft)); }
428.comment-content {
429 white-space: pre-wrap;
430 word-wrap: break-word;
431 color: var(--ink);
432 line-height: 1.5;
433 font-size: 0.95rem;
434}
435
436.comment-actions {
437 display: flex;
438 gap: 0.5rem;
439 margin-top: 0.4rem;
440}
441.comment-reply-btn, .comment-delete-btn {
442 background: none;
443 border: 0;
444 color: var(--ink-muted, var(--ink-soft));
445 font-size: 0.8rem;
446 cursor: pointer;
447 padding: 0.2rem 0;
448 font-family: inherit;
449 text-transform: uppercase;
450 letter-spacing: 0.04em;
451}
452.comment-reply-btn:hover { color: var(--accent); }
453.comment-delete-btn:hover { color: #c33; }
454
455.comment-replies {
456 margin-top: 1rem;
457 margin-left: 0;
458 border-left: 2px solid var(--rule);
459 padding-left: 1rem;
460}
461.comment-reply { padding: 0.75rem 0; }
462.comment-replies > .comment-reply:first-child { border-top: 0; padding-top: 0; }
463.comment-reply .comment-avatar { width: 32px; height: 32px; }
464.comment-reply .comment-avatar span { font-size: 0.85rem; }
465
466.comment-form, .comment-reply-form {
467 display: flex;
468 flex-direction: column;
469 gap: 0.6rem;
470 background: var(--paper-2);
471 border: 1px solid var(--rule);
472 border-radius: 8px;
473 padding: 1rem;
474 margin-top: 1rem;
475}
476.comment-form-label { display: flex; flex-direction: column; gap: 0.4rem; }
477.comment-form-label > span { font-size: 0.85rem; color: var(--ink-muted, var(--ink-soft)); }
478.comment-form textarea, .comment-reply-form textarea {
479 width: 100%;
480 resize: vertical;
481 min-height: 70px;
482 padding: 0.65rem 0.85rem;
483 border: 1px solid var(--rule);
484 border-radius: 5px;
485 background: var(--paper);
486 color: var(--ink);
487 font-family: inherit;
488 font-size: 0.95rem;
489 line-height: 1.4;
490 box-sizing: border-box;
491}
492.comment-form button { align-self: flex-start; }
493.comment-reply-form-actions { display: flex; gap: 0.5rem; }
494/* Show the reply form only AFTER clicking REPLY. The display:flex above would
495 otherwise override the [hidden] attribute → form was always open. */
496.comment-reply-form[hidden] { display: none; }
497/* DELETE button is inside a <form>; display:contents makes it a direct flex-sibling
498 of REPLY → pixel-perfect alignment + equal gap. */
499.comment-actions form { display: contents; }
500
501.comments-login-cta { margin-top: 1.5rem; text-align: center; }
502
503/* ─── Related posts (3-card grid above pinned-nav) ─────────────── */
504.post-related {
505 margin: 3rem auto 1.5rem;
506 /* Break out of the 720px article column so the cards have room to breathe.
507 Cap at 1100 to match other wide content. */
508 max-width: 1100px;
509 padding: 0 1rem;
510}
511.post-related-heading {
512 font-family: var(--font-ui, system-ui), sans-serif;
513 font-size: 0.75rem;
514 font-weight: 600;
515 text-transform: uppercase;
516 letter-spacing: 0.15em;
517 color: var(--ink-muted, var(--ink-soft));
518 margin: 0 0 1rem;
519}
520.post-related-grid {
521 list-style: none;
522 padding: 0; margin: 0;
523 display: grid;
524 grid-template-columns: repeat(3, minmax(0, 1fr));
525 gap: 1rem;
526}
527@media (max-width: 880px) { .post-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
528@media (max-width: 540px) { .post-related-grid { grid-template-columns: 1fr; } }
529
530.post-related-card {
531 background: var(--paper);
532 border: 1px solid var(--rule);
533 border-radius: 10px;
534 overflow: hidden;
535 transition: border-color 150ms, transform 150ms;
536}
537.post-related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
538.post-related-card a {
539 display: block;
540 color: inherit;
541 text-decoration: none;
542}
543.post-related-cover {
544 display: block;
545 aspect-ratio: 16 / 10;
546 background: var(--paper-2) center/cover no-repeat;
547}
548.post-related-cover--empty {
549 background-image: linear-gradient(135deg,
550 color-mix(in srgb, var(--accent) 12%, var(--paper-2)),
551 var(--paper-2));
552}
553.post-related-meta {
554 display: flex; flex-direction: column; gap: 0.4rem;
555 padding: 0.85rem 1rem 1.1rem;
556}
557.post-related-date {
558 font-size: 0.78rem;
559 color: var(--ink-muted, var(--ink-soft));
560 font-variant-numeric: tabular-nums;
561}
562.post-related-title {
563 font-family: var(--font-display, serif);
564 font-size: 1.1rem;
565 font-weight: 600;
566 color: var(--ink);
567 line-height: 1.25;
568}
569
570/* ─── Pinned navigation cards (v9 style) ───────────────────────── */
571.post-pinned-nav {
572 display: grid;
573 grid-template-columns: 1fr 1fr;
574 gap: 1rem;
575 margin: 1.5rem auto 2rem;
576 max-width: 1100px;
577 padding: 0 1rem;
578}
579@media (max-width: 600px) {
580 .post-pinned-nav { grid-template-columns: 1fr; }
581}
582
583.post-pinned-card {
584 display: flex; align-items: center; gap: 1rem;
585 padding: 1rem 1.25rem;
586 border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
587 background: color-mix(in srgb, var(--accent) 6%, var(--paper));
588 border-radius: 10px;
589 text-decoration: none;
590 color: var(--ink);
591 transition: border-color 150ms, background 150ms, transform 150ms;
592 min-height: 88px;
593}
594.post-pinned-card:hover {
595 border-color: var(--accent);
596 background: color-mix(in srgb, var(--accent) 11%, var(--paper));
597 transform: translateY(-2px);
598}
599.post-pinned-arrow {
600 font-size: 1.6rem;
601 color: var(--accent);
602 flex-shrink: 0;
603 line-height: 1;
604}
605.post-pinned-card--next {
606 /* "Volgende" card aligns text to the right with the arrow on the right
607 side, mirroring v9 — the arrow is on the OPPOSITE end from the body. */
608 flex-direction: row-reverse;
609 text-align: right;
610}
611.post-pinned-body {
612 display: flex; flex-direction: column; gap: 0.25rem;
613 flex: 1; min-width: 0;
614}
615.post-pinned-label {
616 font-family: var(--font-ui, system-ui), sans-serif;
617 font-size: 0.7rem; font-weight: 600;
618 text-transform: uppercase;
619 letter-spacing: 0.1em;
620 color: var(--accent);
621}
622.post-pinned-title {
623 font-family: var(--font-display, serif);
624 font-size: 1.05rem; font-weight: 600;
625 color: var(--ink);
626 line-height: 1.25;
627 overflow: hidden;
628 text-overflow: ellipsis;
629 display: -webkit-box;
630 -webkit-line-clamp: 2;
631 -webkit-box-orient: vertical;
632}
633.post-pinned-cta {
634 font-size: 0.78rem;
635 color: var(--accent);
636 font-weight: 500;
637}
638
639/* Edge-of-stack indicator: dashed border, muted styling. */
640.post-pinned-card--edge {
641 flex-direction: column;
642 align-items: flex-start;
643 justify-content: center;
644 gap: 0.35rem;
645 border-style: dashed;
646 background: transparent;
647 color: var(--ink-muted, var(--ink-soft));
648 cursor: default;
649}
650.post-pinned-card--edge:hover {
651 /* Edge cards aren't clickable — undo the lift effect. */
652 transform: none;
653 border-color: color-mix(in srgb, var(--accent) 50%, transparent);
654 background: transparent;
655}
656.post-pinned-edge-label {
657 font-family: var(--font-ui, system-ui), sans-serif;
658 font-size: 0.72rem;
659 font-weight: 600;
660 text-transform: uppercase;
661 letter-spacing: 0.15em;
662 color: var(--accent);
663}
664.post-pinned-edge-title {
665 font-family: var(--font-display, serif);
666 font-size: 1.05rem;
667 font-weight: 600;
668 color: var(--ink);
669}
670</style>
Note: See TracBrowser for help on using the repository browser.