/*
 * Responsive fixes for phones and small tablets.
 * Rules sit inside max-width media queries so desktop rendering is untouched,
 * except the table cap below, which fixes an overflow that also exists on desktop.
 */

/* Reserve the home slider's box (838x386, its MetaSlider size) before Nivo initialises: the
   content below used to jump ~450px down when the slider appeared (CLS 0.18 on desktop) */
#metaslider_container_19365 {
	aspect-ratio: 838 / 386;
}

/* Tables pasted with a fixed width attribute (e.g. width="1254") are capped to the column */
.uk-article table[width] {
	width: 100%;
	max-width: 100%;
	height: auto !important;
}

@media (max-width: 767px) {
	/* Wide tables in articles scroll inside their own box instead of widening the page */
	.uk-article table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Media never wider than the column */
	.uk-article img,
	.uk-article video,
	.uk-article embed,
	.uk-article object,
	.uk-article iframe {
		max-width: 100%;
	}
	.uk-article img {
		height: auto;
	}

	/* Video embeds keep their 16:9 shape when shrunk */
	.uk-article iframe[src*="youtube"],
	.uk-article iframe[src*="vimeo"],
	.uk-article iframe[src*="ted.com"] {
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 9;
	}

	/* Contact form: the two fixed 312px columns stack */
	.contact2-column {
		width: auto;
		max-width: 100%;
	}
	.contact_divright,
	.contact_divleft {
		float: none;
		width: 100%;
	}
	.contact2-column input,
	.contact2-column select,
	.contact2-column textarea,
	.wpcf7 input,
	.wpcf7 select,
	.wpcf7 textarea {
		max-width: 100%;
		box-sizing: border-box;
	}

	/* Recent-post titles: two lines with an ellipsis instead of a hard cut mid-word */
	.rpwe-block h3.rpwe-title {
		white-space: normal;
		height: auto;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		line-clamp: 2;
	}

	/* Header drop-down menus open above the fixed "Advertise with us" tab (z-index 99997) */
	#common-bar #nav,
	#common-bar .kpi-navbar ul {
		z-index: 99998;
	}

	/* Long words and URLs wrap instead of overflowing */
	.uk-article {
		overflow-wrap: break-word;
	}
}

@media (max-width: 550px) {
	/* Header bars were clipped by a 460px minimum width */
	#common-bar .content,
	#common-bar .content1 {
		min-width: 0;
		width: 100%;
	}
}
