/* ==================================================================
   Insideout Events: generous spacing and restrained motion.
   Loaded by the theme after style.css (see functions.php).
   No divider lines, glows or decorative shapes: space, photography and
   type do the work. All motion is off for visitors who ask their device
   to reduce motion.
   ================================================================== */

/* ---------- Spacing -------------------------------------------- */

:root {
	--wp--preset--spacing--50: clamp(2.5rem, 5vw, 4rem);
	--wp--preset--spacing--60: clamp(4rem, 8vw, 6.5rem);
	--wp--preset--spacing--70: clamp(5.5rem, 12vw, 10rem);
}

main .wp-block-columns.is-layout-flex { column-gap: clamp(2rem, 5vw, 5.5rem); row-gap: 3rem; }

.is-style-kicker { margin-bottom: 1.5rem !important; }
.is-style-kicker + :is(h1, h2) { margin-top: 0 !important; }
h1 + :is(p, .is-style-lede) { margin-top: 2rem !important; }
h2 + p, h2 + .is-style-lede { margin-top: 1.5rem !important; }
main .wp-block-buttons { margin-top: 2.5rem !important; }
main p { line-height: 1.8; }

.io-header { padding-top: 1.35rem !important; padding-bottom: 1.35rem !important; }

@media (min-width: 782px) {
	.io-work-grid { gap: 3.5rem 2.25rem !important; }
}
.io-card > .wp-block-group { margin-top: 1.25rem !important; }

.io-service-rows > * { padding-bottom: 2.25rem; margin-bottom: 2.25rem; }
.io-phase { padding-block: 5rem 2rem; }
.io-case-body > p + p { margin-top: 1.6rem; }
.io-section-grid { row-gap: 4rem !important; }

@media (max-width: 781px) {
	:root {
		--wp--preset--spacing--60: 3.5rem;
		--wp--preset--spacing--70: 4.5rem;
	}
	main .wp-block-buttons { margin-top: 2rem !important; }
}

/* Tablets and small laptops: the menu has too many items for one row, so use the menu button */
@media (min-width: 600px) and (max-width: 1100px) {
	.io-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.io-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
	.io-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { display: flex !important; }
}

/* Header on one line on laptops */
@media (min-width: 600px) and (max-width: 1280px) {
	.io-header .wp-block-site-title { white-space: nowrap; }
	.io-header .wp-block-navigation__container { flex-wrap: nowrap !important; gap: 0.15rem !important; }
	.io-header .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content { padding: 0.4rem 0.6rem !important; white-space: nowrap; }
	.io-header .wp-block-navigation-item__label { white-space: nowrap !important; }
	.io-header .wp-block-navigation { font-size: 0.875rem; }
	.io-header-cta .wp-block-button__link { padding: 0.75rem 1.1rem !important; font-size: 0.875rem; white-space: nowrap; }
}
@media (min-width: 600px) and (max-width: 900px) {
	/* No room for the header button beside the menu: the floating button takes over. */
	.io-header .wp-block-buttons.io-header-cta { display: none; }
	.wp-block-buttons.io-mobile-cta { display: block; position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; margin: 0 !important; }
}

/* Soft lift on photographs: no outlines, just depth */
.io-card .wp-block-post-featured-image,
.io-team-photo > img {
	border-radius: 2px;
}

/* ---------- Motion --------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {

	/* Hero and page intros: lines rise in, one after another */
	.io-hero .wp-block-cover__inner-container > .alignwide > *,
	main > .wp-block-post-content > .io-band:first-child .alignwide > * {
		animation: io-rise 1s cubic-bezier(.2, .7, .2, 1) both;
	}
	.io-hero .wp-block-cover__inner-container > .alignwide > :nth-child(2),
	main > .wp-block-post-content > .io-band:first-child .alignwide > :nth-child(2) { animation-delay: .08s; }
	.io-hero .wp-block-cover__inner-container > .alignwide > :nth-child(3),
	main > .wp-block-post-content > .io-band:first-child .alignwide > :nth-child(3) { animation-delay: .16s; }
	.io-hero .wp-block-cover__inner-container > .alignwide > :nth-child(4) { animation-delay: .24s; }
	.io-hero .io-hero-strip { animation: io-fade 1.2s .4s ease both; }

	/* Photos: a slow, slight zoom on hover */
	.io-card .wp-block-post-featured-image img,
	.is-style-plate img { transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }

	/* Card titles warm to brand blue */
	.io-card .wp-block-post-title a { transition: color 300ms ease; }

	/* Scroll-linked motion where supported (Chrome, Edge, Safari 26+).
	   Other browsers show everything in place. */
	@supports (animation-timeline: view()) {
		main :is(h2, .is-style-lede, .io-fact, .io-statement-copy):not(.io-reveal *) {
			animation: io-enter linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 65%;
		}
		/* Gentle parallax inside featured photos and the statement hero */
		.wp-block-post-featured-image img,
		.io-statement .wp-block-cover__image-background {
			scale: 1.08;
			animation: io-parallax linear both;
			animation-timeline: view();
			animation-range: cover;
		}
	}
}

@keyframes io-rise     { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes io-fade     { from { opacity: 0; } to { opacity: 1; } }
@keyframes io-enter    { from { opacity: 0; translate: 0 1.75rem; } to { opacity: 1; translate: 0 0; } }
@keyframes io-parallax { from { translate: 0 -3%; } to { translate: 0 3%; } }

/* Editor: keep the spacing, skip the motion so editing stays calm */
.editor-styles-wrapper *,
.editor-styles-wrapper *::before,
.editor-styles-wrapper *::after { animation: none !important; }
