/**
 * Putovanje – animirana karta
 */

.pk-journey {
	--pk-accent: #f2c94c;
	--pk-map-height: 68vh;
	--pk-panel-width: 50%;
	--pk-panel-mobile: 55%;
	--pk-three-size: 150px;
	--pk-ink: #101010;
	--pk-surface: #171717;

	position: relative;
	width: 100%;
	background: var(--pk-ink);
	font-family: inherit;
}

.pk-journey *,
.pk-journey *::before,
.pk-journey *::after {
	box-sizing: border-box;
}

.pk-map-section {
	position: relative;
	width: 100%;
	height: var(--pk-map-height);
	overflow: hidden;
}

.pk-map {
	width: 100%;
	height: 100%;
}

/* --------------------------------------------------------------- oznake */

.pk-journey .pk-stage-label {
	background: rgba( 17, 17, 17, 0.88 );
	color: #fff;
	border: 1px solid rgba( 255, 255, 255, 0.35 );
	padding: 6px 10px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.35 );
}

.pk-journey .pk-destination-pin {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--pk-accent);
	border: 2px solid #111;
	box-shadow: 0 0 14px rgba( 242, 201, 76, 0.8 );
}

/* ---------------------------------------------------------------- panel */

.pk-panel {
	position: absolute;
	top: 0;
	right: 0;
	width: var(--pk-panel-width);
	height: 100%;
	z-index: 20;
	display: flex;
	flex-direction: column;
	padding: 22px;
	background: rgba( 10, 10, 10, 0.96 );
	color: #e3e3e3;
	opacity: 0;
	transform: translateX( 100% );
	pointer-events: none;
	transition: transform 1s cubic-bezier( 0.22, 0.8, 0.25, 1 ), opacity 1s ease;
	box-shadow: -10px 0 30px rgba( 0, 0, 0, 0.35 );
	overflow: hidden;
}

.pk-panel.is-visible {
	opacity: 1;
	transform: translateX( 0 );
	pointer-events: auto;
}

.pk-panel-title {
	margin: 0 44px 14px 0;
	color: #fff;
	font-size: 20px;
	line-height: 1.3;
	flex: 0 0 auto;
}

.pk-panel-body {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) minmax( 0, 1fr );
	gap: 18px;
	min-height: 0;
	flex: 1 1 auto;
	overflow: hidden;
}

.pk-panel-media {
	min-width: 0;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.pk-panel-media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 10px;
}

/* Bez glavne slike tekst zauzima cijelu širinu. */
.pk-panel-body:not( :has( .pk-panel-media ) ) {
	grid-template-columns: minmax( 0, 1fr );
}

.pk-panel-handle {
	display: none;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
}

.pk-panel-text {
	min-width: 0;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 4px 10px 4px 2px;
	line-height: 1.65;
	font-size: 15px;
	scrollbar-width: thin;
	scrollbar-color: var(--pk-accent) #222;
}

.pk-panel-text > *:first-child {
	margin-top: 0;
}

.pk-panel-text p {
	margin: 0 0 14px;
	color: #ddd;
}

.pk-panel-text h2,
.pk-panel-text h3 {
	margin: 0 0 10px;
	color: var(--pk-accent);
	font-size: 18px;
}

.pk-panel-text h4,
.pk-panel-text h5 {
	margin: 20px 0 8px;
	color: #fff;
	font-size: 16px;
}

.pk-panel-text a {
	color: var(--pk-accent);
}

.pk-panel-text img,
.pk-panel-text figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 10px 0 6px;
	border: 1px solid rgba( 255, 255, 255, 0.12 );
}

.pk-panel-text figure {
	margin: 0 0 14px;
}

.pk-panel-text figcaption,
.pk-panel-text .wp-caption-text {
	margin: 0 0 14px;
	color: #9f9f9f;
	font-size: 12px;
	line-height: 1.4;
}

.pk-panel-text::-webkit-scrollbar {
	width: 8px;
}

.pk-panel-text::-webkit-scrollbar-track {
	background: #222;
	border-radius: 8px;
}

.pk-panel-text::-webkit-scrollbar-thumb {
	background: var(--pk-accent);
	border-radius: 8px;
}

