/* Documentary World Map – amCharts globe */
.doc-globe {
	--g-bg: #0b0b0f;
	--g-surface: rgba(21, 21, 28, 0.88);
	--g-line: rgba(255, 255, 255, 0.1);
	--g-text: #f3f3f6;
	--g-muted: #a5a5b4;
	--g-accent: #ff4757;
	position: relative;
	height: calc(100vh - var(--header-h, 64px) - var(--wp-admin--admin-bar--height, 0px));
	height: calc(100dvh - var(--header-h, 64px) - var(--wp-admin--admin-bar--height, 0px));
	min-height: 520px;
	overflow: hidden;
	background: radial-gradient(ellipse at 50% 45%, #1a1a26 0%, var(--g-bg) 70%);
	color: var(--g-text);
	font-family: var(--font, system-ui, sans-serif);
}

.doc-globe__chart {
	position: absolute;
	inset: 0;
}

/* Satellite images under the globe (faded in by the script when zoomed in) */
.doc-globe__sat {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	background: transparent !important;
}

.doc-globe__credit {
	position: absolute;
	right: 8px;
	bottom: 6px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 8px;
	border-radius: 6px;
	background: rgba(11, 11, 15, 0.6);
	color: var(--g-muted);
	font-size: 0.7rem;
}

.doc-globe__credit[hidden] {
	display: none;
}

.doc-globe__credit a {
	color: inherit;
	text-decoration: none;
}

.doc-globe__credit a:hover {
	color: #fff;
}

.doc-globe__credit img {
	display: block;
	height: 16px;
	width: auto;
}

.doc-globe button {
	font: inherit;
}

/* Top bar */
.doc-globe__bar {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: min(252px, calc(100% - 32px)); /* 30% narrower than the first 360px */
	max-height: calc(100% - 32px);
	overflow-y: auto;
	scrollbar-width: none;
	padding: 16px;
	background: var(--g-surface);
	border: 1px solid var(--g-line);
	border-radius: 14px;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.doc-globe__title {
	margin: 0;
	font-size: 1.35rem;
	line-height: 1.2;
}

.doc-globe__sub {
	margin: 2px 0 0;
	color: var(--g-muted);
	font-size: 0.9rem;
}

.doc-globe__search {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 12px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--g-line);
	border-radius: 10px;
}

.doc-globe__search:focus-within {
	border-color: var(--g-accent);
}

.doc-globe__search svg {
	flex: none;
	width: 18px;
	height: 18px;
	fill: var(--g-muted);
}

.doc-globe__search input {
	flex: 1;
	min-width: 0;
	padding: 10px 0;
	background: none;
	border: 0;
	outline: 0;
	color: var(--g-text);
	font: inherit;
}

.doc-globe__chips,
.doc-globe__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.doc-globe__chips button,
.doc-globe__tools button {
	padding: 6px 12px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--g-line);
	border-radius: 999px;
	color: var(--g-text);
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.doc-globe__chips button:hover,
.doc-globe__tools button:hover {
	background: rgba(255, 255, 255, 0.12);
}

.doc-globe__chips button span {
	margin-left: 3px;
	opacity: 0.6;
	font-size: 0.78em;
}

/* Home / zoom in / zoom out, in the bar (replaces the amCharts buttons on the map) */
.doc-globe__zoom {
	display: flex;
	flex-basis: 100%;
	justify-content: center;
	gap: 8px;
	margin-top: 4px;
}

/* Countries of the chosen continent */
.doc-globe__countries {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	max-height: min(220px, 30vh);
	overflow-y: auto;
	padding: 10px 2px 2px 0;
	border-top: 1px solid var(--g-line);
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.doc-globe__countries[hidden] {
	display: none;
}

.doc-globe__countries button {
	padding: 4px 10px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--g-line);
	border-radius: 999px;
	color: var(--g-text);
	font-size: 0.8rem;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.doc-globe__countries button:hover {
	background: rgba(255, 255, 255, 0.12);
}

.doc-globe__countries button span {
	margin-left: 3px;
	opacity: 0.6;
	font-size: 0.85em;
}

.doc-globe__countries button.is-active {
	background: rgba(255, 71, 87, 0.18);
	border-color: var(--g-accent);
}

.doc-globe__tools .doc-globe__zoom button {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: var(--g-accent);
	border-color: var(--g-accent);
	border-radius: 50%;
	color: #fff;
}

.doc-globe__tools .doc-globe__zoom button:hover {
	background: #ff6b78;
	border-color: #ff6b78;
}

.doc-globe__zoom svg {
	width: 16px;
	height: 16px;
}

.doc-globe__chips button.is-active {
	background: var(--g-accent);
	border-color: var(--g-accent);
	color: #fff;
}

.doc-globe button:focus-visible,
.doc-globe a:focus-visible {
	outline: 2px solid var(--g-accent);
	outline-offset: 2px;
}

/* Films floating over the globe */
.doc-globe__cards {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

.doc-globe__card {
	position: absolute;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 260px;
	padding: 7px 12px 7px 7px;
	background: rgba(21, 21, 28, 0.86);
	border: 1px solid var(--g-line);
	border-radius: 12px;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
	color: var(--g-text);
	font-size: 0.82rem;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
	pointer-events: auto;
	animation: doc-globe-float 6s ease-in-out infinite;
	transition: border-color 0.2s, opacity 0.3s;
}

.doc-globe__card:hover {
	border-color: var(--g-accent);
}

.doc-globe__card img {
	flex: none;
	width: 72px;
	height: 44px;
	object-fit: cover;
	border-radius: 6px;
}

.doc-globe__card strong {
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.doc-globe__card small {
	display: block;
	margin-top: 2px;
	color: var(--g-accent);
}

.doc-globe__card--1 { top: 16%; right: 6%; }
.doc-globe__card--2 { top: 50%; right: 3%; animation-delay: -2s; }
.doc-globe__card--3 { bottom: 9%; right: 12%; animation-delay: -4s; }

/* The panel takes the right side: the cards step aside. */
.doc-globe.has-panel .doc-globe__card {
	opacity: 0;
	pointer-events: none;
}

@keyframes doc-globe-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-8px); }
}

/* Side panel */
.doc-globe__panel {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	width: min(380px, calc(100% - 32px));
	max-height: calc(100% - 32px);
	background: var(--g-surface);
	border: 1px solid var(--g-line);
	border-radius: 14px;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
	animation: doc-globe-in 0.25s ease-out;
}

.doc-globe__panel[hidden] {
	display: none;
}

@keyframes doc-globe-in {
	from { opacity: 0; transform: translateX(16px); }
	to { opacity: 1; transform: none; }
}

.doc-globe__panel > div {
	flex: 1;
	overflow-y: auto;
	padding: 18px;
	overscroll-behavior: contain;
}

.doc-globe__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 1;
	width: 34px;
	height: 34px;
	background: rgba(0, 0, 0, 0.55);
	border: 0;
	border-radius: 50%;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.doc-globe__poster {
	display: block;
	margin: -18px -18px 14px;
}

.doc-globe__poster img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 14px 14px 0 0;
}

