/**
 * Astronomical Theme — Custom styles
 * Covers visual elements that theme.json can't express:
 * starfield canvas, hero glow, product card hover states, status badges.
 */

/* Starfield canvas — fixed to the viewport so stars cover the whole page */
#astronomical-starfield {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 0;
	pointer-events: none;
}

/* Hero glow — positioned over the upper hero area */
.astronomical-hero-glow {
	position: absolute;
	top: -200px;
	left: 50%;
	transform: translateX(-50%);
	width: 800px;
	height: 600px;
	background: radial-gradient(ellipse, rgba(110, 86, 248, 0.15) 0%, transparent 70%);
	pointer-events: none;
	z-index: 1;
}

.astronomical-starfield-wrap {
	position: relative;
}

/* Page content sits above the starfield (z-index:0) and glow (z-index:1) */
.wp-site-blocks {
	position: relative;
	z-index: 2;
}

/* Site logo — SVG has no intrinsic dimensions, so set them explicitly */
.wp-block-site-logo img.custom-logo,
img.custom-logo {
	width: 32px;
	height: 32px;
	max-width: none;
}

/* Tighten gap between logo and site title to match the static nav */
.wp-block-site-logo + .wp-block-site-title,
.wp-block-site-logo + p.wp-block-site-title {
	margin-left: 4px;
}

/* Playbook visual — mini PDF mockup card on the BUA page */
.astronomical-playbook-visual {
	aspect-ratio: 8.5 / 11;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	padding: 28px 24px;
	position: relative;
	overflow: hidden;
	max-width: 260px;
	margin: 0 auto;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
}

.astronomical-playbook-visual::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #2563eb, #6e56f8);
}

.astronomical-playbook-visual-label {
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	font-size: 9px;
	color: #2563eb;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 12px;
}

.astronomical-playbook-visual-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--wp--preset--color--white);
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin-bottom: 12px;
}

.astronomical-playbook-visual-lines {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: auto;
}

.astronomical-playbook-visual-lines span {
	height: 3px;
	background: var(--wp--preset--color--border);
	border-radius: 2px;
}

.astronomical-playbook-visual-lines span:nth-child(1) { width: 100%; }
.astronomical-playbook-visual-lines span:nth-child(2) { width: 88%; }
.astronomical-playbook-visual-lines span:nth-child(3) { width: 94%; }
.astronomical-playbook-visual-lines span:nth-child(4) { width: 72%; }

/* Hero badge dot — pulsing accent indicator */
.astronomical-badge-dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	box-shadow: 0 0 8px var(--wp--preset--color--accent);
}

/* Product grid — 2x2 CSS grid so every card stretches to the tallest.
   The status badge is pinned to the bottom of each card so they line up. */
.astronomical-product-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

@media (max-width: 768px) {
	.astronomical-product-grid {
		grid-template-columns: 1fr;
	}
}

.astronomical-product-card {
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	/* WordPress sets --wp--style--block-gap: 24px !important on :root,
	   so we need !important to override it inside cards. */
	--wp--style--block-gap: 0 !important;
}

/* Override the is-layout-flow margin-block-start so children sit at
   their authored bottom margins instead of inheriting block-gap. */
.astronomical-product-card > *,
.astronomical-product-card.is-layout-flow > *,
.astronomical-product-card.wp-block-group-is-layout-flow > * {
	margin-block-start: 0 !important;
}

.astronomical-product-card .astronomical-product-status {
	margin-top: auto !important;
	padding-top: 20px;
}

/* Stretched link — covers the whole card so it's clickable */
.astronomical-card-stretched-link {
	position: absolute;
	inset: 0;
	z-index: 10;
	text-indent: -9999px;
	overflow: hidden;
}

/* Outlined button — overrides theme.json's default white-on-accent button.
   Theme.json's wp-element-button rule wins over color utility classes via
   :where() specificity quirks, so we target the wrapper class explicitly. */
.wp-block-button.astronomical-btn-outline > .wp-block-button__link,
.wp-block-button.astronomical-btn-outline > .wp-block-button__link:hover {
	background-color: transparent !important;
	color: #e8e8ef !important;
	border-color: #2a2a3a !important;
}

.wp-block-button.astronomical-btn-outline > .wp-block-button__link:hover {
	border-color: #3a3a4c !important;
	background-color: rgba(255, 255, 255, 0.04) !important;
}

.astronomical-product-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	border-radius: 16px 16px 0 0;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.astronomical-product-card:hover {
	border-color: #2a2a3a !important;
	background: var(--wp--preset--color--surface-hover) !important;
	transform: translateY(-2px);
}

.astronomical-product-card:hover::before {
	opacity: 1;
}

.astronomical-product-blocks::before { background: var(--wp--preset--color--accent); }
.astronomical-product-analytics::before { background: #2563eb; }
.astronomical-product-scheduler::before { background: #f59e0b; }
.astronomical-product-audit::before { background: #10b981; }

/* Product icon badge */
.astronomical-product-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
	font-size: 20px;
}

/* Product status indicators */
.astronomical-product-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 20px;
	font-size: 12px;
	font-weight: 500;
	color: var(--wp--preset--color--text-muted);
}

.astronomical-status-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
}

.astronomical-status-dot.astronomical-status-live {
	background: #22c55e;
	box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.astronomical-status-dot.astronomical-status-dev {
	background: #f59e0b;
	box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.astronomical-status-dot.astronomical-status-soon {
	background: var(--wp--preset--color--text-muted);
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.astronomical-hero-glow {
		width: 400px;
		height: 300px;
	}
}

/* Fade-in animation for front page elements */
@keyframes astronomicalFadeUp {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}

.astronomical-starfield-wrap .astronomical-badge {
	animation: astronomicalFadeUp 0.6s ease forwards;
}

.astronomical-starfield-wrap h1 {
	animation: astronomicalFadeUp 0.6s ease 0.1s forwards;
	opacity: 0;
}

.astronomical-starfield-wrap .has-large-font-size {
	animation: astronomicalFadeUp 0.6s ease 0.2s forwards;
	opacity: 0;
}

/* Smooth scrolling site-wide */
html {
	scroll-behavior: smooth;
}

/* Webkit font smoothing for dark backgrounds */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