.pk-panel-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.92 );
	color: #111;
	font-size: 23px;
	line-height: 38px;
	cursor: pointer;
}

.pk-panel-open {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 19;
	border: 0;
	border-radius: 10px;
	padding: 11px 15px;
	background: var(--pk-accent);
	color: #111;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba( 0, 0, 0, 0.3 );
}

/* ------------------------------------------------------------------- 3D */

.pk-three-panel {
	position: absolute;
	width: var(--pk-three-size);
	height: var(--pk-three-size);
	z-index: 18;
	opacity: 0;
	transform: scale( 0.65 );
	pointer-events: none;
	transition: transform 0.7s cubic-bezier( 0.22, 0.8, 0.25, 1 ), opacity 0.7s ease;
	overflow: hidden;
	border-radius: 18px;
	background: rgba( 10, 10, 10, 0.68 );
	border: 1px solid rgba( 255, 255, 255, 0.16 );
	box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.35 );
	backdrop-filter: blur( 4px );
}

.pk-three-panel.is-visible {
	opacity: 1;
	transform: scale( 1 );
	pointer-events: auto;
}

.pk-three-canvas {
	width: 100%;
	height: 100%;
}

.pk-three-canvas canvas {
	display: block;
}

.pk-three-label {
	position: absolute;
	left: 8px;
	bottom: 7px;
	z-index: 2;
	color: #fff;
	background: rgba( 10, 10, 10, 0.66 );
	border-radius: 6px;
	padding: 4px 6px;
	font-size: 11px;
	font-weight: 700;
	pointer-events: none;
}

.pk-three-close {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 3;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.92 );
	color: #111;
	font-size: 16px;
	font-weight: 700;
	line-height: 26px;
	cursor: pointer;
}

.pk-three-open {
	position: absolute;
	z-index: 17;
	border: 0;
	border-radius: 8px;
	padding: 8px 10px;
	background: var(--pk-accent);
	color: #111;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

/* ------------------------------------------------------- tekst dionice */

.pk-caption {
	position: absolute;
	left: 50%;
	z-index: 16;
	max-width: min( 620px, calc( 100% - 32px ) );
	transform: translateX( -50% );
	padding: 12px 18px;
	border: 1px solid rgba( 255, 255, 255, 0.14 );
	border-radius: 12px;
	background: rgba( 10, 10, 10, 0.82 );
	color: #f0f0f0;
	font-size: 15px;
	line-height: 1.5;
	text-align: center;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--pk-caption-fade, 400ms) ease;
	backdrop-filter: blur( 4px );
	box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.35 );
}

.pk-caption-bottom {
	bottom: 22px;
}

.pk-caption-top {
	top: 22px;
}

.pk-caption.is-visible {
	opacity: 1;
	visibility: visible;
}

/* ------------------------------------------------- slika koja putuje */

.pk-journey .pk-traveler {
	position: relative;
	overflow: hidden;
	pointer-events: none;
	background: rgba( 10, 10, 10, 0.5 );
}

.pk-journey .pk-traveler-circle {
	border-radius: 50%;
	border: 2px solid var(--pk-accent);
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.45 );
}

.pk-journey .pk-traveler-square {
	border-radius: 10px;
	border: 2px solid var(--pk-accent);
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.45 );
}

.pk-journey .pk-traveler-plain {
	background: transparent;
	overflow: visible;
}

.pk-journey .pk-traveler-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity var(--pk-traveler-fade, 400ms) ease;
}

.pk-journey .pk-traveler-plain .pk-traveler-img {
	object-fit: contain;
	filter: drop-shadow( 0 3px 8px rgba( 0, 0, 0, 0.5 ) );
}

.pk-journey .pk-traveler-img.is-active {
	opacity: 1;
}

/* ----------------------------------------------------------------- zvuk */

.pk-audio-toggle {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 21;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 13px;
	border: 1px solid rgba( 255, 255, 255, 0.2 );
	border-radius: 999px;
	background: rgba( 10, 10, 10, 0.78 );
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur( 4px );
}

.pk-audio-toggle:hover {
	background: rgba( 10, 10, 10, 0.92 );
}

.pk-audio-toggle .pk-audio-icon {
	display: inline-flex;
	color: var(--pk-accent);
}

