/**
 * Searity: what theme.json cannot express. Loaded on the front end and in the editor.
 *
 * 1. Base   2. Header & footer   3. Block styles   4. Sections   5. Motion
 */

/* ---------- 1. Base ---------- */
:root {
	--searity-overlap: var(--wp--custom--overlap);
	--searity-ease: cubic-bezier(.2, .7, .2, 1);
}
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(h1, h2, h3, h4) { text-wrap: balance; }
:where(p, li) { text-wrap: pretty; }
:where(a, button, summary, input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 4px;
}
.wp-block-heading mark.has-inline-color {
	display: inline-block;
	padding: .15em .6em;
	border-radius: 999px;
	font-size: .58em;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1.5;
	vertical-align: .25em;
}
:where(li) mark.has-inline-color {
	padding: .05em .5em;
	border-radius: 999px;
	font-size: .7em;
	font-weight: 700;
	letter-spacing: .06em;
}

/* Full-width sections and template parts sit edge to edge: no gap strip between coloured bands. */
.wp-site-blocks > * + *,
.wp-block-post-content > .alignfull + .alignfull,
.wp-block-post-content > .alignfull:first-child { margin-block-start: 0; }

/* ---------- 2. Header & footer ---------- */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; } }
/* The frosted glass sits on a layer behind the header, not on the header itself: a backdrop-filter
   would make the header the box that the mobile menu's fixed overlay fills, i.e. 52px tall. */
.searity-header {
	position: relative;
	isolation: isolate;
	border-bottom: 1px solid var(--wp--preset--color--border);
}
/* The phone menu: a full screen of large links from the left edge, the close button where the
   burger was. */
.searity-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: .75rem 16px 2rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
.searity-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 4rem;
	align-items: stretch;
}
.searity-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
	align-items: stretch;
	gap: 0;
}
.searity-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	justify-content: flex-start;
	text-align: left;
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.searity-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 1rem 0;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}
/* Logo and close button in the open menu: placed by view.js over the header's logo and burger. */
.searity-menu-brand { display: none !important; }
.searity-header .is-menu-open .searity-menu-brand { display: flex !important; position: fixed; margin: 0; }
.searity-header .is-menu-open .wp-block-navigation__responsive-container-close { position: fixed; right: auto; }
.searity-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: color-mix(in srgb, var(--wp--preset--color--base) 90%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	backdrop-filter: saturate(1.4) blur(12px);
}
.searity-brand .wp-block-image { margin: 0; flex: none; }
.searity-brand .wp-block-site-title { margin: 0; }
.searity-header .wp-block-button__link { padding: .55rem 1rem; font-size: var(--wp--preset--font-size--small); }
@media (max-width: 781px) { .searity-header .wp-block-buttons { display: none; } }

.searity-footer .searity-footer-title {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0;
}
.wp-block-list.searity-links { list-style: none; margin-block-end: 0; padding: 0; font-size: var(--wp--preset--font-size--small); }
.searity-footer .wp-block-separator { width: 100%; max-width: var(--wp--style--global--wide-size); }
.wp-block-list.searity-links li + li { margin-top: .5rem; }
.searity-links a,
.searity-links.wp-block-navigation .wp-block-navigation-item__content { color: var(--wp--preset--color--contrast-2); text-decoration: none; }
.searity-links a:hover,
.searity-links.wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--primary); text-decoration: underline; }

