/*
Theme Name: Optimal Nexus
Theme URI: https://optimalnexus.com
Author: Optimal Nexus
Version: 1.0.0
Description: Custom theme for Optimal Nexus. Uses ONX plugin shortcodes.
*/

/* ========================================
   ONX Product Pages
   ======================================== */

/* Product Page Container */
.onx-product-page {
	background: #0B0B0B;
	color: #EDEDED;
	min-height: 100vh;
}

/* Product Container (max-width wrapper) */
.onx-product-container {
	max-width: 900px;
	margin: 0 auto;
	padding: 0 24px;
}

/* Product Header */
.onx-product-header {
	padding: 80px 0 40px;
	text-align: center;
	border-bottom: 1px solid rgba(237, 237, 237, 0.08);
}

.onx-product-title {
	font-size: clamp(32px, 5vw, 48px);
	line-height: 1.2;
	margin: 0 0 24px;
	color: #EDEDED;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.onx-product-value {
	font-size: clamp(18px, 2.5vw, 24px);
	line-height: 1.5;
	color: #BDBDBD;
	margin: 0;
	max-width: 700px;
	margin: 0 auto;
}

/* Product Sections */
.onx-product-section {
	padding: 60px 0;
	border-bottom: 1px solid rgba(237, 237, 237, 0.06);
}

.onx-section-label {
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #E50000;
	margin: 0 0 16px;
}

.onx-section-content {
	font-size: clamp(16px, 2vw, 18px);
	line-height: 1.7;
	color: #BDBDBD;
	margin: 0;
}

/* System Link */
.onx-system-link {
	font-size: 16px;
	color: #757575;
	font-style: italic;
	margin: 0;
	text-align: center;
}

/* Media Placeholder */
.onx-media-section {
	padding: 80px 0;
}

.onx-media-placeholder {
	position: relative;
	background: rgba(237, 237, 237, 0.03);
	border: 1px solid rgba(237, 237, 237, 0.08);
	border-radius: 16px;
	padding: 80px 40px;
	text-align: center;
	overflow: hidden;
}

.onx-media-placeholder-content {
	position: relative;
	z-index: 2;
}

.onx-media-icon {
	color: #E50000;
	opacity: 0.3;
	margin: 0 auto 24px;
	display: block;
}

.onx-media-heading {
	font-size: clamp(20px, 3vw, 28px);
	margin: 0 0 12px;
	color: #EDEDED;
	font-weight: 600;
}

.onx-media-note {
	font-size: 16px;
	color: #757575;
	margin: 0;
}

/* Animated Pulse Divider */
.onx-media-pulse {
	position: absolute;
	bottom: 0;
	left: 20%;
	width: 60%;
	height: 2px;
	background: linear-gradient(90deg,
		transparent 0%,
		rgba(229, 0, 0, 0.3) 25%,
		rgba(229, 0, 0, 0.8) 50%,
		rgba(229, 0, 0, 0.3) 75%,
		transparent 100%
	);
	transform-origin: center;
}

