Spaces:
Paused

yaz / src /static /css /platform.css
anaselamr's picture
[PLATFORM] fix(endpoints+templates): Sprint 52 — zero-error operational pass
579285c
Raw History Blame Contribute Delete
21.4 kB
/* ─────────────────────────────────────────────────────────────
* platform.css — YAZ Platform Base Styles
* Migrated from shared/base.html inline <style> block
* Includes: token aliases, dark-mode overrides, layout, sidebar, nav
* ─────────────────────────────────────────────────────────── */
:root {
/* Aliases not in tokens.css */
--accent: var(--c-neutral-900);
--accent-hover: var(--c-neutral-700);
--primary-light: var(--primary-subtle);
/* Shadow shortcut */
--shadow: var(--shadow-sm);
/* Radius backward-compat (tokens uses --radius-sm/md/lg) */
--radius: 6px;
/* Layout */
--sidebar-width: var(--sidebar-w);
--header-height: var(--header-h);
--bottom-nav-height: var(--bottomnav-h);
/* Transition backward-compat (tokens uses --transition-fast/--transition) */
--transition-fast: 0.08s ease;
/* Focus ring (simple rgba for older components) */
--focus-ring: rgba(92, 107, 192, 0.25);
}
[data-theme="dark"] {
--accent: var(--c-neutral-50);
--accent-hover: var(--c-neutral-200);
--shadow: var(--shadow-sm);
--focus-ring: rgba(139, 154, 216, 0.3);
}
/* Dark mode overrides for hard-coded Tailwind classes used by older templates */
[data-theme="dark"] .bg-white { background-color: var(--surface) !important; }
[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-gray-100 { background-color: var(--bg) !important; }
[data-theme="dark"] .bg-gray-200 { background-color: var(--border) !important; }
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-black { color: var(--text) !important; }
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-600 { color: var(--text-muted) !important; }
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-400 { color: var(--text-muted) !important; }
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300 { border-color: var(--border) !important; }
[data-theme="dark"] .shadow-sm { box-shadow: var(--shadow-sm) !important; }
[data-theme="dark"] .shadow { box-shadow: var(--shadow-md) !important; }
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
*:focus { outline: none; }
*:focus-visible {
outline: 2px solid var(--primary);
outline-offset: 2px;
}
/* Skip-to-content link (screen reader + keyboard users) */
.skip-link {
position: absolute;
top: -100%;
left: 0;
padding: 0.625rem 1.25rem;
background: var(--primary);
color: #fff;
font-size: 0.875rem;
font-weight: 600;
border-radius: 0 0 0.5rem 0;
z-index: 9999;
text-decoration: none;
transition: top 0.1s;
}
.skip-link:focus {
top: 0;
outline: 3px solid #fff;
outline-offset: 2px;
}
/* Dropdown app links - no transition, fixed size, instant hover */
.dropdown-app-link {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10px 8px;
border-radius: 8px;
text-decoration: none;
color: var(--text);
height: 60px;
min-height: 60px;
}
.dropdown-app-link:hover {
background: var(--surface);
}
.dropdown-app-link i,
.dropdown-app-link img,
.dropdown-app-link svg {
flex-shrink: 0;
}
body {
font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background-color: var(--bg);
color: var(--text);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* Let browser synthesise bold from 600 (we only serve 400/500/600) */
font-synthesis: weight;
}
.menu-btn:hover {
background: var(--surface);
}
/* Icon button styling matching index.html */
.icon-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: none;
cursor: pointer;
color: var(--text);
border-radius: 8px;
/* Specific props only — avoids layout recalc on every transition */
transition: background var(--transition-fast), color var(--transition-fast);
}
.icon-btn:hover {
background: var(--surface);
}
.icon-btn.has-badge {
position: relative;
}
.icon-btn.has-badge::after {
content: '';
position: absolute;
top: 8px;
right: 8px;
width: 8px;
height: 8px;
background: #ef4444;
border-radius: 50%;
border: 2px solid var(--bg);
}
.user-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--accent);
color: var(--bg);
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 600;
cursor: pointer;
}
/* Layout container */
.layout {
display: flex;
flex: 1;
overflow: hidden;
min-height: 0;
max-width: 100%;
width: 100%;
}
/* Sidebar - Fixed position (always expanded) */
.sidebar {
position: fixed;
top: var(--header-height);
left: 0;
height: calc(100vh - var(--header-height));
width: var(--sidebar-width);
background: var(--bg);
border-right: 1px solid var(--border-subtle);
overflow-y: auto;
overflow-x: hidden;
padding: 32px 0 10px;
flex-shrink: 0;
z-index: var(--z-sidebar, 90);
contain: layout style;
}
.sidebar .nav-item span {
opacity: 1;
width: auto;
white-space: nowrap;
}
.sidebar .nav-group-title {
opacity: 1;
visibility: visible;
padding: 10px 14px 4px;
}
.sidebar-nav {
flex: 1;
padding: 0 0 0.25rem !important;
overflow-y: auto;
}
.nav-group {
margin-bottom: 6px;
}
.nav-group-title {
font-size: 11px;
font-weight: 600;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.4px;
}
.nav-item {
display: flex;
align-items: center;
gap: 8px;
padding: 7px 10px;
color: var(--text-muted);
text-decoration: none;
font-size: 14.5px;
font-weight: 500;
cursor: pointer;
margin: 1px 6px;
border-radius: 7px;
justify-content: flex-start;
transition: background 100ms ease, color 100ms ease;
}
.nav-item:hover {
background: var(--surface-hover);
color: var(--text);
}
.nav-item.active {
color: var(--text);
background: var(--surface);
font-weight: 600;
}
[data-theme="dark"] .nav-item.active {
background: var(--surface-raised);
}
.nav-item svg,
.nav-item i {
width: 16px;
height: 16px;
font-size: 15px;
flex-shrink: 0;
stroke-width: 1.75;
opacity: 0.6;
transition: opacity 100ms ease;
}
.nav-item:hover svg,
.nav-item:hover i,
.nav-item.active svg,
.nav-item.active i {
opacity: 1;
}
/* Collapsible nav groups */
.nav-group-toggle {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding: 10px 14px 4px;
border: none;
background: none;
cursor: pointer;
user-select: none;
}
.nav-group-toggle .nav-group-title { padding: 0; }
.nav-group-chevron {
width: 12px; height: 12px;
color: var(--text-muted);
opacity: 0.5;
flex-shrink: 0;
transition: transform 0.2s ease, opacity 0.15s ease;
}
.nav-group-toggle:hover .nav-group-chevron { opacity: 0.9; }
.nav-group-collapsible .nav-group-items {
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease;
}
.nav-group-collapsible.open .nav-group-items { max-height: 500px; }
.nav-group-collapsible.open .nav-group-chevron { transform: rotate(90deg); }
/* Main Content - adjusted for fixed sidebar */
main {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 1.35rem 2rem;
-webkit-overflow-scrolling: touch;
overscroll-behavior: contain;
min-width: 0;
margin-left: var(--sidebar-width);
width: calc(100% - var(--sidebar-width));
content-visibility: auto;
contain-intrinsic-block-size: 800px;
}
/* Header Brand — single typography system for platform + apps */
:root {
--brand-font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
--brand-font-size: 18px;
--brand-font-weight: 800;
--brand-letter-spacing: 0.22em;
}
.header-brand {
display: flex;
align-items: center;
font-family: var(--brand-font-family);
font-weight: var(--brand-font-weight);
font-size: var(--brand-font-size);
letter-spacing: var(--brand-letter-spacing);
line-height: 1;
text-transform: uppercase;
background: linear-gradient(135deg, var(--c-primary-500) 0%, var(--c-primary-700) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
text-decoration: none;
padding: 0 10px;
flex-shrink: 0;
min-width: max-content; /* never allow the brand to be narrowed below its natural width */
white-space: nowrap; /* prevents letter-wrap at very small containers */
transition: opacity 0.1s ease;
}
#main-header {
transition: background-color 0.1s ease, border-color 0.1s ease;
}
.header-brand.is-switching {
opacity: 0.7;
}
[data-theme="dark"] .header-brand {
background: linear-gradient(135deg, var(--c-primary-300) 0%, var(--c-primary-500) 100%);
-webkit-background-clip: text;
background-clip: text;
}
.header-brand:hover {
opacity: 0.8;
}
/* ── App context brand: "← YAZ / AppName" ──────────────────────
Used by app_base.html when navigating into a domain engine.
The "YAZ" back-link is muted; the app name gets full gradient treatment.
────────────────────────────────────────────────────────────────── */
.header-brand-back {
display: inline-flex;
align-items: center;
gap: 3px;
font-weight: 600;
font-size: 13px;
color: var(--text-muted);
text-decoration: none;
flex-shrink: 0;
padding: 0 2px;
transition: color var(--transition-fast);
}
.header-brand-back:hover { color: var(--text); text-decoration: none; }
.header-brand-back-icon { opacity: 0.6; flex-shrink: 0; }
.header-brand-sep {
color: var(--border);
font-size: 15px;
font-weight: 300;
margin: 0 2px;
flex-shrink: 0;
user-select: none;
}
/* App-specific brand: identical weight/size/spacing as the YAZ platform brand.
Only the gradient colour differs (set via inline style per app). */
.header-brand--app {
font-family: var(--brand-font-family);
font-weight: var(--brand-font-weight);
font-size: var(--brand-font-size);
letter-spacing: var(--brand-letter-spacing);
line-height: 1;
text-transform: uppercase;
}
/* ── App-scoped search input in nav bar ─────────────────────────
Replaces the command-palette trigger when an app injects its
own search (e.g., Surgio bloc case search).
────────────────────────────────────────────────────────────────── */
.nav-search-app-input {
height: 32px;
padding: 0 0.875rem 0 2.25rem;
font-size: 0.875rem;
border: 1px solid var(--border);
border-radius: 999px;
background: var(--bg);
color: var(--text);
outline: none;
width: clamp(180px, 26vw, 380px);
transition: border-color 0.15s, box-shadow 0.15s, width 0.2s ease;
}
.nav-search-app-input::placeholder { color: var(--text-muted); }
.nav-search-app-input:focus {
border-color: var(--primary);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
width: clamp(200px, 32vw, 460px);
}
.nav-search-app-input:focus-visible { outline: none; }
/* Screen-reader only utility */
.sr-only {
position: absolute; width: 1px; height: 1px; padding: 0;
margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
white-space: nowrap; border-width: 0;
}
/* Tablet: narrow sidebar with icons only */
@media (min-width: 769px) and (max-width: 900px) {
:root { --sidebar-width: 56px; }
.sidebar .nav-item span { display: none; }
.sidebar .nav-group-title { display: none; }
.sidebar .nav-group-toggle { justify-content: center; padding: 8px; }
.sidebar .nav-group-chevron { display: none; }
.sidebar .nav-group-collapsible .nav-group-items { max-height: 500px; }
.sidebar .nav-item { justify-content: center; padding: 8px; margin: 1px 4px; }
}
/* Hide sidebar on mobile, show bottom nav */
@media (max-width: 768px) {
.sidebar {
display: none;
}
/* Mobile main: full width, pad for bottom nav */
main {
margin-left: 0;
width: 100%;
padding: 1.1rem 1rem;
padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 1.5rem) !important;
}
/* Compact brand on mobile — never shrink or wrap */
.header-brand {
font-size: var(--brand-font-size);
flex-shrink: 0;
min-width: max-content;
white-space: nowrap;
}
}
/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
width: 4px;
}
.sidebar::-webkit-scrollbar-track {
background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 2px;
}
/* Navigation progress bar */
#nav-progress {
position: fixed;
top: 0;
left: 0;
height: 2px;
width: 0;
background: var(--primary);
z-index: 9999;
pointer-events: none;
}
/* Content entrance — only via .yaz-page-entering (HTMX nav) to avoid double-fade */
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
/* Accessibility: honour reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
/* Mobile: remove 300ms tap delay on interactive elements */
a, button, [role="button"], input, select, textarea { touch-action: manipulation; }
/* ── Wide screen (≥1280px) — wider sidebar, breathing room ── */
@media (min-width: 1280px) {
:root { --sidebar-width: 240px; }
.sidebar { width: 240px; }
main {
margin-left: 240px;
width: calc(100% - 240px);
padding: 1.5rem 2.5rem;
}
}
/* ── Large screen (≥1440px) ── */
@media (min-width: 1440px) {
:root { --sidebar-width: 260px; }
.sidebar { width: 260px; }
main {
margin-left: 260px;
width: calc(100% - 260px);
padding: 1.75rem 3rem;
}
}
/* ── XL screen (≥1920px) ── */
@media (min-width: 1920px) {
:root { --sidebar-width: 280px; }
.sidebar { width: 280px; }
main {
margin-left: 280px;
width: calc(100% - 280px);
padding: 2.25rem 4rem;
}
}
/* ══════════════════════════════════════════════════════════════
Page Navigation Transitions (Platform ↔ App ↔ App)
══════════════════════════════════════════════════════════════
HTMX hx-boost replaces #main-content (outerHTML). Each app's
CSS lives inside #main-content via {% block app_styles %} so
it swaps in/out with the content — no full reload needed.
Two paths:
1. View Transitions API (Chrome 111+, Safari 18+):
htmx-config.js wraps the swap; browser handles old→new.
2. Fallback (other browsers): .yaz-page-entering class added
by htmx-config.js on htmx:afterSettle.
══════════════════════════════════════════════════════════════ */
/* Give #main-content layout containment; will-change only activates during the
animation via the .yaz-page-entering class to avoid permanent compositor layer */
#main-content {
contain: paint style layout;
/* Chrome 111+ / Safari 18+: scope VT to content area only (header+sidebar stay static) */
view-transition-name: main-content;
}
/* ── View Transitions API — native browser compositing (Chrome 111+, Safari 18+) ── */
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-slide-up { from { opacity: 0; transform: translateY(5px); } }
::view-transition-old(main-content) {
animation: 50ms ease-in vt-fade-out;
}
::view-transition-new(main-content) {
animation: 80ms cubic-bezier(0.16, 1, 0.3, 1) vt-slide-up;
}
/* ── CSS fallback (non-VT browsers) — .yaz-page-entering added by htmx-config.js ── */
@keyframes vt-slide-in {
from { opacity: 0; transform: translate3d(0, 4px, 0); }
to { opacity: 1; transform: translate3d(0, 0, 0); }
}
#main-content.yaz-page-entering {
animation: vt-slide-in 60ms cubic-bezier(0.16, 1, 0.3, 1) both;
will-change: opacity, transform;
}
/* ── Reduced motion — cut all transition animations ─────────── */
@media (prefers-reduced-motion: reduce) {
#main-content.yaz-page-entering { animation: none !important; }
::view-transition-old(main-content),
::view-transition-new(main-content) { animation: none !important; }
}