.vtt-pa__actions[hidden],
.vtt-pa__action[hidden] {
	display: none;
}

.vtt-pa__action {
	gap: 9px;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid #f97316;
	border-radius: 8px;
	background: #f97316;
	color: #fff;
	font-weight: 700;
	line-height: 1.2;
	box-shadow: 0 4px 14px rgba(249, 115, 22, .28);
	transition: background-color .2s, border-color .2s, transform .2s, box-shadow .2s;
}

.vtt-pa__action:hover {
	border-color: #ea580c;
	background: #ea580c;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(234, 88, 12, .35);
}

.vtt-pa__action:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.vtt-pa__action[data-vtt-video]::before {
	content: "";
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 10px solid currentColor;
}

.vtt-pa__action[data-vtt-link]::after {
	content: "\2192";
	font-size: 1.15em;
	line-height: 1;
	transition: transform .2s;
}

.vtt-pa__action[data-vtt-link]:hover::after {
	transform: translateX(3px);
}

.vtt-pa__player {
	max-width: calc(100vw - 24px);
	max-height: calc(100vh - 100px);
}

.vtt-pa__player--horizontal {
	width: min(1120px, calc((100vh - 100px) * 16 / 9));
	aspect-ratio: 16 / 9;
}

.vtt-pa__player--vertical {
	width: min(520px, calc((100vh - 100px) * 9 / 16));
	aspect-ratio: 9 / 16;
}

.vtt-pa__player--square {
	width: min(760px, calc(100vh - 100px));
	aspect-ratio: 1 / 1;
}

@media (max-width: 700px) {
	.vtt-pa__action {
		min-height: 46px;
		padding: 10px 15px;
	}

	.vtt-pa__player {
		max-height: calc(100vh - 76px);
	}

	.vtt-pa__player--vertical {
		width: min(calc(100vw - 16px), calc((100vh - 76px) * 9 / 16));
	}
}

/* Compact shortcode preview: three columns on desktop, two edge-to-edge on mobile. */
.vtt-pa {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding: 0 !important;
}

