/* ==========================================================================
   Popsiqal — rules theme.json can't express.
   Brand rules applied: 80% calm / 20% flavor · flat UI · Space Mono used sparingly.
   ========================================================================== */

:root {
	--pq-radius-card: var(--wp--custom--radius--card, 20px);
	--pq-ease: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* ---------- Links: ink text, coral underline ---------- */
:where(.wp-site-blocks) a:where(:not(.wp-element-button):not(.wp-block-navigation-item__content):not(.pq-plain)) {
	text-decoration-color: var(--wp--preset--color--coral);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
	transition: text-decoration-thickness .15s var(--pq-ease);
}
:where(.wp-site-blocks) a:where(:not(.wp-element-button)):hover {
	text-decoration-thickness: 3px;
}
.has-ink-background-color a:where(:not(.wp-element-button)) {
	text-decoration-color: var(--wp--preset--color--sun-pop);
}

/* ---------- Focus: visible, brand blue, never removed ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--electric-blue);
	outline-offset: 3px;
	border-radius: 4px;
}

/* ---------- Buttons ---------- */
.wp-element-button, .wp-block-button__link {
	transition: background-color .18s var(--pq-ease), color .18s var(--pq-ease), border-color .18s var(--pq-ease), transform .18s var(--pq-ease);
}
.wp-element-button:active, .wp-block-button__link:active { transform: translateY(1px); }
/* Coral on ink: invert hover so it stays visible */
.has-ink-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--cream);
	border-color: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--ink);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
}
.has-ink-background-color .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--cream);
	border-color: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--ink);
}

/* ---------- Eyebrow / mono labels (Space Mono = the technical counterpoint) ---------- */
.is-style-eyebrow,
.wp-block-heading.is-style-mono-label {
	font-family: var(--wp--preset--font-family--space-mono) !important;
	font-size: var(--wp--preset--font-size--xs) !important;
	font-weight: 700 !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase;
	line-height: 1.4 !important;
}
.is-style-eyebrow { color: var(--wp--preset--color--ink-soft); }
.has-ink-background-color .is-style-eyebrow { color: var(--wp--preset--color--sun-pop); }
.has-lavender-background-color .is-style-eyebrow { color: var(--wp--preset--color--ink); }

/* Mono inline token, e.g. <code> or .pq-mono */
.pq-mono, :where(p, li) code {
	font-family: var(--wp--preset--font-family--space-mono);
	font-size: 0.875em;
}

/* ---------- Cards: modular, flat, generous ---------- */
.is-style-card {
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--pq-radius-card);
	padding: var(--wp--preset--spacing--40);
}
.is-style-card[class*="-background-color"]:not(.has-white-background-color) { border-color: transparent; }
.is-style-card-flat {
	border-radius: var(--pq-radius-card);
	padding: var(--wp--preset--spacing--40);
}
.has-ink-background-color .is-style-card:not([class*="-background-color"]) {
	background-color: #1C1C20;
	border-color: #2A2A30;
	color: var(--wp--preset--color--cream);
}

/* Section groups with backgrounds get rounded corners when not full-width */
.wp-block-group.alignwide[class*="-background-color"]:not(.is-style-card) { border-radius: 28px; }

/* ---------- Lists ---------- */
.is-style-arrow, .is-style-check { list-style: none; padding-left: 0; }
.is-style-arrow li, .is-style-check li { position: relative; padding-left: 1.75em; margin-bottom: 0.5em; }
.is-style-arrow li::before {
	content: "→";
	position: absolute; left: 0; top: 0;
	font-family: var(--wp--preset--font-family--space-mono);
	color: var(--wp--preset--color--coral);
	font-weight: 700;
}
.is-style-check li::before {
	content: "✓";
	position: absolute; left: 0; top: 0;
	font-weight: 800;
	color: var(--wp--preset--color--coral);
}
.has-ink-background-color .is-style-arrow li::before,
.has-ink-background-color .is-style-check li::before { color: var(--wp--preset--color--sun-pop); }

/* ---------- Separator: flavor stripe (thin — color is an accent, not wallpaper) ---------- */
.wp-block-separator.is-style-flavor {
	border: 0 !important;
	height: 4px !important;
	max-width: 96px;
	background: var(--wp--preset--gradient--flavor) !important;
	border-radius: 999px;
	opacity: 1;
	margin-left: 0;
}
.wp-block-separator.is-style-flavor.has-text-align-center,
.has-text-align-center > .wp-block-separator.is-style-flavor { margin-left: auto; margin-right: auto; }

/* ---------- Popsicle image: no frame, the treat carries the dimension ---------- */
.wp-block-image.is-style-popsicle img { border-radius: 0 !important; background: transparent; }
.pq-hero-visual img { width: 100%; height: auto; max-width: 520px; margin-inline: auto; display: block; }

/* ---------- Header ---------- */
.pq-header {
	position: sticky; top: 0; z-index: 50;
	/* Solid, not blurred: backdrop-filter would trap the fixed mobile menu overlay inside the header. */
	background-color: var(--wp--preset--color--cream);
	border-bottom: 1px solid transparent;
}
.admin-bar .pq-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .pq-header { top: 0; } }
.pq-header .pq-logo img { display: block; width: 168px; height: auto; border-radius: 0; }
.pq-header .pq-logo { margin: 0; }
.pq-header .wp-block-navigation__container { gap: clamp(1rem, 2vw, 2rem); }
.pq-header .wp-block-navigation-item__content { text-decoration: none; padding-block: .25rem; background-image: linear-gradient(var(--wp--preset--color--coral), var(--wp--preset--color--coral)); background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .2s var(--pq-ease); }
.pq-header .wp-block-navigation-item__content:hover,
.pq-header .current-menu-item > .wp-block-navigation-item__content { background-size: 100% 2px; }
.pq-header .wp-block-button__link { padding: .7rem 1.25rem; font-size: .8125rem; }

