/* ==========================================================================
   Travel Globe — globe, marqueurs, photos flottantes et fiches
   ========================================================================== */

/* --- Conteneur ------------------------------------------------------------ */

.travel-globe-wrapper {
	position: relative;
	display: flex;
	width: 100%;
	height: var(--tg-globe-height, 80vh);
	min-height: 420px;
	overflow: hidden;
	box-sizing: border-box;
	font-family: var(--tg-font, inherit);
	background: #15171b;
	isolation: isolate; /* garde les marqueurs sous le menu du site */
}

.travel-globe-wrapper *,
.travel-globe-wrapper *::before,
.travel-globe-wrapper *::after {
	box-sizing: border-box;
}

#travel-globe {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	overflow: hidden;
}

/* Crédits Cesium / fond de carte : discrets mais conservés. */
#travel-globe .cesium-viewer-bottom {
	left: 8px;
	bottom: 6px;
	background: transparent;
	font-size: 10px;
	opacity: 0.75;
}

/* --- Panneau latéral ------------------------------------------------------ */

#travel-globe-panel {
	flex: 0 0 auto;
	width: 0;
	height: 100%;
	overflow-x: hidden;
	overflow-y: auto;
	background: #f3f3f1;
	box-shadow: -10px 0 35px rgba(0, 0, 0, 0.25);
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
	transition: width 0.3s ease;
}

#travel-globe-panel.is-visible {
	width: 30%;
	min-width: 320px;
}

.travel-globe-panel-scroll-hint {
	display: none;
}

/* --- Fiches --------------------------------------------------------------- */

.travel-globe-panel-card {
	margin: 0 16px 20px;
	padding: 0;
	border: 0;
	border-radius: 18px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.06);
	transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
	animation: tg-card-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.travel-globe-panel-card.is-main {
	margin: 0 0 8px;
	border-radius: 0;
	box-shadow: 0 14px 28px -16px rgba(0, 0, 0, 0.28);
	animation: none;
}

.travel-globe-panel-card:not(.is-main) {
	cursor: pointer;
}

.travel-globe-panel-card:not(.is-main):hover {
	transform: translateY(-3px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 14px 32px rgba(0, 0, 0, 0.12);
}

.travel-globe-panel-card:nth-child(3) { animation-delay: 0.06s; }
.travel-globe-panel-card:nth-child(4) { animation-delay: 0.12s; }
.travel-globe-panel-card:nth-child(5) { animation-delay: 0.18s; }
.travel-globe-panel-card:nth-child(6) { animation-delay: 0.24s; }
.travel-globe-panel-card:nth-child(7) { animation-delay: 0.3s; }

.travel-globe-panel-card-image {
	width: 100%;
	line-height: 0;
	overflow: hidden;
}

.travel-globe-panel-card-image img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.travel-globe-panel-card.is-main .travel-globe-panel-card-image img {
	aspect-ratio: 16 / 10;
}

.travel-globe-panel-card:not(.is-main):hover .travel-globe-panel-card-image img {
	transform: scale(1.05);
}

.travel-globe-panel-card-content {
	padding: 16px 18px 18px;
}

.travel-globe-panel-card.is-main .travel-globe-panel-card-content {
	padding: 22px 24px 26px;
}

.travel-globe-panel-card-content h3 {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: #1d1f24;
}

.travel-globe-panel-card.is-main .travel-globe-panel-card-content h3 {
	font-size: 28px;
}

.travel-globe-panel-card-content p {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin: 0 0 16px;
	font-size: 15px;
	line-height: 1.5;
	color: #5b6068;
}

.travel-globe-panel-card.is-main .travel-globe-panel-card-content p {
	-webkit-line-clamp: 3;
}

.travel-globe-card-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: 999px;
	background: #1d1f24;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s ease;
}

.travel-globe-card-button::after {
	content: '→';
	transition: transform 0.2s ease;
}

.travel-globe-card-button:hover,
.travel-globe-card-button:focus {
	background: #000;
	color: #fff;
}

.travel-globe-card-button:hover::after {
	transform: translateX(3px);
}

.travel-globe-panel-subheading {
	margin: 24px 20px 14px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a8f98;
}

@keyframes tg-card-in {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: translateY(0); }
}

