source: Klonkt/src/views/partials/topnav.ejs@ 2149f5a

main
Last change on this file since 2149f5a was 2149f5a, checked in by roboburr <roboburr@…>, 3 months ago

feat(i18n): language dropdown (NL/EN/DE) in the header nav instead of footer

  • Compact language select in the topnav action row (desktop), codes NL/EN/DE.
  • Footer select only on mobile (desktop has it in the header).
  • Standalone admin dashboard select removed (header select shows on admin too).

style.css?v=27.

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

  • Property mode set to 100644
File size: 22.5 KB
Line 
1<%
2// Top nav — RESPONSIVE.
3//
4// Mobile (<768px):
5// - Brand centered, small theme-toggle right.
6// - All other actions live in the bottom-tab nav.
7// - Sticky top, blur background, safe-area-top respected.
8//
9// Desktop (≥768px):
10// - Full v9 masthead: brand left, action row right
11// (Archief / Search / Install / Theme / Prutter / User-menu).
12// - bottom-tab is hidden via CSS, so all nav must live here.
13
14const _siteUrlBase = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
15const _isAdmin = typeof bodyClass !== 'undefined' && bodyClass.indexOf('on-admin') >= 0;
16const _hasSearch = !site || site.show_search === undefined || site.show_search;
17const _hasPrutter = user && site && site.enable_prutter && (typeof tenancy !== 'undefined' && tenancy === 'hub') && (typeof premiumUnlocked === 'undefined' || premiumUnlocked);
18const _canPost = user && (typeof canMutate === 'undefined' || canMutate)
19 && permissions && permissions.canCreatePost && permissions.canCreatePost(user, site);
20%>
21
22<header class="masthead">
23 <div class="container masthead-inner">
24
25 <!-- Brand block (always visible) -->
26 <div class="masthead-brand">
27 <% if (_isAdmin) { %>
28 <a href="<%= _siteUrlBase %>/" class="nav-link nav-link-admin"><%= t('nav.back_to_site') %></a>
29 <% } else if (typeof tenancy !== 'undefined' && tenancy === 'hub') { %>
30 <%# Hub: de brand gaat naar de hub-home via HTMX. De chrome wordt in hub-modus
31 altijd gerenderd en via body.on-hub (CSS) verborgen op de landing, dus htmx
32 kan schakelen zonder full-reload → de audioplayer blijft leven. %>
33 <a class="nav-hub-home" href="/" aria-label="Home" title="Home"
34 hx-get="/?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" hx-push-url="/" hx-indicator="#pcms-loading">
35 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
36 </a>
37 <% } else if (site) { %>
38 <a class="site-title" href="<%= _siteUrlBase %>/"
39 hx-get="<%= _siteUrlBase %>/?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
40 hx-push-url="<%= _siteUrlBase %>/" hx-indicator="#pcms-loading"><%= site.title %></a>
41 <% } else { %>
42 <a class="site-title" href="/">Klonkt</a>
43 <% } %>
44 </div>
45
46 <!-- Mobile: theme toggle ONLY for logged-out users.
47 Logged-in users get the toggle inside the profile sheet
48 (bottom-tab → Profiel → Thema). All other actions in bottom-tab. -->
49 <% if (!user) { %>
50 <div class="top-nav-mobile">
51 <button type="button" class="nav-btn" id="theme-toggle-mobile" aria-label="Thema wisselen" title="Thema wisselen">
52 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
53 </button>
54 </div>
55 <% } %>
56
57 <!-- Desktop-only: full action row -->
58 <nav class="top-nav top-nav-desktop" aria-label="Hoofdnavigatie">
59
60 <% if (!_isAdmin) { %>
61 <a class="nav-link" href="<%= _siteUrlBase %>/archive"
62 hx-get="<%= _siteUrlBase %>/archive?partial=1" hx-target="#pcms-main"
63 hx-swap="innerHTML" hx-push-url="<%= _siteUrlBase %>/archive"
64 hx-indicator="#pcms-loading">
65 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 8v13H3V8"/><rect x="1" y="3" width="22" height="5" rx="1"/><line x1="10" y1="12" x2="14" y2="12"/></svg>
66 <span class="nav-label"><%= t('nav.archive') %></span>
67 </a>
68 <% } %>
69
70 <% if (_hasSearch) { %>
71 <button type="button" class="nav-btn" id="search-toggle" aria-label="Zoeken" title="Zoeken">
72 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
73 </button>
74 <% } %>
75
76 <button type="button" class="nav-btn" id="pwa-install-btn" hidden aria-label="App installeren" title="App installeren">
77 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
78 </button>
79
80 <button type="button" class="nav-btn" id="theme-toggle" aria-label="Thema wisselen" title="Thema wisselen">
81 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/></svg>
82 </button>
83
84 <% if (typeof langs !== 'undefined' && langs && langs.length > 1) { %>
85 <select class="nav-lang" aria-label="<%= t('nav.language') %>" title="<%= t('nav.language') %>"
86 onchange="location.href='/lang/'+this.value+'?r='+encodeURIComponent(location.pathname+location.search)">
87 <% langs.forEach(function(l){ %><option value="<%= l.code %>"<%= l.active ? ' selected' : '' %>><%= l.code.toUpperCase() %></option><% }); %>
88 </select>
89 <% } %>
90
91 <% if (_hasPrutter) { %>
92 <a class="nav-btn" href="<%= _siteUrlBase %>/prutter" aria-label="Prutter (DMs)" title="Prutter">
93 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" 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 </a>
95 <% } %>
96
97 <% if (user) { %>
98 <details class="user-menu">
99 <summary class="nav-btn user-toggle" aria-label="Gebruikersmenu">
100 <% if (user.avatar_url) { %>
101 <img class="user-avatar user-avatar-img" src="<%= user.avatar_url %>" alt="">
102 <% } else { %>
103 <span class="user-avatar"><%= user.username.charAt(0).toUpperCase() %></span>
104 <% } %>
105 </summary>
106 <div class="user-dropdown" role="menu">
107 <div class="user-dropdown-header">
108 <% if (user.avatar_url) { %>
109 <img class="udh-avatar" src="<%= user.avatar_url %>" alt="">
110 <% } else { %>
111 <span class="udh-avatar udh-avatar-fallback"><%= user.username.charAt(0).toUpperCase() %></span>
112 <% } %>
113 <div class="udh-meta">
114 <span class="udh-name"><%= user.username %></span>
115 <% if (user.role === 'god') { %>
116 <span class="udh-role">God</span>
117 <% } else if (user.role === 'admin' || user.role === 'moderator') { %>
118 <span class="udh-role"><%= user.role.charAt(0).toUpperCase() + user.role.slice(1) %></span>
119 <% } %>
120 </div>
121 </div>
122 <div class="user-dropdown-list">
123 <a href="/account" role="menuitem" class="udi"
124 hx-get="/account?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
125 hx-push-url="/account" hx-indicator="#pcms-loading">
126 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
127 <span><%= t('nav.account') %></span>
128 </a>
129 <a href="/favorieten" role="menuitem" class="udi"
130 hx-get="/favorieten?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
131 hx-push-url="/favorieten" hx-indicator="#pcms-loading">
132 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/></svg>
133 <span><%= t('nav.favorites') %></span>
134 </a>
135 <% if (typeof canSeeBeheer !== 'undefined' && canSeeBeheer) { %>
136 <a href="/admin" role="menuitem" class="udi"
137 hx-get="/admin?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
138 hx-push-url="/admin" hx-indicator="#pcms-loading">
139 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 3h7v7H3z"/><path d="M14 3h7v7h-7z"/><path d="M14 14h7v7h-7z"/><path d="M3 14h7v7H3z"/></svg>
140 <span><%= t('nav.admin') %></span>
141 </a>
142 <% } %>
143 <% if (_canPost) { %>
144 <a href="<%= _siteUrlBase %>/posts/new" role="menuitem" class="udi"
145 hx-get="<%= _siteUrlBase %>/posts/new?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
146 hx-push-url="<%= _siteUrlBase %>/posts/new" hx-indicator="#pcms-loading">
147 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"/></svg>
148 <span><%= t('nav.new_post') %></span>
149 </a>
150 <% } %>
151 </div>
152 <div class="user-dropdown-divider" aria-hidden="true"></div>
153 <div class="user-dropdown-list">
154 <a href="/auth/logout" role="menuitem" class="udi udi-danger">
155 <svg class="udi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
156 <span><%= t('nav.logout') %></span>
157 </a>
158 </div>
159 </div>
160 </details>
161 <% } else { %>
162 <a class="nav-link" href="/auth/login"
163 hx-get="/auth/login?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
164 hx-push-url="/auth/login" hx-indicator="#pcms-loading">
165 <span class="nav-label"><%= t('nav.login') %></span>
166 </a>
167 <% } %>
168
169 </nav>
170 </div>
171</header>
172
173<!-- Search overlay (shared by mobile bottom-tab + desktop top-nav) -->
174<div id="search-overlay" class="search-overlay" hidden>
175 <div class="container">
176 <form class="search-overlay-form" method="get" action="<%= _siteUrlBase %>/search">
177 <input type="search" name="q" placeholder="Zoeken in posts…" autocomplete="off">
178 <button type="submit" class="nav-btn" aria-label="Zoeken">
179 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
180 </button>
181 <button type="button" class="nav-btn" id="search-close" aria-label="Sluiten">
182 <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
183 </button>
184 </form>
185 </div>
186</div>
187
188<script>
189(function() {
190 // EÉN keer bedraden. Deze chrome (topnav) wordt bij htmx-navigatie out-of-band
191 // opnieuw ingevoegd → zonder deze guard zou dit script bij elke navigatie EXTRA
192 // listeners stapelen, waardoor de thema-toggle 2× (of vaker) vuurde = geen netto
193 // wisseling ("toggle werkt niet meer"). Alles hieronder is event-delegatie op
194 // body/document, dus het werkt ook voor knoppen die ná deze run (OOB) verschijnen.
195 if (window.__pcmsChromeWired) return;
196 window.__pcmsChromeWired = true;
197
198 function toggleTheme() {
199 var cur = document.documentElement.getAttribute('data-theme') || 'dark';
200 var next = cur === 'dark' ? 'light' : 'dark';
201 document.documentElement.setAttribute('data-theme', next);
202 try { localStorage.setItem('pcms-theme', next); } catch (e) {}
203 }
204 function overlay() { return document.getElementById('search-overlay'); }
205 function openSearch() { var o = overlay(); if (o) { o.hidden = false; var i = o.querySelector('input'); if (i) i.focus(); } }
206 function closeSearch() { var o = overlay(); if (o) o.hidden = true; }
207
208 document.body.addEventListener('click', function(e) {
209 if (e.target.closest('#theme-toggle, #theme-toggle-mobile, #theme-toggle-footer')) { toggleTheme(); return; }
210 if (e.target.closest('#search-toggle')) { openSearch(); return; }
211 if (e.target.closest('#search-close')) { closeSearch(); return; }
212 // Gebruikersmenu sluiten bij klik erbuiten.
213 var open = document.querySelector('.user-menu[open]');
214 if (open && !open.contains(e.target)) open.removeAttribute('open');
215 });
216
217 document.addEventListener('keydown', function(e) {
218 if (e.key === 'Escape') { var o = overlay(); if (o && !o.hidden) o.hidden = true; }
219 });
220})();
221</script>
222
223<style>
224/* ============================================================
225 TOP-NAV — responsive
226 Mobile: brand centered, small theme btn right, NOTHING else.
227 Desktop (≥768px): full v9 layout — brand left, action row right.
228 ============================================================ */
229
230.masthead-inner {
231 /* Override v9's flex-end → space-between so brand is on the left */
232 justify-content: space-between !important;
233 gap: 1rem;
234}
235.masthead-brand .site-title,
236.masthead-brand .nav-link-admin {
237 display: inline-block;
238 vertical-align: middle;
239}
240
241/* Site title is suppressed everywhere — the profile-header carries the brand
242 on content pages, and admin pages have their own "← Terug naar site" link
243 (a different selector, .nav-link-admin, which stays visible). The masthead
244 becomes a thin utility strip with just theme-toggle / search / etc. */
245.masthead-brand .site-title {
246 display: none;
247}
248
249/* Hub-home brand is WÉL zichtbaar — de thuisknop op artiest-/hub-pagina's. */
250.masthead-brand .nav-hub-home {
251 display: inline-flex; align-items: center; justify-content: center;
252 width: 40px; height: 40px;
253 color: var(--ink); text-decoration: none;
254 border-radius: 8px;
255 transition: color 120ms, background 120ms;
256}
257.masthead-brand .nav-hub-home:hover { color: var(--accent); background: var(--paper-2); }
258.masthead-brand .nav-hub-home svg { width: 22px; height: 22px; }
259
260/* On mobile, hide the entire masthead except for admin pages. The brand
261 appears in the profile-header on content pages, and the bottom-tab
262 provides all navigation. Admin keeps it because the "← Terug naar site"
263 link is the only way back to the public site from /admin/*. */
264@media (max-width: 767px) {
265 body:not(.on-admin) .masthead { display: none; }
266}
267
268/* On mobile, center the brand in the masthead */
269@media (max-width: 767px) {
270 .masthead-inner {
271 justify-content: center !important;
272 position: relative;
273 }
274 .masthead-brand {
275 text-align: center;
276 }
277 /* Lone theme button for logged-out users — minimal, icon-only,
278 no border/background to avoid the iOS sticky-hover look. */
279 .top-nav-mobile {
280 position: absolute;
281 right: 0;
282 top: 50%;
283 transform: translateY(-50%);
284 }
285 .top-nav-mobile .nav-btn {
286 width: 44px;
287 height: 44px;
288 padding: 0;
289 background: transparent !important;
290 border-color: transparent !important;
291 color: var(--ink-soft);
292 display: inline-flex;
293 align-items: center;
294 justify-content: center;
295 }
296 .top-nav-mobile .nav-btn:active {
297 transform: scale(0.92);
298 color: var(--ink);
299 }
300 /* Suppress sticky hover on touch — only show feedback for real hover devices */
301 @media (hover: none) {
302 .top-nav-mobile .nav-btn:hover {
303 background: transparent !important;
304 border-color: transparent !important;
305 color: var(--ink-soft);
306 }
307 }
308 .top-nav-desktop {
309 display: none !important;
310 }
311}
312
313/* On desktop, hide the mobile-only theme button */
314@media (min-width: 768px) {
315 .top-nav-mobile { display: none; }
316}
317
318/* ── Admin "back" link styling (inherited from v9 patterns) ── */
319.nav-link-admin {
320 background: var(--accent);
321 color: #fff !important;
322 padding: .5rem .85rem;
323 border-radius: 6px;
324 text-decoration: none;
325 font-family: var(--font-ui);
326 font-size: .875rem;
327 font-weight: 500;
328}
329.nav-link-admin:hover { opacity: .9; color: #fff !important; }
330
331/* ── Tap-target enforcement for all nav buttons on touch ── */
332@media (hover: none) {
333 .nav-btn, .nav-link {
334 min-height: 44px;
335 min-width: 44px;
336 }
337 .nav-btn:active {
338 transform: scale(0.95);
339 background: var(--paper-2);
340 }
341}
342
343/* ── User dropdown (desktop only — mobile uses bottom-tab → /account) ── */
344.user-menu { position: relative; list-style: none; }
345.user-menu > summary {
346 list-style: none; cursor: pointer;
347 padding: .25rem; border-radius: 6px;
348 display: inline-flex; align-items: center;
349 border: 1px solid transparent;
350 transition: all var(--transition);
351}
352.user-menu > summary::-webkit-details-marker { display: none; }
353.user-menu > summary::marker { content: ''; }
354.user-menu > summary:hover { background: var(--paper-2); border-color: var(--rule); }
355.user-avatar {
356 display: inline-flex; align-items: center; justify-content: center;
357 width: 28px; height: 28px; border-radius: 50%;
358 background: var(--paper-2); /* neutral so transparent avatars blend */
359 color: var(--accent); /* fallback initial color */
360 font-family: var(--font-ui); font-weight: 600; font-size: .8rem;
361 pointer-events: none;
362 overflow: hidden;
363}
364.user-avatar-img {
365 /* When the pill renders as <img> instead of <span>, fill it edge-to-edge. */
366 object-fit: cover;
367}
368.user-dropdown {
369 position: absolute; top: calc(100% + .55rem); right: 0;
370 min-width: 220px;
371 padding: .35rem;
372 /* Frosted glass: transparant + zware blur zodat het frosted effect duidelijk is. */
373 background: color-mix(in srgb, var(--paper) 60%, transparent);
374 backdrop-filter: blur(34px) saturate(190%);
375 -webkit-backdrop-filter: blur(34px) saturate(190%);
376 border: 1px solid var(--rule);
377 border-radius: 12px;
378 box-shadow:
379 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent),
380 0 8px 24px color-mix(in srgb, var(--ink) 14%, transparent),
381 0 16px 48px color-mix(in srgb, var(--ink) 10%, transparent);
382 z-index: 200;
383 font-family: var(--font-ui);
384 transform-origin: top right;
385}
386/* Open animation — only fires when <details open> matches, so closing the
387 dropdown doesn't replay the entry animation. */
388.user-menu[open] > .user-dropdown {
389 animation: ud-fade-in .14s cubic-bezier(.2, .8, .25, 1);
390}
391@keyframes ud-fade-in {
392 from { opacity: 0; transform: translateY(-6px) scale(.98); }
393 to { opacity: 1; transform: translateY(0) scale(1); }
394}
395
396/* Identity header — small avatar + username/role badge */
397.user-dropdown-header {
398 display: flex; align-items: center; gap: .65rem;
399 padding: .55rem .65rem .65rem;
400 border-bottom: 1px solid color-mix(in srgb, var(--rule) 65%, transparent);
401 margin-bottom: .35rem;
402}
403.udh-avatar {
404 width: 36px; height: 36px; border-radius: 50%;
405 object-fit: cover;
406 background: var(--paper-2);
407 display: inline-flex; align-items: center; justify-content: center;
408 flex-shrink: 0;
409}
410.udh-avatar-fallback {
411 color: var(--accent); font-weight: 700; font-size: .95rem;
412}
413.udh-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
414.udh-name {
415 font-weight: 600; font-size: .92rem; color: var(--ink);
416 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;
417}
418.udh-role {
419 font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
420 color: var(--accent); opacity: .85; margin-top: .12rem;
421}
422
423/* Item list group */
424.user-dropdown-list { display: flex; flex-direction: column; gap: 1px; }
425.user-dropdown-divider {
426 height: 1px;
427 margin: .35rem .25rem;
428 background: color-mix(in srgb, var(--rule) 60%, transparent);
429}
430
431/* Items — icon + label, rounded inner highlight on hover (macOS feel) */
432.user-dropdown .udi {
433 display: flex; align-items: center; gap: .65rem;
434 padding: .5rem .65rem;
435 color: var(--ink); text-decoration: none;
436 font-size: .88rem; font-weight: 500;
437 border-radius: 7px;
438 transition: background var(--transition), color var(--transition), transform var(--transition);
439}
440.user-dropdown .udi:hover,
441.user-dropdown .udi:focus-visible {
442 background: color-mix(in srgb, var(--accent) 10%, var(--paper-2));
443 color: var(--accent);
444 outline: none;
445}
446.user-dropdown .udi:active { transform: scale(.98); }
447.user-dropdown .udi-icon {
448 width: 16px; height: 16px;
449 opacity: .7;
450 flex-shrink: 0;
451 transition: opacity var(--transition);
452}
453.user-dropdown .udi:hover .udi-icon,
454.user-dropdown .udi:focus-visible .udi-icon { opacity: 1; }
455
456/* Logout: subtle danger tint on hover, never on rest. Uses a fixed red so
457 it always reads as a destructive action even if the user's accent is red. */
458.user-dropdown .udi-danger:hover,
459.user-dropdown .udi-danger:focus-visible {
460 background: color-mix(in srgb, #dc2626 14%, var(--paper-2));
461 color: #dc2626;
462}
463
464/* ── Search overlay ── */
465.search-overlay {
466 position: fixed; top: 0; left: 0; right: 0;
467 background: color-mix(in srgb, var(--paper) 96%, transparent);
468 backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
469 border-bottom: 1px solid var(--rule);
470 padding: 1rem 0; z-index: 200;
471 padding-top: calc(1rem + env(safe-area-inset-top, 0));
472 box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 8%, transparent);
473}
474.search-overlay-form { display: flex; gap: .5rem; align-items: center; }
475.search-overlay-form input {
476 flex: 1; padding: .85rem 1rem;
477 min-height: 44px;
478 border: 1px solid var(--rule); border-radius: 8px;
479 font-family: var(--font-ui); font-size: 1rem;
480 background: var(--paper); color: var(--ink);
481}
482.search-overlay-form input:focus {
483 outline: 2px solid var(--accent); outline-offset: 0;
484}
485.search-overlay-form .nav-btn {
486 width: 44px; height: 44px;
487 display: inline-flex; align-items: center; justify-content: center;
488}
489</style>
Note: See TracBrowser for help on using the repository browser.