@media (prefers-reduced-motion: no-preference) {
	.onx-media-pulse {
		animation: onx-pulse-glow 3s ease-in-out infinite;
	}

	@keyframes onx-pulse-glow {
		0%, 100% {
			opacity: 0.3;
			transform: scaleX(1);
		}
		50% {
			opacity: 1;
			transform: scaleX(1.05);
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.onx-media-pulse {
		opacity: 0.5;
	}
}

/* Compliance Footer */
.onx-product-compliance {
	padding: 40px 0 80px;
	text-align: center;
	border-bottom: none;
}

.onx-compliance-text {
	font-size: 14px;
	color: #757575;
	margin: 0;
}

.onx-compliance-link {
	color: #E50000;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.onx-compliance-link:hover {
	opacity: 0.8;
}

/* MEDDIC Section */
.onx-meddic-section {
	padding: 80px 0;
	border-top: 1px solid rgba(237, 237, 237, 0.08);
	background: rgba(229, 0, 0, 0.02);
}

.onx-meddic-heading {
	font-size: clamp(28px, 4vw, 36px);
	line-height: 1.2;
	margin: 0 0 16px;
	color: #EDEDED;
	font-weight: 700;
}

.onx-meddic-intro {
	font-size: 16px;
	line-height: 1.7;
	color: #BDBDBD;
	margin: 0 0 40px;
}

.onx-meddic-table {
	width: 100%;
	border-collapse: collapse;
	margin: 40px 0;
	background: rgba(11, 11, 11, 0.6);
	border-radius: 8px;
	overflow: hidden;
}

.onx-meddic-table th,
.onx-meddic-table td {
	padding: 16px 20px;
	text-align: left;
	border-bottom: 1px solid rgba(237, 237, 237, 0.08);
}

.onx-meddic-table th {
	background: rgba(229, 0, 0, 0.08);
	font-weight: 600;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #E50000;
}

.onx-meddic-table td {
	font-size: 15px;
	color: #BDBDBD;
}

.onx-meddic-table tbody tr:last-child td {
	border-bottom: none;
}

.onx-meddic-score {
	font-weight: 600;
	color: #EDEDED;
	text-align: center;
}

.onx-meddic-cta {
	margin: 40px 0 0;
}

.onx-meddic-note {
	font-size: 14px;
	color: #757575;
	font-style: italic;
	margin: 24px 0 0;
}

/* Button Overrides for Product Pages */
.onx-product-page .button-primary,
.onx-product-page .onx-btn--primary {
	background: #E50000;
	color: #EDEDED;
	border: none;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 8px;
	text-decoration: none;
	display: inline-block;
	transition: background-color 0.25s ease, transform 0.08s ease;
}

.onx-product-page .button-primary:hover,
.onx-product-page .onx-btn--primary:hover {
	background: #0B0B0B;
	text-decoration: none;
}

.onx-product-page .button-primary:active,
.onx-product-page .onx-btn--primary:active {
	transform: translateY(1px);
}

.onx-product-page .button-secondary,
.onx-product-page .onx-btn--secondary {
	background: #0B0B0B;
	color: #EDEDED;
	border: 1px solid rgba(237, 237, 237, 0.12);
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 8px;
	text-decoration: none;
	display: inline-block;
	transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.08s ease;
}

.onx-product-page .button-secondary:hover,
.onx-product-page .onx-btn--secondary:hover {
	background: #E50000;
	border-color: #E50000;
	text-decoration: none;
}

.onx-product-page .button-secondary:active,
.onx-product-page .onx-btn--secondary:active {
	transform: translateY(1px);
}

/* Responsive */
@media (max-width: 768px) {
	.onx-product-header {
		padding: 60px 0 32px;
	}

	.onx-product-section {
		padding: 40px 0;
	}

	.onx-media-section {
		padding: 60px 0;
	}

	.onx-media-placeholder {
		padding: 60px 24px;
	}

	.onx-meddic-section {
		padding: 60px 0;
	}

	.onx-meddic-table th,
	.onx-meddic-table td {
		padding: 12px 16px;
		font-size: 14px;
	}
}

/* ========================================
   Navigation Styling Cleanup
   ======================================== */

/* Remove ugly red focus box on navigation links */
.main-navigation a:focus,
.main-navigation a:active,
.primary-navigation a:focus,
.primary-navigation a:active,
nav a:focus,
nav a:active {
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
}

/* Smooth transitions for navigation */
.main-navigation a,
.primary-navigation a,
nav a {
	transition: color 0.3s ease, background-color 0.3s ease;
}

/* Hover state - smooth red color fade */
.main-navigation a:hover,
.primary-navigation a:hover,
nav a:hover {
	color: #E50000 !important;
}

/* Current/active menu item styling */
.current-menu-item > a,
.current_page_item > a,
.current-menu-ancestor > a,
.current_page_ancestor > a {
	color: #E50000 !important;
	background: none !important;
}

/* Focus-within for keyboard navigation */
.main-navigation li:focus-within > a,
.primary-navigation li:focus-within > a {
	color: #E50000 !important;
	background: none !important;
}

/* Dropdown submenu styles */
.main-navigation ul.sub-menu {
	background: #000;
	border: 1px solid rgba(255, 255, 255, 0.08);
	padding: 6px 0;
	border-radius: 10px;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: all 0.25s ease;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	z-index: 1000;
}

.main-navigation li.menu-item-has-children:hover > ul.sub-menu,
.main-navigation li.menu-item-has-children:focus-within > ul.sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.main-navigation ul.sub-menu li {
	display: block;
}

.main-navigation ul.sub-menu li a {
	color: #fff;
	padding: 10px 18px;
	display: block;
	transition: color 0.25s ease, background 0.25s ease;
}

.main-navigation ul.sub-menu li a:hover {
	background: rgba(229, 0, 0, 0.10);
	color: #E50000 !important;
}

/* ========================================
   Global Scroll Reveal + Pulse Sync
   ======================================== */

/* CSS Variables for pulse strength control */
:root {
	--onx-red: #E50000;
	--onx-red-mid: #ff2a2a;
	--onx-pulse-strength: 1;
	--onx-pulse-opacity: 0.32; /* Increased from 0.25 for better visibility */
}

/* Global reveal utility: add .onx-reveal to any block/section */
.onx-reveal {
	opacity: 0;
	transform: translateY(40px);
	transition: opacity 1.1s ease-out, transform 1.1s ease-out;
	position: relative;
}

.onx-reveal.onx-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Red pulse glow when revealed - more visible */
.onx-reveal.onx-visible::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	background: radial-gradient(circle at 50% 50%,
		rgba(229, 0, 0, calc(var(--onx-pulse-opacity) * var(--onx-pulse-strength))) 0%,
		rgba(229, 0, 0, 0) 70%);
	filter: blur(18px);
	animation: onx-pulse 2.2s ease-out forwards;
	z-index: -1;
}

@keyframes onx-pulse {
	0% {
		opacity: 0;
		transform: scale(0.85);
	}
	40% {
		opacity: 1;
		transform: scale(1.05);
	}
	100% {
		opacity: 0;
		transform: scale(1.18);
	}
}

/* Boost class for even more pop on hero sections */
.onx-pulse-strong {
	--onx-pulse-strength: 1.25;
	--onx-pulse-opacity: 0.38;
}

/* Backward compatibility: keep .onx-section working */
.onx-section {
	opacity: 0;
	transform: translateY(40px);
	transition: opacity 1.1s ease-out, transform 1.1s ease-out;
	position: relative;
}

.onx-section.visible,
.onx-section.onx-visible {
	opacity: 1;
	transform: translateY(0);
}

.onx-section.visible::before,
.onx-section.onx-visible::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	background: radial-gradient(circle at 50% 50%,
		rgba(229, 0, 0, calc(var(--onx-pulse-opacity) * var(--onx-pulse-strength))) 0%,
		rgba(229, 0, 0, 0) 70%);
	filter: blur(18px);
	animation: onx-pulse 2.2s ease-out forwards;
	z-index: -1;
}

