/*
 Theme Name:   My Listing Child
 Theme URI:    http://mylisting.27collective.net/my-city/
 Description:  MyListing Child Theme
 Author:       27collective
 Author URI:   https://27collective.net/
 Template:     my-listing
 Version:      1.1
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         one-column, two-columns, three-columns, left-sidebar, right-sidebar, grid-layout, custom-menu, custom-logo, featured-images, footer-widgets, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready
 Text Domain:  my-listing-child
*/

/* Elementor compatibility: avoid oversized images and broken gallery layout. */
body .elementor img {
	max-width: 100%;
	height: auto;
}

body.elementor-page .elementor-gallery__container.ecomuseo-gallery-fallback {
	display: grid !important;
	grid-template-columns: repeat(var(--columns, 2), minmax(0, 1fr)) !important;
	column-gap: var(--hgap, 10px) !important;
	row-gap: var(--vgap, 10px) !important;
}

body.elementor-page .elementor-gallery__container.ecomuseo-gallery-fallback .e-gallery-item {
	display: block !important;
	width: 100% !important;
	height: auto;
	margin: 0 !important;
}

body.elementor-page .elementor-gallery__container.ecomuseo-gallery-fallback .e-gallery-image {
	display: block;
	width: 100%;
	height: 0;
	padding-bottom: 75% !important;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* Apply vertical scroll only to third-level dropdowns (sub-sub menus). */
header .main-nav > li > ul.sub-menu.i-dropdown > li > ul.sub-menu.i-dropdown,
header .i-nav .main-nav > li > ul.sub-menu.i-dropdown > li > ul.sub-menu.i-dropdown {
	max-height: min(70vh, 560px);
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/* Remove bottom white strip by matching the page end background to the footer area. */
html,
body,
body #page,
body .site,
body .site-content {
	margin-bottom: 0 !important;
}

body {
	padding-bottom: 0 !important;
}

html {
	background-color: #016425;
}

body footer.footer,
body .elementor-location-footer,
body [role="contentinfo"] {
	margin-bottom: 0 !important;
}

@media (max-width: 767px) {
	body.elementor-page .elementor-widget-gallery .elementor-gallery__container.ecomuseo-mobile-slider {
		display: flex !important;
		grid-template-columns: none !important;
		flex-wrap: nowrap !important;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		column-gap: 12px !important;
		row-gap: 0 !important;
		padding: 0 4vw 8px;
		margin: 0 -4vw;
		scroll-padding-inline: 4vw;
		scrollbar-width: none;
	}

	body.elementor-page .elementor-widget-gallery .elementor-gallery__container.ecomuseo-mobile-slider::-webkit-scrollbar {
		display: none;
	}

	body.elementor-page .elementor-widget-gallery .elementor-gallery__container.ecomuseo-mobile-slider .e-gallery-item {
		flex: 0 0 86vw !important;
		max-width: 86vw !important;
		scroll-snap-align: center;
		scroll-snap-stop: always;
	}

	body.elementor-page .elementor-widget-gallery .elementor-gallery__container.ecomuseo-mobile-slider .e-gallery-image {
		padding-bottom: 66.6667% !important;
		border-radius: 16px;
		overflow: hidden;
	}

	body.elementor-page .elementor-widget-gallery .elementor-gallery__container.ecomuseo-mobile-slider .elementor-gallery-item__overlay {
		border-radius: 16px;
	}

	body.elementor-page .elementor-widget-gallery .ecomuseo-gallery-thumbs {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 8px 0 2px;
		margin-top: 6px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	body.elementor-page .elementor-widget-gallery .ecomuseo-gallery-thumbs::-webkit-scrollbar {
		display: none;
	}

	body.elementor-page .elementor-widget-gallery .ecomuseo-gallery-thumb {
		-webkit-appearance: none;
		appearance: none;
		border: 2px solid transparent;
		border-radius: 10px;
		background-color: #d9d9d9;
		background-size: cover;
		background-position: center;
		flex: 0 0 62px;
		width: 62px;
		height: 62px;
		padding: 0;
		box-shadow: none;
	}

	body.elementor-page .elementor-widget-gallery .ecomuseo-gallery-thumb.is-active {
		border-color: #016425;
		transform: translateY(-1px);
	}
}

body.dialog-prevent-scroll .gtranslate_wrapper,
body.dialog-prevent-scroll .gt_float_switcher,
body.dialog-prevent-scroll .gt_switcher,
body.dialog-prevent-scroll #google_translate_element,
body.dialog-prevent-scroll [class*="gtranslate"] {
	pointer-events: none !important;
}

/* Hide image captions in all frontend lightboxes. */
body .elementor-lightbox .elementor-slideshow__footer,
body .elementor-lightbox .elementor-slideshow__title,
body .elementor-lightbox .elementor-slideshow__description,
body .pswp__caption {
	display: none !important;
}

/* GTranslate next to logo in header-left (mobile/responsive only). */
.ecomuseo-mobile-header-lang {
	display: none !important;
}

@media screen and (max-width: 1200px) {
	body .c27-main-header .header-left {
		display: flex;
		align-items: center;
	}

	body .c27-main-header .header-left .ecomuseo-mobile-header-lang {
		display: inline-flex !important;
		align-items: center;
		margin-left: 8px;
		order: 15;
	}

	body .c27-main-header .header-left .ecomuseo-mobile-header-lang .gtranslate_wrapper,
	body .c27-main-header .header-left .ecomuseo-mobile-header-lang .gt_float_switcher,
	body .c27-main-header .header-left .ecomuseo-mobile-header-lang .gt_switcher,
	body .c27-main-header .header-left .ecomuseo-mobile-header-lang #google_translate_element {
		display: inline-flex;
		align-items: center;
		margin: 0;
	}
}
