/**
 * Sofreye — fluid tweaks after Avenue’s responsive.css (enqueued from functions.php).
 * Makes narrow breakpoints use 100% width instead of fixed 300–420px strips.
 */

@media only screen and (max-width: 959px) {
	#wrapper,
	#wrapper-content {
		max-width: 100% !important;
		box-sizing: border-box;
	}

	.topNav {
		max-width: 100% !important;
		box-sizing: border-box;
	}

	/* Single post hero: Avenue responsive.css fixes img width in px — use fluid. */
	#main .post-thumb,
	#main .post-thumb > a,
	#main .post-thumb a.lightbox {
		width: 100% !important;
		max-width: 100% !important;
		display: block;
		box-sizing: border-box;
	}

	#main .post-thumb img {
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
	}

	/* Comment textarea: Avenue responsive uses fixed 276px + small bitmap */
	#respond .textarea-comment {
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		min-height: 140px;
		background-image: none !important;
	}

	/* Header logo: scale to viewport & stay centered (parent overflow+float clips on mobile). */
	#header {
		overflow: visible !important;
	}

	#header-middle {
		overflow: visible !important;
		text-align: center !important;
		display: flex !important;
		flex-direction: column !important;
		align-items: center !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}

	#header #logo {
		float: none !important;
		clear: both !important;
		width: 100% !important;
		max-width: 100% !important;
		margin-left: auto !important;
		margin-right: auto !important;
		padding-left: max(12px, env(safe-area-inset-left, 0px));
		padding-right: max(12px, env(safe-area-inset-right, 0px));
		box-sizing: border-box !important;
		display: flex !important;
		justify-content: center !important;
		align-items: center !important;
		min-width: 0 !important;
	}

	#header #logo a {
		display: flex !important;
		justify-content: center !important;
		align-items: center !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
		min-width: 0 !important;
	}

	#header #logo img {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		margin: 0 auto !important;
		object-fit: contain !important;
		min-width: 0 !important;
	}
}

@media only screen and (max-width: 767px) {
	#wrapper,
	#wrapper-content,
	.topNav,
	#sidebar {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box;
	}

	/* Allow wide bitmap logos to lay out fully (parent overflow:hidden can clip). */
	#wrapper-content {
		overflow-x: visible !important;
	}

	#main {
		width: 100% !important;
		max-width: 100%;
		box-sizing: border-box;
	}

	.block-item-big,
	.block-item-small,
	.block.half,
	.block.archive .block-item-big {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box;
		padding-left: 12px;
		padding-right: 12px;
	}

	.block-item-big img,
	.block-item-small img,
	.block.archive .block-item-big img,
	#main .block-item-big img,
	#main .block-item-small img {
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
	}

	#slider {
		width: 100% !important;
		max-width: 100% !important;
	}

	.tabs_container,
	#sidebar .tabs-wrapper {
		max-width: 100% !important;
		width: 100% !important;
		box-sizing: border-box;
	}
}

.post-entry iframe,
.post-entry embed,
.video-shortcode iframe,
#wrapper-featured iframe {
	max-width: 100%;
}