/* ---------- 3. Block styles ---------- */
/* Image: a browser window around a screenshot. */
.wp-block-image.is-style-browser {
	overflow: hidden;
	background: var(--wp--preset--color--base);
	border-radius: var(--wp--custom--radius--l);
	box-shadow: var(--wp--preset--shadow--lifted);
}
.wp-block-image.is-style-browser::before {
	content: "";
	display: block;
	height: 34px;
	border-bottom: 1px solid var(--wp--preset--color--border);
	background:
		radial-gradient(circle at 19px 50%, #c9d2cb 5px, transparent 5.5px),
		radial-gradient(circle at 37px 50%, #c9d2cb 5px, transparent 5.5px),
		radial-gradient(circle at 55px 50%, #c9d2cb 5px, transparent 5.5px),
		#eef2ef;
}
.wp-block-image.is-style-browser img { display: block; width: 100%; height: auto; border-radius: 0; }

/* Group: cards. */
.wp-block-group.is-style-card,
.wp-block-group.is-style-card-featured {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--l);
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
}
.wp-block-group.is-style-card-featured {
	border: 2px solid var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--soft);
}

/* List: check marks. */
.wp-block-list.is-style-checks { list-style: none; padding-left: 0; }
.is-style-checks > li { position: relative; padding-left: 1.75rem; }
.is-style-checks > li + li { margin-top: .5rem; }
.is-style-checks > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .3em;
	width: 1.05rem;
	height: 1.05rem;
	background: var(--wp--preset--color--primary);
	-webkit-mask: url(../icons/check.svg) center / contain no-repeat;
	mask: url(../icons/check.svg) center / contain no-repeat;
}

/* Table: feature comparison. */
.wp-block-table.is-style-compare {
	overflow-x: auto;
	margin: 0;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--l);
}
.is-style-compare table { width: 100%; min-width: 520px; border-collapse: collapse; }
.is-style-compare :is(thead, tfoot) { border: 0; }
.is-style-compare :is(th, td) {
	padding: .8rem 1rem;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--border);
	text-align: left;
	vertical-align: top;
}
.is-style-compare thead :is(th, td) {
	border-top: 0;
	background: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--contrast-3);
	font-size: .8125rem;
	font-weight: 600;
}
.is-style-compare :is(th, td):not(:first-child) { width: 8.5rem; text-align: center; color: var(--wp--preset--color--contrast-3); }
.is-style-compare td strong { color: var(--wp--preset--color--primary); }
.is-style-compare td:first-child strong { color: inherit; }
.is-style-compare tr:has(> td:nth-child(2):empty) td { background: var(--wp--preset--color--base-2); font-weight: 600; }
@media (max-width: 600px) {
	.is-style-compare table { min-width: 0; }
	.is-style-compare :is(th, td) { padding: .7rem .6rem; }
	.is-style-compare :is(th, td):first-child { padding-left: .9rem; }
	.is-style-compare :is(th, td):not(:first-child) { width: 4.75rem; }
}
.is-style-compare td em {
	display: block;
	margin-top: .15rem;
	font-style: normal;
	font-size: .8125rem;
	color: var(--wp--preset--color--contrast-3);
}

/* Details: accordion rows. */
.wp-block-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}
.wp-block-details > summary::-webkit-details-marker { display: none; }
.wp-block-details > summary::after {
	content: "";
	flex: none;
	width: .55rem;
	height: .55rem;
	margin-right: .25rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-25%) rotate(45deg);
	transition: transform .2s var(--searity-ease);
}
.wp-block-details[open] > summary::after { transform: translateY(15%) rotate(-135deg); }
.wp-block-details > :not(summary) { margin-top: .6rem; }

/* "Show the whole comparison": the rest of the table opens under the first part. */
.wp-block-details.searity-more { margin-top: 1.25rem; padding: 0; border: 0; }
.searity-more > summary {
	justify-content: center;
	width: max-content;
	margin-inline: auto;
	padding: .7rem 1.2rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--m);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--primary);
}
.searity-more[open] > summary { display: none; }
.searity-more > .wp-block-table { margin-top: 0; }
.searity-more[open] { margin-top: -1px; }
.searity-more .wp-block-table.is-style-compare { border-top-left-radius: 0; border-top-right-radius: 0; }
.wp-block-table.is-style-compare:has(+ .searity-more[open]) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* ---------- 4. Sections ---------- */
/* Feature icons sit on a soft tile. */
.wp-block-image.searity-icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	border-radius: var(--wp--custom--radius--m);
	background: var(--wp--preset--color--primary-soft);
}
.wp-block-image.searity-icon img { width: 1.5rem; height: 1.5rem; }

