/**
 * Mobile layout repair, Velocity 3.1.1.
 * Explicit component rules, not a global height reset or overflow-hiding patch.
 * Keep text, data, consent controls, real media and desktop grids intact.
 */
:root {
	--esv-header-offset: var(--esv-header-height);
	--esv-admin-offset: var(--esv-admin-height);
}
.esv-mobile-nav-tools { display: none; }

/* Short resource cards must not inherit the full journey card's fixed floor.
   Flow-based links also remain safe when titles wrap or text size increases. */
.esv-mobile-layout .esv-growth-home .esv-hp29-journey-card {
	display: flex;
	flex-direction: column;
	min-height: 0;
	height: auto;
}
.esv-mobile-layout .esv-growth-home .esv-hp29-journey-card > a {
	position: static;
	margin-top: auto;
	padding-top: .5rem;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}
.esv-mobile-layout .esv-growth-home .esv-hp29-journey-card > p {
	margin-bottom: .75rem;
}

@media screen and (max-width: 1399px) {
	.esv-mobile-layout .esv-primary-navigation {
		top: var(--esv-nav-top, calc(var(--esv-header-height) + var(--esv-admin-height)));
		overscroll-behavior-y: contain;
		padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
	}
	.esv-mobile-layout .esv-mobile-nav-tools {
		display: grid;
		gap: .25rem;
		width: min(760px, 100%);
		margin: 1rem auto 0;
		padding-top: .5rem;
		border-top: 1px solid var(--esv-slate-200);
	}
	.esv-mobile-layout .esv-mobile-nav-tools__about { display: none; }
	.esv-mobile-layout .esv-nav-toggle:focus-visible,
	.esv-mobile-layout .esv-primary-navigation :focus-visible {
		outline: 3px solid var(--esv-blue-600);
		outline-offset: 3px;
	}
}

