/**
 * CLAADSS performance + responsive (all pages)
 * Images, tables, embeds, menus, labels, content, videos
 */

/* —— Base responsive media —— */
img, video, iframe, embed, object, svg {
	max-width: 100%;
	height: auto;
}
iframe, embed, object {
	max-width: 100%;
}
/* Video/embed aspect boxes */
.entry-content iframe,
.entry-content video,
.wp-block-embed iframe,
.single-video iframe,
.kvp-videos-page iframe {
	max-width: 100% !important;
}
.entry-content table,
.wp-block-table table {
	width: 100% !important;
	max-width: 100% !important;
	display: block;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-collapse: collapse;
}

/* Prevent horizontal scroll from overflow */
html, body {
	overflow-x: hidden;
	max-width: 100%;
}
#page, .site, #content, .site-content {
	max-width: 100%;
	box-sizing: border-box;
}

/* Touch-friendly labels / form controls */
label, .form-label, .kvp-field-label, button, .button, input[type="submit"], .king-submit-button {
	-webkit-tap-highlight-color: rgba(99, 102, 241, 0.15);
}
input, select, textarea, .bpinput, .form-control {
	max-width: 100%;
	box-sizing: border-box;
	font-size: 16px; /* iOS zoom prevention */
}

/* Lazy-friendly images */
img[loading="lazy"] {
	content-visibility: auto;
}

/* Menu wrap on small screens */
@media (max-width: 1100px) {
	.king-head-nav {
		/* mobile drawer used */
	}
	.site-main, .content-area, #primary, .post-page {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	/* Content padding */
	.entry-content, .page-content, .king-submit-video, .kvp-submit-2026 {
		padding-left: 0;
		padding-right: 0;
		word-wrap: break-word;
		overflow-wrap: anywhere;
	}
	/* Buttons full width where cramped */
	.king-submit-button, .kvp-add-cart {
		max-width: 100%;
	}
	/* Cards grids */
	.kvp-package-cards, .kvp-vis-cards, .kvp-how-grid {
		grid-template-columns: 1fr !important;
	}
	@media (min-width: 560px) {
		.kvp-how-grid {
			grid-template-columns: 1fr 1fr !important;
		}
		.kvp-package-cards {
			grid-template-columns: 1fr 1fr !important;
		}
	}
}

/* Reduce layout shift for sticky header */
.site-header.cm-king-header {
	will-change: transform;
}

/* Prefer content-visibility for long article bodies */
@media (min-width: 1101px) {
	body.single .entry-content > * {
		content-visibility: auto;
		contain-intrinsic-size: auto 240px;
	}
	/* Don't apply to first screen content */
	body.single .entry-content > *:nth-child(-n+4) {
		content-visibility: visible;
	}
}

/* Print: hide chrome for readability */
@media print {
	.site-header, .claadss-float-ad, .king-header-right, #secondary, .post-nav {
		display: none !important;
	}
}
