source: Klonkt/src/views/pages/post.ejs@ 5e95aac

main
Last change on this file since 5e95aac was 8afbdd6, checked in by roboburr <roboburr@…>, 3 months ago

feat: viewer role + artists directory + Klonkt Hub Beta rebrand

Viewer role (replaces the separate view-mode/readonly toggle):

  • 'kijker' is now a real role (VALID_ROLES) selectable in Admin. May view EVERYTHING including Admin, but cannot modify anything.
  • isViewer(user) (= role kijker or legacy readonly flag) is the source; requireGod/requireSiteManager(BySlug) let a viewer through (viewing), the global guard 403s every write. Existing readonly accounts are migrated on each role change (readonly=0).
  • Write leaks via GET patched: /prutter/new (INSERT) blocks for viewers, /prutter/:id skips markAsRead (UPDATE); WS upgrade rejects viewers (the HTTP guard doesn't cover WebSockets).
  • Clean "Viewer mode" page (viewer-blocked) instead of raw 403 text; styled sticky banner; account page shows read-only UI instead of an upload button that silently 403s. canMutate hides write buttons.

Scalability (>50 artists):

  • Hub home shows max 24 (most active first) + "All N artists ->".
  • New searchable, paginated /artiesten directory (hub only).
  • 'user' + 'artiesten' reserved as slugs.

Rebrand PrutFolio v1 -> Klonkt Hub Beta (footer, PWA manifest, account/
admin texts, default page title, startup, README; internal package +
PWA id 'prutfolio' remain for stability).

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

  • Property mode set to 100644
File size: 25.1 KB
Line 
1<%
2// In hub-mode is de site bereikbaar onder /user/<slug>; alle site-scoped links
3// (tag, edit, delete, comments) moeten met die prefix anders vallen ze terug op
4// de primaire site → 404 / verkeerde site. In solo is _base = ''.
5const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
6%>
7<article class="container post-page">
8 <% if (post.cover_image_url) { %>
9 <figure class="post-cover">
10 <img src="<%= post.cover_image_url %>" alt="">
11 </figure>
12 <% } %>
13
14 <header class="post-header">
15 <h1 class="post-title"><%= post.title %></h1>
16 <div class="post-meta">
17 <a class="author" href="/users/<%= encodeURIComponent(post.author_username) %>"
18 hx-get="/users/<%= encodeURIComponent(post.author_username) %>?partial=1"
19 hx-target="#pcms-main" hx-swap="innerHTML"
20 hx-push-url="/users/<%= encodeURIComponent(post.author_username) %>"
21 hx-indicator="#pcms-loading"><%= post.author_username %></a>
22 <span class="meta-sep">·</span>
23 <time datetime="<%= post.published_at || post.created_at %>"><%= formatDate(post.published_at || post.created_at) %></time>
24 <% if (post.status !== 'published') { %>
25 <span class="meta-sep">·</span>
26 <span class="status-badge status-<%= post.status %>"><%= post.status %></span>
27 <% } %>
28 </div>
29 </header>
30
31 <div class="post-content">
32 <%- post.content_html %>
33 </div>
34
35 <% if (post.tags && post.tags.length > 0) { %>
36 <div class="post-tags">
37 <% post.tags.forEach(t => { %>
38 <a class="tag" href="<%= _base %>/tag/<%= encodeURIComponent(t) %>"
39 hx-get="<%= _base %>/tag/<%= encodeURIComponent(t) %>?partial=1"
40 hx-target="#pcms-main" hx-swap="innerHTML"
41 hx-push-url="<%= _base %>/tag/<%= encodeURIComponent(t) %>"
42 hx-indicator="#pcms-loading">#<%= t %></a>
43 <% }); %>
44 </div>
45 <% } %>
46
47 <!-- Inline admin actions: only visible if user has permission -->
48 <% if (user && (permissions.canEditPost(user, post, site) || permissions.canDeletePost(user, post, site))) { %>
49 <aside class="post-actions">
50 <% if (permissions.canEditPost(user, post, site)) { %>
51 <a href="<%= _base %>/posts/<%= post.slug %>/edit" class="btn"
52 hx-get="<%= _base %>/posts/<%= post.slug %>/edit?partial=1" hx-target="#pcms-main"
53 hx-push-url="<%= _base %>/posts/<%= post.slug %>/edit" hx-indicator="#pcms-loading">
54 ✏️ Edit
55 </a>
56 <% } %>
57 <% if (permissions.canDeletePost(user, post, site)) { %>
58 <form method="post" action="<%= _base %>/posts/<%= post.slug %>/delete" style="display:inline" onsubmit="return confirm('Delete this post?')">
59 <button type="submit" class="btn btn-danger">🗑 Delete</button>
60 </form>
61 <% } %>
62 </aside>
63 <% } %>
64
65 <!-- Comments -->
66 <section class="post-comments" id="comments">
67 <h2 class="comments-heading">
68 <%= totalComments %> comment<%= totalComments === 1 ? '' : 's' %>
69 </h2>
70
71 <% if (typeof currentPath === 'string' && currentPath && currentPath.indexOf('/' + post.slug) === 0) { %>
72 <% /* If the URL has ?pending=1, the previous submit landed in the queue */ %>
73 <% } %>
74 <script>
75 (function() {
76 if (location.search.indexOf('pending=1') !== -1) {
77 var s = document.createElement('div');
78 s.className = 'comments-pending-flash';
79 s.textContent = 'Your comment is awaiting moderation. It will appear once an admin approves it.';
80 document.currentScript.parentNode.insertBefore(s, document.currentScript);
81 }
82 })();
83 </script>
84
85 <% if (!comments || !comments.length) { %>
86 <p class="comments-empty">No comments yet.<% if (!user) { %> <a href="/auth/login?next=<%= encodeURIComponent(_base + '/' + post.slug + '#comments') %>">Log in</a> to start the conversation.<% } %></p>
87 <% } else { %>
88 <ol class="comments-list">
89 <% comments.forEach(function(c) { %>
90 <li class="comment" id="comment-<%= c.id %>">
91 <div class="comment-avatar">
92 <% if (c.author_avatar) { %>
93 <img src="<%= c.author_avatar %>" alt="">
94 <% } else { %>
95 <span><%= c.author_username.charAt(0).toUpperCase() %></span>
96 <% } %>
97 </div>
98 <div class="comment-body">
99 <div class="comment-meta">
100 <a class="comment-author" href="/users/<%= encodeURIComponent(c.author_username) %>"><%= c.author_username %></a>
101 <span class="comment-time" title="<%= c.created_at %>"><%= formatDateTime(c.created_at) %></span>
102 </div>
103 <div class="comment-content"><%= c.content %></div>
104 <div class="comment-actions">
105 <% if (user && canMutate) { %>
106 <button type="button" class="comment-reply-btn" data-reply-to="<%= c.id %>">Reply</button>
107 <% } %>
108 <% if (user && permissions.canDeleteComment(user, c, site)) { %>
109 <form method="post" action="<%= _base %>/comments/<%= c.id %>/delete" style="display:inline" onsubmit="return confirm('Delete this comment?')">
110 <button type="submit" class="comment-delete-btn">Delete</button>
111 </form>
112 <% } %>
113 </div>
114
115 <!-- Inline reply form (hidden by default) -->
116 <% if (user && canMutate) { %>
117 <form method="post" action="<%= _base %>/comments" class="comment-reply-form" hidden data-reply-form-for="<%= c.id %>">
118 <input type="hidden" name="post_slug" value="<%= post.slug %>">
119 <input type="hidden" name="parent_comment_id" value="<%= c.id %>">
120 <textarea name="content" rows="3" maxlength="4000" placeholder="Reply to <%= c.author_username %>…" required></textarea>
121 <div class="comment-reply-form-actions">
122 <button type="submit" class="btn btn-primary">Reply</button>
123 <button type="button" class="btn comment-cancel-reply">Cancel</button>
124 </div>
125 </form>
126 <% } %>
127
128 <!-- Replies (1 level deep) -->
129 <% if (c.replies && c.replies.length) { %>
130 <ol class="comment-replies">
131 <% c.replies.forEach(function(r) { %>
132 <li class="comment comment-reply" id="comment-<%= r.id %>">
133 <div class="comment-avatar">
134 <% if (r.author_avatar) { %>
135 <img src="<%= r.author_avatar %>" alt="">
136 <% } else { %>
137 <span><%= r.author_username.charAt(0).toUpperCase() %></span>
138 <% } %>
139 </div>
140 <div class="comment-body">
141 <div class="comment-meta">
142 <a class="comment-author" href="/users/<%= encodeURIComponent(r.author_username) %>"><%= r.author_username %></a>
143 <span class="comment-time"><%= formatDateTime(r.created_at) %></span>
144 </div>
145 <div class="comment-content"><%= r.content %></div>
146 <div class="comment-actions">
147 <% if (user && permissions.canDeleteComment(user, r, site)) { %>
148 <form method="post" action="<%= _base %>/comments/<%= r.id %>/delete" style="display:inline" onsubmit="return confirm('Delete this comment?')">
149 <button type="submit" class="comment-delete-btn">Delete</button>
150 </form>
151 <% } %>
152 </div>
153 </div>
154 </li>
155 <% }); %>
156 </ol>
157 <% } %>
158 </div>
159 </li>
160 <% }); %>
161 </ol>
162 <% } %>
163
164 <!-- Top-level comment form (only for logged-in users for now) -->
165 <% if (user && canMutate) { %>
166 <form method="post" action="<%= _base %>/comments" class="comment-form">
167 <input type="hidden" name="post_slug" value="<%= post.slug %>">
168 <label class="comment-form-label">
169 <span>Add a comment as <strong><%= user.username %></strong></span>
170 <textarea name="content" rows="3" maxlength="4000" placeholder="Share your thoughts…" required></textarea>
171 </label>
172 <button type="submit" class="btn btn-primary">Post comment</button>
173 </form>
174 <% } else if (!user) { %>
175 <p class="comments-login-cta">
176 <a href="/auth/login?next=<%= encodeURIComponent(_base + '/' + post.slug + '#comments') %>" class="btn">Log in to comment</a>
177 </p>
178 <% } else { %>
179 <p class="comments-login-cta" style="color:var(--ink-muted)">👁️ Kijker-modus — reageren is uitgeschakeld.</p>
180 <% } %>
181 </section>
182
183 <!-- Reply form toggle -->
184 <script>
185 (function() {
186 document.querySelectorAll('.comment-reply-btn').forEach(function(btn) {
187 btn.addEventListener('click', function() {
188 var id = btn.dataset.replyTo;
189 var form = document.querySelector('[data-reply-form-for="' + id + '"]');
190 if (form) {
191 form.hidden = !form.hidden;
192 if (!form.hidden) form.querySelector('textarea').focus();
193 }
194 });
195 });
196 document.querySelectorAll('.comment-cancel-reply').forEach(function(btn) {
197 btn.addEventListener('click', function() {
198 btn.closest('.comment-reply-form').hidden = true;
199 });
200 });
201 })();
202 </script>
203
204 <%# ── Related posts (3-card grid) ─────────────────────────────
205 Always shown if at least one related post exists. Selection logic
206 lives server-side: same-tag posts ranked by overlap, falling back
207 to most-recent if there's no tag overlap. %>
208 <% if (relatedPosts && relatedPosts.length > 0) { %>
209 <section class="post-related" aria-labelledby="related-heading">
210 <h2 class="post-related-heading" id="related-heading">Gerelateerde posts</h2>
211 <ul class="post-related-grid">
212 <% relatedPosts.forEach(function(rp) { %>
213 <li class="post-related-card">
214 <a href="/<%= rp.slug %>"
215 hx-get="/<%= rp.slug %>?partial=1" hx-target="#pcms-main"
216 hx-push-url="/<%= rp.slug %>" hx-indicator="#pcms-loading">
217 <% if (rp.cover_image_url) { %>
218 <span class="post-related-cover"
219 style="background-image: url('<%= rp.cover_image_url %>')"
220 aria-hidden="true"></span>
221 <% } else { %>
222 <span class="post-related-cover post-related-cover--empty" aria-hidden="true"></span>
223 <% } %>
224 <span class="post-related-meta">
225 <span class="post-related-date"><%= formatDate(rp.published_at) %></span>
226 <span class="post-related-title"><%= rp.title %></span>
227 </span>
228 </a>
229 </li>
230 <% }); %>
231 </ul>
232 </section>
233 <% } %>
234
235 <%# ── Pinned navigation (only when current post is pinned) ───
236 Two card-style links: "Vorige vastgepinde" / "Volgende vastgepinde".
237 Edge-of-stack states show "← BOVENAAN — Nieuwste post" or the equivalent
238 for the bottom. Layout mirrors v9 exactly. %>
239 <% if (post.pinned) { %>
240 <nav class="post-pinned-nav" aria-label="Pinned navigation">
241 <%# LEFT card: post one step UP the pinned stack (towards #1).
242 Uses prevPinnedPost which now means "smaller rank". %>
243 <% if (prevPinnedPost) { %>
244 <a class="post-pinned-card post-pinned-card--prev" href="/<%= prevPinnedPost.slug %>"
245 hx-get="/<%= prevPinnedPost.slug %>?partial=1" hx-target="#pcms-main"
246 hx-push-url="/<%= prevPinnedPost.slug %>" hx-indicator="#pcms-loading">
247 <span class="post-pinned-arrow" aria-hidden="true">←</span>
248 <span class="post-pinned-body">
249 <span class="post-pinned-label">📌 Vorige vastgepinde</span>
250 <span class="post-pinned-title"><%= prevPinnedPost.title %></span>
251 <span class="post-pinned-cta">Lees deze post →</span>
252 </span>
253 </a>
254 <% } else if (pinnedTopOfStack) { %>
255 <span class="post-pinned-card post-pinned-card--edge">
256 <span class="post-pinned-edge-label">— BOVENAAN —</span>
257 <span class="post-pinned-edge-title">Nieuwste post</span>
258 </span>
259 <% } %>
260
261 <%# RIGHT card: post one step DOWN the pinned stack (away from #1).
262 Uses nextPinnedPost which now means "larger rank". %>
263 <% if (nextPinnedPost) { %>
264 <a class="post-pinned-card post-pinned-card--next" href="/<%= nextPinnedPost.slug %>"
265 hx-get="/<%= nextPinnedPost.slug %>?partial=1" hx-target="#pcms-main"
266 hx-push-url="/<%= nextPinnedPost.slug %>" hx-indicator="#pcms-loading">
267 <span class="post-pinned-arrow" aria-hidden="true">→</span>
268 <span class="post-pinned-body">
269 <span class="post-pinned-label">📌 Volgende vastgepinde</span>
270 <span class="post-pinned-title"><%= nextPinnedPost.title %></span>
271 <span class="post-pinned-cta">← Lees deze post</span>
272 </span>
273 </a>
274 <% } else if (pinnedBottomOfStack) { %>
275 <span class="post-pinned-card post-pinned-card--edge">
276 <span class="post-pinned-edge-label">— ONDERAAN —</span>
277 <span class="post-pinned-edge-title">Oudste post</span>
278 </span>
279 <% } %>
280 </nav>
281 <% } %>
282
283 <%# ── Chronological prev/next (kept for non-pinned posts) ──────
284 For pinned posts the pinned-nav above replaces this. Non-pinned
285 regular posts still get the simple older/newer pair. %>
286 <% if (!post.pinned && (prevPost || nextPost)) { %>
287 <nav class="post-nav">
288 <% if (prevPost) { %>
289 <a class="post-nav-prev" href="/<%= prevPost.slug %>"
290 hx-get="/<%= prevPost.slug %>?partial=1" hx-target="#pcms-main"
291 hx-push-url="/<%= prevPost.slug %>" hx-indicator="#pcms-loading">
292 <span class="post-nav-label">← Older</span>
293 <span class="post-nav-title"><%= prevPost.title %></span>
294 </a>
295 <% } else { %><span></span><% } %>
296 <% if (nextPost) { %>
297 <a class="post-nav-next" href="/<%= nextPost.slug %>"
298 hx-get="/<%= nextPost.slug %>?partial=1" hx-target="#pcms-main"
299 hx-push-url="/<%= nextPost.slug %>" hx-indicator="#pcms-loading">
300 <span class="post-nav-label">Newer →</span>
301 <span class="post-nav-title"><%= nextPost.title %></span>
302 </a>
303 <% } %>
304 </nav>
305 <% } %>
306</article>
307<style>
308.post-page { max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
309.post-cover { margin: 0 0 2rem; border-radius: 8px; overflow: hidden; }
310.post-cover img { width: 100%; height: auto; display: block; }
311.post-header { margin-bottom: 2rem; }
312.post-title { font-family: var(--font-display, serif); font-size: 2.5rem; line-height: 1.1; margin: 0 0 1rem; }
313@media (max-width: 600px) { .post-title { font-size: 1.85rem; } }
314.post-meta { font-size: 0.9rem; color: var(--ink-muted); }
315.author { font-weight: 500; color: var(--ink-soft); text-decoration: none; }
316.author:hover { color: var(--accent); }
317.post-content { font-family: var(--font-body, serif); font-size: 1.1rem; line-height: 1.7; color: var(--ink); }
318.post-content p { margin: 1.2em 0; }
319.post-content h2 { font-family: var(--font-display, serif); font-size: 1.6rem; margin: 2rem 0 1rem; }
320.post-content h3 { font-family: var(--font-display, serif); font-size: 1.3rem; margin: 1.5rem 0 0.75rem; }
321.post-content a { color: var(--accent); }
322.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; }
323.post-content pre { background: var(--paper-2); padding: 1rem; border-radius: 6px; overflow-x: auto; }
324.post-content blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; margin: 1.5rem 0; color: var(--ink-soft); font-style: italic; }
325.post-content img { max-width: 100%; height: auto; border-radius: 6px; }
326.post-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 2rem 0; }
327.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; }
328.tag:hover { background: var(--accent); color: white; }
329.post-actions { display: flex; gap: 0.5rem; margin: 2rem 0; padding: 1rem; background: var(--paper-2); border-radius: 6px; flex-wrap: wrap; }
330.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
331.post-nav-prev, .post-nav-next { display: flex; flex-direction: column; padding: 1rem; background: var(--paper-2); border-radius: 6px; text-decoration: none; color: var(--ink); }
332.post-nav-next { text-align: right; align-items: flex-end; }
333.post-nav-label { font-size: 0.8rem; color: var(--ink-muted); margin-bottom: 0.25rem; }
334.post-nav-title { font-weight: 500; }
335@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } }
336
337/* ============================================================
338 Comments
339 ============================================================ */
340.post-comments {
341 margin-top: 3rem;
342 padding-top: 2rem;
343 border-top: 1px solid var(--rule);
344}
345.comments-heading {
346 font-family: var(--font-display, serif);
347 font-size: 1.5rem;
348 margin: 0 0 1.5rem;
349}
350.comments-empty { color: var(--ink-muted, var(--ink-soft)); margin: 0 0 1.5rem; }
351.comments-pending-flash {
352 background: rgba(40, 160, 90, 0.15);
353 color: #2a9d5e;
354 border: 1px solid rgba(40, 160, 90, 0.3);
355 padding: 0.75rem 1rem;
356 border-radius: 6px;
357 margin-bottom: 1rem;
358 font-size: 0.9rem;
359}
360.comments-empty a { color: var(--accent); }
361
362.comments-list, .comment-replies {
363 list-style: none;
364 padding: 0;
365 margin: 0 0 2rem;
366}
367
368.comment {
369 display: flex;
370 gap: 0.85rem;
371 padding: 1rem 0;
372 border-top: 1px solid var(--rule);
373}
374.comments-list > .comment:first-child { border-top: 0; padding-top: 0; }
375
376.comment-avatar {
377 flex-shrink: 0;
378 width: 40px;
379 height: 40px;
380 border-radius: 50%;
381 background: var(--paper-2);
382 border: 1px solid var(--rule);
383 overflow: hidden;
384 display: inline-flex;
385 align-items: center;
386 justify-content: center;
387}
388.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
389.comment-avatar span {
390 font-family: var(--font-display, serif);
391 font-weight: 700;
392 color: var(--accent);
393}
394
395.comment-body { flex: 1; min-width: 0; }
396.comment-meta {
397 display: flex;
398 gap: 0.5rem;
399 align-items: baseline;
400 font-size: 0.85rem;
401 margin-bottom: 0.3rem;
402}
403.comment-author { color: var(--ink); font-weight: 600; text-decoration: none; }
404.comment-author:hover { color: var(--accent); }
405.comment-time { color: var(--ink-muted, var(--ink-soft)); }
406.comment-content {
407 white-space: pre-wrap;
408 word-wrap: break-word;
409 color: var(--ink);
410 line-height: 1.5;
411 font-size: 0.95rem;
412}
413
414.comment-actions {
415 display: flex;
416 gap: 0.5rem;
417 margin-top: 0.4rem;
418}
419.comment-reply-btn, .comment-delete-btn {
420 background: none;
421 border: 0;
422 color: var(--ink-muted, var(--ink-soft));
423 font-size: 0.8rem;
424 cursor: pointer;
425 padding: 0.2rem 0;
426 font-family: inherit;
427 text-transform: uppercase;
428 letter-spacing: 0.04em;
429}
430.comment-reply-btn:hover { color: var(--accent); }
431.comment-delete-btn:hover { color: #c33; }
432
433.comment-replies {
434 margin-top: 1rem;
435 margin-left: 0;
436 border-left: 2px solid var(--rule);
437 padding-left: 1rem;
438}
439.comment-reply { padding: 0.75rem 0; }
440.comment-replies > .comment-reply:first-child { border-top: 0; padding-top: 0; }
441.comment-reply .comment-avatar { width: 32px; height: 32px; }
442.comment-reply .comment-avatar span { font-size: 0.85rem; }
443
444.comment-form, .comment-reply-form {
445 display: flex;
446 flex-direction: column;
447 gap: 0.6rem;
448 background: var(--paper-2);
449 border: 1px solid var(--rule);
450 border-radius: 8px;
451 padding: 1rem;
452 margin-top: 1rem;
453}
454.comment-form-label { display: flex; flex-direction: column; gap: 0.4rem; }
455.comment-form-label > span { font-size: 0.85rem; color: var(--ink-muted, var(--ink-soft)); }
456.comment-form textarea, .comment-reply-form textarea {
457 width: 100%;
458 resize: vertical;
459 min-height: 70px;
460 padding: 0.65rem 0.85rem;
461 border: 1px solid var(--rule);
462 border-radius: 5px;
463 background: var(--paper);
464 color: var(--ink);
465 font-family: inherit;
466 font-size: 0.95rem;
467 line-height: 1.4;
468 box-sizing: border-box;
469}
470.comment-form button { align-self: flex-start; }
471.comment-reply-form-actions { display: flex; gap: 0.5rem; }
472
473.comments-login-cta { margin-top: 1.5rem; text-align: center; }
474
475/* ─── Related posts (3-card grid above pinned-nav) ─────────────── */
476.post-related {
477 margin: 3rem auto 1.5rem;
478 /* Break out of the 720px article column so the cards have room to breathe.
479 Cap at 1100 to match other wide content. */
480 max-width: 1100px;
481 padding: 0 1rem;
482}
483.post-related-heading {
484 font-family: var(--font-ui, system-ui), sans-serif;
485 font-size: 0.75rem;
486 font-weight: 600;
487 text-transform: uppercase;
488 letter-spacing: 0.15em;
489 color: var(--ink-muted, var(--ink-soft));
490 margin: 0 0 1rem;
491}
492.post-related-grid {
493 list-style: none;
494 padding: 0; margin: 0;
495 display: grid;
496 grid-template-columns: repeat(3, minmax(0, 1fr));
497 gap: 1rem;
498}
499@media (max-width: 880px) { .post-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
500@media (max-width: 540px) { .post-related-grid { grid-template-columns: 1fr; } }
501
502.post-related-card {
503 background: var(--paper);
504 border: 1px solid var(--rule);
505 border-radius: 10px;
506 overflow: hidden;
507 transition: border-color 150ms, transform 150ms;
508}
509.post-related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
510.post-related-card a {
511 display: block;
512 color: inherit;
513 text-decoration: none;
514}
515.post-related-cover {
516 display: block;
517 aspect-ratio: 16 / 10;
518 background: var(--paper-2) center/cover no-repeat;
519}
520.post-related-cover--empty {
521 background-image: linear-gradient(135deg,
522 color-mix(in srgb, var(--accent) 12%, var(--paper-2)),
523 var(--paper-2));
524}
525.post-related-meta {
526 display: flex; flex-direction: column; gap: 0.4rem;
527 padding: 0.85rem 1rem 1.1rem;
528}
529.post-related-date {
530 font-size: 0.78rem;
531 color: var(--ink-muted, var(--ink-soft));
532 font-variant-numeric: tabular-nums;
533}
534.post-related-title {
535 font-family: var(--font-display, serif);
536 font-size: 1.1rem;
537 font-weight: 600;
538 color: var(--ink);
539 line-height: 1.25;
540}
541
542/* ─── Pinned navigation cards (v9 style) ───────────────────────── */
543.post-pinned-nav {
544 display: grid;
545 grid-template-columns: 1fr 1fr;
546 gap: 1rem;
547 margin: 1.5rem auto 2rem;
548 max-width: 1100px;
549 padding: 0 1rem;
550}
551@media (max-width: 600px) {
552 .post-pinned-nav { grid-template-columns: 1fr; }
553}
554
555.post-pinned-card {
556 display: flex; align-items: center; gap: 1rem;
557 padding: 1rem 1.25rem;
558 border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
559 background: color-mix(in srgb, var(--accent) 6%, var(--paper));
560 border-radius: 10px;
561 text-decoration: none;
562 color: var(--ink);
563 transition: border-color 150ms, background 150ms, transform 150ms;
564 min-height: 88px;
565}
566.post-pinned-card:hover {
567 border-color: var(--accent);
568 background: color-mix(in srgb, var(--accent) 11%, var(--paper));
569 transform: translateY(-2px);
570}
571.post-pinned-arrow {
572 font-size: 1.6rem;
573 color: var(--accent);
574 flex-shrink: 0;
575 line-height: 1;
576}
577.post-pinned-card--next {
578 /* "Volgende" card aligns text to the right with the arrow on the right
579 side, mirroring v9 — the arrow is on the OPPOSITE end from the body. */
580 flex-direction: row-reverse;
581 text-align: right;
582}
583.post-pinned-body {
584 display: flex; flex-direction: column; gap: 0.25rem;
585 flex: 1; min-width: 0;
586}
587.post-pinned-label {
588 font-family: var(--font-ui, system-ui), sans-serif;
589 font-size: 0.7rem; font-weight: 600;
590 text-transform: uppercase;
591 letter-spacing: 0.1em;
592 color: var(--accent);
593}
594.post-pinned-title {
595 font-family: var(--font-display, serif);
596 font-size: 1.05rem; font-weight: 600;
597 color: var(--ink);
598 line-height: 1.25;
599 overflow: hidden;
600 text-overflow: ellipsis;
601 display: -webkit-box;
602 -webkit-line-clamp: 2;
603 -webkit-box-orient: vertical;
604}
605.post-pinned-cta {
606 font-size: 0.78rem;
607 color: var(--accent);
608 font-weight: 500;
609}
610
611/* Edge-of-stack indicator: dashed border, muted styling. */
612.post-pinned-card--edge {
613 flex-direction: column;
614 align-items: flex-start;
615 justify-content: center;
616 gap: 0.35rem;
617 border-style: dashed;
618 background: transparent;
619 color: var(--ink-muted, var(--ink-soft));
620 cursor: default;
621}
622.post-pinned-card--edge:hover {
623 /* Edge cards aren't clickable — undo the lift effect. */
624 transform: none;
625 border-color: color-mix(in srgb, var(--accent) 50%, transparent);
626 background: transparent;
627}
628.post-pinned-edge-label {
629 font-family: var(--font-ui, system-ui), sans-serif;
630 font-size: 0.72rem;
631 font-weight: 600;
632 text-transform: uppercase;
633 letter-spacing: 0.15em;
634 color: var(--accent);
635}
636.post-pinned-edge-title {
637 font-family: var(--font-display, serif);
638 font-size: 1.05rem;
639 font-weight: 600;
640 color: var(--ink);
641}
642</style>
Note: See TracBrowser for help on using the repository browser.