/**
 * WehfiGO — Gallery page paint / scroll performance + social icon polish.
 *
 * Uniform card size: force the Envira .envira-lazy padding box to 1:1 and
 * absolutely fill the image. Do not set aspect-ratio on the <a> alone.
 */

body.wehfigo-gallery-perf a.envira-gallery-link.is-wehfigo-loading {
	cursor: wait;
	opacity: 0.72;
}

/* Keep share stack clipped to the photo (short landscape covers). */
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-gallery-item .envira-gallery-item-inner {
	position: relative !important;
	overflow: hidden !important;
	border-radius: 4px;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-gallery-item a.envira-gallery-link {
	position: relative !important;
	display: block !important;
	overflow: hidden !important;
}

/*
 * Same card height: override Envira inline padding-bottom + 3-col relative imgs.
 * Lazy wrapper uses height:0 + padding-bottom; image fills absolutely.
 */
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-gallery-item a.envira-gallery-link .envira-lazy:not(img) {
	position: relative !important;
	display: block !important;
	height: 0 !important;
	padding-bottom: 100% !important; /* 1:1 square covers */
	overflow: hidden !important;
	background: #111 !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-gallery-item a.envira-gallery-link .envira-lazy:not(img) img,
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-gallery-item a.envira-gallery-link img.envira-gallery-image {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	object-position: center !important;
	visibility: visible !important;
	opacity: 1 !important;
	display: block !important;
}

/* Page heading: Listeo headline widget (Gallery) — was white-on-white */
body.wehfigo-gallery-perf .elementor-widget-listeo-headline h3.headline,
body.wehfigo-gallery-perf .elementor-widget-listeo-headline .headline.headline-box,
body.wehfigo-gallery-perf h3.headline.headline-box,
body.wehfigo-gallery-filters-on .elementor-widget-listeo-headline h3.headline,
body.wehfigo-gallery-filters-on h3.headline.headline-box {
	color: #111 !important;
	-webkit-text-fill-color: #111 !important;
	opacity: 1 !important;
	visibility: visible !important;
	display: block !important;
	font-size: clamp(28px, 2.8vw, 40px) !important;
	line-height: 1.2 !important;
	font-weight: 700 !important;
	margin: 0 0 1.15rem !important;
	padding-bottom: 18px !important;
	text-shadow: none !important;
}

body.wehfigo-gallery-perf .elementor-widget-listeo-headline h3.headline.headline-box:after,
body.wehfigo-gallery-perf h3.headline.headline-box:after,
body.wehfigo-gallery-filters-on h3.headline.headline-box:after {
	background: var(--color-brand-red, #d6001c) !important;
	opacity: 1 !important;
}

/* Album titles + breadcrumbs: larger for PC readability (Listeo root ~10px) */
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-album-title,
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-title {
	font-size: 18px !important;
	line-height: 1.35 !important;
	font-weight: 700 !important;
}

body.wehfigo-gallery-perf .envira-breadcrumbs,
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-breadcrumbs {
	font-size: 15px !important;
	line-height: 1.45 !important;
}

body.wehfigo-gallery-perf .envira-breadcrumbs a,
body.wehfigo-gallery-perf .envira-breadcrumbs .breadcrumb_last {
	font-size: inherit !important;
}

/* Desktop: nearly full viewport (Elementor boxed + Listeo .container were ~1100px) */
@media (min-width: 1025px) {
	body.wehfigo-gallery-perf {
		--wehfigo-gallery-content-max: min(1800px, calc(100vw - 32px));
	}

	body.wehfigo-gallery-perf .elementor .e-con-boxed,
	body.wehfigo-gallery-perf .elementor .e-con-boxed.e-parent {
		--container-max-width: var(--wehfigo-gallery-content-max) !important;
	}

	body.wehfigo-gallery-perf .elementor .e-con-boxed > .e-con-inner,
	body.wehfigo-gallery-perf .elementor-section.elementor-section-boxed > .elementor-container,
	body.wehfigo-gallery-perf .elementor-top-section.elementor-section-boxed > .elementor-container {
		max-width: var(--wehfigo-gallery-content-max) !important;
		width: 100% !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}

	/*
	 * Never squeeze the site header/footer. A prior max-width:1210 rule
	 * collapsed #logo to 0px width and wrapped Sign In off the pill.
	 */
	body.wehfigo-gallery-perf #header-container,
	body.wehfigo-gallery-perf #header-container .container,
	body.wehfigo-gallery-perf #header > .container {
		width: 100% !important;
		max-width: none !important;
	}

	body.wehfigo-gallery-perf #footer .container {
		max-width: 1210px !important;
		width: 100% !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}

	body.wehfigo-gallery-perf .envira-gallery-wrap,
	body.wehfigo-gallery-perf .wehfigo-gallery-filters,
	body.wehfigo-gallery-perf .elementor-widget-shortcode,
	body.wehfigo-gallery-perf .elementor-widget-shortcode .elementor-widget-container,
	body.wehfigo-gallery-perf .elementor-widget-shortcode .elementor-shortcode {
		max-width: 100% !important;
		width: 100% !important;
	}

	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-album-public {
		width: 100% !important;
	}
}

/* Belt-and-braces: logo must keep intrinsic size on gallery */
body.wehfigo-gallery-perf #logo,
body.wehfigo-gallery-perf #logo a {
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
}

