/**
 * Emmanuel — global styles.
 *
 * Only what theme.json cannot express lives here. Block-specific styles are in
 * assets/css/blocks/ and load only when the block is on the page.
 *
 * Breakpoints (match the previous Elementor site):
 *   tablet  ≤ 1024px  (menu collapses to the hamburger)
 *   mobile  ≤ 767px   (columns stack)
 */

/* -------------------------------------------------------------------------
 * Base
 * ---------------------------------------------------------------------- */

html {
	scroll-padding-top: calc(var(--wp--custom--header--height) + var(--wp-admin--admin-bar--height, 0px) + 1rem);
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Remove the gap WordPress adds between template parts and main content. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

:where(.wp-site-blocks) :focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Inline SVG decorations are never interactive. */
.ebc-shape {
	pointer-events: none;
	user-select: none;
}

/* Visually hidden but available to screen readers. */
.screen-reader-text:not(:focus):not(:active) {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* Skip link (output by core for block themes). */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--white);
	border-radius: var(--wp--custom--radius--xs);
	box-shadow: var(--wp--preset--shadow--raised);
	color: var(--wp--preset--color--teal);
	font-weight: 600;
	left: 1rem;
	padding: 0.75rem 1.25rem;
	top: 1rem;
	z-index: 100000;
}

/* -------------------------------------------------------------------------
 * Sticky header
 * ---------------------------------------------------------------------- */

.site-header-wrap {
	/* Hairline always; a soft shadow is added once the page scrolls. Both
	   layers are listed so the scroll animation can interpolate between them. */
	background: var(--wp--preset--color--white);
	box-shadow: 0 1px 0 var(--wp--custom--color--hairline), 0 4px 12px 0 rgba(0, 0, 0, 0);
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
}

/* The admin bar is not sticky on small screens, so neither is the offset. */
@media (max-width: 600px) {
	.admin-bar .site-header-wrap {
		top: 0;
	}
}

/* Shadow appears once the page scrolls (no JavaScript needed). */
@supports (animation-timeline: scroll()) {
	.site-header-wrap {
		animation: ebc-header-shadow linear both;
		animation-range: 0 80px;
		animation-timeline: scroll(root);
	}
}

@keyframes ebc-header-shadow {
	to {
		box-shadow: 0 1px 0 var(--wp--custom--color--hairline), 0 4px 12px 0 rgba(0, 0, 0, 0.12);
	}
}

.site-header {
	min-height: var(--wp--custom--header--height);
}

.site-header .wp-block-site-logo img {
	height: auto;
	width: 226px;
}

@media (max-width: 767px) {
	.site-header {
		min-height: 79px;
	}
}

/* -------------------------------------------------------------------------
 * Footer
 * ---------------------------------------------------------------------- */

.site-footer a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--sky);
	text-decoration: none;
}

.site-footer a:where(:not(.wp-element-button)):hover {
	color: var(--wp--preset--color--white);
	text-decoration: underline;
}

.site-footer .ebc-footer__logo img {
	height: auto;
	width: min(466px, 100%);
}

@media (max-width: 767px) {
	.site-footer .ebc-footer__logo img {
		width: 165px;
	}
}

.site-footer .ebc-footer__legal a {
	color: var(--wp--preset--color--off-white);
}

/* -------------------------------------------------------------------------
 * Motion
 *
 * A few of the previous site's scroll effects (see assets/js/motion.js):
 * feature bands (invitation, Bible verses, beliefs and questions) fade in as
 * they scroll up the screen, and the header's buttons and card grids rise
 * gently into place when they arrive. Page headers themselves don't fade in,
 * and everything else stays still. html.ebc-motion is only set for visitors
 * who haven't asked for reduced motion, and only while the script can run,
 * so content is never left hidden.
 *
 * The selectors here and in motion.js (ARRIVE) must match.
 * ---------------------------------------------------------------------- */

/* Entrance: hidden until motion.js adds .is-in. Kept for the moments that
   matter: the header's buttons, and grids of people, photo cards and
   sermons arriving one after another. :where() keeps the
   hidden state at low priority, so .is-in always wins. */