/* Hero: the screenshot runs into the next section. */
.wp-block-cover.searity-hero { overflow: visible; min-height: 0; }
.searity-hero .wp-block-cover__inner-container { position: relative; z-index: 2; }
.searity-hero .wp-block-heading em { font-style: normal; color: var(--wp--preset--color--accent); }
.searity-hero p strong { color: var(--wp--preset--color--base); }
.searity-hero .wp-block-buttons { margin-top: var(--wp--preset--spacing--30); }
.wp-block-image.searity-overlap {
	position: relative;
	z-index: 2;
	margin-top: var(--wp--preset--spacing--60);
	margin-bottom: calc(-1 * var(--searity-overlap));
}
.searity-hero + * { padding-top: calc(var(--searity-overlap) + var(--wp--preset--spacing--60)) !important; }

/* Story: on wide screens the panel stays in view and shows the screenshot for the step being read. */
.wp-block-cover.searity-panel { min-height: 0; }
.searity-panel .wp-block-cover__inner-container { display: grid; gap: var(--wp--preset--spacing--30); }
.searity-step + .searity-step { margin-top: var(--wp--preset--spacing--40); }
/* On phones each screenshot follows its own step: the columns, the panel and its inner box step
   aside (display: contents), so steps and screenshots become one list ordered step, shot, step, shot. */
@media (max-width: 781px) {
	.searity-story { flex-direction: column; gap: 0; }
	.searity-story > .wp-block-column,
	.searity-story .searity-panel,
	.searity-story .searity-panel > .wp-block-cover__inner-container { display: contents; }
	.searity-story .searity-panel > .wp-block-cover__image-background,
	.searity-story .searity-panel > .wp-block-cover__background { display: none; }
	.searity-story .searity-step,
	.searity-story .searity-panel .wp-block-image { width: 100%; margin: 0; }
	.searity-story .searity-step + .searity-step { margin-top: 0; }
	.searity-story .searity-panel .wp-block-image { margin: var(--wp--preset--spacing--30) 0 var(--wp--preset--spacing--50); }
	.searity-story .searity-step:nth-child(1) { order: 1; }
	.searity-story .searity-panel .wp-block-image:nth-child(1) { order: 2; }
	.searity-story .searity-step:nth-child(2) { order: 3; }
	.searity-story .searity-panel .wp-block-image:nth-child(2) { order: 4; }
	.searity-story .searity-step:nth-child(3) { order: 5; }
	.searity-story .searity-panel .wp-block-image:nth-child(3) { order: 6; margin-bottom: 0; }
}
@media (min-width: 782px) {
	/* Core sets align-items: normal !important on columns, which stretches the panel's column to the
	   height of the steps and leaves sticky no room to move; the column itself opts out. */
	.searity-story > .wp-block-column:last-child { position: sticky; top: 6rem; align-self: flex-start; }
	.searity-story.is-live .searity-panel .wp-block-cover__inner-container > .wp-block-image {
		grid-area: 1 / 1;
		align-self: center;
		opacity: 0;
		transform: translateY(24px);
		transition: opacity .35s cubic-bezier(.5, 0, .75, 0), transform .35s cubic-bezier(.5, 0, .75, 0);
	}
	/* The screenshot just read leaves upwards; the next one rises from below a beat later. */
	.searity-story.is-live .searity-panel .wp-block-image.is-past { transform: translateY(-16px); }
	.searity-story.is-live .searity-panel .wp-block-image.is-active {
		opacity: 1;
		transform: none;
		transition: opacity .5s var(--searity-ease) .2s, transform .5s var(--searity-ease) .2s;
	}
	.searity-story.is-live .searity-step { opacity: .45; transition: opacity .3s; }
	.searity-story.is-live .searity-step.is-active { opacity: 1; }
	.searity-step { padding-block: var(--wp--preset--spacing--40); }
}

