source: Klonkt/src/views/pages/post.ejs@ 7c44c12

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

fix(activitypub): pass locals explicitly into fedi-node include (500 fix)

EJS does not auto-share parent locals with a nested include, so the recursive
fedi-node include lost _base/t/etc. Pass them explicitly in both includes.

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

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