/*
 * Wonday — front-end styles.
 *
 * This file owns:
 *   - Base resets beyond what theme.json expresses
 *   - Global selection + focus behaviour
 *   - Motion primitives (reveal-on-scroll, marquee, link underline, parallax hint)
 *   - Shared utility classes used across block patterns (.wonday-eyebrow etc.)
 *
 * Per-section styles live alongside their block pattern's BEM root
 * (e.g., `.wonday-hero__*` rules live in section-hero.css when that splits out).
 * For now, section styles that need CSS-level behaviour live in this file grouped
 * by BEM root so they're easy to locate.
 *
 * Token layer: assets/css/tokens.css defines every `--wonday-*` alias. Do not use
 * `--wp--preset--*` vars directly in this file — always use the Wonday alias.
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   Placeholder image slots
   During build-out (before real photos are set), <img> with empty src renders
   0×0 and its column collapses. These rules give empty image slots a visible
   dashed-border placeholder so the layout reads correctly. Once a real src is
   set, the image fills the slot and the placeholder styling is effectively
   hidden by the image itself.
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-placeholder {
	background: var(--wonday-color-surface);
	border: 1px dashed var(--wonday-color-border);
	border-radius: var(--wonday-radius-md);
	position: relative;
	overflow: hidden;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
}

.wonday-hero__portrait {
	aspect-ratio: 4 / 5;
	min-height: 320px;
}

.wonday-credibility__image {
	aspect-ratio: 1 / 1;
	min-height: 200px;
	margin-bottom: var(--wonday-space-md);
}

.wonday-about__portrait {
	aspect-ratio: 3 / 4;
	min-height: 380px;
}

.wonday-placeholder::after {
	content: "Image placeholder";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wonday-color-ink-muted);
	font-family: var(--wonday-font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	pointer-events: none;
}

/* Real-image slots — applies when a wp:image figure carries the slot class.
   The aspect-ratio is already on .wonday-hero__portrait / __image / __portrait
   below; here we make the figure render correctly and the inner img cover the slot. */
figure.wonday-hero__portrait,
figure.wonday-credibility__image,
figure.wonday-about__portrait {
	position: relative;
	overflow: hidden;
	border-radius: var(--wonday-radius-md);
	margin: 0;
	padding: 0;
	display: block;
	width: 100%;
}

figure.wonday-hero__portrait img,
figure.wonday-credibility__image img,
figure.wonday-about__portrait img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
}