body.wehfigo-gallery-perf #logo img,
body.wehfigo-gallery-perf #listeo_logo {
	width: auto !important;
	max-width: none !important;
	height: auto !important;
	min-width: 72px !important;
}

body.wehfigo-gallery-perf a.sign-in,
body.wehfigo-gallery-perf .sign-in-button {
	white-space: nowrap !important;
	flex-wrap: nowrap !important;
	overflow: visible !important;
}

/* Restore Envira Social circular icons (plugin CSS is reset by .envira-gallery-wrap *). */
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons,
.envirabox-container .envira-social-buttons {
	z-index: 6 !important;
	text-align: left !important;
	pointer-events: auto !important;
}

/* Keep FB / X / WhatsApp only — hide Pinterest, LinkedIn, Email (desktop + mobile). */
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.pinterest,
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.linkedin,
body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.email,
.envirabox-container .envira-social-buttons div.pinterest,
.envirabox-container .envira-social-buttons div.linkedin,
.envirabox-container .envira-social-buttons div.email {
	display: none !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons.orientation-vertical,
.envirabox-container .envira-social-buttons.orientation-vertical {
	display: block !important;
	float: left !important;
	margin: 5px 0 0 5px !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons.orientation-vertical div.envira-social-network,
.envirabox-container .envira-social-buttons.orientation-vertical div.envira-social-network {
	clear: both !important;
	float: left !important;
	margin: 0 0 6px 0 !important;
	display: block !important;
	width: 22px !important;
	height: 22px !important;
	overflow: visible !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons.orientation-vertical div.envira-social-network:last-of-type,
.envirabox-container .envira-social-buttons.orientation-vertical div.envira-social-network:last-of-type {
	margin: 0 0 6px 0 !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.envira-social-network a.envira-social-button,
.envirabox-container .envira-social-buttons div.envira-social-network a.envira-social-button {
	display: block !important;
	float: left !important;
	width: 22px !important;
	height: 22px !important;
	min-width: 22px !important;
	min-height: 22px !important;
	line-height: 22px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 50% !important;
	color: #fff !important;
	text-indent: -9999px !important;
	overflow: hidden !important;
	font-size: 0 !important;
	text-decoration: none !important;
	box-shadow: none !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.facebook a,
.envirabox-container .envira-social-buttons div.facebook a {
	background: #2d609b url("/wp-content/plugins/envira-social/assets/images/facebook.svg") center no-repeat !important;
	background-size: 14px 14px !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.twitter a,
.envirabox-container .envira-social-buttons div.twitter a {
	background: #000 url("/wp-content/plugins/envira-social/assets/images/x.svg") center no-repeat !important;
	background-size: 14px 14px !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.pinterest a,
.envirabox-container .envira-social-buttons div.pinterest a {
	background: #ca212a url("/wp-content/plugins/envira-social/assets/images/pinterest.svg") center no-repeat !important;
	background-size: 14px 14px !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.linkedin a,
.envirabox-container .envira-social-buttons div.linkedin a {
	background: #0077b5 url("/wp-content/plugins/envira-social/assets/images/linkedin.svg") center no-repeat !important;
	background-size: 14px 14px !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.email a,
.envirabox-container .envira-social-buttons div.email a {
	background: #eb4026 url("/wp-content/plugins/envira-social/assets/images/email.svg") center no-repeat !important;
	background-size: 14px 14px !important;
}

body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.whatsapp a,
.envirabox-container .envira-social-buttons div.whatsapp a {
	background: #25d366 url("/wp-content/plugins/envira-social/assets/images/whatsapp.svg") center no-repeat !important;
	background-size: 14px 14px !important;
}

@media (max-width: 767px) {
	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons.orientation-vertical {
		margin: 4px 0 0 4px !important;
	}

	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons.orientation-vertical div.envira-social-network,
	.envirabox-container .envira-social-buttons.orientation-vertical div.envira-social-network {
		margin: 0 0 5px 0 !important;
		width: 20px !important;
		height: 20px !important;
	}

	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.envira-social-network a.envira-social-button,
	.envirabox-container .envira-social-buttons div.envira-social-network a.envira-social-button {
		width: 20px !important;
		height: 20px !important;
		min-width: 20px !important;
		min-height: 20px !important;
		line-height: 20px !important;
	}

	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.facebook a,
	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.twitter a,
	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.pinterest a,
	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.linkedin a,
	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.email a,
	body.wehfigo-gallery-perf .envira-gallery-wrap .envira-social-buttons div.whatsapp a,
	.envirabox-container .envira-social-buttons div.facebook a,
	.envirabox-container .envira-social-buttons div.twitter a,
	.envirabox-container .envira-social-buttons div.pinterest a,
	.envirabox-container .envira-social-buttons div.linkedin a,
	.envirabox-container .envira-social-buttons div.email a,
	.envirabox-container .envira-social-buttons div.whatsapp a {
		background-size: 12px 12px !important;
	}
}