html.ebc-motion main :where(
	.ebc-hero .wp-block-buttons,
	.wp-block-emmanuel-collection:is(.is-variant-cards, .is-variant-people) > *,
	.ebc-sermon-grid > li,
	.ebc-sermon-links > li
) {
	opacity: 0;
	transition: opacity 0.9s ease, translate 0.9s ease;
	transition-delay: var(--ebc-delay, 0s);
	translate: 0 1.5rem;
}

html.ebc-motion main .is-in {
	opacity: 1;
	translate: none;
}

/* Header shadow where scroll-driven animations aren't supported (Firefox). */
.site-header-wrap.is-scrolled {
	box-shadow: 0 1px 0 var(--wp--custom--color--hairline), 0 4px 12px 0 rgba(0, 0, 0, 0.12);
	transition: box-shadow 0.2s ease;
}

/* -------------------------------------------------------------------------
 * Layout helpers used by patterns
 * ---------------------------------------------------------------------- */

/* Sections stack flush; their own padding provides the rhythm. */
.entry-content > .ebc-section {
	margin-block: 0;
}

/* Columns stack at the Elementor mobile breakpoint (core stacks at 781px). */
@media (max-width: 1024px) and (min-width: 768px) {
	.wp-block-columns.ebc-stack-tablet {
		flex-wrap: wrap !important;
	}

	.wp-block-columns.ebc-stack-tablet > .wp-block-column {
		flex-basis: 100% !important;
	}
}

/* Hairline divider used between rows and columns. */
.ebc-hairline-right {
	border-right: 2px solid var(--wp--custom--color--hairline);
	padding-right: var(--wp--preset--spacing--40);
}

@media (max-width: 781px) {
	.ebc-hairline-right {
		border-right: 0;
		padding-right: 0;
	}
}

/* -------------------------------------------------------------------------
 * Typography helpers
 * ---------------------------------------------------------------------- */

/* Small uppercase label: footer headings, eyebrows, tab labels. */
.ebc-label {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	letter-spacing: var(--wp--custom--letter-spacing--label);
	line-height: 1.25;
	text-transform: uppercase;
}

.site-footer .ebc-footer__contact {
	letter-spacing: 0.76px;
	line-height: 22px;
}

.site-footer .ebc-footer__legal {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	color: color-mix(in srgb, var(--wp--preset--color--off-white) 75%, transparent);
}

.site-footer .ebc-footer__legal > * {
	margin: 0;
}

/* -------------------------------------------------------------------------
 * Sections
 * ---------------------------------------------------------------------- */

.ebc-section {
	position: relative;
}

/* Eyebrow above a heading ("WELCOME TO"). */
.ebc-eyebrow {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 500;
	letter-spacing: var(--wp--custom--letter-spacing--tight);
	line-height: 1.4;
	text-transform: uppercase;
}

/* Large introductory paragraph. */
.ebc-lead {
	color: var(--wp--preset--color--lead);
	font-size: var(--wp--preset--font-size--x-large);
	letter-spacing: var(--wp--custom--letter-spacing--title);
	line-height: 1.25;
}

/* Subtitle under a section heading. */
.ebc-subtitle {
	margin-top: 0.5rem !important;
}

/* Dark sections switch outline buttons, focus rings and dividers to light. */
.is-style-section-teal,
.is-style-section-teal-arc,
.wp-block-cover.is-dark,
.site-footer {
	--ebc-outline: var(--wp--preset--color--off-white);
	--ebc-focus: var(--wp--preset--color--lime);
}

:where(.is-style-section-teal, .is-style-section-teal-arc, .wp-block-cover, .site-footer) :focus-visible {
	outline-color: var(--ebc-focus, currentColor);
}

/* Teal band with the large brand arc in the corner (decorative). */
.is-style-section-teal-arc {
	isolation: isolate;
	overflow: hidden;
}

.is-style-section-teal-arc::before {
	background: url("../images/shapes/quarter-arc.svg") no-repeat 0 0 / contain;
	content: "";
	height: 660px;
	left: -109px;
	opacity: 0.12;
	pointer-events: none;
	position: absolute;
	top: 289px;
	width: 660px;
	z-index: -1;
}

.is-style-section-teal-arc.ebc-deco-pill::before {
	background-image: url("../images/shapes/pill.svg");
	height: 372px;
	left: -209px;
	opacity: 0.25;
	top: 209px;
	width: 897px;
}

@media (max-width: 767px) {
	.is-style-section-teal-arc::before {
		left: -385px;
		top: auto;
		bottom: -420px;
	}
}

