source: Klonkt/src/views/pages/post.ejs@ c16e0a5

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

feat(activitypub): inbound interactions — replies, likes, boosts (Phase 2)

Inbox now stores incoming Create(reply to our note), Like and Announce (boost),
plus Undo(Like/Announce) and Delete(reply). New ap_interactions table; the post
page shows a 'From the fediverse' section (counts + replies with avatar/handle,
sanitized). Actor name/icon resolved best-effort; reply HTML sanitized.

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

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