/* =====================================================================
   Pulsar Media — main.css
   Modern dark "cosmic" base. CSS variables let the Customizer
   override accent colors at runtime.
   ===================================================================== */

/* ---------- Design Tokens ---------- */
:root {
	--pm-bg:           #050714;
	--pm-bg-soft:      #0a0e1f;
	--pm-bg-card:      #11152a;
	--pm-border:       rgba(255, 255, 255, 0.08);
	--pm-border-soft:  rgba(255, 255, 255, 0.05);
	--pm-text:         #f1f5f9;
	--pm-text-muted:   #94a3b8;
	--pm-text-dim:     #64748b;

	--pm-accent:       #8b5cf6;   /* violet */
	--pm-accent-2:     #22d3ee;   /* cyan */
	--pm-accent-glow:  rgba(139, 92, 246, 0.35);

	--pm-font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--pm-font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;

	--pm-radius:       14px;
	--pm-radius-lg:    22px;
	--pm-shadow:       0 20px 50px -20px rgba(0, 0, 0, 0.6);
	--pm-shadow-accent: 0 10px 40px -10px var(--pm-accent-glow);

	--pm-container:    1200px;
	--pm-container-narrow: 760px;
	--pm-gap:          clamp(1.25rem, 2vw, 2rem);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* Base page background — high-specificity selectors AND html-level rule so the
   dark theme wins over Elementor's frontend styles regardless of cascade order. */
html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	background-color: var(--pm-bg);
}

html body,
body.custom-background,
body.elementor-default,
body {
	background-color: var(--pm-bg);
	color: var(--pm-text);
}

body {
	margin: 0;
	font-family: var(--pm-font-body);
	font-size: 17px;
	line-height: 1.65;
	background-image:
		radial-gradient(1200px 600px at 10% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
		radial-gradient(900px 500px at 110% 10%, rgba(34, 211, 238, 0.10), transparent 60%);
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
	color: var(--pm-accent-2);
	text-decoration: none;
	transition: color 160ms ease, opacity 160ms ease;
}
a:hover, a:focus { color: var(--pm-accent); }

p { margin: 0 0 1em; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--pm-font-display);
	font-weight: 600;
	line-height: 1.15;
	color: var(--pm-text);
	margin: 0 0 0.6em;
	letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.25rem, 4vw + 1rem, 4.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 2.2vw + 1rem, 2.75rem); }
h3 { font-size: clamp(1.25rem, 1vw + 1rem, 1.6rem); }
h4 { font-size: 1.15rem; }

::selection { background: var(--pm-accent); color: #fff; }

/* ---------- Accessibility helpers ---------- */
.screen-reader-text {
	border: 0; clip: rect(1px,1px,1px,1px);
	-webkit-clip-path: inset(50%); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
	width: 1px; word-wrap: normal !important;
}
.skip-link {
	position: absolute; top: -3rem; left: 1rem;
	background: var(--pm-accent); color: #fff;
	padding: 0.6rem 1rem; border-radius: 6px;
	z-index: 9999; transition: top 200ms;
}
.skip-link:focus { top: 1rem; }

/* ---------- Layout ---------- */
.container {
	width: 100%;
	max-width: var(--pm-container);
	margin: 0 auto;
	padding: 0 clamp(1rem, 3vw, 2rem);
}
.container.narrow { max-width: var(--pm-container-narrow); }

.site-content { padding-block: clamp(2rem, 5vw, 4rem); }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(5, 7, 20, 0.75);
	backdrop-filter: saturate(140%) blur(14px);
	-webkit-backdrop-filter: saturate(140%) blur(14px);
	border-bottom: 1px solid var(--pm-border);
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
	padding-block: 1rem;
}

.site-branding { display: flex; align-items: center; gap: 0.75rem; }
.site-branding .custom-logo-link img { max-height: 44px; width: auto; }
.site-title-link { text-decoration: none; }
.site-title {
	font-family: var(--pm-font-display);
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--pm-text);
	letter-spacing: -0.01em;
}
.site-description {
	margin: 0;
	font-size: 0.85rem;
	color: var(--pm-text-muted);
}

