/**
 * Sustainability Mission - "Explore our forest" map and tree-records slider.
 *
 * Add the CSS class  av-explore-forest-section  to the section's main container in
 * Elementor (Advanced > CSS Classes). Every rule below is scoped to that
 * class, so it only affects that container, on any page. The theme loads this
 * file, with sustainability-mission-forest-map-slider.js, on every page that
 * uses the class (see includes/enqueue.php).
 */

/* ----------------------------------------------------------------------
   Tree records slider: 3 cards per view, hover lift and the arrow link.
   The slider box is any container whose child containers each hold an H4
   heading widget (the tree record cards).
   ---------------------------------------------------------------------- */
.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4):not(:has(> .e-con-inner)),
.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) > .e-con-inner {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px !important;
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4):not([data-avs]) .e-con:nth-child(n+4) {
	display: none !important;
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .e-con {
	min-width: 0;
	width: auto;
	cursor: pointer;
	-webkit-backdrop-filter: blur(30px);
	backdrop-filter: blur(30px);
	transition: border-color .25s, transform .25s, opacity .4s;
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .e-con:hover {
	border-color: rgba(90, 191, 227, .55) !important;
	transform: translateY(-4px);
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .elementor-heading-title {
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .elementor-button {
	padding: 0;
	border: 0;
	background: none !important;
	line-height: 24px;
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .elementor-button-text::after {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 7px;
	vertical-align: -2px;
	background: #8fd0f3;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E") center/contain no-repeat;
	transition: transform .2s;
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .e-con:hover .elementor-button-text::after {
	transform: translate(2px, -2px);
}

/* ----------------------------------------------------------------------
   Button above the map
   ---------------------------------------------------------------------- */
.av-explore-forest-section .elementor-widget-button:has(+ .elementor-widget-html .avf-root) .elementor-button {
	padding: 16px 28px;
	box-shadow: 0 4px 114px rgba(70, 186, 227, .25);
	transition: transform .2s, filter .2s;
}

.av-explore-forest-section .elementor-widget-button:has(+ .elementor-widget-html .avf-root) .elementor-button:hover {
	transform: translateY(-2px);
	filter: brightness(1.08);
}

.av-explore-forest-section .elementor-widget-button:has(+ .elementor-widget-html .avf-root) .elementor-button-text::after {
	content: "";
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-left: 10px;
	vertical-align: -3px;
	background: #fff;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ----------------------------------------------------------------------
   Forest section: background and layout
   ---------------------------------------------------------------------- */
.av-explore-forest-section {
	position: relative;
	overflow: hidden;
}

.av-explore-forest-section::before {
	content: "";
	position: absolute;
	width: 520px;
	height: 520px;
	top: -120px;
	left: -220px;
	border-radius: 50%;
	background: linear-gradient(135deg, #5ABFE3, #3466D6);
	filter: blur(160px);
	opacity: .22;
	pointer-events: none;
	z-index: 0;
}

.av-explore-forest-section .elementor-element {
	position: relative;
	z-index: 1;
}

.av-explore-forest-section .avf-grad {
	background: linear-gradient(90deg, #3466D6 0%, #3989E0 50%, #5ABFE3 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	-webkit-text-fill-color: transparent;
}

.av-explore-forest-section .elementor-widget-html {
	width: 100%;
}

/* ----------------------------------------------------------------------
   District map block: base styles
   ---------------------------------------------------------------------- */
.av-explore-forest-section .avf-root {
	--avf-cyan: #46bae3;
	--avf-cyan-l: #78c7e3;
	--avf-body: rgba(255, 255, 255, .7);
	--avf-mute: rgba(255, 255, 255, .5);
	--avf-line: rgba(255, 255, 255, .15);
	position: relative;
	width: 100%;
	font-family: "Manrope", system-ui, sans-serif;
	color: #fff;
}

.av-explore-forest-section .avf-root * {
	box-sizing: border-box;
}

.av-explore-forest-section .avf-root p {
	margin: 0;
	padding: 0;
}

.av-explore-forest-section .avf-root button {
	font-family: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.av-explore-forest-section .avf-root button:focus-visible {
	outline: 2px solid var(--avf-cyan);
	outline-offset: 3px;
}

/* ----------------------------------------------------------------------
   Layout: controls column and map
   ---------------------------------------------------------------------- */
.av-explore-forest-section .avf-atlas {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	gap: 24px;
}

.av-explore-forest-section .avf-ctrl {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 26px 22px;
	border: 1px solid var(--avf-line);
	border-radius: 30px;
	background: rgba(255, 255, 255, .03);
	-webkit-backdrop-filter: blur(30px);
	backdrop-filter: blur(30px);
}

.av-explore-forest-section .avf-eyebrow {
	font-size: 12px !important;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	line-height: 1.4 !important;
	background: linear-gradient(90deg, #366adf, #46bae3);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	-webkit-text-fill-color: transparent;
	width: max-content;
}

.av-explore-forest-section .avf-status {
	font-size: 15px !important;
	line-height: 1.5 !important;
	color: var(--avf-body) !important;
}

.av-explore-forest-section .avf-dlist {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* ----------------------------------------------------------------------
   District buttons
   ---------------------------------------------------------------------- */
.av-explore-forest-section .avf-root .avf-dist {
	display: grid;
	grid-template-columns: 18px 1fr;
	column-gap: 12px;
	row-gap: 3px;
	align-items: center;
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--avf-line);
	border-radius: 20px;
	background: transparent;
	color: #fff;
	text-align: left;
	cursor: pointer;
	transition: border-color .2s, background-color .2s;
	font-size: inherit;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: 0;
}

.av-explore-forest-section .avf-root .avf-dist:hover {
	border-color: rgba(70, 186, 227, .5);
	background: rgba(255, 255, 255, .04);
}

.av-explore-forest-section .avf-root .avf-dist.on {
	border-color: rgba(70, 186, 227, .75);
	background: rgba(70, 186, 227, .09);
}

.av-explore-forest-section .avf-dist .avf-dot {
	grid-row: 1/3;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid var(--avf-cyan-l);
}

.av-explore-forest-section .avf-dist.on .avf-dot {
	background: linear-gradient(135deg, #78c7e3, #46bae3);
	border-color: #fff;
}

.av-explore-forest-section .avf-dist .avf-dn {
	font-size: 16px;
	font-weight: 600;
}

.av-explore-forest-section .avf-dist .avf-dc {
	font-size: 13px;
	font-weight: 500;
	color: var(--avf-mute);
	font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------------
   "Show both districts" button
   ---------------------------------------------------------------------- */
.av-explore-forest-section .avf-root .avf-both {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 20px;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 999px;
	background: transparent;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color .2s, background-color .2s;
	text-transform: none;
	letter-spacing: 0;
}

.av-explore-forest-section .avf-root .avf-both svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: url(#avfIconGrad);
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.av-explore-forest-section .avf-root .avf-both:hover {
	border-color: rgba(70, 186, 227, .6);
	background: rgba(255, 255, 255, .05);
}

.av-explore-forest-section .avf-root .avf-both[aria-pressed="true"] {
	border-color: rgba(70, 186, 227, .75);
	background: rgba(70, 186, 227, .09);
}

/* ----------------------------------------------------------------------
   Map container, loading state and caption
   ---------------------------------------------------------------------- */
.av-explore-forest-section .avf-mapbox {
	position: relative;
	min-width: 0;
	border: 1px solid var(--avf-line);
	border-radius: 30px;
	overflow: hidden;
	background: #05080d;
	isolation: isolate;
}

.av-explore-forest-section .avf-map {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 460px;
	background: #05080d;
}

.av-explore-forest-section .avf-loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-size: 14px !important;
	color: var(--avf-mute) !important;
	text-align: center;
	padding: 24px;
}

.av-explore-forest-section .avf-loading a {
	color: #fff !important;
	font-weight: 700;
	text-decoration: none;
}

.av-explore-forest-section .avf-caption {
	margin-top: 14px !important;
	font-size: 14px !important;
	line-height: 1.55 !important;
	color: var(--avf-mute) !important;
}

/* ----------------------------------------------------------------------
   Slider: slide visibility and fade
   ---------------------------------------------------------------------- */
.av-explore-forest-section .avf-slide.avf-off {
	display: none !important;
}

.av-explore-forest-section .avf-slide.avf-fade {
	opacity: 0;
}

/* ----------------------------------------------------------------------
   Slider: progress dots and previous / next arrows
   ---------------------------------------------------------------------- */
.av-explore-forest-section .avf-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
}

.av-explore-forest-section .avf-dots {
	display: flex;
	gap: 6px;
}

.av-explore-forest-section .avf-dots i {
	position: relative;
	display: block;
	width: 22px;
	height: 3px;
	border-radius: 3px;
	overflow: hidden;
	background: rgba(255, 255, 255, .14);
}

.av-explore-forest-section .avf-dots i b {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 0;
	background: linear-gradient(90deg, #3466D6, #5ABFE3);
}

.av-explore-forest-section .avf-dots i.on b {
	animation: avfFill 6s linear forwards;
}

.av-explore-forest-section .avf-dots i.done b {
	width: 100%;
}

.av-explore-forest-section .avf-bar.avf-paused .avf-dots i.on b {
	animation-play-state: paused;
}

@keyframes avfFill {
	to {
		width: 100%;
	}
}

.av-explore-forest-section .avf-ctl {
	display: flex;
	gap: 8px;
}

.av-explore-forest-section .avf-ctl button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	min-height: 0;
	padding: 0;
	margin: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .18);
	background: rgba(255, 255, 255, .03);
	color: #fff;
	cursor: pointer;
	transition: border-color .2s;
}

.av-explore-forest-section .avf-ctl button:hover,
.av-explore-forest-section .avf-ctl button:focus-visible {
	border-color: rgba(90, 191, 227, .6);
	background: rgba(255, 255, 255, .03);
}

.av-explore-forest-section .avf-ctl svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: #fff;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ----------------------------------------------------------------------
   Tablet
   ---------------------------------------------------------------------- */
@media (max-width:1024px) {
	.av-explore-forest-section .avf-atlas {
		grid-template-columns: 280px minmax(0, 1fr);
	}

	.av-explore-forest-section .avf-ctrl {
		padding: 24px 18px;
	}

	.av-explore-forest-section .avf-dist .avf-dc {
		font-size: 12px;
		white-space: nowrap;
	}

	.av-explore-forest-section .avf-map {
		min-height: 420px;
	}
}

/* ----------------------------------------------------------------------
   Mobile
   ---------------------------------------------------------------------- */
@media (max-width:767px) {
	.av-explore-forest-section .elementor-widget-button:has(+ .elementor-widget-html .avf-root),
	.av-explore-forest-section .elementor-widget-button:has(+ .elementor-widget-html .avf-root) .elementor-button {
		width: 100%;
		justify-content: center;
	}

	.av-explore-forest-section .avf-atlas {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
	}

	.av-explore-forest-section .avf-ctrl {
		padding: 20px 18px;
		gap: 12px;
		border-radius: 24px;
	}

	.av-explore-forest-section .avf-dlist {
		gap: 8px;
	}

	.av-explore-forest-section .avf-root .avf-dist {
		grid-template-columns: 14px 1fr;
		padding: 11px 14px;
		border-radius: 16px;
	}

	.av-explore-forest-section .avf-dist .avf-dot {
		width: 12px;
		height: 12px;
	}

	.av-explore-forest-section .avf-dist .avf-dn {
		font-size: 15px;
	}

	.av-explore-forest-section .avf-mapbox {
		border-radius: 24px;
	}

	.av-explore-forest-section .avf-map {
		min-height: 340px;
	}

	.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4):not(:has(> .e-con-inner)),
	.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) > .e-con-inner {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px !important;
	}
}

/* ----------------------------------------------------------------------
   Reduced motion
   ---------------------------------------------------------------------- */
@media (prefers-reduced-motion:reduce) {
	.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .e-con {
		transition: none;
	}
}

/* ----------------------------------------------------------------------
   Tree record cards: box look, title and link text
   ---------------------------------------------------------------------- */
.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .e-con {
	background: rgba(255, 255, 255, .03) !important;
	border: 1px solid rgba(255, 255, 255, .15) !important;
	border-radius: 20px !important;
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .elementor-widget {
	margin: 0 !important;
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .elementor-heading-title {
	margin: 0 !important;
	font-family: "Manrope", sans-serif !important;
	font-size: 19px !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: #fff !important;
}

.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .elementor-button,
.av-explore-forest-section .e-con:has(> .e-con > .elementor-widget-heading h4) .elementor-button-text {
	font-family: "Manrope", sans-serif !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: #fff !important;
}

.av-explore-forest-section .e-con:has(> .e-con > .e-con > .elementor-widget-heading h4) > .elementor-widget-heading .elementor-heading-title,
.av-explore-forest-section .elementor-heading-title,
.av-explore-forest-section .elementor-button,
.av-explore-forest-section .elementor-button-text {
	text-transform: none !important;
	letter-spacing: normal;
}

.av-explore-forest-section .e-con:has(> .e-con > .e-con > .elementor-widget-heading h4) > .elementor-widget-text-editor p {
	margin: 0 !important;
}

.av-explore-forest-section .e-con:has(> .e-con > .e-con > .elementor-widget-heading h4) > .elementor-widget {
	margin-bottom: 0 !important;
}

/* ----------------------------------------------------------------------
   Map (Leaflet) and district pins. Moved here from the script, which
   used to inject these at runtime.
   ---------------------------------------------------------------------- */
.avf-root .avf-map.leaflet-container {
	font-family: "Manrope", system-ui, sans-serif !important;
	background: #05080d !important;
	outline: 0;
}

.avf-root .avf-map .leaflet-tile-pane {
	filter: grayscale(1) invert(1) brightness(.82) contrast(1.12);
}

.avf-root .avf-map img {
	max-width: none !important;
	max-height: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.avf-root .avf-map .leaflet-control-attribution {
	background: rgba(0, 0, 0, .6) !important;
	color: rgba(255, 255, 255, .6) !important;
	font-size: 10.5px !important;
	line-height: 1.5 !important;
	padding: 2px 8px !important;
	border-top-left-radius: 8px;
	font-family: inherit !important;
}

.avf-root .avf-map .leaflet-control-attribution a {
	color: #78c7e3 !important;
	text-decoration: none !important;
}

.avf-root .avf-map .leaflet-control-attribution svg {
	display: none !important;
}

.avf-root .avf-map .leaflet-bar {
	border: none !important;
	border-radius: 12px !important;
	overflow: hidden;
	box-shadow: none !important;
}

.avf-root .avf-map .leaflet-control-zoom a {
	width: 34px !important;
	height: 34px !important;
	line-height: 32px !important;
	background: rgba(5, 8, 13, .85) !important;
	color: #fff !important;
	border: 1px solid rgba(255, 255, 255, .15) !important;
	text-decoration: none !important;
	font-family: inherit !important;
}

.avf-root .avf-map .leaflet-control-zoom a:hover {
	background: rgba(255, 255, 255, .12) !important;
}

.avf-root .avf-map .leaflet-top.leaflet-left .leaflet-control {
	margin: 14px 0 0 14px;
}

.avf-pin {
	position: relative;
	width: 22px;
	height: 22px;
	cursor: pointer;
	transition: opacity .25s;
}

.avf-pin::before {
	content: "";
	position: absolute;
	inset: -14px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(70, 186, 227, .45) 0%, rgba(70, 186, 227, 0) 70%);
}

.avf-pin i {
	position: absolute;
	inset: 4px;
	border-radius: 50%;
	background: linear-gradient(135deg, #78c7e3, #46bae3);
	border: 2px solid #fff;
	display: block;
	font-style: normal;
}

.avf-pin::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 1px solid rgba(120, 199, 227, .85);
	animation: avfPulse 2.4s ease-out infinite;
}

@keyframes avfPulse {
	0% {
		transform: scale(.6);
		opacity: 1;
	}
	100% {
		transform: scale(2.2);
		opacity: 0;
	}
}

.avf-pin b {
	position: absolute;
	left: 50%;
	top: 100%;
	margin-top: 6px;
	transform: translateX(-50%);
	white-space: nowrap;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	color: #fff;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .72);
	border: 1px solid rgba(255, 255, 255, .18);
	pointer-events: none;
}

.avf-pin.dim {
	opacity: .45;
}

.avf-pin.on::after {
	animation-duration: 1.4s;
}

@media (prefers-reduced-motion:reduce) {
	.avf-pin::after {
		animation: none;
		opacity: 0;
	}
}