/* Pulse restart class - triggers animation every time section enters viewport */
.onx-pulse-restart::before {
	animation: onx-pulse 2.2s ease-out forwards;
}

/* Accessibility: disable for reduced motion */
@media (prefers-reduced-motion: reduce) {
	.onx-reveal,
	.onx-reveal::before,
	.onx-section,
	.onx-section::before,
	.onx-pulse-restart::before {
		transition: none !important;
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}

/* ========================================
   Global Button System
   ======================================== */

/* Base button styles */
.onx-btn,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: auto;
	min-width: 44px; /* Accessibility minimum touch target */
	padding: 12px 18px;
	border-radius: 12px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, transform 0.06s ease;
	border: 1px solid transparent;
	cursor: pointer;
}

/* Primary button (red fill) */
.onx-btn--primary,
.wp-block-button.is-style-fill .wp-block-button__link {
	background: var(--onx-red, #E50000);
	color: #fff !important;
	border-color: var(--onx-red, #E50000);
}

.onx-btn--primary:hover,
.onx-btn--primary:focus,
.wp-block-button.is-style-fill .wp-block-button__link:hover,
.wp-block-button.is-style-fill .wp-block-button__link:focus {
	background: #ff1e1e;
	border-color: #ff1e1e;
	color: #fff;
}

/* Secondary button (black) */
.onx-btn--secondary,
.wp-block-button.is-style-outline .wp-block-button__link {
	background: #0b0b0b;
	color: #fff !important;
	border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Keep it black on all interactive states */
.onx-btn--secondary:hover,
.onx-btn--secondary:focus,
.onx-btn--secondary:active,
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus,
.wp-block-button.is-style-outline .wp-block-button__link:active {
	background: #0b0b0b !important;
	color: #fff !important;
	border-color: rgba(255, 255, 255, 0.28) !important;
	box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.06) inset;
}

/* Focus state (accessible but elegant) - only for primary buttons */
.onx-btn:not(.onx-btn--secondary):focus,
.wp-block-button__link:not(.onx-btn--secondary):focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(229, 0, 0, 0.3);
}

/* Secondary button focus uses its own inset shadow (defined above) */

/* Active state - micro-press feedback */
.onx-btn:active,
.wp-block-button__link:active {
	transform: scale(0.985);
}

/* CTA row container (for side-by-side buttons) */
.onx-cta-row {
	display: flex;
	gap: 16px;
	align-items: center;
	flex-wrap: wrap;
}

/* ========================================
   Insights Page
   ======================================== */

.onx-insights {
	max-width: 1100px;
	margin: 0 auto;
	padding: 96px 20px 120px;
}

.onx-insights__hero {
	text-align: center;
	margin-bottom: 36px;
}

.onx-insights__hero h1 {
	font-size: clamp(36px, 6vw, 48px);
	line-height: 1.1;
	margin: 0 0 12px;
	color: #fff;
}

.onx-insights__hero p {
	opacity: 0.85;
	max-width: 820px;
	margin: 0 auto;
	font-size: clamp(16px, 2vw, 18px);
	line-height: 1.6;
	color: #BDBDBD;
}

/* Pulse divider (brand EKG) */
.onx-divider-ekg {
	position: relative;
	height: 32px;
	margin: 28px auto 48px;
	max-width: 620px;
}

.onx-divider-ekg::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 3px;
	transform: translateY(-50%);
	background: linear-gradient(90deg,
		rgba(229, 0, 0, 0) 0%,
		rgba(229, 0, 0, 0.35) 10%,
		rgba(229, 0, 0, 0.55) 50%,
		rgba(229, 0, 0, 0.35) 90%,
		rgba(229, 0, 0, 0) 100%);
	border-radius: 9999px;
	filter: drop-shadow(0 0 6px rgba(229, 0, 0, 0.45));
}