@media (max-width: 599px) {
	.pq-header .pq-header-cta { display: none; }
	.pq-header .pq-logo img { width: 136px; }
}

/* Mobile overlay menu: ink field, big type */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--ink) !important;
	color: var(--wp--preset--color--cream) !important;
	padding: 1.5rem !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 1.25rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; text-transform: none;
	background-image: none;
}
.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg { width: 28px; height: 28px; }

/* ---------- Footer ---------- */
.pq-footer .pq-footer-logo img { width: 160px; height: auto; border-radius: 0; }
.pq-footer a { color: inherit; }
.pq-footer .pq-footer-links a { text-decoration: none; opacity: .86; }
.pq-footer .pq-footer-links a:hover { opacity: 1; text-decoration: underline; text-decoration-color: var(--wp--preset--color--sun-pop); }
.pq-footer .pq-footer-links ul { list-style: none; padding: 0; margin: 0; }
.pq-footer .pq-footer-links li { margin-bottom: .55rem; }

/* ---------- IQ equation operators ---------- */
.pq-operator {
	font-family: var(--wp--preset--font-family--space-mono);
	font-weight: 700;
	font-size: 2rem;
	line-height: 1;
	color: var(--wp--preset--color--coral);
	align-self: center;
}
@media (max-width: 781px) { .pq-operator { text-align: center; margin-block: -.5rem !important; } }

/* ---------- Big numbers (case-study proof) ---------- */
.pq-stat {
	font-size: var(--wp--preset--font-size--mega) !important;
	font-weight: 800;
	line-height: .95;
	letter-spacing: -0.045em;
}

/* ---------- Process steps ---------- */
.pq-step-num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 2.75rem; height: 2.75rem; border-radius: 999px;
	background: var(--wp--preset--color--ink); color: var(--wp--preset--color--cream);
	font-family: var(--wp--preset--font-family--space-mono); font-weight: 700; font-size: .875rem;
}

/* ---------- Post cards (blog / archive) ---------- */
.pq-post-card { height: 100%; display: flex; flex-direction: column; transition: transform .2s var(--pq-ease), border-color .2s var(--pq-ease); }
.pq-post-card:hover { transform: translateY(-3px); border-color: var(--wp--preset--color--ink); }
.pq-post-card .wp-block-post-featured-image { margin: calc(-1 * var(--wp--preset--spacing--40)) calc(-1 * var(--wp--preset--spacing--40)) 0; }
.pq-post-card .wp-block-post-featured-image img { border-radius: var(--pq-radius-card) var(--pq-radius-card) 0 0; aspect-ratio: 16/10; object-fit: cover; }
.wp-block-post-template.is-layout-grid > li { display: flex; }
.wp-block-post-template.is-layout-grid > li > * { flex: 1; }

/* Prose rhythm in single posts / pages */
.pq-prose > * + h2 { margin-top: var(--wp--preset--spacing--50); }
.pq-prose > * + h3 { margin-top: var(--wp--preset--spacing--40); }

/* Selection */
::selection { background: var(--wp--preset--color--sun-pop); color: var(--wp--preset--color--ink); }

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Readable measure for lead paragraphs */
.pq-measure { max-width: 34ch; }
.pq-hero-visual img { aspect-ratio: 1 / 1; object-fit: contain; }
.pq-step-num { flex-shrink: 0; margin: 0; }
@media (max-width: 781px) {
	.pq-cta-visual img { width: 120px !important; }
}
@media (max-width: 781px) { .pq-hero-visual img { max-width: 300px; } }

/* ---------- Forms ---------- */
.wp-block-search__input,
:where(.wp-site-blocks) input[type="text"], :where(.wp-site-blocks) input[type="email"], :where(.wp-site-blocks) input[type="tel"], :where(.wp-site-blocks) textarea {
	background: var(--wp--preset--color--white);
	border: 1.5px solid var(--wp--preset--color--line);
	border-radius: 999px;
	padding: .85rem 1.25rem;
	font: inherit;
	color: var(--wp--preset--color--ink);
	transition: border-color .15s var(--pq-ease);
}
:where(.wp-site-blocks) textarea { border-radius: 16px; }
.wp-block-search__input:hover, :where(.wp-site-blocks) input:hover, :where(.wp-site-blocks) textarea:hover { border-color: var(--wp--preset--color--ink-soft); }
.wp-block-search__inside-wrapper { gap: .5rem; max-width: 560px; }
.wp-block-search__button { margin-left: 0; }

/* Footer polish */
.pq-footer .pq-footer-links { font-size: var(--wp--preset--font-size--small); }
.pq-footer .pq-footer-links h3 { margin-bottom: 1rem; }
.pq-footer .pq-footer-links a { overflow-wrap: anywhere; }

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: flex-start !important; padding-top: 3rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: flex-start !important; }

/* Section-built pages (Home, landing pages): full-width sections stack flush */
.pq-sections > .alignfull { margin-block-start: 0 !important; margin-block-end: 0 !important; }
.pq-sections > :first-child:not(.alignfull) { margin-top: var(--wp--preset--spacing--50); }