.main-navigation { display: flex; align-items: center; }
.primary-menu {
	display: flex; align-items: center; gap: 0.25rem;
	list-style: none; margin: 0; padding: 0;
}
.primary-menu li { position: relative; }
.primary-menu a {
	display: inline-block;
	padding: 0.55rem 1rem;
	color: var(--pm-text);
	font-weight: 500;
	font-size: 0.95rem;
	border-radius: 999px;
	transition: background 160ms ease, color 160ms ease;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
}
.primary-menu .sub-menu {
	position: absolute; top: 100%; left: 0;
	min-width: 220px;
	background: var(--pm-bg-card);
	border: 1px solid var(--pm-border);
	border-radius: var(--pm-radius);
	padding: 0.5rem;
	list-style: none;
	box-shadow: var(--pm-shadow);
	opacity: 0; visibility: hidden;
	transform: translateY(6px);
	transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}
.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
	opacity: 1; visibility: visible; transform: translateY(0);
}

/* Mobile menu toggle */
.menu-toggle {
	display: none;
	background: transparent; border: 1px solid var(--pm-border);
	border-radius: 10px; padding: 0.55rem;
	cursor: pointer;
	width: 44px; height: 44px;
	flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}
.menu-toggle__bar {
	display: block; width: 20px; height: 2px;
	background: var(--pm-text); border-radius: 2px;
	transition: transform 180ms ease, opacity 180ms ease;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 880px) {
	.menu-toggle { display: inline-flex; }
	.main-navigation {
		position: absolute; left: 0; right: 0; top: 100%;
		background: var(--pm-bg-card);
		border-bottom: 1px solid var(--pm-border);
		padding: 1rem;
		display: none;
	}
	.main-navigation.is-open { display: block; }
	.primary-menu { flex-direction: column; align-items: stretch; gap: 0.25rem; }
	.primary-menu a { padding: 0.75rem 1rem; }
	.primary-menu .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		box-shadow: none; padding-left: 0.75rem; background: transparent; border: 0;
	}
}

/* ---------- Buttons ---------- */
.button, button.button, .wp-block-button__link, input[type="submit"], .button.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.85rem 1.4rem;
	font: inherit;
	font-weight: 600;
	font-family: var(--pm-font-display);
	letter-spacing: 0.01em;
	border-radius: 999px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
	text-decoration: none;
}
.button--primary, input[type="submit"] {
	background: linear-gradient(135deg, var(--pm-accent), var(--pm-accent-2));
	color: #0b0d1c;
	box-shadow: var(--pm-shadow-accent);
}
.button--primary:hover, input[type="submit"]:hover {
	transform: translateY(-1px);
	color: #0b0d1c;
	filter: brightness(1.05);
}
.button--ghost {
	background: transparent;
	color: var(--pm-text);
	border-color: var(--pm-border);
}
.button--ghost:hover {
	border-color: var(--pm-accent);
	color: var(--pm-accent-2);
}

/* ---------- Hero ---------- */
.hero {
	position: relative;
	overflow: hidden;
	padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 6rem);
}
.hero__inner { position: relative; z-index: 2; max-width: 900px; }
.hero__eyebrow {
	font-family: var(--pm-font-display);
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: 0.85rem;
	color: var(--pm-accent-2);
	margin-bottom: 1rem;
}
.hero__title {
	font-size: clamp(2.5rem, 5vw + 1rem, 5.5rem);
	background: linear-gradient(180deg, #ffffff 0%, #c7c9d6 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.hero__lede {
	font-size: clamp(1.05rem, 1vw + 0.7rem, 1.3rem);
	color: var(--pm-text-muted);
	max-width: 60ch;
	margin-bottom: 2rem;
}
.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero__glow {
	position: absolute; inset: -20%;
	background:
		radial-gradient(600px 320px at 20% 30%, var(--pm-accent-glow), transparent 60%),
		radial-gradient(500px 280px at 80% 60%, rgba(34, 211, 238, 0.18), transparent 60%);
	filter: blur(40px);
	z-index: 1;
	pointer-events: none;
}

/* ---------- Section header ---------- */
.section-header { margin-bottom: clamp(2rem, 4vw, 3rem); max-width: 720px; }
.section-eyebrow {
	font-family: var(--pm-font-display);
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: 0.8rem;
	color: var(--pm-accent-2);
	margin-bottom: 0.5rem;
}
.section-title { margin: 0; }

/* ---------- Services grid ---------- */
.services-preview, .page-body { padding-block: clamp(3rem, 6vw, 5rem); }

.service-grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.service-grid--detailed { margin-top: 2rem; }
.service-card {
	background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
	border: 1px solid var(--pm-border);
	border-radius: var(--pm-radius);
	padding: 1.75rem;
	position: relative;
	transition: border-color 200ms ease, transform 200ms ease;
}
.service-card::before {
	content: ''; position: absolute; inset: 0;
	border-radius: inherit;
	background: linear-gradient(135deg, var(--pm-accent), var(--pm-accent-2));
	opacity: 0; transition: opacity 200ms;
	z-index: -1;
}
.service-card:hover {
	transform: translateY(-3px);
	border-color: rgba(139, 92, 246, 0.4);
}
.service-card h3 { margin-bottom: 0.5rem; }
.service-card p { color: var(--pm-text-muted); margin: 0; }

/* ---------- CTA strip ---------- */
.cta-strip {
	padding-block: clamp(3rem, 6vw, 5rem);
	margin-block: clamp(2rem, 5vw, 4rem);
}
.cta-strip__inner {
	background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.10));
	border: 1px solid var(--pm-border);
	border-radius: var(--pm-radius-lg);
	padding: clamp(2rem, 4vw, 3.5rem);
	display: flex;
	gap: 1.5rem;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}
