/* TMC Mobile Fixes v4 (2026-11-21, Air agent; footer fix approved by Terry). Loaded by mu-plugin tmc-mobile-fixes.php.
   Versioned filenames ensure changed CSS is fetched even when the site strips ?ver=. */

/* 1. Wide tables (Resources pages: up to 1,724px, nowrap) — wrap text and scroll inside their own box on phones/tablets */
@media (max-width: 767px) {
	.elementor-widget-text-editor table,
	.elementor-widget-theme-post-content table,
	.entry-content table {
		display: block !important;
		max-width: 100% !important;
		width: 100% !important;
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
	}
	.elementor-widget-text-editor table th,
	.elementor-widget-text-editor table td,
	.elementor-widget-theme-post-content table th,
	.elementor-widget-theme-post-content table td,
	.entry-content table th,
	.entry-content table td {
		white-space: normal !important;
		min-width: 140px;
		word-break: normal;
		overflow-wrap: anywhere;
	}
}

/* 2. CookieYes consent box: 394px box on a 390px phone shifted the page sideways */
@media (max-width: 480px) {
	.cky-consent-container.cky-box-bottom-right,
	.cky-consent-container.cky-box-bottom-left {
		left: 8px !important;
		right: 8px !important;
		width: auto !important;
		max-width: calc(100vw - 16px) !important;
		box-sizing: border-box !important;
	}
}

/* 3. Older iOS Safari (< 16) doesn't support overflow: clip → fall back so pages can't slide sideways */
@supports not (overflow: clip) {
	html, body { overflow-x: hidden; }
}

/* 4. Safety net: very long words in headings (e.g. "INTERNATIONALLY" at 40px on /watch/) must wrap, not overflow */
@media (max-width: 767px) {
	.elementor-heading-title {
		overflow-wrap: break-word;
		hyphens: auto;
	}
}

/* 5. (v3, 2026-11-17, Air agent, approved by Terry) Accessibility button (ea11y-widget, z-index 2147483645) sat on top of the CookieYes "Reject All" button on phones. Keep the consent box above it on phones so the buttons are tappable. Accessibility button returns once the box is answered. */
@media (max-width: 767px) {
	.cky-consent-container {
		z-index: 2147483646 !important;
	}
}

/* 6. Newsletter form layout. Elementor Kit 22844's auto-width submit/Turnstile group collapsed the email field and overflowed its footer column. Stack the email, Turnstile, and submit controls from 481px up; keep the phone layout at 480px and below. */
@media (min-width: 481px) {
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-form-fields-wrapper {
		flex-direction: column !important;
		align-items: stretch !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-group-email {
		flex: 0 1 auto !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-group-email .elementor-field {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-type-submit {
		flex: 0 1 auto !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-type-submit .cf-turnstile {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-type-submit .elementor-button {
		flex: 0 1 100% !important;
		min-width: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
}

/* At tablet widths, the four-column footer gives the newsletter/Turnstile too little room. Move its existing inner column to a full row. */
@media (min-width: 768px) and (max-width: 1024px) {
	.elementor-kit-22844 .elementor-element-1e2661ff {
		flex: 0 0 100% !important;
		width: 100% !important;
		max-width: 100% !important;
	}
}