.pk-audio-toggle .pk-audio-off,
.pk-audio-toggle.is-muted .pk-audio-on {
	display: none;
}

.pk-audio-toggle.is-muted .pk-audio-off {
	display: inline-flex;
	color: #8d8d8d;
}

.pk-audio-toggle.is-muted {
	color: #b6b6b6;
}

.pk-audio-toggle svg {
	display: block;
}

/* ------------------------------------------------------------- kontrole */

.pk-controls {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 24px;
	text-align: center;
	background: var(--pk-surface);
	color: #fff;
}

.pk-intro {
	margin: 0;
	max-width: 68ch;
	color: #d0d0d0;
	line-height: 1.55;
	font-size: 16px;
}

.pk-play {
	border: 0;
	border-radius: 12px;
	padding: 15px 26px;
	background: var(--pk-accent);
	color: #111;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
}

.pk-play:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.pk-play-floating {
	position: absolute;
	left: 16px;
	bottom: 16px;
	z-index: 16;
	font-size: 15px;
	padding: 11px 18px;
}

.pk-status {
	margin: 0;
	min-height: 22px;
	font-weight: 700;
	color: var(--pk-accent);
}

.pk-status-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
}

.pk-journey button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.pk-error {
	padding: 12px;
	border-left: 4px solid #d63638;
	background: #fdf3f3;
	color: #3c2323;
}

/* -------------------------------------------------------------- mobitel */

@media ( max-width: 700px ) {
	.pk-audio-toggle {
		top: 12px;
		left: 12px;
		padding: 9px 11px;
	}

	.pk-audio-toggle .pk-audio-text {
		display: none;
	}

	.pk-caption {
		font-size: 14px;
		padding: 10px 14px;
		max-width: calc( 100% - 24px );
	}

	.pk-caption-bottom {
		bottom: 14px;
	}

	.pk-caption-top {
		top: 62px;
	}

	.pk-panel {
		top: auto;
		bottom: 0;
		right: 0;
		width: 100%;
		height: var(--pk-panel-mobile);
		max-height: 100%;
		padding: 0 16px 16px;
		border-radius: 16px 16px 0 0;
		transform: translateY( 100% );
		box-shadow: 0 -10px 30px rgba( 0, 0, 0, 0.4 );
		transition: transform 1s cubic-bezier( 0.22, 0.8, 0.25, 1 ), opacity 1s ease, height 0.35s ease;
	}

	.pk-panel.is-visible {
		transform: translateY( 0 );
	}

	.pk-panel.is-expanded {
		height: 100%;
		border-radius: 0;
	}

	/* Ručka za razvlačenje – ujedno je i dovoljno velika meta za prst. */
	.pk-panel-handle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: calc( 100% + 32px );
		margin: 0 -16px;
		padding: 12px 0 10px;
		border: 0;
		background: none;
		cursor: pointer;
		flex: 0 0 auto;
		touch-action: none;
	}

	.pk-handle-bar {
		display: block;
		width: 44px;
		height: 5px;
		border-radius: 999px;
		background: rgba( 255, 255, 255, 0.4 );
	}

	.pk-panel-title {
		font-size: 17px;
		margin: 0 46px 10px 0;
	}

	/* Na dodir je bolje da se lista cijeli panel nego uski okvir za tekst. */
	.pk-panel-body {
		display: block;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		touch-action: pan-y;
		padding-bottom: 24px;
	}

	.pk-panel-media {
		display: block;
		max-height: 34vh;
		margin-bottom: 14px;
	}

	.pk-panel-media img {
		height: auto;
		max-height: 34vh;
	}

	.pk-panel-text {
		overflow: visible;
		padding: 0;
		font-size: 15px;
	}

	.pk-panel-open {
		top: auto;
		bottom: 16px;
		right: 16px;
	}

	.pk-three-panel {
		width: calc( var(--pk-three-size) * 0.78 );
		height: calc( var(--pk-three-size) * 0.78 );
		border-radius: 14px;
	}

	.pk-three-label {
		font-size: 10px;
		left: 6px;
		bottom: 5px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.pk-panel,
	.pk-three-panel {
		transition-duration: 0.01ms;
	}
}