.onx-divider-ekg::after {
	content: "";
	position: absolute;
	top: 50%;
	left: -10%;
	transform: translateY(-50%);
	width: 10px;
	height: 6px;
	border-radius: 9999px;
	background: linear-gradient(180deg, #ff2a2a, #b00000);
	box-shadow: 0 0 40px rgba(229, 0, 0, 0.85), 0 0 120px rgba(229, 0, 0, 0.45);
	animation: onx-divider-move 4.2s linear infinite, onx-divider-beat 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}

@keyframes onx-divider-move {
	0% { left: -10%; }
	100% { left: 110%; }
}

@keyframes onx-divider-beat {
	0% { height: 6px; }
	12% { height: 60px; }
	16% { height: 86px; }
	22% { height: 12px; }
	28% { height: 32px; }
	36% { height: 8px; }
	100% { height: 6px; }
}

/* Cards */
.onx-insights__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-top: 8px;
}

.onx-card {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 16px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.onx-card h2 {
	margin: 0;
	font-size: clamp(20px, 3vw, 22px);
	color: #fff;
	font-weight: 600;
}

.onx-card p {
	opacity: 0.85;
	margin: 0;
	color: #BDBDBD;
	line-height: 1.6;
}

.onx-card .onx-btn {
	align-self: flex-start;
	margin-top: auto;
}

/* Clickable card styling */
.onx-card-link {
	position: relative;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.onx-card-link:hover {
	border-color: rgba(255, 255, 255, 0.12);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Ensure content stays above decorations */
.onx-card * {
	position: relative;
	z-index: 1;
}

/* Card CTA wrapper */
.onx-card-cta {
	margin-top: 14px;
}

/* CTA band */
.onx-insights__cta {
	margin-top: 60px;
	text-align: center;
	padding: 28px 20px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 16px;
}

.onx-insights__cta h3 {
	margin: 0 0 12px;
	font-size: clamp(22px, 3vw, 28px);
	color: #fff;
	font-weight: 600;
}

.onx-insights__cta .onx-cta-row {
	justify-content: center;
	margin-top: 12px;
}

/* ==========================================================================
   Calendly Widget Wrapper
   ========================================================================== */

.onx-calendly-wrap {
	background: #0b0b0b;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

/* Mobile responsive */
@media (max-width: 900px) {
	.onx-insights__grid {
		grid-template-columns: 1fr;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.onx-divider-ekg::after {
		animation: none !important;
	}
}
