/* ==========================================================================
   GF Locations widget
   ========================================================================== */

/* Navy background + photo at low opacity (Figma: 14%) */
.gf-locations {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background-color: var(--gf-navy);
	color: var(--gf-white);
}

.gf-locations::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: var(--gf-loc-bg, none);
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center center;
	opacity: 0.07;
	pointer-events: none;
}

@media (min-width: 1200px) {
	.gf-locations::before {
		background-size: 100% auto;
		background-position: center 48.3%;
	}
}

/* Content follows Elementor Site Settings → Layout width */
.gf-locations__inner {
	max-width: calc(var(--gf-site-width) + var(--gf-site-pad-l) + var(--gf-site-pad-r));
	margin: 0 auto;
	padding: 0 var(--gf-site-pad-r) 0 var(--gf-site-pad-l);
}

/* Header */
.gf-locations__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
	max-width: 780px;
	margin: 0 auto 50px;
}

.gf-locations__title {
	margin: 0;
	font-family: var(--gf-font-alt);
	font-size: var(--gf-h2);
	font-weight: 600;
	line-height: 1.16;
	letter-spacing: -.02em;
	color: var(--gf-white);
}

.gf-locations__subtitle {
	max-width: 1472px;
	margin: 0;
	font-family: var(--gf-font-body);
	font-size: var(--gf-body);
	line-height: var(--gf-body-lh);
	letter-spacing: -.02em;
	color: #e2e2e2;
}

.gf-locations__empty {
	padding: 40px;
	border: 1px dashed rgba(255, 255, 255, .4);
	text-align: center;
}

/* Cards */
.gf-locations__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.gf-location-card {
	position: relative;
	isolation: isolate;
	aspect-ratio: 873 / 477; /* minimum shape — grows if the list is taller */
	background-color: rgba(43, 38, 104, .5);
	border: 1px solid #5348b5;
	border-radius: 13px;
	container-type: inline-size;
}

/* Glows are clipped here so the card itself can grow with its content */
.gf-location-card__fx {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	border-radius: inherit;
	pointer-events: none;
}

.gf-location-card__glow.gf-location-card__glow {
	position: absolute;
	width: 115.49%;
	max-width: none;
	height: auto;
	pointer-events: none;
}

.gf-location-card__glow--top {
	top: -39.2%;
	left: -15.58%;
}

.gf-location-card__glow--bottom {
	top: 107.4%;
	left: 68.26%;
	transform: translate(-50%, -50%) rotate(-17.36deg);
}

.gf-location-card__map.gf-location-card__map {
	position: absolute;
	top: .42%;
	right: .11%;
	z-index: 0;
	width: auto;
	max-width: 75%;
	height: 99.37%;
	object-fit: contain;
	object-position: right center;
	border-radius: 2.86cqw;
	mix-blend-mode: lighten;
}

.gf-location-card__content {
	position: relative;
	z-index: 1;
	padding: 4.03cqw 3.75cqw;
}

.gf-location-card__title {
	margin: 0 0 min(36px, 4.15cqw);
	font-family: var(--gf-font-alt);
	padding-left: .45cqw;
	font-size: min(36px, 4.09cqw);
	font-weight: 600;
	line-height: 1.16;
	letter-spacing: -.04em;
	color: var(--gf-white);
}

