@media (max-width: 767.98px) {
	:root {
		--ws-mobile-gutter: 24px;
	}

	/* Override theme page padding on mobile so content spans ~95% of viewport */
	:root {
		--page-padding: 2.5vw !important; /* 2.5vw each side = 95vw content width */
	}
	/* Block theme root spacing variables */
	:root {
		--wp--style--root--padding-left: 2.5vw !important;
		--wp--style--root--padding-right: 2.5vw !important;
	}
	/* Apply fallback padding on common wrappers (block & classic themes) */
	.wp-site-blocks,
	.site,
	.site-content,
	.wrap,
	.container,
	.container-fluid,
	.content-area {
		padding-left: 2.5vw !important;
		padding-right: 2.5vw !important;
		max-width: none !important;
	}

	/* Pictures page grid: vertical rhythm between stack posts */
	.ws-wanders-grid-inner {
		row-gap: 16px !important;
		column-gap: 0 !important; /* single column on mobile */
	}

	/* Gutenberg galleries → single column, consistent spacing */
	.entry-content .wp-block-gallery,
	.entry-content .wp-block-gallery .blocks-gallery-grid,
	.entry-content .wp-block-gallery.has-nested-images {
		display: block !important;
		margin: 0 !important;
		padding: 0;
	}

	.entry-content .wp-block-gallery .blocks-gallery-item,
	.entry-content .wp-block-gallery figure.wp-block-image {
		width: calc(100% - (var(--ws-mobile-gutter) * 2)) !important;
		max-width: none !important;
		margin-left: var(--ws-mobile-gutter) !important;
		margin-right: var(--ws-mobile-gutter) !important;
		margin-top: 0 !important;
		margin-bottom: 24px !important;
		float: none !important;
		clear: both;
		display: block !important;
	}
	.entry-content .wp-block-gallery .blocks-gallery-item:last-child,
	.entry-content .wp-block-gallery figure.wp-block-image:last-child {
		margin-bottom: 0 !important;
	}

	.entry-content .wp-block-gallery .blocks-gallery-item img,
	.entry-content .wp-block-gallery figure.wp-block-image img {
		width: 100% !important;
		height: auto !important;
		display: block;
	}

	/* Legacy [gallery] shortcode */
	.entry-content .gallery {
		margin: 0 !important;
	}

	.entry-content .gallery .gallery-item {
		width: calc(100% - (var(--ws-mobile-gutter) * 2)) !important;
		max-width: none !important;
		margin-left: var(--ws-mobile-gutter) !important;
		margin-right: var(--ws-mobile-gutter) !important;
		margin-top: 0 !important;
		margin-bottom: 24px !important;
		float: none !important;
		display: block !important;
	}
	.entry-content .gallery .gallery-item:last-child {
		margin-bottom: 0 !important;
	}

	.entry-content .gallery .gallery-item img {
		width: 100% !important;
		height: auto !important;
		display: block;
	}

	/* Post article images → single column, consistent spacing */
	.single-post .entry-content figure,
	.single-post .entry-content .wp-block-image,
	.single-post .entry-content img[class*="wp-image"] {
		width: calc(100% - (var(--ws-mobile-gutter) * 2)) !important;
		max-width: none !important;
		margin-left: var(--ws-mobile-gutter) !important;
		margin-right: var(--ws-mobile-gutter) !important;
		margin-top: 0 !important;
		margin-bottom: 24px !important;
		display: block;
	}
	.single-post .entry-content figure:last-child,
	.single-post .entry-content .wp-block-image:last-child,
	.single-post .entry-content img[class*="wp-image"]:last-child {
		margin-bottom: 0 !important;
	}

	.single-post .entry-content img {
		width: 100% !important;
		height: auto !important;
		display: block;
	}

	/* Also apply to regular pages (e.g., Pictures page) */
	.page .entry-content figure,
	.page .entry-content .wp-block-image,
	.page .entry-content .wp-block-gallery .blocks-gallery-item,
	.page .entry-content .gallery .gallery-item,
	.page .entry-content img[class*="wp-image"] {
		width: calc(100% - (var(--ws-mobile-gutter) * 2)) !important;
		max-width: none !important;
		margin-left: var(--ws-mobile-gutter) !important;
		margin-right: var(--ws-mobile-gutter) !important;
		margin-top: 0 !important;
		margin-bottom: 24px !important;
		display: block !important;
		float: none !important;
		clear: both !important;
	}
	.page .entry-content figure:last-child,
	.page .entry-content .wp-block-image:last-child,
	.page .entry-content .wp-block-gallery .blocks-gallery-item:last-child,
	.page .entry-content .gallery .gallery-item:last-child,
	.page .entry-content img[class*="wp-image"]:last-child {
		margin-bottom: 0 !important;
	}

	/* Places page: center location stacks horizontally (do not affect header/nav) */
	.page-places .ws-wanders-grid-inner {
		display: flex !important;
		flex-direction: column !important;
		align-items: center !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}
	.page-places .ws-wander-card {
		width: min(92vw, 560px) !important;
		max-width: 100% !important;
		margin-left: auto !important;
		margin-right: auto !important;
		box-sizing: border-box !important;
	}
}

