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

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

chore(csp): drop the last script unsafe-inline + add Permissions-Policy

Move every inline on* handler to a shared delegated data-* handler, so script-src-attr
can be 'none' instead of 'unsafe-inline'. Add a Permissions-Policy header disabling
camera/microphone/geolocation/Topics (embed features left at default).

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