.cta-strip__inner h2 { margin: 0; max-width: 28ch; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
	position: relative;
	padding: clamp(3rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
	border-bottom: 1px solid var(--pm-border-soft);
}
.page-hero__title { margin: 0; }

/* ---------- Posts / cards ---------- */
.post-grid {
	display: grid;
	gap: clamp(1.25rem, 2vw, 2rem);
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.post-card {
	background: var(--pm-bg-card);
	border: 1px solid var(--pm-border);
	border-radius: var(--pm-radius);
	overflow: hidden;
	display: flex; flex-direction: column;
	transition: transform 200ms ease, border-color 200ms ease;
}
.post-card:hover {
	transform: translateY(-3px);
	border-color: rgba(139, 92, 246, 0.4);
}
.post-card__media img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.post-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.post-card .entry-title { margin: 0; font-size: 1.3rem; }
.post-card .entry-title a { color: var(--pm-text); }
.post-card .entry-title a:hover { color: var(--pm-accent-2); }
.post-card .entry-meta { font-size: 0.85rem; color: var(--pm-text-dim); }
.post-card .entry-summary { color: var(--pm-text-muted); font-size: 0.95rem; }
.post-card__link {
	margin-top: auto;
	font-weight: 600;
	color: var(--pm-accent-2);
}

/* ---------- Single article / page article ---------- */
.single-article, .page-article {
	max-width: var(--pm-container-narrow);
	margin: 0 auto;
}
.entry-thumbnail { margin-bottom: 1.5rem; border-radius: var(--pm-radius); overflow: hidden; }
.entry-content { font-size: 1.05rem; }
.entry-content > * + * { margin-top: 1em; }
.entry-content img { border-radius: var(--pm-radius); }
.entry-content blockquote {
	margin: 1.5em 0; padding: 1rem 1.25rem;
	border-left: 3px solid var(--pm-accent);
	background: rgba(139, 92, 246, 0.06);
	color: var(--pm-text);
	border-radius: 0 var(--pm-radius) var(--pm-radius) 0;
}
.entry-content code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 6px;
	font-size: 0.92em;
}
.entry-meta { color: var(--pm-text-dim); font-size: 0.9rem; }
.entry-meta a { color: var(--pm-text-muted); }

.post-navigation, .posts-navigation {
	margin-top: 3rem; padding-top: 2rem;
	border-top: 1px solid var(--pm-border-soft);
	display: grid; gap: 1rem; grid-template-columns: 1fr 1fr;
}
.nav-subtitle { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--pm-text-dim); }
.nav-title { color: var(--pm-text); font-weight: 600; }

/* ---------- Contact page ---------- */
.contact-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(1.5rem, 3vw, 3rem);
	margin-top: 2rem;
}
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 0.5rem; color: var(--pm-text-muted); }
.contact-info strong { display: inline-block; min-width: 4.5rem; color: var(--pm-text); }

