/* Pensar Mídia & QR Code — public viewer
   Standalone page: theme styles are dequeued, so everything the page needs
   is here. */

:root {
	--pmq-bg: #0a0b0d;
	--pmq-fg: #fff;
	--pmq-glass: rgba(255, 255, 255, 0.12);
	--pmq-glass-hover: rgba(255, 255, 255, 0.22);
	--pmq-bar: 60px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body.pmq-body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: var(--pmq-bg);
	color: var(--pmq-fg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
	overscroll-behavior: none;
}

.pmq-stage {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.pmq-stage.is-ready {
	opacity: 1;
}

/* ---------- Top bar ---------- */

.pmq-bar {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: calc(12px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 26px calc(16px + env(safe-area-inset-left));
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 55%, transparent 100%);
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.pmq-bar > * {
	pointer-events: auto;
}

.pmq-bar__title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.01em;
	color: rgba(255, 255, 255, 0.92);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pmq-bar__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.pmq-counter {
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	color: rgba(255, 255, 255, 0.62);
	white-space: nowrap;
}

/* Reset aggressively: this page may still receive stray inline theme rules. */
.pmq-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pmq-glass);
	color: var(--pmq-fg);
	text-decoration: none;
	cursor: pointer;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: background 0.18s ease, transform 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}

.pmq-iconbtn:hover,
.pmq-iconbtn:focus-visible {
	background: var(--pmq-glass-hover);
	color: var(--pmq-fg);
	outline: none;
}

.pmq-iconbtn:active {
	transform: scale(0.92);
}

.pmq-iconbtn svg {
	width: 19px;
	height: 19px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------- Loading ---------- */

.pmq-loader {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--pmq-bg);
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pmq-loader.is-hidden {
	opacity: 0;
	visibility: hidden;
}

.pmq-spinner {
	width: 30px;
	height: 30px;
	border: 2.5px solid rgba(255, 255, 255, 0.16);
	border-top-color: rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	animation: pmq-spin 0.8s linear infinite;
}

@keyframes pmq-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Gallery / image ---------- */

.pmq-swiper {
	width: 100%;
	height: 100%;
	--swiper-pagination-color: #fff;
	--swiper-pagination-bullet-inactive-color: #fff;
	--swiper-pagination-bullet-inactive-opacity: 0.32;
	--swiper-pagination-bullet-size: 7px;
	--swiper-pagination-bullet-horizontal-gap: 5px;
}

.pmq-swiper .swiper-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(var(--pmq-bar) + env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom));
}

/* Room for the swipe hint and the dots. */
.pmq-swiper--multi .swiper-slide {
	padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

.pmq-swiper .swiper-zoom-container {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Shown at its own resolution, shrunk to fit when needed, never enlarged
   past the original file (--pmq-cap, already capped at 1400px server-side). */
.pmq-swiper img {
	display: block;
	width: auto;
	height: auto;
	max-width: min(100%, var(--pmq-cap, 1400px));
	max-height: 100%;
	border-radius: 4px;
	user-select: none;
	-webkit-user-drag: none;
}

.pmq-dots {
	bottom: calc(16px + env(safe-area-inset-bottom)) !important;
}

/* ---------- Swipe hint ---------- */

.pmq-swipehint {
	position: absolute;
	bottom: calc(40px + env(safe-area-inset-bottom));
	left: 50%;
	z-index: 16;
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 6px 13px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.09);
	color: rgba(255, 255, 255, 0.72);
	font-size: 12.5px;
	line-height: 1;
	white-space: nowrap;
	pointer-events: none;
	transform: translateX(-50%);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: opacity 0.45s ease;
}

.pmq-swipehint svg {
	width: 13px;
	height: 13px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
	animation: pmq-nudge 1.7s ease-in-out infinite;
}

.pmq-swipehint svg:last-child {
	animation-delay: 0.85s;
}

.pmq-swipehint.is-gone {
	opacity: 0;
}

@keyframes pmq-nudge {
	0%,
	100% {
		opacity: 0.45;
		transform: translateX(0);
	}
	50% {
		opacity: 1;
		transform: translateX(-2px);
	}
}

.pmq-swipehint svg:last-child {
	animation-name: pmq-nudge-right;
}

@keyframes pmq-nudge-right {
	0%,
	100% {
		opacity: 0.45;
		transform: translateX(0);
	}
	50% {
		opacity: 1;
		transform: translateX(2px);
	}
}

/* Custom nav buttons — Swiper's defaults are iOS blue and oversized. */
.pmq-nav {
	position: absolute;
	top: 50%;
	z-index: 15;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-top: -23px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pmq-glass);
	color: var(--pmq-fg);
	cursor: pointer;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: background 0.18s ease, opacity 0.18s ease;
}

.pmq-nav:hover {
	background: var(--pmq-glass-hover);
}

.pmq-nav svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pmq-nav--prev {
	left: 16px;
}

.pmq-nav--next {
	right: 16px;
}

.pmq-nav.swiper-button-disabled {
	opacity: 0.25;
	pointer-events: none;
}

/* ---------- PDF ---------- */

.pmq-pdf {
	width: 100%;
	height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: calc(var(--pmq-bar) + 14px + env(safe-area-inset-top)) 12px calc(28px + env(safe-area-inset-bottom));
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.pmq-pdf::-webkit-scrollbar {
	width: 9px;
}

.pmq-pdf::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.24);
	border-radius: 5px;
}

.pmq-pdf::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.36);
}

.pmq-pdf-page {
	display: block;
	max-width: min(100%, 940px);
	height: auto;
	border-radius: 3px;
	box-shadow: 0 6px 28px rgba(0, 0, 0, 0.55);
}

/* ---------- Dismissed state ---------- */

body.pmq-dismissed .pmq-stage {
	opacity: 0;
	pointer-events: none;
}

body.pmq-dismissed::after {
	content: 'Você já pode fechar esta aba.';
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	color: rgba(255, 255, 255, 0.45);
	font-size: 15px;
}

/* ---------- Responsive ---------- */

@media (max-width: 782px) {
	:root {
		--pmq-bar: 54px;
	}

	.pmq-bar {
		gap: 10px;
		padding-bottom: 22px;
	}

	.pmq-bar__title {
		font-size: 14px;
	}

	/* Swiping is the natural gesture on touch; the arrows only cover content. */
	.pmq-nav {
		display: none;
	}

	.pmq-swiper .swiper-slide {
		padding-left: 6px;
		padding-right: 6px;
	}

	.pmq-pdf {
		padding-left: 6px;
		padding-right: 6px;
		gap: 10px;
	}
}

@media (hover: none) {
	.pmq-iconbtn:active {
		background: var(--pmq-glass-hover);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pmq-stage,
	.pmq-loader,
	.pmq-iconbtn,
	.pmq-nav {
		transition: none;
	}

	.pmq-spinner {
		animation-duration: 2s;
	}
}