/* Pricing: the price figure. */
.searity-price { line-height: 1; letter-spacing: -.03em; }
.searity-plans > .wp-block-group { display: flex; flex-direction: column; }
/* The buttons sit at the bottom of every card (auto margin), always a step below the list. */
.searity-plans > .wp-block-group > .wp-block-buttons { margin-top: auto; padding-top: var(--wp--preset--spacing--40); }

/* Calls to action on photos. */
.wp-block-cover.searity-cta { min-height: 0; }

/* ---------- 5. Motion ---------- */
/* All of it hangs on .searity-motion, which a one-line head script sets on <html> unless the visitor
   asks for reduced motion. Without it the page is static and complete. */
@keyframes searity-rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes searity-rise-far { from { opacity: 0; transform: translateY(80px); } }
@keyframes searity-rise-shot { from { opacity: 0; transform: translateY(80px); } } /* same; a new name restarts it */
@keyframes searity-fade { from { opacity: 0; } }
@keyframes searity-fade-in { from { opacity: 0; } }

/* Hero: heading, text and buttons one after another… */
.searity-motion .searity-hero .wp-block-cover__inner-container > * { animation: searity-rise .8s var(--searity-ease) both; }
.searity-motion .searity-hero .wp-block-cover__inner-container > :nth-child(2) { animation-delay: .12s; }
.searity-motion .searity-hero .wp-block-cover__inner-container > :nth-child(3) { animation-delay: .24s; }
/* …then the screenshot, once decoded (view.js adds .is-ready), so it never paints half-loaded.
   Should the script not run, it comes in by itself after 2.5 s. */
.searity-motion .searity-hero .searity-overlap { animation: searity-rise-far 1s var(--searity-ease) 2.5s both; }
.searity-motion .searity-hero .searity-overlap.is-ready { animation-name: searity-rise-shot; animation-delay: var(--searity-delay, 0s); }

/* Photos behind text drift slower than the page (view.js moves them). The image is taller than its
   box and clipped back to it, because the hero lets its screenshot overflow. */
.searity-motion :is(.searity-hero, .searity-panel, .searity-cta) > .wp-block-cover__image-background {
	top: -12%;
	height: 124%;
	clip-path: inset(9.68% 0);
	will-change: transform;
}
/* Like the screenshot, photos fade in once decoded instead of painting in bands. The hero's has the
   same 2.5 s fallback; the others (lazy, below the fold) are hidden only once view.js runs. */
.searity-motion .searity-hero > .wp-block-cover__image-background { animation: searity-fade .8s ease-out 2.5s both; }
.searity-motion .searity-hero > .wp-block-cover__image-background.is-ready { animation-name: searity-fade-in; animation-delay: 0s; }
.searity-js :is(.searity-panel, .searity-cta) > .wp-block-cover__image-background { opacity: 0; transition: opacity .8s ease-out; }
.searity-js :is(.searity-panel, .searity-cta) > .wp-block-cover__image-background.is-ready { opacity: 1; }

/* Sections below the fold rise in as they reach the screen (view.js marks them first)… */
.searity-motion .searity-reveal { transition: opacity .8s var(--searity-ease), transform .8s var(--searity-ease); }
.searity-motion .searity-reveal.is-waiting { opacity: 0; transform: translateY(28px); }
/* …and in grids the cards follow one another. */
.searity-motion .searity-reveal.is-layout-grid,
.searity-motion .searity-reveal.is-layout-grid.is-waiting { opacity: 1; transform: none; transition: none; }
.searity-motion .searity-reveal.is-layout-grid > * {
	transition: opacity .7s var(--searity-ease), transform .7s var(--searity-ease);
	transition-delay: calc(var(--searity-i, 0) * 80ms);
}
.searity-motion .searity-reveal.is-layout-grid.is-waiting > * { opacity: 0; transform: translateY(24px); }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.searity-story.is-live .searity-panel .wp-block-image,
	.wp-block-details > summary::after { transition: none; }
}