.gf-location-card__list {
	display: flex;
	flex-direction: column;
	gap: 21px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gf-location-card__item {
	display: flex;
	align-items: center;
	gap: 15px;
	min-height: 30px;
	font-family: var(--gf-font-alt);
	font-size: min(24px, 2.73cqw);
	font-weight: 500;
	line-height: 1.16;
	letter-spacing: -.02em;
	color: var(--gf-white);
	text-decoration: none;
	transition: color .2s ease;
}

a.gf-location-card__item:hover,
a.gf-location-card__item:focus {
	color: var(--gf-gold);
}

.gf-location-card__pin {
	flex-shrink: 0;
	width: 24px;
	height: 24px;
}

/* Responsive */
@media (max-width: 1440px) {
	.gf-location-card__list {
		gap: 16px;
	}
}

@media (max-width: 1024px) {
	.gf-location-card__title {
		font-size: min(32px, 4.12cqw);
	}

	.gf-location-card__item {
		font-size: min(22px, 2.75cqw);
	}
}

@media (max-width: 767px) {
	.gf-locations__head {
		margin-bottom: 36px;
	}

	.gf-locations__grid {
		gap: 20px;
	}

	/* Stack: list, then map */
	.gf-location-card {
		display: flex;
		flex-direction: column;
		aspect-ratio: auto;
	}

	.gf-location-card__content {
		order: 1;
		padding: 24px 20px 8px;
	}

	.gf-location-card__map.gf-location-card__map {
		position: relative;
		top: auto;
		right: auto;
		order: 2;
		width: 100%;
		max-width: 100%;
		height: auto;
		border-radius: 0 0 13px 13px;
	}

	.gf-location-card__title {
		margin-bottom: 18px;
		font-size: 28px;
	}

	.gf-location-card__item {
		gap: 12px;
		min-height: 0;
		font-size: 18px;
	}

	.gf-location-card__pin {
		width: 20px;
		height: 20px;
	}
}

/* ==========================================================================
   Tabs + map layout
   ========================================================================== */
.gf-locmap {
	display: grid;
	grid-template-columns: minmax(260px, var(--gf-locmap-side, 50%)) minmax(0, 1fr);
	gap: 24px;
	align-items: stretch;
	width: 100%;
	margin: 0 auto;
}

.gf-locmap__main {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	min-width: 0;
}

/* Side list of the selected province's locations */
.gf-locmap__side {
	display: flex;
	min-width: 0;
	padding: 24px;
	overflow: hidden;
	background: linear-gradient(160deg, rgb(255 255 255 / 12%) 0%, rgb(255 255 255 / 4%) 100%);
	border: 1px solid rgb(255 255 255 / 16%);
	border-radius: 16px;
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	/* Match the map column's height; long lists scroll inside */
	height: 0;
	min-height: 100%;
}

.gf-locmap__list {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 18px;
	min-height: 0;
	animation: gf-locmap-in .45s ease both;
}

.gf-locmap__list[hidden] {
	display: none;
}

@keyframes gf-locmap-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

.gf-locmap__side-head {
	display: grid;
	gap: 4px;
	padding-bottom: 16px;
	border-bottom: 1px dashed rgb(255 255 255 / 20%);
}

.gf-locmap__side-label {
	font-family: var(--gf-font-body);
	font-size: 12px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--gf-gold);
}

.gf-locmap__side-title {
	margin: 0;
	font-family: var(--gf-font-alt);
	font-size: 28px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -.02em;
	color: var(--gf-white);
}

.gf-locmap__count {
	font-family: var(--gf-font-body);
	font-size: 13px;
	color: rgb(255 255 255 / 70%);
}

.gf-locmap__items {
	display: grid;
	/* As many columns as fit, so the whole list shows without scrolling */
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	align-content: start;
	gap: 4px 8px;
	margin: 0 -10px;
	padding: 0;
	overflow-y: auto;
	list-style: none;
	scrollbar-width: thin;
	scrollbar-color: rgb(255 255 255 / 30%) transparent;
}

.gf-locmap .gf-locmap__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border-radius: 10px;
	font-family: var(--gf-font-alt);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--gf-white);
	text-decoration: none;
	transition: background-color .25s ease;
}

.gf-locmap .gf-locmap__item:hover,
.gf-locmap .gf-locmap__item:focus-visible {
	background-color: rgb(255 255 255 / 10%);
	color: var(--gf-white);
	outline: none;
}

.gf-locmap__item-pin {
	display: grid;
	flex-shrink: 0;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgb(226 43 43 / 18%);
	color: #ff6b6b;
	transition: background-color .25s ease, color .25s ease;
}

.gf-locmap__item:hover .gf-locmap__item-pin,
.gf-locmap__item:focus-visible .gf-locmap__item-pin {
	background: var(--gf-red);
	color: var(--gf-white);
}

.gf-locmap__item-name {
	flex: 1;
	min-width: 0;
}

.gf-locmap__item-go {
	flex-shrink: 0;
	color: var(--gf-gold);
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity .25s ease, transform .25s ease;
}

.gf-locmap__item:hover .gf-locmap__item-go,
.gf-locmap__item:focus-visible .gf-locmap__item-go {
	opacity: 1;
	transform: none;
}

/* Pin highlighted from the side list */
.gf-locmap__marker.is-hot .gf-locmap__pin {
	transform: translateY(-4px) scale(1.18);
}

/* Tighter header spacing when the map layout is used */
.gf-locations:has(.gf-locmap) .gf-locations__head {
	margin-bottom: 32px;
}

.gf-locmap__tabs[hidden] {
	display: none;
}

