/**
 * Heyrace Blocks — supplementary front-end + editor styles.
 * Design tokens live in theme.json; this file only covers behaviour and a few
 * component details theme.json cannot express. All classes are prefixed `hr-`.
 */

/* ---------------------------------------------------------------------------
 * Inline highlight (the brand-blue emphasis inside headings/statements)
 * ------------------------------------------------------------------------- */
.hr-accent {
	color: var(--wp--preset--color--primary);
}

/* Short blue accent dash above feature headings */
.hr-dash {
	width: 40px;
	min-height: 4px;
	height: 4px;
	background: var(--wp--preset--color--primary);
	border-radius: 2px;
}

/* Inline illustrations embedded mid-sentence in the mission statement */
.hr-inline-img {
	height: 1.45em;
	width: auto;
	vertical-align: middle;
	margin: 0 0.2em;
	position: relative;
	top: -0.06em;
}

/* Section eyebrow (h6) sits closer in size and further from its title */
h6.wp-block-heading + .wp-block-heading {
	margin-top: 1.25rem;
}

/* ---------------------------------------------------------------------------
 * Sticky floating "pill" header
 * ------------------------------------------------------------------------- */
:root {
	/* Approximate rendered header height incl. its top margin. Used to tuck
	 * the home hero up beneath the floating header. */
	--hr-header-h: 106px;
}

/* The header template-part wrapper is only as tall as the header itself, which
 * would confine `position: sticky` and let the bar scroll away after ~96px.
 * Collapsing that wrapper (display: contents) makes the page-tall .wp-site-blocks
 * the sticky containing block, so the bar stays pinned for the whole page while
 * still reserving its normal flow space (so inner pages are unaffected). */
.wp-site-blocks > .wp-block-template-part:has(> .hr-header) {
	display: contents;
}
.hr-header {
	position: sticky;
	top: 0;
	z-index: 100;
	padding-top: 1.75rem;
	padding-bottom: 1rem;
	padding-inline: clamp(1rem, 4vw, 2rem);
	background: transparent;
	transition: transform 0.35s ease, opacity 0.35s ease;
}
/* Hide on scroll-down, reveal on scroll-up (toggled by interactions.js). */
.hr-header.is-hidden {
	transform: translateY(-120%);
	opacity: 0;
	pointer-events: none;
}
/* Resources (blog): give the floating nav the same dark backdrop as the
 * page-title band beneath it, and close the gap so they read as one header.
 * (Single posts and the request-for-demo / landing page keep a transparent nav
 * that floats over their own full-bleed hero, so they're intentionally excluded.) */
.blog .hr-header {
	background-color: var(--wp--preset--color--dark);
}
.blog main {
	margin-top: 0;
}
/* Single posts: the blue article hero is full-bleed and the floating nav
 * overlaps its top — the same treatment as the homepage / landing hero. */
.single main {
	margin-top: calc(-1 * var(--hr-header-h));
}

/* Site Editor may save <main> as a wrapping flex column; on tall pages (e.g. long
 * posts) that clips/overlaps the end of the content and adds a stray gap between
 * stacked sections. Normalise any flex <main> back to block flow. */
main.wp-block-group.is-layout-flex {
	display: flow-root;
}

/* Primary-nav active/hover indicator — indigo underline on the current page link. */
.hr-nav a.wp-block-navigation-item__content {
	border-bottom: 2px solid transparent;
	padding-bottom: 3px;
	transition: border-color 0.2s ease, color 0.2s ease;
}
.hr-nav a.wp-block-navigation-item__content:hover,
.hr-nav a.wp-block-navigation-item__content:focus-visible,
.hr-nav .current-menu-item > a.wp-block-navigation-item__content,
.hr-nav .current_page_item > a.wp-block-navigation-item__content,
.hr-nav a.wp-block-navigation-item__content[aria-current] {
	border-bottom-color: var(--wp--preset--color--primary);
}