.doc-globe__meta {
	margin: 0 0 4px;
	color: var(--g-accent);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.doc-globe__film h3 {
	margin: 0 0 4px;
	font-size: 1.25rem;
	line-height: 1.25;
}

.doc-globe__film h3 a {
	color: inherit;
	text-decoration: none;
}

.doc-globe__place {
	margin: 0 0 10px;
	color: var(--g-muted);
	font-size: 0.9rem;
}

.doc-globe__text {
	margin: 0 0 16px;
	color: #d6d6de;
	font-size: 0.93rem;
	line-height: 1.55;
}

.doc-globe__watch {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	background: var(--g-accent);
	border-radius: 8px;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

.doc-globe__watch:hover {
	background: #ff6b78;
	color: #fff;
}

.doc-globe__more {
	display: block;
	margin-top: 14px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--g-muted);
	text-decoration: underline;
	cursor: pointer;
}

.doc-globe__listhead {
	margin: 0 40px 12px 0;
	font-size: 1.15rem;
}

.doc-globe__listhead button {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 0;
	background: none;
	border: 0;
	color: inherit;
	font: inherit;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}

.doc-globe__listhead button > span {
	flex: 1;
	min-width: 0;
}

.doc-globe__listhead span span {
	margin-left: 4px;
	color: var(--g-muted);
	font-weight: 400;
}

.doc-globe__listhead svg {
	flex: none;
	width: 20px;
	height: 20px;
	color: var(--g-muted);
	transition: transform 0.2s;
}

.doc-globe__listhead [aria-expanded="false"] svg {
	transform: rotate(-90deg);
}

.doc-globe__panel.is-folded .doc-globe__listhead {
	margin-bottom: 0;
}

.doc-globe__fold[hidden] {
	display: none;
}

/* States / regions of a country with many films: a third row in the bar */
.doc-globe__regions {
	max-height: min(180px, 24vh);
}

.doc-globe__sublabel {
	flex-basis: 100%;
	margin: 0 0 2px;
	color: var(--g-muted);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.doc-globe__list {
	padding: 6px 0 4px;
}

.doc-globe__list {
	display: grid;
	gap: 6px;
}

.doc-globe__item {
	display: grid;
	grid-template-columns: 96px 1fr;
	gap: 10px;
	align-items: center;
	padding: 6px;
	background: none;
	border: 1px solid transparent;
	border-radius: 10px;
	color: var(--g-text);
	text-align: left;
	cursor: pointer;
}

.doc-globe__item:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: var(--g-line);
}

.doc-globe__item img,
.doc-globe__noimg {
	width: 96px;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 6px;
	background: #272733;
}

.doc-globe__item strong {
	display: block;
	font-size: 0.92rem;
	line-height: 1.3;
}

.doc-globe__item small {
	display: block;
	margin-top: 2px;
	color: var(--g-muted);
	font-size: 0.8rem;
}

.doc-globe__empty,
.doc-globe__noscript {
	color: var(--g-muted);
}

.doc-globe__noscript {
	position: absolute;
	top: 50%;
	width: 100%;
	text-align: center;
}

/* Phones: compact bar, panel as bottom sheet */
@media (max-width: 700px) {
	.doc-globe {
		min-height: 560px;
	}

	.doc-globe__bar {
		top: 10px;
		left: 10px;
		width: calc(100% - 20px);
		padding: 12px;
		gap: 8px;
	}

	.doc-globe__head {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 8px;
	}

	.doc-globe__title {
		font-size: 1.05rem;
	}

	.doc-globe__sub {
		font-size: 0.8rem;
	}

	.doc-globe__chips,
	.doc-globe__tools {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.doc-globe__chips button,
	.doc-globe__tools button {
		flex: none;
	}

	.doc-globe__zoom {
		flex-basis: auto;
		margin: 0 0 0 auto;
	}

	.doc-globe__countries {
		flex-wrap: nowrap;
		max-height: none;
		overflow-x: auto;
		overflow-y: hidden;
		padding-top: 8px;
		scrollbar-width: none;
	}

	.doc-globe__countries button {
		flex: none;
	}

	.doc-globe__sublabel {
		flex: none;
		align-self: center;
		margin: 0 4px 0 0;
	}

	.doc-globe__panel {
		top: auto;
		left: 10px;
		right: 10px;
		bottom: 10px;
		width: auto;
		max-height: 62%;
		animation-name: doc-globe-up;
	}

	.doc-globe__poster img {
		aspect-ratio: 21 / 9;
	}

	/* Phones: one card at the bottom. */
	.doc-globe__card {
		max-width: 230px;
		font-size: 0.76rem;
	}

	.doc-globe__card--1 { top: auto; bottom: 14px; right: 10px; }
	.doc-globe__card--2,
	.doc-globe__card--3 { display: none; }

	@keyframes doc-globe-up {
		from { opacity: 0; transform: translateY(24px); }
		to { opacity: 1; transform: none; }
	}
}

@media (prefers-reduced-motion: reduce) {
	.doc-globe__panel,
	.doc-globe__card {
		animation: none;
	}
}