/* --- Photos flottantes ---------------------------------------------------- */

#travel-globe-hover-gallery {
	position: absolute;
	display: flex;
	align-items: flex-end;
	width: max-content;
	transform: translate(-50%, -80%);
	pointer-events: none;
	opacity: 0;
	z-index: 500;
}

#travel-globe-hover-gallery.is-visible {
	opacity: 1;
}

#travel-globe-hover-gallery img {
	flex-shrink: 0;
	object-fit: cover;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

#travel-globe-hover-gallery img:nth-child(1) {
	margin-right: -7px;
	z-index: 1;
	transition-delay: 0.2s;
}

#travel-globe-hover-gallery img:nth-child(2) {
	z-index: 2;
	transition-delay: 0.1s;
}

#travel-globe-hover-gallery img:nth-child(3) {
	margin-left: -3px;
	margin-bottom: -5px;
	z-index: 1;
	transition-delay: 0.3s;
}

#travel-globe-hover-gallery.is-visible img:nth-child(1) {
	opacity: 1;
	transform: translateY(0) rotate(-8deg);
}

#travel-globe-hover-gallery.is-visible img:nth-child(2) {
	opacity: 1;
	transform: translateY(0);
}

#travel-globe-hover-gallery.is-visible img:nth-child(3) {
	opacity: 1;
	transform: translateY(0) rotate(8deg);
}

#travel-globe-hover-gallery.is-scroll-hidden img {
	opacity: 0 !important;
	transform: translateY(30px) !important;
	transition-delay: 0s !important;
}

/* --- Marqueurs ------------------------------------------------------------ */

#travel-globe-markers {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 400;
}

.tg-marker {
	position: absolute;
	left: 0;
	top: 0;
	width: 0;
	height: 0;
	transition: opacity 0.25s ease, visibility 0.25s;
}

.tg-marker.is-hidden {
	opacity: 0;
	visibility: hidden;
}

.tg-marker-hit {
	position: absolute;
	left: -18px;
	top: -18px;
	width: 36px;
	height: 36px;
	pointer-events: auto;
	cursor: pointer;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.tg-marker-pulse,
.tg-marker-dot {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 12px;
	height: 12px;
	margin: -6px 0 0 -6px;
	border-radius: 50%;
	background: #fff;
}

.tg-marker-pulse {
	opacity: 0.55;
	animation: tg-marker-pulse 2.4s ease-out infinite;
}

.tg-marker-dot {
	box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2), 0 3px 10px rgba(0, 0, 0, 0.4);
	transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}

.tg-marker-hit:focus-visible .tg-marker-dot {
	outline: 2px solid #fff;
	outline-offset: 4px;
}

.tg-marker-label {
	position: absolute;
	left: 50%;
	bottom: calc(100% - 4px);
	transform: translateX(-50%);
	white-space: nowrap;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.01em;
	color: #fff;
	background: rgba(15, 20, 28, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.2);
	-webkit-backdrop-filter: blur(10px) saturate(140%);
	backdrop-filter: blur(10px) saturate(140%);
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tg-marker.is-hover .tg-marker-dot,
.tg-marker.is-active .tg-marker-dot {
	transform: scale(1.5);
}

.tg-marker.is-active .tg-marker-dot {
	box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.3), 0 3px 10px rgba(0, 0, 0, 0.4);
}

.tg-marker.is-hover .tg-marker-label,
.tg-marker.is-active .tg-marker-label {
	background: rgba(255, 255, 255, 0.92);
	color: #12161d;
	transform: translateX(-50%) translateY(-4px);
}

@keyframes tg-marker-pulse {
	0% { transform: scale(1); opacity: 0.55; }
	100% { transform: scale(3.2); opacity: 0; }
}

/* --- Écrans tactiles : pas d'effet de survol ------------------------------ */

@media (hover: none), (pointer: coarse) {

	.travel-globe-panel-card {
		-webkit-tap-highlight-color: transparent;
	}

	.travel-globe-panel-card:not(.is-main):hover {
		transform: none;
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.06);
	}

	.travel-globe-panel-card:not(.is-main):hover .travel-globe-panel-card-image img {
		transform: none;
	}

	.travel-globe-card-button:hover {
		background: #1d1f24;
	}

	.travel-globe-card-button:hover::after {
		transform: none;
	}
}

