/* tiq-shell.css — TIQ-side override for the parai-core shell chrome.
 *
 * WHY THIS FILE EXISTS
 * --------------------
 * TIQ is a parai-core *consumer*. The global shell (header, module-nav,
 * language picker, branding) lives in parai-core's
 * frontend/src/routes/+layout.svelte, which this repo must NOT modify
 * (opdrachtgeverskeuze: parai-core source is read-only). parai-core exposes
 * no UI config-hook (the only App options are WithName / WithStaticFS /
 * WithConfigFile / WithModuleConfigurator; config.yaml has no `ui.locales`),
 * so the language picker, module chip and brand label cannot be configured
 * away server-side.
 *
 * MECHANISM
 * ---------
 * The shell's index.html is served verbatim from the embedded static/ dir
 * (parai-core server.go spaFallback). `make spa` rebuilds that index.html from
 * the parai-core build, then a post-step (Makefile `spa` target) injects a
 * <link> to THIS stylesheet into the served HTML. The injection is idempotent
 * and re-applied on every `make spa`, so this is a reproducible build step —
 * not a hand-edit of a generated file. This file is git-tracked and survives
 * `make spa` (which only wipes static/_app + static/images).
 *
 * The CSP allows style-src 'self' 'unsafe-inline', so a same-origin <link>
 * stylesheet loads fine.
 *
 * Selectors target the shell's stable hooks:
 *   [data-testid="language-toggle"]  — the language picker wrapper
 *   [data-testid="module-nav"]       — the module chip / module navigation
 *   header .font-serif.text-lg.font-bold — the "Parai" brand label
 *   header img[alt]                  — the Parai logo
 *   :root                            — the brand design tokens
 *   .login-hero-panel/.login-hero-glow — the login decorative surfaces
 * These are owned by parai-core; if parai-core renames them, this override
 * degrades gracefully (controls reappear / colours fall back to the
 * parai-default, no breakage) rather than crashing the app.
 *
 * COLOUR OVERRIDE — WHY :root:root (double), NOT plain :root
 * ---------------------------------------------------------
 * UX-02 asks for the "donkerblauwe kleurvlak" to become TGSC-green. That blue
 * is parai-core's --secondary (oklch hue 265); the whole brand palette lives
 * in the shell bundle as `:root{ --primary … --secondary … }`
 * (_app/immutable/assets/0.*.css). That bundle is loaded by SvelteKit/Vite as
 * a <link> APPENDED to <head> AT RUNTIME — i.e. AFTER this static stylesheet.
 * A plain `:root{…}` here has equal specificity (0-1-0) and an EARLIER source
 * order, so the shell bundle would WIN and our colours would never apply. We
 * therefore raise specificity to `:root:root` (0-2-0) so the override wins
 * regardless of load order, and `:root:root.dark` (0-3-0) for dark mode. This
 * is a token override, NOT a copy of parai-core source (no // Bron needed).
 * The values mirror modules/tiq/frontend/src/app.css so shell + module read as
 * one TGSC-green product.
 */

/* UX-007 — TIQ is Nederlands-only for this delivery. Hide the language picker
 * so the shell never promises an English UI that the TIQ module doesn't
 * provide. Hidden (not removed) so layout/flex spacing stays intact. */
[data-testid="language-toggle"] {
	display: none !important;
}

/* UX-008 — single-module consumer: the module chip ("Tiq") is not a real
 * choice (main.go registers exactly one module). Hide the module-nav so the
 * header reads as one finished product, not a dev scaffold. */
[data-testid="module-nav"] {
	display: none !important;
}

/* UX-008 — replace generic "Parai" brand text + logo with TGSC branding.
 * The brand <span> text is a paraglide message ("Parai") we cannot edit from
 * here, so we visually hide it and render the product name via a pseudo
 * element on its parent. */
header > div:first-child > span.font-serif.text-lg.font-bold {
	font-size: 0; /* hide the original "Parai" glyphs */
	line-height: inherit;
}
header > div:first-child > span.font-serif.text-lg.font-bold::after {
	content: "TGSC portaal";
	font-size: 1.125rem; /* text-lg */
	line-height: 1.75rem;
	font-weight: 700;
	white-space: nowrap;
}

/* UX-02/UX-03 — swap the shell logo for the TGSC placeholder mark.
 * The asset lives at static/tgsc-logo.svg (served at /tgsc-logo.svg). It sits
 * at the static ROOT on purpose: `make spa` wipes static/_app + static/images
 * but NOT the static root, so the logo (like this stylesheet) survives a fresh
 * shell copy without a Makefile cp-step. `content:` replaces the rendered
 * <img> bitmap; the original alt text stays for a11y. */
header > div:first-child > img[alt] {
	content: url(/tgsc-logo.svg);
}

/* Single-module TIQ deploy — toon het TGSC-merk linksboven (waar de parai-logo
 * stond). .shell-header__home is de merk/home-<button> (eerste header-kind):
 * <img /images/Main_logo.jpg> + <span>{app_name}</span> (= "TIQ", main.go
 * WithName). We laten het blok nu staan (géén display:none meer) en vervangen
 * alleen het logo-bitmap door het TGSC-icoon (/tgsc-logo.svg, static-ROOT,
 * overleeft `make spa`; 40×40 viewBox, schaalt in de h-8 w-8 box). De
 * "TIQ"-tekst blijft; klikken op het merk gaat naar de tiq-home
 * (default_module). Degradeert netjes: hernoemt parai-core .shell-header__home
 * of Main_logo.jpg, dan valt het terug op de parai-default zonder breuk. */
.shell-header__home img[src$="Main_logo.jpg"] {
	content: url(/tgsc-logo.svg);
}