.hr-header__bar {
	max-width: 1176px;
	margin-inline: auto;
	box-shadow: 0 10px 30px rgba(4, 4, 12, 0.08);
	transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.hr-header.is-stuck .hr-header__bar {
	box-shadow: 0 12px 34px rgba(4, 4, 12, 0.18);
}
.hr-header .wp-block-site-logo img {
	display: block;
	height: auto;
}
.hr-header__cta .wp-block-button__link {
	white-space: nowrap;
}
@media (max-width: 781px) {
	.hr-header__bar {
		flex-wrap: nowrap;
		gap: 0.5rem;
	}
	/* Keep the CTA visible on mobile (the overlay menu holds nav links only). */
	.hr-header__cta .wp-block-button__link {
		padding-inline: 1rem;
		font-size: 0.9rem;
	}
}

/* ---------------------------------------------------------------------------
 * Hero — rounded, inset card with the floating header overlapping its top
 * ------------------------------------------------------------------------- */
/* Pull the homepage content up so the sticky header floats over the hero card
 * (rather than sitting in a blank band above it). Leaves a small top gap. */
.hr-home-main {
	margin-top: calc(1rem - var(--hr-header-h));
}
/* Request-for-demo / landing pages: float the sticky nav over the hero with a
 * small top gap, so the rounded inset hero card is inset on all sides (matching
 * the homepage treatment). */
.page-template-page-landing main {
	margin-top: calc(1rem - var(--hr-header-h));
}
/* Side gutter around the hero card; the alignfull frame spans the viewport. */
.hr-hero-frame {
	padding-inline: clamp(0.75rem, 2vw, 1.5rem);
}
.hr-hero {
	border-radius: 28px;
	overflow: hidden;
}
/* Keep the hero copy aligned to the site container, not flush to the screen edge.
 * Core shrink-wraps the inner container (`width:auto`) for custom content positions
 * with a 0,5,0 selector (…center-left…), so out-specify it to restore full width. */
.hr-hero.hr-hero.has-custom-content-position.has-custom-content-position.is-position-center-left .wp-block-cover__inner-container {
	width: 100%;
}
/* Pad the copy in to the container's left edge (container gutter on small screens). */
.hr-hero-inner {
	width: 100%;
	padding-inline: max(clamp(1.25rem, 5vw, 2.5rem), calc((100% - 1176px) / 2));
}
.hr-hero-content {
	max-width: 620px;
	padding-inline: 0;
}

/* ---------------------------------------------------------------------------
 * Logo strip + marquee (JS clones the row into a seamless scroller)
 * ------------------------------------------------------------------------- */
.hr-logo img {
	filter: grayscale(1);
	opacity: 0.55;
	transition: filter 0.2s ease, opacity 0.2s ease;
}
.hr-logo:hover img {
	filter: grayscale(0);
	opacity: 1;
}
.hr-marquee.is-animated {
	display: block;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.hr-marquee.is-animated .hr-marquee__track {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 3.5rem;
	width: max-content;
	animation: hr-marquee-scroll 34s linear infinite;
}
.hr-marquee.is-animated:hover .hr-marquee__track {
	animation-play-state: paused;
}
.hr-marquee.is-animated .hr-logo {
	margin: 0;
	flex: 0 0 auto;
}
@keyframes hr-marquee-scroll {
	to {
		transform: translateX(-50%);
	}
}

/* ---------------------------------------------------------------------------
 * Single-row challenge carousel — full-bleed row, top-right arrows, dot pager.
 * interactions.js drives it: transform-based, one card per step, infinite loop.
 * Arrows + dots are injected by JS; with JS off the row scrolls by touch.
 * ------------------------------------------------------------------------- */
.hr-carousel {
	position: relative;
}
/* Prev/next arrows grouped at the top-right, aligned to the site container. */
.hr-carousel__controls {
	display: flex;
	justify-content: flex-end;
	gap: 0.6rem;
	max-width: 1176px;
	margin: 0 auto 1.5rem;
	padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}
.hr-carousel__arrow {
	width: 46px;
	height: 46px;
	display: grid;
	place-items: center;
	color: var(--wp--preset--color--headline);
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--light-grey);
	border-radius: 50%;
	box-shadow: 0 8px 22px rgba(4, 4, 12, 0.10);
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.hr-carousel__arrow:hover {
	color: #fff;
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
}
.hr-carousel__arrow:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}
.hr-carousel__arrow svg {
	width: 20px;
	height: 20px;
}
/* Viewport scrolls on its own without JS; JS switches it to clipped transform mode.
 * The row begins at the screen's left edge (no leading gutter). */
.hr-carousel__viewport {
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.hr-carousel__viewport::-webkit-scrollbar {
	display: none;
}
.hr-carousel.is-enhanced .hr-carousel__viewport {
	overflow: hidden;
}
.hr-carousel__track {
	display: flex;
	flex-wrap: nowrap;
	gap: 1.5rem;
	padding-block: 0.5rem;
	padding-inline: 0;
}
.hr-carousel.is-enhanced .hr-carousel__track {
	will-change: transform;
}
.hr-carousel__track > .hr-carousel__item {
	flex: 0 0 clamp(260px, 30vw, 330px);
	margin: 0;
}
/* Dot pager below the row — one dot per card. */
.hr-carousel__dots {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.5rem;
}
.hr-carousel__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 100px;
	background: var(--wp--preset--color--light-grey);
	cursor: pointer;
	transition: background-color 0.2s ease, width 0.2s ease;
}
.hr-carousel__dot[aria-current="true"] {
	width: 26px;
	background: var(--wp--preset--color--primary);
}
.hr-carousel__dot:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
 * Scroll-reveal entrance animation
 * ------------------------------------------------------------------------- */
/* Only hide pre-reveal when JS is available, so content never gets stuck hidden. */
.hr-js .hr-reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.7s ease, transform 0.7s ease;
	will-change: opacity, transform;
}
.hr-js .hr-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* ---------------------------------------------------------------------------
 * Media-text feature / role rows (image flush inside a rounded card)
 * ------------------------------------------------------------------------- */