.contact-form { display: grid; gap: 1rem; }
.contact-form label { display: grid; gap: 0.4rem; font-size: 0.85rem; color: var(--pm-text-muted); }
.contact-form input, .contact-form textarea, .search-form .search-field {
	background: var(--pm-bg-card);
	border: 1px solid var(--pm-border);
	color: var(--pm-text);
	padding: 0.85rem 1rem;
	border-radius: 10px;
	font: inherit;
	width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus, .search-form .search-field:focus {
	outline: none;
	border-color: var(--pm-accent);
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.contact-form__note { font-size: 0.8rem; color: var(--pm-text-dim); margin: 0.25rem 0 0; }
.contact-form__req { color: var(--pm-accent-2); margin-left: 0.15rem; }
.contact-form__notice {
	padding: 0.9rem 1.1rem;
	border-radius: 10px;
	font-size: 0.95rem;
	border: 1px solid transparent;
}
.contact-form__notice--success {
	background: rgba(34, 211, 238, 0.10);
	border-color: rgba(34, 211, 238, 0.35);
	color: var(--pm-text);
}
.contact-form__notice--error {
	background: rgba(239, 68, 68, 0.10);
	border-color: rgba(239, 68, 68, 0.35);
	color: #fecaca;
}

/* Radio group (Preferred Method of Contact) */
.contact-form__radio-group {
	border: 0;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 0.5rem;
}
.contact-form__radio-group legend {
	font-size: 0.85rem;
	color: var(--pm-text-muted);
	margin-bottom: 0.4rem;
	padding: 0;
}
.contact-form__radios {
	display: grid;
	gap: 0.5rem;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.contact-form__radio {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.7rem 0.9rem;
	background: var(--pm-bg-card);
	border: 1px solid var(--pm-border);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 160ms ease, background 160ms ease;
	color: var(--pm-text);
	font-size: 0.95rem;
}
.contact-form__radio:hover {
	border-color: rgba(139, 92, 246, 0.4);
}
.contact-form__radio input[type="radio"] {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--pm-accent);
	flex-shrink: 0;
}
.contact-form__radio:has(input[type="radio"]:checked) {
	border-color: var(--pm-accent);
	background: rgba(139, 92, 246, 0.10);
}

/* Description character counter */
.contact-form__field--description { position: relative; }
.contact-form__counter {
	display: block;
	font-size: 0.8rem;
	color: var(--pm-text-dim);
	margin-top: 0.4rem;
	text-align: right;
}
.contact-form__counter-used { font-variant-numeric: tabular-nums; color: var(--pm-text-muted); }

/* CAPTCHA */
.contact-form__field--captcha strong {
	font-family: var(--pm-font-display);
	font-size: 1.05em;
	color: var(--pm-accent-2);
	font-weight: 600;
}

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 0.5rem; max-width: 480px; }
.search-form .search-submit { padding: 0.85rem 1.2rem; }

/* ---------- Pagination ---------- */
.pagination, .navigation.pagination, .nav-links {
	display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center;
	margin-top: 3rem;
}
.pagination .page-numbers, .nav-links .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 0.75rem;
	border-radius: 10px;
	border: 1px solid var(--pm-border);
	color: var(--pm-text);
	background: transparent;
}
.pagination .page-numbers.current, .nav-links .page-numbers.current {
	background: var(--pm-accent); color: #fff; border-color: transparent;
}

/* ---------- 404 ---------- */
.error-404-wrap { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.error-404 .page-title { font-size: clamp(2rem, 4vw + 1rem, 4rem); }
.error-404-search { margin-top: 2rem; display: flex; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
	margin-top: clamp(3rem, 6vw, 5rem);
	border-top: 1px solid var(--pm-border);
	background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4));
	padding-block: clamp(2rem, 4vw, 3rem);
}
.site-footer .widget-title { color: #fff; font-size: 1rem; }

.footer-widgets {
	display: grid; gap: 2rem;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	margin-bottom: 2rem;
}
.footer-widgets a { color: var(--pm-text-muted); }
.footer-widgets a:hover { color: var(--pm-accent-2); }

.site-footer__bottom {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1.5rem; flex-wrap: wrap;
	padding-top: 2rem;
	border-top: 1px solid var(--pm-border-soft);
}
.site-footer__title { font-family: var(--pm-font-display); font-weight: 700; color: #fff; }
.site-footer__copy { margin: 0; color: var(--pm-text-dim); font-size: 0.9rem; }
.footer-menu { list-style: none; display: flex; gap: 1.25rem; padding: 0; margin: 0; }
.footer-menu a { color: var(--pm-text-muted); font-size: 0.9rem; }

/* ---------- Widgets ---------- */
.widget { margin-bottom: 2rem; }
.widget ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.widget ul a { color: var(--pm-text-muted); }

/* ---------- Elementor compat ---------- */
/* Ensure Elementor full-width / canvas templates don't get squeezed by container. */
.elementor-section { position: relative; }
body.elementor-page #content { padding-block: 0; }

/* WordPress core block colors honoring the theme palette */
.wp-block-button__link {
	background: linear-gradient(135deg, var(--pm-accent), var(--pm-accent-2));
	color: #0b0d1c;
}

/* ---------- Print ---------- */
@media print {
	body { background: #fff; color: #000; }
	.site-header, .site-footer, .menu-toggle { display: none; }
}
