source: Klonkt/src/views/pages/post.ejs@ 55bc7f9

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

feat(activitypub): reply back to the fediverse (Phase 4 outbound)

Site owner can reply to an inbound fediverse interaction from the post page. The
reply is sent as a signed Create(Note) with inReplyTo + @Mention to the remote
actor's inbox + our followers, stored in ap_outbox, shown in the thread, and
resolvable at /ap/notes/<id>.

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

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