.hr-feature-row,
.hr-role-panel {
	overflow: hidden;
	box-shadow: 0 12px 34px rgba(4, 4, 12, 0.06);
}
.hr-feature-row .wp-block-media-text,
.hr-role-panel .wp-block-media-text {
	min-height: 340px;
}
.hr-mt.is-image-fill .wp-block-media-text__media {
	min-height: 100%;
}
@media (max-width: 781px) {
	.hr-mt.is-image-fill .wp-block-media-text__media {
		min-height: 260px;
	}
	.hr-feature-row .wp-block-media-text,
	.hr-role-panel .wp-block-media-text {
		min-height: 0;
	}
}

/* ---------------------------------------------------------------------------
 * Role tabs (progressively enhanced from stacked panels)
 * ------------------------------------------------------------------------- */
.hr-tabs:not(.is-enhanced) .hr-role-panel + .hr-role-panel {
	margin-top: 1.5rem;
}
.hr-tabs__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.6rem;
	margin-bottom: var(--wp--preset--spacing--50);
}
.hr-tab {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--wp--preset--color--headline);
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--light-grey);
	border-radius: 100px;
	padding: 0.7rem 1.4rem;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.hr-tab:hover {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}
.hr-tab[aria-selected="true"] {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: #fff;
}
.hr-tab:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}
.hr-tabs.is-enhanced .hr-role-panel {
	display: none;
}
.hr-tabs.is-enhanced .hr-role-panel.is-active {
	display: block;
	animation: hr-fade 0.4s ease;
}
@keyframes hr-fade {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

/* Eyebrow pill (role panels) */
.hr-pill {
	display: inline-block;
	width: fit-content;
	background: var(--wp--preset--color--light-blue);
	color: var(--wp--preset--color--primary);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	padding: 0.4em 0.95em;
	border-radius: 100px;
	margin: 0;
	font-size: 0.7rem;
}

/* ---------------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------------- */
.hr-card {
	height: 100%;
}
.hr-card .wp-block-post-featured-image img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
	width: 100%;
}
.hr-card {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hr-card:hover {
	transform: translateY(-4px);
}
/* Post meta row (author • date • read time) */
.hr-card-meta p {
	margin: 0;
}
.hr-readtime {
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #94a3b8;
}

/* ---------------------------------------------------------------------------
 * Article body (single post) — tighten the in-article heading scale:
 * H2 smaller than the global hero size, but still a step above H3.
 * ------------------------------------------------------------------------- */
.wp-block-post-content h2 {
	font-size: clamp(1.6rem, 1.35rem + 1vw, 2rem);
	line-height: 1.25;
}
.wp-block-post-content h3,
.wp-block-post-content .rank-math-question {
	font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
	line-height: 1.3;
}

/* ---------------------------------------------------------------------------
 * Testimonials
 * ------------------------------------------------------------------------- */
.hr-stars {
	color: #f5a623;
	letter-spacing: 2px;
	margin: 0;
	font-size: 0.95rem;
	line-height: 1;
}
.hr-quote-feature__inner {
	min-height: 100%;
	height: 100%;
	justify-content: space-between;
}

/* ---------------------------------------------------------------------------
 * CTA band — two equal-height rounded columns (text panel + photo) with a gap
 * ------------------------------------------------------------------------- */
.hr-cta-cols .wp-block-column {
	display: flex;
}
.hr-cta-cols .wp-block-column > * {
	flex: 1;
	width: 100%;
}
.hr-cta-media {
	overflow: hidden;
	height: 100%;
}
@media (max-width: 781px) {
	/* Columns stack; keep the photo a sensible height. */
	.hr-cta-media {
		min-height: 240px;
	}
}

/* ---------------------------------------------------------------------------
 * Check-list bullets
 * ------------------------------------------------------------------------- */
.hr-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
}
.hr-checklist li {
	position: relative;
	padding-left: 1.9rem;
	font-weight: 600;
	color: var(--wp--preset--color--headline);
}
.hr-checklist li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.2em;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 50%;
	background: var(--wp--preset--color--light-blue);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--primary);
}
.hr-checklist li::after {
	content: "";
	position: absolute;
	left: 0.42rem;
	top: 0.5em;
	width: 0.34rem;
	height: 0.6rem;
	border: solid var(--wp--preset--color--primary);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ---------------------------------------------------------------------------
 * Article hero (single post) — full-bleed blue cover (featured image tinted with
 * the primary colour) with the floating nav overlapping its top.
 * ------------------------------------------------------------------------- */
.hr-article-hero {
	/* Clear the floating nav that overlaps the top (see `.single main`). */
	padding-top: calc(var(--hr-header-h) + clamp(1.5rem, 4vw, 3rem));
}
/* Centre the hero content in a box on the site's wide line (the cover's inner
 * container is flow layout, so `alignwide` alone gives no max-width — it would
 * otherwise bleed to the screen edge). A soft shadow keeps the white copy
 * legible now that the photo shows through the overlay. */
.hr-article-hero__inner {
	width: 100%;
	max-width: 1176px;
	margin-inline: auto;
	padding-inline: clamp(1.25rem, 5vw, 2.5rem);
	/* Tight shadow (not a wide blurred cloud) so it hugs the text instead of
	 * reading as a dim panel over the image. */
	text-shadow: 0 1px 4px rgba(4, 4, 12, 0.55);
}
.hr-article-hero .wp-block-post-title {
	max-width: 75%;
	margin-bottom: 0;
	font-size: clamp(2.5rem, 1.9rem + 3vw, 3.75rem);
	line-height: 1.05;
}
@media (max-width: 781px) {
	.hr-article-hero .wp-block-post-title {
		max-width: 100%;
	}
}
.hr-article-hero .wp-block-post-excerpt {
	max-width: 60ch;
	margin: 0;
}
.hr-article-hero .wp-block-post-excerpt p {
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
/* Meta row (author • date • category • read time) sits on the blue hero. */
.hr-article-meta {
	align-items: center;
	margin-top: 0.5rem;
}
.hr-article-meta p {
	margin: 0;
	opacity: 0.7;
}
/* Neutralise the global post-terms colour (primary on primary = invisible). */
.hr-article-meta .wp-block-post-terms,
.hr-article-meta .wp-block-post-terms a {
	color: var(--wp--preset--color--white);
}
.hr-article-meta .hr-readtime {
	color: var(--wp--preset--color--white);
	opacity: 0.85;
}

/* Breadcrumb trail */
.hr-breadcrumb {
	font-size: 0.8rem;
	letter-spacing: 0.02em;
	color: rgba(255, 255, 255, 0.8);
}
.hr-breadcrumb a {
	color: inherit;
	text-decoration: none;
}
.hr-breadcrumb a:hover {
	text-decoration: underline;
}
.hr-breadcrumb__sep {
	margin-inline: 0.2rem;
	opacity: 0.6;
}

/* ---------------------------------------------------------------------------
 * Request-for-demo hero — a rounded, inset photo card as the background behind
 * two columns: copy (left) + a white form card (right).
 * ------------------------------------------------------------------------- */
/* Side gutter so the rounded image card sits inset from the screen edges. */
.hr-demo-hero-frame {
	padding-inline: clamp(0.75rem, 2vw, 1.5rem);
}
.hr-demo-hero {
	border-radius: 28px;
	overflow: hidden;
	/* Clear the floating nav that overlaps the top (see page-landing main). */
	padding-top: calc(var(--hr-header-h) + clamp(1.5rem, 4vw, 3rem));
}
/* Keep the copy + form on the site's wide line (the cover inner container is
 * flow layout, so `alignwide` alone would let them span the whole card). */
.hr-demo-hero__cols {
	width: 100%;
	max-width: 1176px;
	margin-inline: auto;
}
/* White form card fills its column for a balanced two-up layout. */
.hr-demo-form-card {
	width: 100%;
}
/* The card lives inside the cover, which paints its headings white; restore the
 * dark heading colour so the "Request a Demo" title shows on the white card. */
.hr-demo-form-card .wp-block-heading {
	color: var(--wp--preset--color--headline);
}
@media (max-width: 781px) {
	/* Columns stack: copy first, then the form card. */
	.hr-demo-hero {
		padding-bottom: var(--wp--preset--spacing--60);
	}
}

/* ---------------------------------------------------------------------------
 * FAQ (Details) accordion
 * ------------------------------------------------------------------------- */
.hr-faq {
	background: var(--wp--preset--color--white);
}
.hr-faq summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	color: var(--wp--preset--color--headline);
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}
.hr-faq summary::-webkit-details-marker {
	display: none;
}
.hr-faq summary::after {
	content: "+";
	font-size: 1.5rem;
	line-height: 1;
	color: var(--wp--preset--color--primary);
	transition: transform 0.2s ease;
}
.hr-faq[open] summary::after {
	transform: rotate(45deg);
}

/* ---------------------------------------------------------------------------
 * Form placeholder marker
 * ------------------------------------------------------------------------- */
.hr-form-placeholder {
	font-weight: 600;
	letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------------------
 * Respect reduced-motion preferences
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.hr-js .hr-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
	.hr-marquee.is-animated .hr-marquee__track {
		animation: none;
		justify-content: center;
		flex-wrap: wrap;
		width: auto;
	}
	.hr-tabs.is-enhanced .hr-role-panel.is-active {
		animation: none;
	}
	.hr-carousel.is-enhanced .hr-carousel__track {
		transition: none !important;
	}
	.hr-header {
		transition: none;
	}
}
