source: Klonkt/src/views/pages/post.ejs@ 594cc50

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

fix(activitypub): remote-reply button — data attrs + delegated handler

The inline onclick used JSON.stringify (double quotes) inside a double-quoted
attribute, which closed the attribute early and broke the button. Replaced with
data-* attributes + a single delegated click handler.

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

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