/* --- Mobile : le panneau devient un volet qui sort du bas ----------------- */

@media (max-width: 768px) {

	.travel-globe-wrapper {
		display: block !important;
	}

	#travel-globe {
		position: absolute !important;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		width: auto !important;
		height: auto !important;
		transition: bottom 0.35s ease;
	}

	.travel-globe-panel-open #travel-globe {
		bottom: calc(var(--tg-panel-height, 30dvh) - 20px) !important;
		overflow: visible !important;
	}

	#travel-globe-panel {
		position: absolute !important;
		left: 0;
		bottom: 0;
		width: 100% !important;
		min-width: 0 !important;
		height: var(--tg-panel-height, 30dvh) !important;
		border-radius: 20px 20px 0 0;
		box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.25);
		transform: translateY(100%);
		visibility: hidden;
		transition: transform 0.35s ease, visibility 0s linear 0.35s;
		z-index: 10;
		touch-action: pan-y;
		-webkit-overflow-scrolling: touch;
	}

	#travel-globe-panel.is-visible {
		transform: translateY(0);
		visibility: visible;
		transition: transform 0.35s ease, visibility 0s;
	}

	/* Photos : posées sur la bordure entre la carte et le volet. */
	#travel-globe-hover-gallery {
		transform: translate(-50%, -80%) scale(0.5);
	}

	.travel-globe-panel-open #travel-globe-hover-gallery {
		left: 50% !important;
		top: calc(100% - 20px) !important;
		transform: translate(-50%, -50%) scale(0.5);
		z-index: 20;
	}

	.travel-globe-panel-card.is-main .travel-globe-panel-card-image img {
		aspect-ratio: 16 / 9;
	}

	.travel-globe-panel-card.is-main .travel-globe-panel-card-content {
		padding: 18px 20px 22px;
	}

	.travel-globe-panel-card.is-main .travel-globe-panel-card-content h3 {
		font-size: 24px;
	}

	/* Indice de défilement sous la première fiche. */
	.travel-globe-panel-scroll-hint {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-end;
		gap: 4px;
		position: sticky;
		bottom: 0;
		height: 64px;
		margin-top: -64px;
		padding-bottom: 10px;
		background: linear-gradient(to top, #f3f3f1 30%, rgba(243, 243, 241, 0));
		pointer-events: none;
		font-size: 12px;
		font-weight: 500;
		color: #555;
		transition: opacity 0.25s ease;
		z-index: 5;
	}

	.travel-globe-panel-scroll-hint i {
		width: 8px;
		height: 8px;
		border-right: 2px solid #555;
		border-bottom: 2px solid #555;
		transform: rotate(45deg);
		animation: tg-scroll-hint 1.4s ease-in-out infinite;
	}

	#travel-globe-panel.has-scrolled .travel-globe-panel-scroll-hint {
		opacity: 0;
	}

	.tg-marker-label {
		font-size: 12px;
		padding: 5px 10px;
	}
}

