/* ==========================================================================
   Reusable UI Components — buttons, badges, section headers, dividers, glass panels
   Loaded sitewide via inc/enqueue.php
   ========================================================================== */

/* Motion Foundation — shared scroll reveal + stagger system
   (relocated from front-page.css so it's available on every template) */
.js-reveal {
	opacity: 0;
	transform: translateY(var(--zm-reveal-distance));
	transition:
		opacity var(--zm-duration-slow) var(--zm-ease-out-expo),
		transform var(--zm-duration-slow) var(--zm-ease-out-expo);
}

.js-reveal.zm-revealed {
	opacity: 1;
	transform: none;
}

.js-reveal--left {
	transform: translateX(calc(var(--zm-reveal-distance) * -1));
}

.js-reveal--right {
	transform: translateX(var(--zm-reveal-distance));
}

.js-reveal--scale {
	transform: scale(0.94);
}

.js-reveal--left.zm-revealed,
.js-reveal--right.zm-revealed,
.js-reveal--scale.zm-revealed {
	opacity: 1;
	transform: none;
}

.js-reveal-group > *:nth-child(1) { transition-delay: calc(var(--zm-stagger-base) * 0); }
.js-reveal-group > *:nth-child(2) { transition-delay: calc(var(--zm-stagger-base) * 1); }
.js-reveal-group > *:nth-child(3) { transition-delay: calc(var(--zm-stagger-base) * 2); }
.js-reveal-group > *:nth-child(4) { transition-delay: calc(var(--zm-stagger-base) * 3); }
.js-reveal-group > *:nth-child(5) { transition-delay: calc(var(--zm-stagger-base) * 4); }
.js-reveal-group > *:nth-child(6) { transition-delay: calc(var(--zm-stagger-base) * 5); }
.js-reveal-group > *:nth-child(7) { transition-delay: calc(var(--zm-stagger-base) * 6); }
.js-reveal-group > *:nth-child(8) { transition-delay: calc(var(--zm-stagger-base) * 7); }

/* Buttons
   (moved from front-page.css so they're available on every template) */
.zm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: var(--space-4) var(--space-10);
	border-radius: var(--zm-radius-sm);
	font-family: var(--font-primary);
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	letter-spacing: 0.02em;
	cursor: pointer;
	border: 1px solid transparent;
	transition:
		transform var(--duration-fast) var(--ease-out),
		box-shadow var(--duration-fast) var(--ease-out),
		border-color var(--duration-fast) var(--ease-out),
		color var(--duration-fast) var(--ease-out),
		background var(--duration-fast) var(--ease-out);
}

.zm-btn--primary {
	background: linear-gradient(120deg, var(--zm-gold-300), var(--zm-gold-500));
	color: var(--zm-navy-950);
}
.zm-btn--primary:hover {
	transform: translateY(-3px);
	box-shadow: 0 20px 44px -10px var(--zm-gold-glow), 0 0 0 1px rgba(212, 175, 55, 0.35);
}
.zm-btn--primary:active {
	transform: translateY(0);
	box-shadow: 0 6px 16px -8px var(--zm-gold-glow);
}

.zm-btn--ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.24);
	color: var(--zm-white);
}
.zm-btn--ghost:hover {
	border-color: var(--zm-gold-500);
	color: var(--zm-gold-300);
	transform: translateY(-3px);
}
.zm-btn--ghost:active {
	transform: translateY(0);
	background: rgba(255, 255, 255, 0.06);
}

.zm-btn--outline {
	background: transparent;
	border-color: var(--zm-gold-500);
	color: var(--zm-gold-300);
}
.zm-btn--outline:hover {
	background: var(--zm-gold-glow);
	transform: translateY(-3px);
}
.zm-btn--outline:active {
	transform: translateY(0);
	background: rgba(212, 175, 55, 0.22);
}

.zm-btn:focus-visible {
	outline: 2px solid var(--zm-gold-500);
	outline-offset: 3px;
}

.zm-btn:disabled,
.zm-btn[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
	transform: none;
	box-shadow: none;
}

/* Badge — small pill label, e.g. "Pharmaceutical Grade" */
.zm-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-1) var(--space-4);
	border-radius: 999px;
	background: var(--zm-glass-bg);
	border: 1px solid var(--zm-glass-border);
	color: var(--zm-gold-300);
	font-family: var(--font-primary);
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
}

.zm-badge--solid {
	background: linear-gradient(120deg, var(--zm-gold-300), var(--zm-gold-500));
	border-color: transparent;
	color: var(--zm-navy-950);
}

/* Section header — eyebrow + title + subtitle pattern used across sections */
.zm-section-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-4);
	max-width: 640px;
	margin-inline: auto;
	text-align: center;
}