@media screen and (max-width: 767px) {
	:root {
		--esv-shell: min(1240px, calc(100% - 32px));
		--esv-article: min(800px, calc(100% - 32px));
		--esv-header-height: 68px;
	}
	/* One compact row; the existing utility link moves into the mobile menu. */
	.esv-mobile-layout .esv-utility-bar { display: none; }
	.esv-mobile-layout .esv-site-header {
		top: var(--esv-admin-visible-height, var(--esv-admin-height));
	}
	.esv-mobile-layout .esv-primary-header__inner {
		min-height: 68px;
		padding-block: 8px;
		gap: 12px;
	}
	.esv-mobile-layout .esv-brand { display: inline-flex; align-items: center; min-height: 44px; }
	.esv-mobile-layout .esv-brand__logo {
		width: min(208px, 52vw);
		height: auto;
		max-width: 100%;
	}
	.esv-mobile-layout .esv-nav-toggle {
		width: auto;
		min-width: 44px;
		min-height: 44px;
		padding: 10px;
		gap: 7px;
		font-size: .8125rem;
		line-height: 1.2;
	}
	.esv-mobile-layout .esv-nav-toggle__label { display: inline; }
	.esv-mobile-layout .esv-nav-toggle__bars { width: 20px; }
	.esv-mobile-layout .esv-primary-navigation { padding-inline: 16px; }
	.esv-mobile-layout .esv-mobile-nav-tools__about { display: flex; }
	.esv-mobile-layout .esv-primary-navigation a { overflow-wrap: anywhere; }

	/* Section spacing: independent from desktop's 64-128px padding floors. */
	.esv-mobile-layout :is(
		.esv-section, .esv-hp29-section, .esv-growth-home, .esv-home-cta,
		.esv-hp29-final, .esv-content-shell, .esv-archive-content, .esv-home-section,
		.esv-article-related, .esv-contact-layout, .esv-faq-content,
		.esv-title-strip, .esv-industry-article,
		.esv-standard-guide__body, .esv-standard-guide__related,
		.esv-standard-guide__next-step, .esv-about-v3__section,
		.esv-about-v3__audience, .esv-about-v3__independence, .esv-about-v3__contact,
		.esv-cg29-section, .esv-cg29-final, .esv-ih31-section, .esv-ih31-final,
		.esv-partner-intent, .esv-partner-section, .esv-partner-governance,
		.esv-partner-application, .esv-partner-final
	) { padding-block: 28px; }
	.esv-mobile-layout :is(
		.esv-hp29-hero, .esv-home-hero, .esv-native-hero, .esv-page-hero,
		.esv-article-header, .esv-industry-hero, .esv-standard-guide__hero,
		.esv-about-v3__hero, .esv-cg29-hero, .esv-ih31-hero,
		.esv-top29-hero, .esv-partner-hero, .esv-application-title-bridge
	) { padding-block: 28px; min-height: 0; }
	.esv-mobile-layout .esv-top29-jump__inner { margin-inline: auto; padding-inline: 0; }
	.esv-mobile-layout .esv-top29-directory .estop-section { padding-block: 28px; }
	.esv-mobile-layout :is(
		.esv-hp29-promotion, .esv-cg29-promotion, .esv-cg29-catalogue,
		.esv-ih31-promotion, .esv-ih31-support, .esv-article-promotion,
		.esv-guide-promotion, .esv-industry-promotion, .esv-top29-promotion
	) { padding-block: 16px 24px; }
	.esv-mobile-layout :is(
		.esv-hp29-heading, .esv-split-heading, .esv-cg29-heading,
		.esv-ih31-section-head, .esv-partner-section__heading,
		.esv-about-v3__section-heading, .esv-faq-content__heading
	) { margin-bottom: 20px; gap: 12px; }
	.esv-mobile-layout :is(
		.esv-hp29-hero__layout, .esv-hp29-experts, .esv-hp29-faq-layout,
		.esv-hp29-final__inner, .esv-industry-hero__grid, .esv-industry-layout,
		.esv-standard-guide__hero-grid, .esv-standard-guide__layout,
		.esv-standard-guide__next-step-inner, .esv-about-v3__hero-grid,
		.esv-about-v3__mission-grid, .esv-about-v3__audience-grid,
		.esv-about-v3__independence-grid, .esv-about-v3__transparency-grid,
		.esv-about-v3__contact-inner, .esv-cg29-hero__layout,
		.esv-cg29-catalogue__panel, .esv-cg29-support, .esv-cg29-faq-layout,
		.esv-cg29-final__inner, .esv-ih31-hero__layout, .esv-ih31-method-layout,
		.esv-ih31-support__panel, .esv-ih31-faq-layout, .esv-ih31-final__inner,
		.esv-top29-hero__grid, .esv-partner-hero__layout,
		.esv-partner-intent__grid, .esv-partner-governance__layout,
		.esv-partner-application__heading, .esv-partner-faq-layout,
		.esv-partner-final__inner, .esv-partner-profile-explainer,
		.esv-contact-layout
	) { grid-template-columns: minmax(0, 1fr); gap: 24px; }

	/* Make cards content-sized; do not reduce embedded tools/media heights. */
	.esv-mobile-layout :is(
		.esv-hp29-journey-card, .esv-hp29-compliance-card,
		.esv-hp29-industry-card, .esv-hp29-standard-card,
		.esv-about-v3__service-card, .esv-ih31-industry-card,
		.esv-cg29-route-grid > a, .esv-cg29-core-grid > a,
		.esv-cg29-guide-card, .esv-partner-model-card, .estop-card
	) { min-height: 0; height: auto; }
	.esv-mobile-layout :is(
		.esv-hp29-journey-card, .esv-hp29-compliance-card,
		.esv-about-v3__service-card, .esv-cg29-route-grid > a,
		.esv-cg29-core-grid > a, .esv-cg29-guide-card,
		.esv-partner-model-card, .esv-partner-offer-card
	) { padding: 20px; border-radius: 16px; }
	.esv-mobile-layout .esv-hp29-journey-card > a {
		position: static;
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		margin-top: 8px;
		padding-block: 8px;
	}
	.esv-mobile-layout .esv-hp29-journey-card ul { padding-bottom: 0; margin-top: 16px; }
	.esv-mobile-layout .esv-hp29-journey-card__number { margin-bottom: 16px; }
	.esv-mobile-layout .esv-hp29-trust__grid > div { min-height: 0; padding-block: 16px; }
	.esv-mobile-layout .esv-hp29-trust__grid > div > span { top: 18px; }
	.esv-mobile-layout .esv-hp29-compliance-card > div { margin-top: 16px; }
	.esv-mobile-layout .esv-hp29-journey-grid { gap: 14px; }
	.esv-mobile-layout :is(.esv-hp29-experts, .esv-cg29-support, .esv-cg29-catalogue__panel, .esv-ih31-support__panel) { padding: 20px; }

	/* Native headlines fit a phone without making body text or controls tiny. */
	.esv-mobile-layout :is(
		.esv-hp29-hero, .esv-native-hero, .esv-page-hero, .esv-title-strip,
		.esv-article-header, .esv-industry-hero, .esv-standard-guide__hero,
		.esv-about-v3__hero, .esv-cg29-hero, .esv-ih31-hero,
		.esv-top29-hero, .esv-partner-hero
	) h1 { font-size: clamp(2rem, 8.4vw, 2.65rem); line-height: 1.12; overflow-wrap: anywhere; }
	.esv-mobile-layout :is(
		.esv-hp29-heading, .esv-cg29-heading, .esv-ih31-section-head,
		.esv-about-v3__section-heading, .esv-partner-section__heading,
		.esv-hp29-final, .esv-cg29-final, .esv-ih31-final
	) h2 { font-size: clamp(1.625rem, 7vw, 2.15rem); line-height: 1.16; }
	.esv-mobile-layout :is(.esv-shell, .esv-content-shell, .esv-article-shell,
		.esv-prose, .esv-standard-guide__prose, .esv-industry-content,
		.esv-contact-form-card, .esp-working-tool, .esp-reader-tools) { min-width: 0; }
	.esv-mobile-layout :is(.esv-prose, .esv-standard-guide__prose, .esv-industry-content) :is(p, li, a, h2, h3) { overflow-wrap: anywhere; }
	.esv-mobile-layout :is(.esv-prose, .esv-standard-guide__prose, .esv-industry-content) .wp-block-spacer { max-height: 24px; margin-block: 0; }
	.esv-mobile-layout .esv-builder-output .elementor-spacer-inner { max-height: 32px; }
	.esv-mobile-layout :is(.esv-contact-form-card, .esv-contact-sidebar > section) { padding: 16px; }
	.esv-mobile-layout :is(.esp-working-tool, .esp-reader-tools, .esp-topic-card) { margin-block: 20px; }
	.esv-mobile-layout :is(.esv-contact-form-wrap, .esv-fallback-contact-form, .esp-working-tool) :is(input:not([type=checkbox]):not([type=radio]), textarea, select) { font-size: 16px; }

	.esv-mobile-layout .esv-page-article { padding-block: 0; }
	.esv-mobile-layout .esv-article-body { padding-bottom: 28px; }
	.esv-mobile-layout .esv-article-footer { padding-top: 20px; margin-top: 24px; }
	.esv-mobile-layout .esv-faq-disclaimer { margin-bottom: 28px; padding: 20px; }
	.esv-mobile-layout .esv-site-footer { padding-top: 0; }
	.esv-mobile-layout .esv-footer-grid { gap: 24px; padding-block: 28px 24px; }
	.esv-mobile-layout .esv-footer-disclaimer { margin-top: 0; padding-block: 20px; }
	.esv-mobile-layout .esv-footer-bottom__inner { padding-block: 16px; gap: 12px; }
}


