source: Klonkt/src/views/pages/post.ejs@ 3289a64

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

feat(fedi): comment like is a toggle too (Undo Like / un-favourite)

Symmetric to boost: ap_interactions.acted_like remembers a liked comment, the star
shows an 'on' state, and clicking again retracts it via Undo(Like) (Mastodon honours it).
sendInteraction gains an 'unlike' branch (author-only, no fanout).

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