.zm-section-header--left {
	align-items: flex-start;
	margin-inline: 0;
	text-align: left;
}

.zm-section-header__eyebrow {
	font-family: var(--font-primary);
	font-size: 0.8rem;
	font-weight: var(--weight-semibold);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--zm-gold-300);
	margin: 0;
}

.zm-section-header__title {
	font-family: var(--font-display);
	font-size: clamp(2rem, 4vw, 3.2rem);
	line-height: var(--leading-tight);
	color: var(--zm-white);
	margin: 0;
}

.zm-section-header__subtitle {
	font-family: var(--font-primary);
	font-size: var(--text-lg);
	line-height: var(--leading-loose);
	color: var(--zm-gray-400);
	margin: 0;
}

/* Divider */
.zm-divider {
	height: 1px;
	border: 0;
	margin: 0;
	background: linear-gradient(90deg, transparent, var(--zm-glass-border), transparent);
}

.zm-divider--accent {
	position: relative;
	height: 1px;
	border: 0;
	margin: 0;
	background: var(--zm-glass-border);
}

.zm-divider--accent::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--zm-gold-500);
	box-shadow: 0 0 12px var(--zm-gold-glow);
}

/* Glass panel — reusable glassmorphism container */
.zm-glass-panel {
	background: var(--zm-glass-bg);
	border: 1px solid var(--zm-glass-border);
	border-radius: var(--zm-radius-lg);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	padding: var(--space-8);
}

.zm-glass-panel--interactive {
	transition:
		border-color var(--duration-normal) var(--ease-out),
		background var(--duration-normal) var(--ease-out),
		transform var(--duration-normal) var(--ease-out);
}

.zm-glass-panel--interactive:hover,
.zm-glass-panel--interactive:focus-within {
	border-color: var(--zm-gold-500);
	background: rgba(255, 255, 255, 0.06);
	transform: translateY(-6px);
}

/* Typography utility */
.zm-display {
	font-family: var(--font-display);
}

/* Single post template */
.zm-single {
	padding-block: var(--space-16) var(--space-24);
}

.zm-single__article {
	max-width: 760px;
	margin-inline: auto;
	padding-inline: var(--space-6);
}

.zm-single__header {
	margin-bottom: var(--space-8);
}

.zm-single__title {
	font-size: var(--text-4xl);
}

.zm-single__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin-top: var(--space-4);
}

.zm-single__thumbnail {
	max-width: 760px;
	margin: 0 auto var(--space-8);
	padding-inline: var(--space-6);
	border-radius: var(--zm-radius-lg);
	overflow: hidden;
}

.zm-single__thumbnail-img {
	width: 100%;
	height: auto;
}

.zm-single__content {
	max-width: 760px;
	margin-inline: auto;
	padding-inline: var(--space-6);
	color: var(--zm-gray-100);
	font-size: var(--text-lg);
	line-height: var(--leading-loose);
}

.zm-single__nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space-6);
	max-width: 760px;
	margin: var(--space-16) auto 0;
	padding: var(--space-8) var(--space-6) 0;
	border-top: 1px solid var(--zm-glass-border);
}

.zm-single__nav-next {
	margin-left: auto;
	text-align: right;
}

.zm-single__nav a {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}

.zm-single__nav-label {
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--zm-gold-300);
}

.zm-single__nav-title {
	font-family: var(--font-display);
	font-size: var(--text-lg);
	color: var(--zm-white);
}

/* Archive template */
.zm-archive {
	padding-block: var(--space-16) var(--space-24);
}

.zm-archive__header {
	max-width: var(--zm-container-max);
	margin-inline: auto;
	padding-inline: var(--space-6);
	margin-bottom: var(--space-12);
}

.zm-archive__title {
	font-size: var(--text-3xl);
}

.zm-archive__grid {
	max-width: var(--zm-container-max);
	margin-inline: auto;
	padding-inline: var(--space-6);
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-8);
}

@media (min-width: 768px) {
	.zm-archive__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1100px) {
	.zm-archive__grid { grid-template-columns: repeat(3, 1fr); }
}

.zm-post-card {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.zm-post-card__date {
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--zm-gold-300);
}

.zm-post-card__title {
	font-size: var(--text-xl);
	margin: 0;
}

.zm-post-card__title a {
	color: var(--zm-white);
}

.zm-post-card__title a:hover {
	color: var(--zm-gold-300);
}

.zm-post-card__excerpt {
	color: var(--zm-gray-400);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
	margin: 0;
}

.zm-post-card__link {
	margin-top: auto;
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	color: var(--zm-gold-300);
}

.zm-post-card__link:hover {
	color: var(--zm-gold-500);
}

.zm-archive__pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-2);
	max-width: var(--zm-container-max);
	margin: var(--space-16) auto 0;
	padding-inline: var(--space-6);
}