/* Companion-plugin public pages use their own classes, not the theme's article
   layout. Change spacing only; their forms, payment state and privacy UI remain
   owned by the plugin. No iframe or form-step heights are reset. */
@media screen and (max-width: 767px) {
	.esv-mobile-layout :is(.espc-hero, .espc-section, .espc-final-cta,
		.espc-policy-hero, .espc-policy-section, .espc-directory-hero,
		.espc-directory-categories, .espc-directory-results, .espc-directory-how,
		.espc-directory-cta, .espc-directory-disclosure, .espc-profile-hero,
		.espc-profile-layout, .espc-profile-related, .espc-profile-directory-cta) {
		padding-block: 28px;
	}
	.esv-mobile-layout :is(.espc-hero__grid, .espc-section-heading--split,
		.espc-profile-explainer, .espc-directory-hero__grid,
		.espc-profile-hero__grid, .espc-profile-layout, .espc-final-cta__inner) {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}
	.esv-mobile-layout :is(.espc-hero, .espc-directory-hero, .espc-profile-hero,
		.espc-policy-hero) h1 {
		font-size: clamp(2rem, 8.4vw, 2.65rem);
		line-height: 1.12;
		overflow-wrap: anywhere;
	}
	.esv-mobile-layout :is(.espc-profile-section, .espc-profile-explainer,
		.espc-directory-hero__panel, .espc-directory-cta__panel,
		.espc-directory-steps article, .espc-hero__panel) { padding: 20px; }
	.esv-mobile-layout .espc-profile-breadcrumbs { padding-block: 14px; }
	.esv-mobile-layout :is(.espc-profile-layout, .espc-directory-search,
		.espc-profile-main, .espc-profile-sidebar, .espc-shell) { min-width: 0; }
	.esv-mobile-layout :is(.espc-directory-search, .espc-form) :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { font-size: 16px; }

	/* Known application shells have independent styles and content. Compact
	   only their outer introductions; do not change interactive finder grids. */
	.esv-mobile-layout .esv-application-output :is(.es-hero, .eslab-hero,
		.es-ceg-hero, .es-hen-hero, .es-cen-hero, .es-cel-hero, .es-mdrc-hero) {
		padding-block: 28px;
	}
	.esv-mobile-layout .esv-rich-page-output .esv-rich-fallback { padding-block: 28px; }
	.esv-mobile-layout .esv-legal-output .es-privacy-page { padding-bottom: 28px; }
}

@media screen and (max-width: 359px) {
	.esv-mobile-layout .esv-nav-toggle__label { display: none; }
}

/* Progressive table enhancement. The original table and caption are preserved. */
.esv-mobile-table-scroll {
	max-width: 100%;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	margin-block: 1.25rem;
}
.esv-mobile-table-scroll:focus-visible { outline: 3px solid var(--esv-blue-600); outline-offset: 3px; }
.esv-mobile-table-scroll > table { display: table; margin-block: 0; }
@media print {
	.esv-mobile-table-scroll { overflow: visible; }
}

/* Short landscape viewports need usable navigation space, too. */
@media screen and (min-width: 768px) and (max-width: 1399px) and (max-height: 500px) {
	.esv-mobile-layout .esv-utility-bar { display: none; }
	.esv-mobile-layout .esv-primary-header__inner { min-height: 68px; padding-block: 8px; }
	.esv-mobile-layout .esv-brand__logo { width: 200px; height: auto; }
	.esv-mobile-layout .esv-nav-toggle { min-height: 44px; padding-block: 10px; }
	.esv-mobile-layout .esv-mobile-nav-tools__about { display: flex; }
}
