/**
 * Tocqueville locations section.
 *
 * Styles for the [tqv_locations] shortcode: the split video / map layout and
 * the grey office tabs sitting on the top-right corner of the map. Ported from
 * the old site's .contacts .coordinates-container and .towns rules so the
 * section looks the same inside Divi.
 */

.tqv-locations {
	width: 100%;
	overflow: hidden;
}

.tqv-locations-inner {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
}

/* ---------- Video side ---------- */

.tqv-locations-media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background-color: #1d2642;
}

/* Fallback for browsers without aspect-ratio support. */
@supports not ( aspect-ratio: 16 / 9 ) {
	.tqv-locations-media {
		height: 0;
		padding-top: 56.25%;
	}
}

.tqv-locations-video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.4s ease-out;
	pointer-events: none;
}

.tqv-locations-video.is-active {
	opacity: 1;
}

/* ---------- Map side ---------- */

.tqv-locations-map-wrap {
	position: relative;
	width: 100%;
	min-height: 12.5rem;
	background-color: #f5f5f5;
}

.tqv-locations-map {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* ---------- Still image fallback ----------
   Hidden until the section is flagged as is-map-unavailable, either by PHP
   when there is no API key or by the script when Maps fails to load. */

.tqv-locations-fallback {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease-out;
	pointer-events: none;
}

.tqv-locations.is-map-unavailable .tqv-locations-fallback.is-active {
	opacity: 1;
	visibility: visible;
}

/* Hide the map container so Google's own error overlay never shows through. */
.tqv-locations.is-map-unavailable .tqv-locations-map {
	display: none;
}

/* Info window content. */
.tqv-locations-info {
	font-family: AGaramondPro-Regular, Helvetica, Arial, sans-serif;
	font-size: 0.75rem;
	line-height: 1.3;
	max-width: 9.1875rem;
	padding: 0.3125rem 0;
	color: #191919;
}

.tqv-locations-info p {
	margin: 0;
}

/* ---------- Office tabs ---------- */

.tqv-locations-tabs {
	position: absolute;
	z-index: 2;
	top: 0;
	right: 0;
	display: flex;
	padding: 0 0.625rem;
	background-color: #cacaca;
}

.tqv-locations-tab {
	position: relative;
	display: inline-block;
	padding: 0.5rem;
	font-family: gotham-regular, Helvetica, Arial, sans-serif;
	font-size: 1rem;
	line-height: 1;
	color: #565656;
	text-align: center;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	background: none;
	border: 0;
	border-radius: 0;
	outline: 0;
	transition: color 0.25s ease-out;
	-webkit-appearance: none;
	appearance: none;
}

.tqv-locations-tab:hover,
.tqv-locations-tab:focus-visible,
.tqv-locations-tab.is-active {
	color: #fff;
	background: none;
}

.tqv-locations-tab:hover::after,
.tqv-locations-tab:focus-visible::after,
.tqv-locations-tab.is-active::after {
	position: absolute;
	right: 8px;
	bottom: 5px;
	left: 8px;
	height: 1px;
	content: '';
	background-color: #fff;
}

/* Admin-only warning, never shown to visitors. */
.tqv-locations-notice {
	padding: 1rem;
	font-family: Helvetica, Arial, sans-serif;
	font-size: 0.875rem;
	color: #664d03;
	background-color: #fff3cd;
	border: 1px solid #ffe69c;
}

/* ---------- Medium up ---------- */

@media screen and ( min-width: 40em ) {
	.tqv-locations-map-wrap {
		min-height: 18.75rem;
	}
}

/* ---------- Large up: side by side ---------- */

@media screen and ( min-width: 64em ) {
	.tqv-locations-inner {
		flex-wrap: nowrap;
		align-items: stretch;
	}

	.tqv-locations-media,
	.tqv-locations-map-wrap {
		width: 50%;
	}

	.tqv-locations-map-wrap {
		min-height: 0;
	}

	.tqv-locations-tab {
		padding: 1.9375rem;
	}

	.tqv-locations-tab:hover::after,
	.tqv-locations-tab:focus-visible::after,
	.tqv-locations-tab.is-active::after {
		right: 15px;
		bottom: 12px;
		left: 15px;
	}

	.tqv-locations-info {
		font-size: 1.125rem;
		line-height: 1.5rem;
		max-width: 9.3125rem;
	}
}

@media screen and ( min-width: 90em ) {
	.tqv-locations-info {
		padding: 1.4375rem 0;
	}
}

/* ---------- Reduced motion ---------- */

@media ( prefers-reduced-motion: reduce ) {
	.tqv-locations-video,
	.tqv-locations-fallback {
		transition: none;
	}
}
