source: Klonkt/src/views/pages/post.ejs@ 22d2f5a8

main
Last change on this file since 22d2f5a8 was 22d2f5a8, checked in by Robin <roboburr@…>, 7 weeks ago

Feature: "Interact via the fediverse" next to the Share button

A visitor can now reply/like/boost a post from their own fediverse
server straight from the top of the post, next to Share. Reuses the
existing fedi-remote flow (click -> asks for your server -> redirects to
your instance's authorize_interaction for this post's URI). Hidden for
the owner/admin (their own post) and when AP is off. Removed the
now-duplicate CTA that sat lower in the fediverse section, so there is
one prominent place. Dropped the now-unused _postAbsUrl var.

Browser-verified: present in the share row for visitors, absent for the
owner, and the click pops the server-input form targeting the post URI.

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

  • Property mode set to 100644
File size: 27.4 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<%= post.nsfw ? ' nsfw-gate' : '' %>">
8
9 <%# Navigation across ALL posts — ABOVE the post (shared partial). %>
10 <%- include('../partials/post-nav', { newerPost: newerPost, olderPost: olderPost }) %>
11
12 <% if (post.nsfw) { %>
13 <div class="nsfw-banner">
14 <span class="nsfw-banner-icon">🔞</span>
15 <span class="nsfw-banner-text"><%= post.content_warning || t('post.nsfw_warning') %></span>
16 <button type="button" class="nsfw-banner-btn nsfw-reveal"><%= t('post.nsfw_show') %></button>
17 </div>
18 <% } %>
19
20 <% if (post.cover_image_url) { %>
21 <figure class="post-cover">
22 <img src="<%= post.cover_image_url %>" alt="<%= post.cover_alt || '' %>"<% if (post.cover_video_url) { %> data-ios-mp4="<%= post.cover_video_url %>"<% } %>>
23 </figure>
24 <% } else if (post.cover_video_url) { %>
25 <figure class="post-cover">
26 <video src="<%= post.cover_video_url %>" poster="<%= thumb(post.cover_video_url, 1280) %>" controls loop muted playsinline preload="metadata"></video>
27 </figure>
28 <% } %>
29
30 <header class="post-header">
31 <h1 class="post-title"><%= post.title %></h1>
32 <div class="post-meta">
33 <a class="author" href="/users/<%= encodeURIComponent(post.author_username) %>"
34 hx-get="/users/<%= encodeURIComponent(post.author_username) %>?partial=1"
35 hx-target="#pcms-main" hx-swap="innerHTML"
36 hx-push-url="/users/<%= encodeURIComponent(post.author_username) %>"
37 hx-indicator="#pcms-loading"><%= post.author_username %></a>
38 <span class="meta-sep">·</span>
39 <time datetime="<%= post.published_at || post.created_at %>"><%= formatDate(post.published_at || post.created_at) %></time>
40 <% if (post.status !== 'published') { %>
41 <span class="meta-sep">·</span>
42 <span class="status-badge status-<%= post.status %>"><%= post.status %></span>
43 <% } %>
44 </div>
45 </header>
46
47 <div class="post-content">
48 <%- post.content_html %>
49 </div>
50
51 <% if (typeof poll !== 'undefined' && poll) { %>
52 <section class="poll" aria-label="<%= t('poll.aria') %>">
53 <% poll.options.forEach(function(o){ var _lead = poll.total > 0 && o.count === Math.max.apply(null, poll.options.map(function(x){return x.count;})); %>
54 <div class="poll-opt<%= _lead ? ' is-lead' : '' %>">
55 <div class="poll-bar" style="width:<%= o.pct %>%"></div>
56 <span class="poll-name"><%= o.name %></span>
57 <span class="poll-pct"><%= o.pct %>%</span>
58 </div>
59 <% }); %>
60 <div class="poll-meta">
61 <span><%= poll.voters %> <%= poll.voters === 1 ? t('poll.voter_one') : t('poll.voter_many') %></span>
62 <span aria-hidden="true">·</span>
63 <% if (poll.closed) { %>
64 <span><%= t('poll.closed') %></span>
65 <% } else if (poll.endTime) { %>
66 <span><%= t('poll.closes') %> <%= new Date(poll.endTime).toLocaleString() %></span>
67 <% } %>
68 <% if (poll.multiple) { %><span aria-hidden="true">·</span><span><%= t('poll.multiple') %></span><% } %>
69 </div>
70 <p class="poll-note"><%= t('poll.fedi_only') %></p>
71 </section>
72 <% } %>
73
74 <% if (post.tags && post.tags.length > 0) { %>
75 <div class="post-tags">
76 <% post.tags.forEach(t => { %>
77 <a class="tag" href="<%= _base %>/tag/<%= encodeURIComponent(t) %>"
78 hx-get="<%= _base %>/tag/<%= encodeURIComponent(t) %>?partial=1"
79 hx-target="#pcms-main" hx-swap="innerHTML"
80 hx-push-url="<%= _base %>/tag/<%= encodeURIComponent(t) %>"
81 hx-indicator="#pcms-loading">#<%= t %></a>
82 <% }); %>
83 </div>
84 <% } %>
85
86 <div class="post-share" style="margin:1.25rem 0;display:flex;align-items:center;gap:.6rem;flex-wrap:wrap">
87 <button type="button" class="btn post-share-btn" data-share data-share-title="<%= post.title %>">🔗 <%= t('post.share') %></button>
88 <%# Interact via the fediverse — for VISITORS (reply/like/boost from their own
89 server). Same flow as the CTA in the fediverse section; hidden for the
90 owner/admin (their own post) and when AP is off. %>
91 <% if (post.status === 'published' && (typeof apEnabled === 'undefined' || apEnabled) && (typeof canManageSite === 'undefined' || !canManageSite)) { %>
92 <% var _shareAbsUrl = (typeof ogOrigin !== 'undefined' && ogOrigin ? ogOrigin : '') + (typeof _base !== 'undefined' && _base ? _base : '') + '/' + post.slug; %>
93 <button type="button" class="btn fedi-remote-reply-btn" data-fedi-uri="<%= _shareAbsUrl %>" data-fedi-ph="<%= t('fedi.remote_ph') %>">
94 <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="17 1 21 5 17 9"/><path d="M3 11V9a4 4 0 0 1 4-4h14"/><polyline points="7 23 3 19 7 15"/><path d="M21 13v2a4 4 0 0 1-4 4H3"/></svg>
95 <%= t('fedi.remote_interact') %>
96 </button>
97 <% } %>
98 <span class="post-share-feedback" id="post-share-feedback" style="color:var(--accent);font-size:.85rem" hidden><%= t('post.share_copied') %></span>
99 </div>
100
101 <!-- Inline admin actions: only visible if user has permission -->
102 <% if (user && (permissions.canEditPost(user, post, site) || permissions.canDeletePost(user, post, site))) { %>
103 <aside class="post-actions">
104 <% if (permissions.canEditPost(user, post, site)) { %>
105 <a href="<%= _base %>/posts/<%= post.slug %>/edit" class="btn"
106 hx-get="<%= _base %>/posts/<%= post.slug %>/edit?partial=1" hx-target="#pcms-main"
107 hx-push-url="<%= _base %>/posts/<%= post.slug %>/edit" hx-indicator="#pcms-loading">
108 ✏️ Edit
109 </a>
110 <% } %>
111 <% if (permissions.canDeletePost(user, post, site)) { %>
112 <form method="post" action="<%= _base %>/posts/<%= post.slug %>/delete" style="display:inline" data-confirm="Delete this post?">
113 <button type="submit" class="btn btn-danger">🗑 Delete</button>
114 </form>
115 <% } %>
116 </aside>
117 <% } %>
118
119 <!-- Fediverse interactions — single place: ⭐ like (clickable) + 🔁/💬 counts + reply -->
120 <% var _fedi = (typeof fediverse !== 'undefined' && fediverse) ? fediverse : { thread: [], likeCount: 0, announceCount: 0 }; %>
121 <% if (post.status === 'published' && (typeof apEnabled === 'undefined' || apEnabled)) { %>
122 <section class="post-fediverse post-comments" id="fediverse">
123 <h2 class="comments-heading"><%= t('fedi.heading') %></h2>
124 <div class="fedi-stats">
125 <span class="fedi-stat" title="<%= t('fedi.likes') %>">
126 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
127 <span><%= _fedi.likeCount %></span>
128 </span>
129 <span class="fedi-stat" title="<%= t('fedi.boosts') %>">
130 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="17 1 21 5 17 9"/><path d="M3 11V9a4 4 0 0 1 4-4h14"/><polyline points="7 23 3 19 7 15"/><path d="M21 13v2a4 4 0 0 1-4 4H3"/></svg>
131 <span><%= _fedi.announceCount %></span>
132 </span>
133 <span class="fedi-stat" title="<%= t('fedi.replies') %>">
134 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
135 <span><%= (_fedi.thread || []).length %></span>
136 </span>
137 </div>
138 <% if (_fedi.thread && _fedi.thread.length) { %>
139 <ol class="comments-list">
140 <% _fedi.thread.forEach(function(n){ %>
141 <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, postSlug: post.slug }) %></li>
142 <% }); %>
143 </ol>
144 <% } %>
145 <%# The "Interact via the fediverse" button for visitors now lives next to
146 the Share button at the top of the post (single, prominent place). %>
147 </section>
148 <% } %>
149 <script>
150 (function(){
151 if (window.__fediRemoteWired) return; window.__fediRemoteWired = true;
152 var current = null, currentBtn = null;
153 function close(){ if (current) { current.remove(); current = null; currentBtn = null; } }
154 function go(raw, uri){
155 var d = (raw||'').trim().replace(/^@?[^@\s]*@/, '').replace(/^https?:\/\//i, '').replace(/\/.*$/, '').trim();
156 if (d) { try { localStorage.setItem('pcmsFediServer', d); } catch(e){} location.href = 'https://' + d + '/authorize_interaction?uri=' + encodeURIComponent(uri||''); }
157 }
158 function place(f, b){
159 var r = b.getBoundingClientRect();
160 f.style.top = (r.bottom + window.scrollY + 6) + 'px';
161 f.style.left = Math.max(8, Math.min(r.left + window.scrollX, window.scrollX + window.innerWidth - 340)) + 'px';
162 }
163 document.addEventListener('click', function(e){
164 if (e.target.closest && e.target.closest('.fedi-remote-cancel')) { close(); return; }
165 if (current && e.target.closest && e.target.closest('.fedi-remote-form')) return; // click inside → keep
166 var b = e.target.closest && e.target.closest('.fedi-remote-reply-btn');
167 if (b) {
168 e.preventDefault();
169 if (currentBtn === b) { close(); return; } // toggle off
170 close();
171 var f = document.createElement('form');
172 f.className = 'fedi-remote-form';
173 f.dataset.uri = b.getAttribute('data-fedi-uri') || '';
174 f.innerHTML = '<input type="text" autocomplete="off" spellcheck="false">'
175 + '<button type="submit" class="btn btn-primary fedi-remote-go" aria-label="ok">&rarr;</button>'
176 + '<button type="button" class="fedi-remote-cancel" aria-label="x">&times;</button>';
177 var _inp = f.querySelector('input');
178 _inp.placeholder = b.getAttribute('data-fedi-ph') || 'mastodon.social';
179 try { var _sv = localStorage.getItem('pcmsFediServer'); if (_sv) _inp.value = _sv; } catch(e){}
180 document.body.appendChild(f); // floating popover → no layout reflow
181 place(f, b); current = f; currentBtn = b;
182 _inp.focus(); _inp.select();
183 return;
184 }
185 if (current) close(); // click anywhere else closes it
186 });
187 document.addEventListener('submit', function(e){
188 var f = e.target.closest && e.target.closest('.fedi-remote-form');
189 if (!f) return; e.preventDefault();
190 go(f.querySelector('input').value, f.dataset.uri);
191 });
192 document.addEventListener('keydown', function(e){ if (e.key === 'Escape') close(); });
193 window.addEventListener('scroll', close, true);
194 })();
195 </script>
196
197
198 <%# ── Related posts (3-card grid) ─────────────────────────────
199 Always shown if at least one related post exists. Selection logic
200 lives server-side: same-tag posts ranked by overlap, falling back
201 to most-recent if there's no tag overlap. %>
202 <% if (relatedPosts && relatedPosts.length > 0) { %>
203 <section class="post-related" aria-labelledby="related-heading">
204 <h2 class="post-related-heading" id="related-heading"><%= t('related.title') %></h2>
205 <ul class="post-related-grid">
206 <% relatedPosts.forEach(function(rp) { %>
207 <li class="post-related-card">
208 <a href="<%= rp._urlBase || '' %>/<%= rp.slug %>"<% if (!rp._urlBase) { %>
209 hx-get="/<%= rp.slug %>?partial=1" hx-target="#pcms-main"
210 hx-push-url="/<%= rp.slug %>" hx-indicator="#pcms-loading"<% } %>>
211 <% if (rp.cover_image_url) { %>
212 <span class="post-related-cover<%= rp.nsfw ? ' nsfw-media' : '' %>" aria-hidden="true"><img class="post-related-img" src="<%= rp.cover_image_url %>" alt="" loading="lazy" decoding="async"<% if (rp.cover_video_url) { %> data-ios-mp4="<%= rp.cover_video_url %>"<% } %>><% if (rp.nsfw) { %><span class="nsfw-veil"><%- include('../partials/nsfw-veil', { cw: rp.content_warning }) %></span><% } %></span>
213 <% } else { %>
214 <span class="post-related-cover post-related-cover--empty<%= rp.nsfw ? ' nsfw-media' : '' %>" aria-hidden="true"><% if (rp.nsfw) { %><span class="nsfw-veil"><%- include('../partials/nsfw-veil', { cw: rp.content_warning }) %></span><% } %></span>
215 <% } %>
216 <span class="post-related-meta">
217 <span class="post-related-date"><%= formatDate(rp.published_at) %></span>
218 <span class="post-related-title"><%= rp.title %></span>
219 </span>
220 </a>
221 </li>
222 <% }); %>
223 </ul>
224 </section>
225 <% } %>
226
227</article>
228<style>
229.post-page { max-width: 720px; margin: 0.5rem auto 2rem; padding: 0 1rem; }
230.post-cover { margin: 0 0 2rem; border-radius: 8px; overflow: hidden; }
231.post-cover img, .post-cover video { width: 100%; height: auto; display: block; }
232.post-header { margin-bottom: 2rem; }
233.post-title { font-family: var(--font-display, serif); font-size: 2.5rem; line-height: 1.1; margin: 0 0 1rem; }
234@media (max-width: 600px) { .post-title { font-size: 1.85rem; } }
235.post-meta { font-size: 0.9rem; color: var(--ink-muted); }
236.author { font-weight: 500; color: var(--ink-soft); text-decoration: none; }
237.author:hover { color: var(--accent); }
238.post-content { font-family: var(--font-body, serif); font-size: 1.1rem; line-height: 1.7; color: var(--ink); }
239.post-content p { margin: 1.2em 0; }
240/* Poll (a hosted AS2 Question) — display-only; voting happens from the fediverse. */
241.poll { margin: 1.75rem 0; display: flex; flex-direction: column; gap: .5rem; }
242.poll-opt { position: relative; display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; border: 1px solid var(--line, rgba(128,128,128,.25)); border-radius: 8px; overflow: hidden; font-size: .98rem; }
243.poll-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 18%, transparent); z-index: 0; transition: width .3s ease; }
244.poll-opt.is-lead .poll-bar { background: color-mix(in srgb, var(--accent) 30%, transparent); }
245.poll-name { position: relative; z-index: 1; flex: 1; color: var(--ink); }
246.poll-opt.is-lead .poll-name { font-weight: 600; }
247.poll-pct { position: relative; z-index: 1; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
248.poll-meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .85rem; color: var(--ink-muted); }
249.poll-note { font-size: .8rem; color: var(--ink-muted); margin: .1rem 0 0; }
250.like-btn {
251 display: inline-flex; align-items: center; gap: 0.45rem;
252 padding: 0.4rem 0.85rem; border: 1px solid var(--rule); border-radius: 999px;
253 background: var(--paper-2); color: var(--ink); font: inherit; font-size: 0.95rem;
254 cursor: pointer; text-decoration: none; transition: border-color 120ms, color 120ms, background 120ms;
255}
256.like-btn:hover { border-color: var(--accent); }
257.like-btn .like-heart { font-size: 1.1rem; line-height: 1; }
258.like-btn.is-liked { border-color: var(--accent); color: var(--accent); }
259.like-btn.is-liked .like-heart { color: var(--accent); }
260.like-btn .like-count { font-variant-numeric: tabular-nums; }
261.post-content h2 { font-family: var(--font-display, serif); font-size: 1.6rem; margin: 2rem 0 1rem; }
262.post-content h3 { font-family: var(--font-display, serif); font-size: 1.3rem; margin: 1.5rem 0 0.75rem; }
263.post-content a { color: var(--accent); }
264.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; }
265.post-content pre { background: var(--paper-2); padding: 1rem; border-radius: 6px; overflow-x: auto; }
266.post-content blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; margin: 1.5rem 0; color: var(--ink-soft); font-style: italic; }
267.post-content img { max-width: 100%; height: auto; border-radius: 6px; }
268.post-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 2rem 0; }
269.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; }
270.tag:hover { background: var(--accent); color: white; }
271.post-actions { display: flex; gap: 0.5rem; margin: 2rem 0; padding: 1rem; background: var(--paper-2); border-radius: 6px; flex-wrap: wrap; }
272
273/* ============================================================
274 Comments
275 ============================================================ */
276.post-comments {
277 margin-top: 3rem;
278 padding-top: 2rem;
279 border-top: 1px solid var(--rule);
280}
281.comments-heading {
282 font-family: var(--font-display, serif);
283 font-size: 1.5rem;
284 margin: 0 0 1.5rem;
285}
286.comments-empty { color: var(--ink-muted, var(--ink-soft)); margin: 0 0 1.5rem; }
287.comments-pending-flash {
288 background: rgba(40, 160, 90, 0.15);
289 color: #2a9d5e;
290 border: 1px solid rgba(40, 160, 90, 0.3);
291 padding: 0.75rem 1rem;
292 border-radius: 6px;
293 margin-bottom: 1rem;
294 font-size: 0.9rem;
295}
296.comments-empty a { color: var(--accent); }
297
298.comments-list, .comment-replies {
299 list-style: none;
300 padding: 0;
301 margin: 0 0 2rem;
302}
303
304.comment {
305 display: flex;
306 gap: 0.85rem;
307 padding: 1rem 0;
308 border-top: 1px solid var(--rule);
309}
310.comments-list > .comment:first-child { border-top: 0; padding-top: 0; }
311
312.comment-avatar {
313 flex-shrink: 0;
314 width: 40px;
315 height: 40px;
316 border-radius: 50%;
317 background: var(--paper-2);
318 border: 1px solid var(--rule);
319 overflow: hidden;
320 display: inline-flex;
321 align-items: center;
322 justify-content: center;
323}
324.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
325.comment-avatar span {
326 font-family: var(--font-display, serif);
327 font-weight: 700;
328 color: var(--accent);
329}
330
331.comment-body { flex: 1; min-width: 0; }
332.comment-meta {
333 display: flex;
334 gap: 0.5rem;
335 align-items: baseline;
336 flex-wrap: wrap;
337 row-gap: 0.1rem;
338 font-size: 0.85rem;
339 margin-bottom: 0.3rem;
340}
341.comment-author { color: var(--ink); font-weight: 600; text-decoration: none; }
342.comment-author:hover { color: var(--accent); }
343.comment-time { color: var(--ink-muted, var(--ink-soft)); }
344.comment-meta .fedi-handle { overflow-wrap: anywhere; }
345@media (max-width: 560px) {
346 .comment-meta .comment-time { flex-basis: 100%; font-size: 0.78rem; color: var(--ink-faint, var(--ink-muted)); }
347}
348.comment-content {
349 white-space: pre-wrap;
350 word-wrap: break-word;
351 color: var(--ink);
352 line-height: 1.5;
353 font-size: 0.95rem;
354}
355
356.comment-actions {
357 display: flex;
358 gap: 0.5rem;
359 margin-top: 0.4rem;
360 flex-wrap: wrap;
361 align-items: center;
362}
363.fedi-owner-react { display: inline; }
364.fedi-owner-reply { display: inline-block; }
365.fedi-owner-reply[open] { flex-basis: 100%; }
366.comment-reply-btn, .comment-delete-btn {
367 background: none;
368 border: 0;
369 color: var(--ink-muted, var(--ink-soft));
370 font-size: 0.8rem;
371 cursor: pointer;
372 padding: 0.2rem 0;
373 font-family: inherit;
374 text-transform: uppercase;
375 letter-spacing: 0.04em;
376}
377.comment-reply-btn:hover { color: var(--accent); }
378.comment-delete-btn:hover { color: #c33; }
379
380/* Owner comment-action icons — same visual language as the News feed, compact (30px). */
381.fedi-cact { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; padding: 0; box-sizing: border-box;
382 display: inline-flex; align-items: center; justify-content: center; list-style: none;
383 border: 1px solid color-mix(in srgb, var(--ink, #000) 14%, transparent);
384 background: color-mix(in srgb, var(--ink, #000) 3%, transparent);
385 color: var(--ink-soft, #888); cursor: pointer; -webkit-tap-highlight-color: transparent;
386 transition: background .12s, border-color .12s, transform .1s; }
387.fedi-cact::-webkit-details-marker { display: none; }
388.fedi-cact svg { width: 15px; height: 15px; display: block; }
389.fedi-cact:active { transform: scale(.9); }
390.fedi-cact-like svg { color: #e8b04b; }
391.fedi-cact-like:hover { background: color-mix(in srgb, #e8b04b 15%, transparent); border-color: color-mix(in srgb, #e8b04b 50%, transparent); }
392.fedi-cact-like.is-on { background: color-mix(in srgb, #e8b04b 18%, transparent); border-color: color-mix(in srgb, #e8b04b 60%, transparent); }
393.fedi-cact-boost svg { color: #2fa85a; }
394.fedi-cact-boost:hover { background: color-mix(in srgb, #2fa85a 15%, transparent); border-color: color-mix(in srgb, #2fa85a 50%, transparent); }
395.fedi-cact-boost.is-on { background: color-mix(in srgb, #2fa85a 18%, transparent); border-color: color-mix(in srgb, #2fa85a 60%, transparent); }
396.fedi-cact-reply svg { color: var(--accent, #06c); }
397.fedi-cact-reply:hover { background: color-mix(in srgb, var(--accent, #888) 14%, transparent); border-color: color-mix(in srgb, var(--accent, #888) 50%, transparent); }
398
399.comment-replies {
400 margin-top: 1rem;
401 margin-left: 0;
402 border-left: 2px solid var(--rule);
403 padding-left: 1rem;
404}
405.comment-reply { padding: 0.75rem 0; }
406.comment-replies > .comment-reply:first-child { border-top: 0; padding-top: 0; }
407.comment-reply .comment-avatar { width: 32px; height: 32px; }
408.comment-reply .comment-avatar span { font-size: 0.85rem; }
409
410.comment-form, .comment-reply-form {
411 display: flex;
412 flex-direction: column;
413 gap: 0.6rem;
414 background: var(--paper-2);
415 border: 1px solid var(--rule);
416 border-radius: 8px;
417 padding: 1rem;
418 margin-top: 1rem;
419}
420.comment-form-label { display: flex; flex-direction: column; gap: 0.4rem; }
421.comment-form-label > span { font-size: 0.85rem; color: var(--ink-muted, var(--ink-soft)); }
422.comment-form textarea, .comment-reply-form textarea {
423 width: 100%;
424 resize: vertical;
425 min-height: 70px;
426 max-height: 200px;
427 padding: 0.65rem 0.85rem;
428 border: 1px solid var(--rule);
429 border-radius: 5px;
430 background: var(--paper);
431 color: var(--ink);
432 font-family: inherit;
433 font-size: 0.95rem;
434 line-height: 1.4;
435 box-sizing: border-box;
436}
437.comment-form button { align-self: flex-start; }
438.comment-reply-form-actions { display: flex; gap: 0.5rem; }
439/* Show the reply form only AFTER clicking REPLY. The display:flex above would
440 otherwise override the [hidden] attribute → form was always open. */
441.comment-reply-form[hidden] { display: none; }
442.fedi-owner-reply summary { list-style: none; cursor: pointer; }
443.fedi-owner-reply summary::-webkit-details-marker { display: none; }
444.fedi-owner-reply[open] summary { margin-bottom: .45rem; }
445/* DELETE button is inside a <form>; display:contents makes it a direct flex-sibling
446 of REPLY → pixel-perfect alignment + equal gap. */
447.comment-actions form { display: contents; }
448
449.comments-login-cta { margin-top: 1.5rem; text-align: center; }
450
451/* ─── Related posts (3-card grid above pinned-nav) ─────────────── */
452.post-related {
453 margin: 3rem auto 1.5rem;
454 /* Break out of the 720px article column so the cards have room to breathe.
455 Cap at 1100 to match other wide content. */
456 max-width: 1100px;
457 padding: 0 1rem;
458}
459.post-related-heading {
460 font-family: var(--font-ui, system-ui), sans-serif;
461 font-size: 0.75rem;
462 font-weight: 600;
463 text-transform: uppercase;
464 letter-spacing: 0.15em;
465 color: var(--ink-muted, var(--ink-soft));
466 margin: 0 0 1rem;
467}
468.post-related-grid {
469 list-style: none;
470 padding: 0; margin: 0;
471 display: grid;
472 grid-template-columns: repeat(3, minmax(0, 1fr));
473 gap: 1rem;
474}
475@media (max-width: 880px) { .post-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
476@media (max-width: 540px) { .post-related-grid { grid-template-columns: 1fr; } }
477
478.post-related-card {
479 background: var(--paper);
480 border: 1px solid var(--rule);
481 border-radius: 10px;
482 overflow: hidden;
483 transition: border-color 150ms, transform 150ms;
484}
485.post-related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
486.post-related-card a {
487 display: block;
488 color: inherit;
489 text-decoration: none;
490}
491.post-related-cover {
492 display: block;
493 position: relative;
494 overflow: hidden;
495 aspect-ratio: 16 / 10;
496 background: var(--paper-2) center/cover no-repeat;
497}
498.post-related-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
499.post-related-cover--empty {
500 background-image: linear-gradient(135deg,
501 color-mix(in srgb, var(--accent) 12%, var(--paper-2)),
502 var(--paper-2));
503}
504.post-related-meta {
505 display: flex; flex-direction: column; gap: 0.4rem;
506 padding: 0.85rem 1rem 1.1rem;
507}
508.post-related-date {
509 font-size: 0.78rem;
510 color: var(--ink-muted, var(--ink-soft));
511 font-variant-numeric: tabular-nums;
512}
513.post-related-title {
514 font-family: var(--font-display, serif);
515 font-size: 1.1rem;
516 font-weight: 600;
517 color: var(--ink);
518 line-height: 1.25;
519}
520
521/* ─── Pinned navigation cards (v9 style) ───────────────────────── */
522.post-pinned-nav {
523 display: grid;
524 grid-template-columns: 1fr 1fr;
525 gap: 1rem;
526 margin: 1.5rem auto 2rem;
527 max-width: 1100px;
528 padding: 0 1rem;
529}
530@media (max-width: 600px) {
531 .post-pinned-nav { grid-template-columns: 1fr; }
532}
533
534.post-pinned-card {
535 display: flex; align-items: center; gap: 1rem;
536 padding: 1rem 1.25rem;
537 border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
538 background: color-mix(in srgb, var(--accent) 6%, var(--paper));
539 border-radius: 10px;
540 text-decoration: none;
541 color: var(--ink);
542 transition: border-color 150ms, background 150ms, transform 150ms;
543 min-height: 88px;
544}
545.post-pinned-card:hover {
546 border-color: var(--accent);
547 background: color-mix(in srgb, var(--accent) 11%, var(--paper));
548 transform: translateY(-2px);
549}
550.post-pinned-arrow {
551 font-size: 1.6rem;
552 color: var(--accent);
553 flex-shrink: 0;
554 line-height: 1;
555}
556.post-pinned-card--next {
557 /* "Volgende" card aligns text to the right with the arrow on the right
558 side, mirroring v9 — the arrow is on the OPPOSITE end from the body. */
559 flex-direction: row-reverse;
560 text-align: right;
561}
562.post-pinned-body {
563 display: flex; flex-direction: column; gap: 0.25rem;
564 flex: 1; min-width: 0;
565}
566.post-pinned-label {
567 font-family: var(--font-ui, system-ui), sans-serif;
568 font-size: 0.7rem; font-weight: 600;
569 text-transform: uppercase;
570 letter-spacing: 0.1em;
571 color: var(--accent);
572}
573.post-pinned-title {
574 font-family: var(--font-display, serif);
575 font-size: 1.05rem; font-weight: 600;
576 color: var(--ink);
577 line-height: 1.25;
578 overflow: hidden;
579 text-overflow: ellipsis;
580 display: -webkit-box;
581 -webkit-line-clamp: 2;
582 -webkit-box-orient: vertical;
583}
584.post-pinned-cta {
585 font-size: 0.78rem;
586 color: var(--accent);
587 font-weight: 500;
588}
589
590/* Edge-of-stack indicator: dashed border, muted styling. */
591.post-pinned-card--edge {
592 flex-direction: column;
593 align-items: flex-start;
594 justify-content: center;
595 gap: 0.35rem;
596 border-style: dashed;
597 background: transparent;
598 color: var(--ink-muted, var(--ink-soft));
599 cursor: default;
600}
601.post-pinned-card--edge:hover {
602 /* Edge cards aren't clickable — undo the lift effect. */
603 transform: none;
604 border-color: color-mix(in srgb, var(--accent) 50%, transparent);
605 background: transparent;
606}
607.post-pinned-edge-label {
608 font-family: var(--font-ui, system-ui), sans-serif;
609 font-size: 0.72rem;
610 font-weight: 600;
611 text-transform: uppercase;
612 letter-spacing: 0.15em;
613 color: var(--accent);
614}
615.post-pinned-edge-title {
616 font-family: var(--font-display, serif);
617 font-size: 1.05rem;
618 font-weight: 600;
619 color: var(--ink);
620}
621</style>
Note: See TracBrowser for help on using the repository browser.