/* -------------------------------------------------------------------------
 * Buttons
 * ---------------------------------------------------------------------- */

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	border-color: currentColor;
	color: var(--ebc-outline, var(--wp--preset--color--teal));
	padding: 14px 24px;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: color-mix(in srgb, currentColor 10%, transparent);
	color: var(--ebc-outline, var(--wp--preset--color--teal));
}

.wp-block-button.is-style-outline-light > .wp-block-button__link {
	background: transparent;
	border-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--off-white);
}

.wp-block-button.is-style-outline-light > .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.12);
	color: var(--wp--preset--color--white);
}

/* Buttons stretch full width on phones, as on the old site. */
@media (max-width: 767px) {
	.ebc-section .wp-block-buttons.ebc-stack-mobile {
		flex-direction: column;
		align-items: stretch;
	}

	.ebc-section .wp-block-buttons.ebc-stack-mobile > .wp-block-button {
		width: 100%;
	}

	.ebc-section .wp-block-buttons.ebc-stack-mobile .wp-block-button__link {
		width: 100%;
	}
}

/* -------------------------------------------------------------------------
 * Images
 * ---------------------------------------------------------------------- */

.wp-block-image.is-style-arched img {
	border-radius: var(--wp--custom--radius--arch);
}

.wp-block-image.is-style-rounded-lg img {
	border-radius: var(--wp--custom--radius--lg);
}

.wp-block-image.is-style-square img {
	border-radius: 0;
}

.wp-block-image img {
	border-radius: inherit;
}

/* Which part of a cropped photo stays in view (Image blocks have no focal
   point setting; Cover blocks do). Set by the page builder. */
.wp-block-image.ebc-focus-top img {
	object-position: 50% 0;
}

.wp-block-image.ebc-focus-upper img {
	object-position: 50% 33%;
}

.wp-block-image.ebc-focus-lower img {
	object-position: 50% 67%;
}

/* -------------------------------------------------------------------------
 * Lists
 * ---------------------------------------------------------------------- */

/* "Tags": small rounded labels in a row. */
.wp-block-list.is-style-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	padding: 0;
}

.wp-block-list.is-style-pills > li {
	background: var(--wp--preset--color--mist);
	border-radius: var(--wp--custom--radius--pill);
	color: var(--wp--preset--color--teal);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	margin: 0;
	padding: 6px 14px;
	text-transform: uppercase;
}

.wp-block-list.is-style-pills > li:first-child {
	background: color-mix(in srgb, var(--wp--preset--color--lime) 25%, white);
	color: #4d5200;
}

/* "Divided rows": hairline between list items. */
.wp-block-list.is-style-hairline {
	list-style: none;
	padding: 0;
}

.wp-block-list.is-style-hairline > li {
	border-bottom: 1px solid var(--wp--custom--color--hairline);
	padding: 12px 0;
}

/* Label above each section on the internal "Pattern library" page. */
.ebc-pattern-label {
	background: #1e1e1e;
	color: #fff;
	font-family: ui-monospace, monospace;
	font-size: 12px;
	letter-spacing: 0;
	margin: 40px 0 0 !important;
	padding: 6px 12px;
}

.ebc-pattern-label code {
	color: #9ad;
	margin-left: 8px;
}

/* Sections that reorder columns on phones (photo first) switch the columns to
   a vertical flex direction. Core's mobile `flex-basis: 100%` and wrapping
   would then apply to height and collapse a column, so reset both — only for
   these reversed layouts; normal columns keep core's stacking. */
@media (max-width: 781px) {
	:is(.ebc-split-card__card, .ebc-text-image--reverse .wp-block-columns, .ebc-ministry--reverse .ebc-ministry__card):not(.is-not-stacked-on-mobile) {
		flex-wrap: nowrap !important;
	}

	:is(.ebc-split-card__card, .ebc-text-image--reverse .wp-block-columns, .ebc-ministry--reverse .ebc-ministry__card):not(.is-not-stacked-on-mobile) > .wp-block-column {
		flex-basis: auto !important;
	}
}

/* Breathing room between the header and the first page header (banner). */
:root {
	--ebc-hero-gap: clamp(1rem, 0.6rem + 1.2vw, 1.75rem);
}

.entry-content > .ebc-hero:first-child {
	margin-top: var(--ebc-hero-gap) !important;
}