.zm-archive__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding-inline: var(--space-3);
	border-radius: var(--zm-radius-sm);
	border: 1px solid var(--zm-glass-border);
	color: var(--zm-gray-100);
	font-size: var(--text-sm);
}

.zm-archive__pagination .page-numbers:hover {
	border-color: var(--zm-gold-500);
	color: var(--zm-gold-300);
}

.zm-archive__pagination .page-numbers.current {
	background: linear-gradient(120deg, var(--zm-gold-300), var(--zm-gold-500));
	border-color: transparent;
	color: var(--zm-navy-950);
}

.zm-archive__empty {
	max-width: var(--zm-container-max);
	margin-inline: auto;
	padding-inline: var(--space-6);
	color: var(--zm-gray-400);
}

/* 404 template */
.zm-404 {
	min-height: 60vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-block: var(--space-24);
}

.zm-404__hero {
	max-width: 640px;
	margin-inline: auto;
	padding-inline: var(--space-6);
	text-align: center;
}

.zm-404__title {
	font-size: var(--text-4xl);
	margin-bottom: var(--space-4);
}

.zm-404__subtext {
	color: var(--zm-gray-400);
	font-size: var(--text-lg);
	line-height: var(--leading-normal);
	margin-bottom: var(--space-8);
}

.zm-404__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-4);
}

/* Custom cursor */
.zm-cursor {
	position: fixed;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
	pointer-events: none;
	z-index: 9998;
	opacity: 0;
	transform: translate3d(var(--zm-cursor-x, -100px), var(--zm-cursor-y, -100px), 0);
	transition: transform 100ms ease-out, opacity var(--zm-duration-fast) var(--zm-ease-out-expo);
}

.zm-cursor.is-visible {
	opacity: 1;
}

.zm-cursor__ring {
	position: absolute;
	top: 0;
	left: 0;
	width: 32px;
	height: 32px;
	transform: translate(-50%, -50%) scale(1);
	border: 1.5px solid var(--zm-gold-500);
	border-radius: 50%;
	mix-blend-mode: difference;
	transition: transform var(--zm-duration-fast) var(--zm-ease-out-expo);
}

.zm-cursor.is-active .zm-cursor__ring {
	transform: translate(-50%, -50%) scale(2.5);
}

.zm-cursor.is-active--subtle .zm-cursor__ring {
	transform: translate(-50%, -50%) scale(1.3);
}

html.zm-has-custom-cursor,
html.zm-has-custom-cursor a,
html.zm-has-custom-cursor button,
html.zm-has-custom-cursor input,
html.zm-has-custom-cursor textarea,
html.zm-has-custom-cursor select,
html.zm-has-custom-cursor [role="button"] {
	cursor: none;
}

@media (prefers-reduced-motion: reduce) {
	.zm-cursor {
		display: none;
	}
}

/* Scroll progress bar */
#zm-scroll-progress {
	position: fixed;
	top: 0;
	left: 0;
	width: 0%;
	height: 2px;
	background: var(--zm-gold-500);
	z-index: 9999;
	transition: width 0.1s linear;
	transform-origin: left;
}

@media (prefers-reduced-motion: reduce) {
	#zm-scroll-progress {
		width: 100%;
		transition: none;
	}
}

/* Back-to-top button with scroll progress ring */
.zm-back-to-top {
	position: fixed;
	right: 2rem;
	bottom: 2rem;
	z-index: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--zm-header-scrolled-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: var(--zm-gold-300);
	cursor: pointer;
	opacity: 0;
	transform: translateY(16px);
	pointer-events: none;
	transition: opacity var(--zm-duration-base) var(--zm-ease-out-expo), transform var(--zm-duration-base) var(--zm-ease-out-expo), color var(--duration-fast) var(--ease-out);
}

.zm-back-to-top.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.zm-back-to-top:hover { color: var(--zm-gold-500); }

.zm-back-to-top:focus-visible {
	outline: 2px solid var(--zm-gold-500);
	outline-offset: 3px;
}

.zm-back-to-top__ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.zm-back-to-top__ring-track,
.zm-back-to-top__ring-fill {
	fill: none;
	stroke-width: 2;
}

.zm-back-to-top__ring-track { stroke: rgba(255, 255, 255, 0.12); }

.zm-back-to-top__ring-fill {
	stroke: var(--zm-gold-500);
	stroke-linecap: round;
	stroke-dasharray: 131.95;
	stroke-dashoffset: 131.95;
	transition: stroke-dashoffset 0.1s linear;
}

.zm-back-to-top__arrow {
	width: 18px;
	height: 18px;
}

@media (prefers-reduced-motion: reduce) {
	.zm-back-to-top,
	.zm-back-to-top__ring-fill {
		transition: none;
	}
}