@keyframes tg-scroll-hint {
	0%, 100% { transform: translateY(0) rotate(45deg); opacity: 0.4; }
	50% { transform: translateY(5px) rotate(45deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {

	.travel-globe-panel-card {
		animation: none;
	}

	.tg-marker-pulse {
		animation: none;
		opacity: 0;
	}

	.travel-globe-panel-scroll-hint i {
		animation: none;
	}
}

/* ==========================================================================
   Version 2 : recherche, filtres, indice, fiches enrichies, repli
   ========================================================================== */

/* --- Barre de recherche et filtres --------------------------------------- */

.tg-toolbar {
	position: absolute;
	top: clamp(16px, 2.4vw, 32px);
	left: 50%;
	z-index: 600;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	width: min(360px, calc(100% - 32px));
	transform: translateX(-50%);
	pointer-events: none;
}

.tg-search {
	position: relative;
	z-index: 2;
	width: 100%;
	pointer-events: auto;
}

.tg-search-input {
	display: block;
	width: 100%;
	height: 42px;
	margin: 0;
	padding: 0 16px 0 40px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	background: rgba(15, 20, 28, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px 50%;
	-webkit-backdrop-filter: blur(10px) saturate(140%);
	backdrop-filter: blur(10px) saturate(140%);
	color: #fff;
	font: inherit;
	font-size: 14px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.tg-search-input::placeholder {
	color: rgba(255, 255, 255, 0.7);
}

.tg-search-input:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.6);
	background-color: rgba(15, 20, 28, 0.8);
}

.tg-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.tg-search-results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 6px;
	list-style: none;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.tg-search-results[hidden] {
	display: none;
}

.tg-search-results button {
	display: block;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: #1d1f24;
	font: inherit;
	font-size: 14px;
	text-align: left;
	cursor: pointer;
}

.tg-search-results button:hover,
.tg-search-results button:focus-visible {
	background: #f0f0ee;
	outline: none;
}

.tg-search-results .is-empty {
	padding: 10px 12px;
	color: #6b7078;
	font-size: 14px;
}

.tg-chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	pointer-events: auto;
}

.tg-chip {
	margin: 0;
	padding: 6px 12px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	background: rgba(15, 20, 28, 0.55);
	-webkit-backdrop-filter: blur(10px) saturate(140%);
	backdrop-filter: blur(10px) saturate(140%);
	color: #fff;
	font: inherit;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.tg-chip:hover {
	background: rgba(15, 20, 28, 0.8);
}

.tg-chip[aria-pressed="true"] {
	background: #fff;
	border-color: #fff;
	color: #12161d;
}

/* --- Indice de démarrage -------------------------------------------------- */

.tg-hint {
	position: absolute;
	left: 50%;
	bottom: 52px;
	z-index: 500;
	max-width: calc(100% - 32px);
	padding: 8px 16px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	background: rgba(15, 20, 28, 0.55);
	-webkit-backdrop-filter: blur(10px) saturate(140%);
	backdrop-filter: blur(10px) saturate(140%);
	color: #fff;
	font-size: 13px;
	text-align: center;
	pointer-events: none;
	transform: translateX(-50%);
	transition: opacity 0.4s ease, transform 0.4s ease;
}

.tg-hint.is-hidden {
	opacity: 0;
	transform: translate(-50%, 8px);
}

/* --- Fiches : puce date/type, boutons ------------------------------------- */

.travel-globe-panel-card-meta {
	margin: 0 0 6px;
	color: #8a8f98;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.travel-globe-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.travel-globe-card-button.is-secondary {
	background: transparent;
	color: #1d1f24;
	box-shadow: inset 0 0 0 1.5px #1d1f24;
}

.travel-globe-card-button.is-secondary::after {
	content: none;
}

.travel-globe-card-button.is-secondary:hover,
.travel-globe-card-button.is-secondary:focus {
	background: #1d1f24;
	color: #fff;
}

.travel-globe-panel-card:focus-visible {
	outline: 2px solid #1d1f24;
	outline-offset: 2px;
}

/* --- Repli quand le globe 3D est impossible ------------------------------- */

.travel-globe-fallback,
.travel-globe-noscript {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	height: 100%;
	padding: 24px;
	color: #fff;
	text-align: center;
}

.travel-globe-fallback p,
.travel-globe-noscript {
	margin: 0;
}

.travel-globe-fallback a,
.travel-globe-noscript a {
	padding: 10px 18px;
	border-radius: 999px;
	background: #fff;
	color: #12161d;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.travel-globe-noscript {
	position: absolute;
	inset: 0;
}

@media (max-width: 768px) {

	/* Le logo est en haut à gauche : la recherche passe en dessous. */
	.tg-toolbar {
		top: 84px;
		width: calc(100% - 32px);
	}

	.tg-chips {
		flex-wrap: nowrap;
		justify-content: flex-start;
		width: 100%;
		overflow-x: auto;
		padding-bottom: 2px;
		scrollbar-width: none;
	}

	.tg-chips::-webkit-scrollbar {
		display: none;
	}

	.tg-chip {
		flex: 0 0 auto;
	}

	.tg-hint {
		bottom: 44px;
	}

	.travel-globe-panel-open .tg-hint,
	.travel-globe-panel-open .tg-toolbar {
		opacity: 0;
		pointer-events: none;
	}
}

@media (prefers-reduced-motion: reduce) {

	.tg-hint,
	.tg-search-input,
	.tg-chip {
		transition: none;
	}
}