/* Hero portrait gets a slightly larger radius for a more sculpted feel. */
figure.wonday-hero__portrait {
	border-radius: var(--wonday-radius-lg);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Base + reset
   ═══════════════════════════════════════════════════════════════════════════════ */

* {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

html {
	scroll-behavior: smooth;
}

body {
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--wonday-color-accent);
	color: var(--wonday-color-accent-ink);
}

:focus-visible {
	outline: 2px solid var(--wonday-color-accent);
	outline-offset: 3px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Utility — eyebrow, cluster, stack
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-eyebrow {
	display: inline-block;
	padding-bottom: 0.25em;
	border-bottom: 1px solid var(--wonday-color-border);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Motion — reveal on scroll
   Paired with assets/js/main.js IntersectionObserver; .is-visible class added
   when element enters viewport.
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-reveal {
	opacity: 0;
	transform: translateY(24px);
	transition:
		opacity var(--wonday-motion-dur-reveal) var(--wonday-motion-ease-out),
		transform var(--wonday-motion-dur-reveal) var(--wonday-motion-ease-out);
	will-change: opacity, transform;
}

.wonday-reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Staggered entry — apply different delays to siblings so they cascade in. */
.wonday-reveal--delay-1 { transition-delay: calc(var(--wonday-motion-stagger) * 1); }
.wonday-reveal--delay-2 { transition-delay: calc(var(--wonday-motion-stagger) * 2); }
.wonday-reveal--delay-3 { transition-delay: calc(var(--wonday-motion-stagger) * 3); }
.wonday-reveal--delay-4 { transition-delay: calc(var(--wonday-motion-stagger) * 4); }
.wonday-reveal--delay-5 { transition-delay: calc(var(--wonday-motion-stagger) * 5); }
.wonday-reveal--delay-6 { transition-delay: calc(var(--wonday-motion-stagger) * 6); }

/* Variants */
.wonday-reveal--from-left {
	transform: translateX(-32px);
}
.wonday-reveal--from-left.is-visible {
	transform: translateX(0);
}
.wonday-reveal--from-right {
	transform: translateX(32px);
}
.wonday-reveal--from-right.is-visible {
	transform: translateX(0);
}
.wonday-reveal--fade-only {
	transform: none;
}
.wonday-reveal--scale-in {
	transform: translateY(16px) scale(0.98);
	transform-origin: center bottom;
}
.wonday-reveal--scale-in.is-visible {
	transform: translateY(0) scale(1);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Motion — parallax hint (CSS-only, light touch; real parallax handled by JS)
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-parallax {
	/* JS writes --wonday-parallax-y as the page scrolls */
	transform: translate3d(0, var(--wonday-parallax-y, 0px), 0);
	will-change: transform;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Motion — marquee (for credibility strip or credential list, if used that way)
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-marquee {
	display: flex;
	overflow: hidden;
	gap: 3rem;
	mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.wonday-marquee__track {
	display: flex;
	gap: inherit;
	flex: 0 0 auto;
	animation: wonday-marquee-scroll 32s linear infinite;
}

.wonday-marquee:hover .wonday-marquee__track {
	animation-play-state: paused;
}

@keyframes wonday-marquee-scroll {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Motion — animated link underline
   ═══════════════════════════════════════════════════════════════════════════════ */

.wp-block-navigation a {
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0% 1px;
	transition: background-size var(--wonday-motion-dur-fast) var(--wonday-motion-ease-out);
}

.wp-block-navigation a:hover,
.wp-block-navigation a:focus-visible {
	background-size: 100% 1px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Block: wonday-hero
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-hero {
	position: relative;
}

.wonday-hero__inner {
	align-items: center;
}

.wonday-hero__content > *,
.wonday-hero__content h1,
.wonday-hero__content p {
	margin-inline: 0; /* keep everything flush-left with the eyebrow */
}

.wonday-hero__headline {
	max-width: 22ch;
	margin: 0;
}

.wonday-hero__lede {
	max-width: 52ch;
	margin-top: var(--wonday-space-md);
}

.wonday-hero__eyebrow {
	margin-bottom: var(--wonday-space-md);
}

.wonday-hero__ctas {
	margin-top: var(--wonday-space-lg);
}

.wonday-hero__portrait img,
.wonday-hero__portrait {
	width: 100%;
	aspect-ratio: 4 / 5;
	border-radius: var(--wonday-radius-lg);
}

.wonday-hero__portrait img {
	height: auto;
	object-fit: cover;
	display: block;
}

@media (max-width: 900px) {
	.wonday-hero__inner {
		grid-template-columns: 1fr !important;
	}
	.wonday-hero__content,
	.wonday-hero__media {
		grid-column: 1 / -1 !important;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Block: wonday-credibility
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-credibility__item {
	text-align: left;
}

.wonday-credibility__image img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: var(--wonday-radius-md);
	margin-bottom: var(--wonday-space-md);
}

@media (max-width: 720px) {
	.wonday-credibility__inner {
		grid-template-columns: 1fr !important;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Block: wonday-services
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-services__header {
	max-width: 68ch; /* keep header text comfortable even when the grid spans wide */
}

.wonday-services__lede {
	max-width: 62ch;
}

.wonday-services__card {
	display: flex !important;
	flex-direction: column;
	gap: var(--wonday-space-sm);
	transition:
		transform var(--wonday-motion-dur-base) var(--wonday-motion-ease-out),
		border-color var(--wonday-motion-dur-base) var(--wonday-motion-ease-out);
}

.wonday-services__card:hover {
	transform: translateY(-4px);
	border-color: var(--wonday-color-ink) !important;
}

.wonday-services__card-ctas {
	margin-top: auto;
}

@media (max-width: 900px) {
	.wonday-services__grid {
		grid-template-columns: 1fr !important;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Block: wonday-about
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-about__inner {
	align-items: center;
}

.wonday-about__portrait img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: var(--wonday-radius-lg);
}

.wonday-about__body {
	max-width: 60ch;
}

@media (max-width: 900px) {
	.wonday-about__inner {
		grid-template-columns: 1fr !important;
	}
	.wonday-about__media,
	.wonday-about__content {
		grid-column: 1 / -1 !important;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Block: wonday-proof
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-proof__stat {
	text-align: left;
}

.wonday-proof__stat-value {
	margin: 0;
}

.wonday-proof__stat-label {
	margin-top: var(--wonday-space-2xs);
}

.wonday-proof__testimonial {
	display: flex !important;
	flex-direction: column;
	gap: var(--wonday-space-md);
}

.wonday-proof__testimonial-quote {
	margin: 0;
	flex: 1 1 auto;
}

@media (max-width: 900px) {
	.wonday-proof__stats,
	.wonday-proof__testimonials {
		grid-template-columns: 1fr 1fr !important;
	}
}
@media (max-width: 540px) {
	.wonday-proof__stats,
	.wonday-proof__testimonials {
		grid-template-columns: 1fr !important;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Block: wonday-contact
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-contact__headline {
	max-width: 16ch;
	margin: 0;
}

.wonday-contact__lede {
	max-width: 48ch;
	margin-top: var(--wonday-space-md);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Block: wonday-footer
   ═══════════════════════════════════════════════════════════════════════════════ */

.wonday-footer__wordmark a {
	color: var(--wonday-color-ink) !important;
	text-decoration: none;
}

.wonday-footer__tagline {
	margin-top: var(--wonday-space-xs);
}

.wonday-footer__social-links {
	--wp--social-links--icon-color: var(--wonday-color-ink);
}

@media (max-width: 720px) {
	.wonday-footer__inner {
		grid-template-columns: 1fr !important;
	}
	.wonday-footer__brand,
	.wonday-footer__contact,
	.wonday-footer__social {
		grid-column: 1 / -1 !important;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Reduced motion respect
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
	.wonday-reveal,
	.wonday-reveal.is-visible {
		opacity: 1 !important;
		transform: none !important;
	}
	.wonday-marquee__track {
		animation: none !important;
	}
	.wonday-parallax {
		transform: none !important;
	}
}
