/* ═══════════════════════════════════════════════════════════
   آپاتیت — Soft design layer (does NOT break Blocksy layout)
   White · Purple · Gold
═══════════════════════════════════════════════════════════ */

:root,
.apatite-palette {
	--ap-white: #ffffff;
	--ap-bg: #faf9ff;
	--ap-purple-50: #f5f3ff;
	--ap-purple-100: #ede9fe;
	--ap-purple-200: #ddd6fe;
	--ap-purple-400: #a78bfa;
	--ap-purple-500: #8b5cf6;
	--ap-purple-600: #7c3aed;
	--ap-purple-700: #6d28d9;
	--ap-purple-900: #4c1d95;

	--ap-gold: #c9a227;
	--ap-gold-soft: #e8d48b;
	--ap-gold-deep: #a6851a;

	--ap-ink: #1e1b4b;
	--ap-muted: #6b7280;
	--ap-muted-2: #4b476b;

	--ap-font: "Vazirmatn", system-ui, sans-serif;

	/* Soft Blocksy bridges — colors only, no layout */
	--theme-palette-color-1: #6d28d9;
	--theme-palette-color-2: #8b5cf6;
	--theme-palette-color-3: #c9a227;
	--theme-link-initial-color: #6d28d9;
	--theme-link-hover-color: #a6851a;
	--theme-button-background-initial-color: #7c3aed;
	--theme-button-background-hover-color: #6d28d9;
	--theme-button-text-initial-color: #ffffff;
	--theme-button-text-hover-color: #ffffff;
	--theme-button-border-radius: 12px;
	--theme-font-family: var(--ap-font);
	--font-family: var(--ap-font);
}

html {
	scroll-behavior: smooth;
}

body.apatite-theme {
	font-family: var(--ap-font);
	color: var(--ap-ink);
}

body.apatite-theme ::selection {
	background: rgba(139, 92, 246, 0.28);
	color: var(--ap-ink);
}

/* Ambient: fixed, never affects document flow */
.apatite-ambient {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	overflow: hidden;
}

.apatite-orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(90px);
	opacity: 0.35;
	animation: apatite-float 16s ease-in-out infinite;
}

.apatite-orb-1 {
	width: 480px;
	height: 480px;
	background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
	top: -10%;
	right: -8%;
}

.apatite-orb-2 {
	width: 360px;
	height: 360px;
	background: radial-gradient(circle, rgba(232, 212, 139, 0.45) 0%, transparent 70%);
	bottom: 15%;
	left: 8%;
	animation-delay: -6s;
}

.apatite-orb-3 {
	width: 280px;
	height: 280px;
	background: radial-gradient(circle, #ede9fe 0%, transparent 70%);
	top: 50%;
	left: -6%;
	animation-delay: -10s;
}

.apatite-grid {
	position: absolute;
	inset: 0;
	opacity: 0.6;
	background-image:
		linear-gradient(rgba(139, 92, 246, 0.025) 1px, transparent 1px),
		linear-gradient(90deg, rgba(139, 92, 246, 0.025) 1px, transparent 1px);
	background-size: 48px 48px;
	mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, black, transparent);
	-webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, black, transparent);
}

@keyframes apatite-float {
	0%, 100% { transform: translate(0, 0); }
	50% { transform: translate(16px, -12px); }
}

/* Typography — color/weight only */
body.apatite-theme h1,
body.apatite-theme h2,
body.apatite-theme h3,
body.apatite-theme h4,
body.apatite-theme h5,
body.apatite-theme h6 {
	font-family: var(--ap-font);
	font-weight: 800;
	letter-spacing: -0.015em;
}

/* Header title — always readable on white header */
body.apatite-theme header#header .site-title,
body.apatite-theme header#header .site-title a,
body.apatite-theme header#header .site-branding .site-title,
body.apatite-theme header#header .site-branding .site-title a,
body.apatite-theme header#header .ct-site-title,
body.apatite-theme header#header .ct-site-title a,
body.apatite-theme .ct-header .site-title,
body.apatite-theme .ct-header .site-title a,
body.apatite-theme .ct-header [data-id="logo"] .site-title,
body.apatite-theme .ct-header [data-id="logo"] .site-title a {
	font-weight: 800 !important;
	color: #4c1d95 !important;
	-webkit-text-fill-color: #4c1d95 !important;
	opacity: 1 !important;
}

body.apatite-theme header#header .site-description,
body.apatite-theme .ct-header .site-description {
	color: #6b7280 !important;
	-webkit-text-fill-color: #6b7280 !important;
	opacity: 1 !important;
}

/* Soft menu color only — never background/padding (breaks Blocksy indicators) */
body.apatite-theme header#header .menu > li > a {
	font-weight: 600;
}

body.apatite-theme header#header .menu > li > a:hover {
	color: #6d28d9;
}

/* Buttons — visual only */
body.apatite-theme .ct-button,
body.apatite-theme .button:not(.components-button),
body.apatite-theme input[type="submit"],
body.apatite-theme .wp-block-button__link {
	font-family: var(--ap-font);
	font-weight: 700;
	border-radius: 12px;
	transition: filter 0.2s ease, box-shadow 0.2s ease;
}

body.apatite-theme .ct-button:hover,
body.apatite-theme .button:not(.components-button):hover,
body.apatite-theme input[type="submit"]:hover,
body.apatite-theme .wp-block-button__link:hover {
	filter: brightness(1.05);
	box-shadow: 0 8px 22px rgba(124, 58, 237, 0.28);
}

/* Forms */
body.apatite-theme input[type="text"],
body.apatite-theme input[type="email"],
body.apatite-theme input[type="search"],
body.apatite-theme input[type="password"],
body.apatite-theme input[type="tel"],
body.apatite-theme input[type="url"],
body.apatite-theme input[type="number"],
body.apatite-theme textarea,
body.apatite-theme select {
	font-family: var(--ap-font);
	border-radius: 12px;
}

body.apatite-theme input:focus,
body.apatite-theme textarea:focus,
body.apatite-theme select:focus {
	border-color: var(--ap-purple-500);
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
	outline: none;
}

/* Sidebar widgets — only when clearly widgets */
body.apatite-theme .ct-sidebar .ct-widget {
	border-radius: 16px;
}

body.apatite-theme .ct-sidebar .widget-title {
	font-weight: 800;
	color: var(--ap-purple-700);
}

/* Categories pills */
body.apatite-theme .entry-categories a,
body.apatite-theme .ct-categories a {
	border-radius: 999px;
	background: var(--ap-purple-50);
	color: var(--ap-purple-700);
	font-weight: 700;
	font-size: 0.75rem;
}

/* Footer accent — only when footer exists, thin line */
body.apatite-theme footer#footer > .ct-footer::before,
body.apatite-theme #footer .ct-footer::before {
	content: "";
	display: block;
	height: 2px;
	background: linear-gradient(90deg, var(--ap-purple-600), var(--ap-gold), var(--ap-purple-400));
}

body.apatite-theme footer#footer a:hover {
	color: var(--ap-gold-deep);
}

/* Pagination current */
body.apatite-theme .ct-pagination .current,
body.apatite-theme .page-numbers.current {
	background: var(--ap-purple-600);
	color: #fff;
	border-radius: 10px;
}

/* Reveal (opt-in via JS class; no layout shift when visible) */
.apatite-reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.5s ease, transform 0.5s ease;
}

.apatite-reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.apatite-orb,
	.apatite-reveal {
		animation: none !important;
		transition: none !important;
		opacity: 1;
		transform: none;
	}
}