/* The login form (parai-core auth/login/+page.svelte:152) renders a small
 * /images/parai-logo.svg above the app name. Swap it to the TGSC mark too so
 * the login screen carries one identity. Attribute-suffix match survives a
 * path change as long as the filename is stable. */
img[src$="parai-logo.svg"] {
	content: url(/tgsc-logo.svg);
}

/* ===========================================================================
 * UX-02 / UX-03 — TGSC-green brand tokens (mirror of the TIQ module palette in
 * modules/tiq/frontend/src/app.css). :root:root beats the shell bundle's
 * `:root{…}` by specificity so it wins irrespective of load order (see header
 * note). This turns the shell's --secondary (the "donkerblauwe kleurvlak"),
 * accents, ring and surfaces TGSC-green across login + post-login chrome.
 * ======================================================================== */
:root:root {
	--radius: 1.5rem;
	--background: #ffffff;
	--foreground: #323536;
	--primary: #bfd795;
	--primary-foreground: #323536;
	--secondary: #bed5cf;
	--secondary-foreground: #323536;
	--muted: #f2f4ee;
	--muted-foreground: #5b5f60;
	--accent: #bed5cf;
	--accent-foreground: #323536;
	--border: #e3e7df;
	--input: #e3e7df;
	--ring: #bfd795;
	--card: #ffffff;
	--card-foreground: #323536;
	--sidebar: #f7f9f4;
	--sidebar-foreground: #323536;
}

:root:root.dark {
	--background: #1a1c1c;
	--foreground: #f2f4ee;
	--primary: #bfd795;
	--primary-foreground: #1a1c1c;
	--secondary: #6f928a;
	--secondary-foreground: #f2f4ee;
	--muted: #2a2d2d;
	--muted-foreground: #a7aca6;
	--accent: #2f3a37;
	--accent-foreground: #f2f4ee;
	--border: #3a3d3d;
	--input: #3a3d3d;
	--ring: #bfd795;
	--card: #232626;
	--card-foreground: #f2f4ee;
	--sidebar: #1f2121;
	--sidebar-foreground: #f2f4ee;
}

/* ===========================================================================
 * UX-02 — login hero: recolour the "warm-dark" decorative panel to TGSC-green.
 * The panel background is set inline as `--login-hero-bg` on the element AND
 * consumed by a Svelte-scoped rule
 *   .login-hero-panel.svelte-xxxx { background: var(--login-hero-bg) }
 * (specificity 0-2-0, no !important). An inline custom-prop cannot be beaten by
 * a :root override, so we do NOT touch --login-hero-bg; instead we override the
 * `background` PROPERTY directly with !important, which wins over the scoped
 * rule regardless of its hashed specificity. Degrades gracefully: if parai-core
 * renames .login-hero-panel, the panel simply reverts to the parai default.
 * ======================================================================== */
.login-hero-panel {
	/* Groen vlak + centrale TGSC-emblem (twee background-lagen: SVG bóven de
	 * effen kleur). De SVG staat op de static-ROOT → overleeft `make spa`. */
	background:
		url("/tgsc-hero.svg") no-repeat center 40% / min(58%, 360px),
		#22301e !important; /* deep TGSC charcoal-green; witte tekst ~13:1 */
}
.login-hero-glow {
	background: radial-gradient(
		ellipse,
		rgba(191, 215, 149, 0.22) 0%,
		transparent 70%
	) !important; /* brand-green ambient glow i.p.v. de warme oranje glow */
}

/* UX-02/UX-03 — verwijder de Parai-branding op het loginscherm zodat er geen
 * "Parai"-teksten meer staan (klantwens). We RAKEN de parai-core-tekst niet in
 * de bron (read-only); we verbergen/vervangen ze via de override:
 *   1. het grote "Parai"-watermerk (het enige aria-hidden <span>) → "TGSC";
 *   2. de tagline "Digital voices, real insights" (<h2>) → "TGSC portaal";
 *   3. de subtitel (<p>) → een passende, feitelijke NL-omschrijving;
 *   4. het "Parai"-wordmark boven het formulier (<h1>) → "TGSC portaal".
 * Tekstvervanging via font-size:0 + ::after (zelfde techniek als de
 * header-rebrand hierboven); degradeert netjes als parai-core de structuur
 * hernoemt (de originele tekst komt dan terug, geen breuk). */
.login-hero-panel > span[aria-hidden="true"] {
	font-size: 0 !important; /* verberg de "Parai"-glyphs */
}
.login-hero-panel > span[aria-hidden="true"]::after {
	content: "TGSC";
	font-size: 14rem; /* text-[14rem] */
	line-height: 1; /* leading-none */
	font-weight: 300; /* font-light — het <span> erft kleur text-white/[0.07] */
}
.login-hero-panel h2 {
	font-size: 0 !important;
}
.login-hero-panel h2::after {
	content: "TGSC portaal";
	font-size: 2.25rem; /* text-4xl */
	line-height: 1.15;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.92);
}
.login-hero-panel p {
	font-size: 0 !important;
}
.login-hero-panel p::after {
	content: "Veilig medewerkersportaal voor onderzoek en analyse.";
	font-size: 0.875rem; /* text-sm */
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.5);
}

/* Het "Parai"-wordmark boven het inlogformulier (parai-core login
 * +page.svelte:157, m.app_name()). Zelfde vier utility-classes als de bron,
 * zodat het exact dit element raakt. */
h1.font-serif.text-2xl.font-bold.tracking-tight {
	font-size: 0 !important;
}
h1.font-serif.text-2xl.font-bold.tracking-tight::after {
	content: "TGSC portaal";
	font-size: 1.5rem; /* text-2xl */
	line-height: 2rem;
	font-weight: 700;
}
