/*
 * Kegites Mobile 1.0.0 - phone and tablet layout for kegitesclubofnigeria.com (theme KegitesClubUI / Huza).
 * Everything here sits inside max-width media queries: screens 992px and wider (desktop) are not touched.
 */

/* ===================== phones and tablets (the theme's mobile header range) ===================== */
@media (max-width: 991px) {

	/* 1. Root cause: the theme's style.css has a global rule
	      img { max-width: 90%; width: 75em; padding-left: 50px; margin-left: 30px; }
	      which squeezes the logo (50px of its width is padding), blows small images up past the screen edge
	      and pushes every picture 80px to the right. Images go back to their real size here. */
	html body img {
		width: auto;
		max-width: 100%;
		height: auto;
		padding-left: 0;
		margin-left: 0;
	}

	/* 2. Nothing may widen the page sideways (a wider page makes the phone zoom out and leaves a white strip). */
	#wrapper-container { overflow-x: clip; }

	/* 3. Header: menu button left, logo fills the rest of the bar, bar stays on screen while scrolling. */
	#apus-header-mobile {
		position: -webkit-sticky;
		position: sticky;
		top: 0;
		padding: 6px 0;
		background: #fff;
		box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
	}
	#apus-header-mobile .row {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
	}
	#apus-header-mobile .row::before,
	#apus-header-mobile .row::after { display: none; }
	#apus-header-mobile .row > .col-xs-3 {
		flex: 0 0 auto;
		width: auto;
		padding-right: 0;
	}
	#apus-header-mobile .row > .col-xs-6 {
		flex: 1 1 auto;
		width: auto;
		min-width: 0;
		padding-left: 10px;
	}
	#apus-header-mobile .sidebar-mobile { margin: 0; }
	#apus-header-mobile .btn-offcanvas {
		width: 44px;
		height: 44px;
		padding: 0;
		font-size: 24px;
		line-height: 44px;
		color: #1f6b34;
	}
	#apus-header-mobile .logo {
		text-align: center;
		line-height: 0;
	}
	#apus-header-mobile .logo a { display: inline-block; width: 100%; max-width: 440px; }
	#apus-header-mobile .logo img { width: 100%; }

	/* the dark page overlay behind the open menu must cover the sticky header too */
	.overflow-wrapper-canvas { z-index: 100; }
}

/* logged-in editors: keep the sticky bar below the WordPress admin bar */
@media (min-width: 601px) and (max-width: 782px) { .admin-bar #apus-header-mobile { top: 46px; } }
@media (min-width: 783px) and (max-width: 991px) { .admin-bar #apus-header-mobile { top: 32px; } }

/* ===================== phones ===================== */
@media (max-width: 767px) {

	/* 4. Slider: the arrows sit on top of the title on a phone (swipe still works); hide the loading ring. */
	.ls-wp-container .ls-nav-prev,
	.ls-wp-container .ls-nav-next,
	.ls-wp-container .ls-circle-timer { display: none !important; }

	/* 5. Spacing: WPBakery spacers sized for desktop become large empty bands on a phone. */
	.vc_empty_space { max-height: 30px; }
	/* columns left empty on purpose for desktop spacing take room for nothing on a phone */
	.wpb_column:has(> .vc_column-inner > .wpb_wrapper:empty) { display: none; }

	/* 6. Rows of small (thumbnail) images, e.g. the two palm-wine emblems: side by side, not one per screen. */
	.vc_row:has(> .wpb_column .wpb_single_image img.attachment-thumbnail) {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0 24px;
	}
	.vc_row:has(> .wpb_column .wpb_single_image img.attachment-thumbnail) > .wpb_column { width: auto; flex: 0 0 auto; }
	.vc_row:has(> .wpb_column .wpb_single_image img.attachment-thumbnail)::before,
	.vc_row:has(> .wpb_column .wpb_single_image img.attachment-thumbnail)::after { display: none; }
	.wpb_single_image img.attachment-thumbnail { width: 120px; }
	.vc_row:has(> .wpb_column .wpb_single_image img.attachment-thumbnail) .wpb_content_element { margin-bottom: 0; }
	.vc_row:has(> .wpb_column .wpb_single_image img.attachment-thumbnail) .vc_column-inner { padding-top: 10px; }
	.wpb_single_image.vc_align_left { text-align: center; }

	/* 7. "Make a single or monthly donation" over a busy photo: a dark panel so the text can be read. */
	.widget-action {
		background: rgba(0, 0, 0, .55);
		padding: 20px 18px;
		border-radius: 8px;
	}
	.widget-action .left-content { float: none; width: auto; }
	.widget-action .title { font-size: 24px; line-height: 1.25; }
	.widget-action .description { font-size: 15px; line-height: 1.6; }
	.widget-action .description br { display: none; }
	.widget-action .action { padding: 16px 0 0; text-align: left; overflow: visible; }

	/* 8. "You can bring real hope by" block */
	.widget-bring, .widget-bring > * { display: block; }
	.widget-bring .left-content { width: auto; padding: 0 0 12px; line-height: 1.25; }
	.widget-bring .left-content span[style] { font-size: 26px !important; }
	.widget-bring .right-conetnt { padding-left: 14px; }

	/* 9. Donation banners: less padding, no forced line breaks */
	.widget-banner-donation { padding: 36px 20px; }
	.widget-banner-donation .widget-title { margin-bottom: 16px; }
	.widget-banner-donation .widget-description br { display: none; }
	.widget-banner-donation .widget-price { margin-bottom: 24px; }

	/* 10. Counters (Fundraising / Volunteer / Raised Funds): icon above the number, nothing clipped */
	.counters .counter-wrap { text-align: center; }
	.counters .icon { float: none; padding: 0 0 6px; }
	.counters .right-content { overflow: visible; }
	.counters .counter { font-size: 24px; word-break: break-all; }
	.vc_inner:has(.counters) { display: flex; flex-wrap: wrap; justify-content: center; }
	.vc_inner:has(.counters)::before,
	.vc_inner:has(.counters)::after { display: none; }
	/* the section's curved top edge (a background picture) covered the first counters */
	.vc_column-inner:has(> .wpb_wrapper > .vc_inner .counters) { padding-top: 80px; }

	/* 11. Footer: tighter spacing, the two link lists side by side, slimmer copyright band */
	#apus-footer .vc_column_container > .vc_column-inner { padding-top: 16px; }
	#apus-footer .wpb_content_element { margin-bottom: 16px; }
	#apus-footer .wpb_wrapper:has(> .apus_custom_menu + .apus_custom_menu) {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: 16px;
	}
	#apus-footer .wpb_wrapper:has(> .apus_custom_menu + .apus_custom_menu) > .apus_custom_menu { margin-bottom: 0; }
	#apus-footer .apus-copyright.vc_row { padding-top: 24px !important; padding-bottom: 24px !important; }

	/* 12. Back-to-top button: out of the way of content and thumbs */
	#back-to-top { right: 14px; bottom: 14px; }
}
