/**
 * KSA Theme — static structural polish (no user colors).
 * Colors and tokens come from generated preset CSS (theme_active.css).
 */

/* Cairo only when KSA theme is enabled (Enable Theme = on) */
body.ksa-theme-enabled.ksa-font-cairo {
	font-family: Cairo, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

body.ksa-theme-enabled .page-title,
body.ksa-theme-enabled h1,
body.ksa-theme-enabled h2,
body.ksa-theme-enabled h3,
body.ksa-theme-enabled h4 {
	font-family: inherit;
}

/* Focus visibility without fighting Frappe defaults */
body.ksa-theme-enabled :focus-visible {
	outline: 2px solid var(--primary, #006c35);
	outline-offset: 2px;
}

/* Compact mode only with KSA theme on */
body.ksa-theme-enabled.ksa-compact-mode .layout-main .form-section,
body.ksa-theme-enabled.ksa-compact-mode .dialog-body .form-section {
	margin-bottom: 0.75rem;
}

body.ksa-theme-enabled.ksa-compact-mode .page-head {
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}

/* Respect reduced motion + admin “animations off” */
@media (prefers-reduced-motion: reduce) {
	body.ksa-theme-enabled * {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

body.ksa-theme-enabled.ksa-animations-disabled .indicator,
body.ksa-theme-enabled.ksa-animations-disabled .progress,
body.ksa-theme-enabled.ksa-animations-disabled [class*="fade"] {
	animation: none !important;
	transition: none !important;
}

/* Brand title next to the app logo (Frappe desk navbar.html); not gated on Enable Theme.
   Scope to navbar so form `.container` rows are not affected. */
header.navbar .container,
header.navbar .container-fluid {
	flex-wrap: wrap;
	row-gap: 0.15rem;
}
/* Same as Help / .nav-link: use --navbar-fg (set with desk nav in presets), not body --text-color. */
header.navbar .ksa-desk-brand-text {
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	margin-inline: 0.5rem;
	flex: 0 0 auto;
	max-width: min(50vw, 28rem);
	white-space: normal;
	line-height: 1.2;
	color: var(--navbar-fg, inherit) !important;
	position: relative;
	z-index: 1;
}