/* Tabs: white pill, the navy "thumb" slides under the active tab like a switch */
.gf-locmap__tabs {
	position: relative;
	display: inline-flex;
	gap: 4px;
	max-width: 100%;
	padding: 6px;
	overflow-x: auto;
	background-color: var(--gf-white);
	border-radius: 999px;
	box-shadow: 0 10px 30px rgb(5 2 47 / 25%);
	scrollbar-width: none;
}

.gf-locmap__thumb {
	position: absolute;
	top: 6px;
	bottom: 6px;
	left: 0;
	z-index: 0;
	width: 0;
	background-color: var(--gf-navy);
	border-radius: 999px;
	box-shadow: 0 6px 16px rgb(43 38 104 / 35%);
}

.gf-locmap.is-ready .gf-locmap__thumb {
	transition: transform .45s cubic-bezier(.65, 0, .35, 1), width .45s cubic-bezier(.65, 0, .35, 1);
}

.gf-locmap .gf-locmap__tab,
.gf-locmap .gf-locmap__tab:hover,
.gf-locmap .gf-locmap__tab:focus {
	position: relative;
	z-index: 1;
	min-height: 48px;
	margin: 0;
	padding: 0 28px;
	background: transparent;
	border: 0;
	border-radius: 999px;
	box-shadow: none;
	font-family: var(--gf-font-alt);
	font-size: 18px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -.02em;
	text-transform: none;
	white-space: nowrap;
	color: var(--gf-navy);
	cursor: pointer;
	transition: color .35s ease;
}

.gf-locmap .gf-locmap__tab[aria-selected="true"] {
	color: var(--gf-white);
}

.gf-locmap .gf-locmap__tab:focus-visible {
	outline: 2px solid var(--gf-red);
	outline-offset: 2px;
}

/* White map box */
.gf-locmap__box {
	width: 100%;
	padding: 10px;
	overflow: hidden;
	background-color: var(--gf-white);
	border-radius: 16px;
	box-shadow: 0 24px 60px rgb(5 2 47 / 35%);
}

.gf-locmap__map.gf-locmap__map {
	background-color: #e9e9e9;
}

.gf-locmap__map {
	position: relative;
	z-index: 0; /* keep Leaflet's panes below the sticky header */
	width: 100%;
	/* Fits the whole section (heading + tabs + map + padding ≈ 470px) in one screen */
	height: clamp(280px, calc(100vh - var(--gf-header-offset, 98px) - 470px), 460px);
	overflow: hidden;
	background-color: #f2f2f5;
	border-radius: 10px;
}

.gf-locmap__map .leaflet-control-attribution {
	font-family: var(--gf-font-body);
	font-size: 11px;
}

.gf-locmap__map .leaflet-bar a {
	color: var(--gf-navy);
}

/* Pins */
.gf-locmap__marker {
	background: none;
	border: 0;
}

.gf-locmap__pin {
	display: block;
	width: 34px;
	height: 34px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	filter: drop-shadow(0 4px 6px rgb(0 0 0 / 35%));
	transition: transform .2s ease;
}

.gf-locmap__pin--dot {
	width: 18px;
	height: 18px;
	margin: 8px;
	background-color: var(--gf-red);
	border: 3px solid var(--gf-white);
	border-radius: 50%;
}

.gf-locmap__marker:hover .gf-locmap__pin {
	transform: translateY(-3px) scale(1.08);
}

.gf-locmap__tip {
	font-family: var(--gf-font-alt);
	font-size: 14px;
	font-weight: 500;
	color: var(--gf-navy);
}

.gf-locmap__popup,
.gf-locmap__popup a {
	font-family: var(--gf-font-alt);
	font-size: 16px;
	font-weight: 600;
	color: var(--gf-navy);
}

@media (prefers-reduced-motion: reduce) {
	.gf-locmap.is-ready .gf-locmap__thumb {
		transition: none;
	}

	.gf-locmap__list {
		animation: none;
	}
}

@media (max-width: 1024px) {
	.gf-locmap {
		grid-template-columns: minmax(0, 1fr);
	}

	.gf-locmap__side {
		height: auto;
	}

	/* Stacked order: tabs → "Locations in" list → map */
	.gf-locmap__main {
		display: contents;
	}

	.gf-locmap__tabs {
		order: 1;
		justify-self: center;
	}

	.gf-locmap__side {
		order: 2;
	}

	.gf-locmap__box {
		order: 3;
	}

	.gf-locmap .gf-locmap__items {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}
}

@media (max-width: 767px) {
	.gf-locmap .gf-locmap__tab {
		min-height: 42px;
		padding: 0 18px;
		font-size: 16px;
	}

	.gf-locmap__box {
		padding: 8px;
		border-radius: 12px;
	}
}
