/*
 * restore-responsive.css
 * ------------------------------------------------------------------
 * Loaded last, so it wins over the archived stylesheets.
 * Only contains fixes for things that actually broke in the restore -
 * the original Elementor breakpoints are left alone.
 */

/* Never let a stray wide element cause sideways scrolling on a phone. */
html,
body {
	max-width: 100%;
	overflow-x: hidden;
}

/* Media is fluid regardless of the width/height attributes WordPress emitted. */
img,
video,
iframe,
embed,
object {
	max-width: 100%;
	height: auto;
}

/* Gutenberg figures carry the original pixel width, which overflows on phones
   even though the <img> inside is fluid. */
figure,
.wp-block-image,
.wp-block-image img,
.wp-block-gallery,
.wp-caption {
	max-width: 100% !important;
	height: auto;
}

/* Elementor sets explicit pixel widths on some columns; let them wrap. */
.elementor-section.elementor-section-boxed > .elementor-container {
	max-width: 100%;
}

@media (max-width: 1024px) {
	/* Columns that were side-by-side stack rather than squeeze. */
	.elementor-section .elementor-container {
		flex-wrap: wrap;
	}
}

@media (max-width: 767px) {
	/* Long unbroken words (URLs in post bodies) must not widen the page. */
	body,
	p,
	li,
	h1, h2, h3, h4, h5, h6 {
		overflow-wrap: break-word;
		word-wrap: break-word;
	}

	/* Tables are the classic overflow culprit - give them their own scroller. */
	table {
		display: block;
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Give the burger a comfortable tap target (Elementor default is tight). */
	.elementor-menu-toggle {
		min-width: 44px;
		min-height: 44px;
	}

	/* The Premium Addons dual-header renders the post date at a decorative 92px.
	   Its phone-size override lived in one of the per-template stylesheets that
	   was never archived, so restore an equivalent here. */
	.premium-dual-header-first-span,
	.premium-dual-header-second-span {
		font-size: clamp(1.75rem, 12vw, 5.75rem) !important;
		line-height: 1.1;
	}

	.premium-dual-header-first-head,
	.premium-dual-header-second-head,
	.premium-dual-header-container {
		max-width: 100%;
		overflow-wrap: break-word;
	}
}

/* Placeholders for photos the archive never captured. They keep the original
   URL in data-archived-src, so restoring wp-content/uploads later is a
   find-and-replace away. */
img.restore-missing {
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	background: #efece5;
}

/* The dropdown animates from scaleY(0); make sure it is actually reachable
   once our compat script adds .elementor-active. */
.elementor-nav-menu--toggle .elementor-menu-toggle.elementor-active + .elementor-nav-menu__container {
	transform: scaleY(1);
	max-height: 100vh;
	overflow: auto;
}