.vtt-pa .vtt-pa__preview {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 6px !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

.vtt-pa .vtt-pa__preview-item,
.vtt-pa .vtt-pa__preview-item img {
	margin: 0 !important;
	padding: 0 !important;
}

@media (max-width: 700px) {
	.vtt-pa .vtt-pa__preview {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		width: 100vw !important;
		max-width: 100vw !important;
		margin-left: calc(50% - 50vw) !important;
		margin-right: calc(50% - 50vw) !important;
		gap: 6px !important;
	}
}

/* Related-photo rail in the image lightbox. */
.vtt-pa .vtt-pa__lightbox figure {
	padding-bottom: 10px;
}

.vtt-pa .vtt-pa__thumbs {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
	width: min(100%, 1000px);
	margin: 0 auto;
	padding: 6px 2px 4px;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-inline: contain;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.vtt-pa .vtt-pa__thumbs button {
	position: relative;
	display: block;
	flex: 0 0 76px;
	width: 76px;
	height: 56px;
	margin: 0;
	padding: 2px;
	border: 2px solid transparent;
	border-radius: 5px;
	background: #222;
	overflow: hidden;
	cursor: pointer;
	scroll-snap-align: center;
	opacity: .68;
	transition: border-color .2s, opacity .2s, transform .2s;
}

.vtt-pa .vtt-pa__thumbs button:hover,
.vtt-pa .vtt-pa__thumbs button:focus-visible {
	opacity: 1;
}

.vtt-pa .vtt-pa__thumbs button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.vtt-pa .vtt-pa__thumbs button.is-active {
	border-color: #f97316;
	opacity: 1;
	transform: translateY(-1px);
}

.vtt-pa .vtt-pa__thumbs img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	border-radius: 2px;
}

/* A dedicated video header keeps the close button away from player controls. */
.vtt-pa .vtt-pa__video-modal {
	display: grid;
	place-items: center;
	padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
}

.vtt-pa .vtt-pa__video-modal[hidden] {
	display: none;
}

.vtt-pa .vtt-pa__video-dialog {
	display: flex;
	flex-direction: column;
	width: fit-content;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
	padding: 0;
	border: 1px solid #303030;
	border-radius: 12px;
	background: #111;
	overflow: hidden;
	box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
}

.vtt-pa .vtt-pa__video-bar {
	display: flex;
	flex: 0 0 56px;
	align-items: center;
	justify-content: flex-end;
	width: 100%;
	height: 56px;
	min-height: 56px;
	margin: 0;
	padding: 6px 10px;
	background: #151515;
	border-bottom: 1px solid #303030;
}

.vtt-pa .vtt-pa__video-close {
	position: static;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #292929;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.vtt-pa .vtt-pa__video-close:hover {
	background: #3a3a3a;
}

.vtt-pa .vtt-pa__video-close:focus-visible {
	outline: 3px solid #f97316;
	outline-offset: 2px;
}

.vtt-pa .vtt-pa__player {
	max-height: calc(100vh - 160px);
}

.vtt-pa .vtt-pa__player--horizontal {
	width: min(1120px, calc((100vh - 160px) * 16 / 9));
}

.vtt-pa .vtt-pa__player--vertical {
	width: min(520px, calc((100vh - 160px) * 9 / 16));
}

.vtt-pa .vtt-pa__player--square {
	width: min(760px, calc(100vh - 160px));
}

@media (max-width: 700px) {
	.vtt-pa .vtt-pa__lightbox figure {
		padding-bottom: 6px;
	}

	.vtt-pa .vtt-pa__thumbs {
		gap: 6px;
		width: 100%;
		padding: 5px 4px 2px;
	}

	.vtt-pa .vtt-pa__thumbs button {
		flex-basis: 92px;
		width: 92px;
		height: 69px;
	}

	.vtt-pa .vtt-pa__video-modal {
		padding: max(6px, env(safe-area-inset-top, 0px)) 6px max(6px, env(safe-area-inset-bottom, 0px));
	}

	.vtt-pa .vtt-pa__video-dialog {
		border-radius: 10px;
	}

	.vtt-pa .vtt-pa__video-bar {
		flex-basis: 54px;
		height: 54px;
		min-height: 54px;
		padding: 5px 8px;
	}

	.vtt-pa .vtt-pa__player {
		max-height: calc(100vh - 136px);
	}

	.vtt-pa .vtt-pa__player--horizontal {
		width: min(calc(100vw - 12px), calc((100vh - 136px) * 16 / 9));
	}

	.vtt-pa .vtt-pa__player--vertical {
		width: min(calc(100vw - 12px), calc((100vh - 136px) * 9 / 16));
	}

	.vtt-pa .vtt-pa__player--square {
		width: min(calc(100vw - 12px), calc(100vh - 136px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.vtt-pa__action,
	.vtt-pa__action::after {
		transition: none;
	}
}

/* Keep the full-gallery chrome compact and isolated from theme styles. */
.vtt-pa .vtt-pa__modal-bar {
	position: sticky !important;
	top: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	width: 100% !important;
	height: auto !important;
	min-height: 68px !important;
	margin: 0 !important;
	padding: 8px clamp(16px, 4vw, 48px) !important;
	box-sizing: border-box !important;
}

.vtt-pa .vtt-pa__modal-bar > div {
	display: flex !important;
	flex: 1 1 auto !important;
	flex-direction: column !important;
	justify-content: center !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

.vtt-pa .vtt-pa__modal-bar strong,
.vtt-pa .vtt-pa__modal-bar span {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.25 !important;
}

.vtt-pa .vtt-pa__modal-bar button[data-vtt-close] {
	display: grid !important;
	place-items: center !important;
	flex: 0 0 44px !important;
	width: 44px !important;
	height: 44px !important;
	min-width: 44px !important;
	min-height: 44px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	line-height: 1 !important;
}

.vtt-pa .vtt-pa__grid {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	margin: 0 auto !important;
}

.vtt-pa .vtt-pa__grid button,
.vtt-pa .vtt-pa__grid img {
	margin: 0 !important;
	padding: 0 !important;
}

.vtt-pa .vtt-pa__grid img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
}

@media (max-width: 700px) {
	.vtt-pa .vtt-pa__modal-bar {
		min-height: calc(64px + env(safe-area-inset-top, 0px)) !important;
		padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px !important;
	}

	.vtt-pa .vtt-pa__modal-bar strong {
		font-size: 1rem !important;
	}

	.vtt-pa .vtt-pa__modal-bar span {
		font-size: .82rem !important;
	}

	.vtt-pa .vtt-pa__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 6px !important;
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}
}
