/**
 * GoPixel PDF Embed front-end wrapper.
 */

.gopixel-pdf {
	--gopixel-pdf-width: 100%;
	--gopixel-pdf-height: 800px;
	--gopixel-pdf-accent: #4f46e5;
	--gopixel-pdf-radius: 16px;
	--gopixel-pdf-border: #e4e7ef;
	--gopixel-pdf-bar-bg: #ffffff;
	--gopixel-pdf-text: #171a24;
	--gopixel-pdf-muted: #6a7185;
	--gopixel-pdf-button-bg: #f3f4f8;
	--gopixel-pdf-button-hover: #e9ebf3;
	display: block;
	width: min(100%, var(--gopixel-pdf-width));
	max-width: 100%;
	margin: 1.5rem auto;
	overflow: hidden;
	background: var(--gopixel-pdf-bar-bg);
	border: 1px solid var(--gopixel-pdf-border);
	border-radius: var(--gopixel-pdf-radius);
	box-shadow: 0 18px 45px rgba(20, 24, 40, 0.08);
	isolation: isolate;
	color-scheme: light;
}

.gopixel-pdf *,
.gopixel-pdf *::before,
.gopixel-pdf *::after {
	box-sizing: border-box;
}

.gopixel-pdf__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 54px;
	padding: 8px 10px 8px 16px;
	background: var(--gopixel-pdf-bar-bg);
	border-bottom: 1px solid var(--gopixel-pdf-border);
}

.gopixel-pdf__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: var(--gopixel-pdf-text);
}

.gopixel-pdf__brand-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: rgba(79, 70, 229, 0.13);
	background: color-mix(in srgb, var(--gopixel-pdf-accent) 13%, transparent);
	color: var(--gopixel-pdf-accent);
}

.gopixel-pdf__brand-icon svg {
	width: 19px;
	height: 19px;
}

.gopixel-pdf__title {
	display: block;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.005em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gopixel-pdf__actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

.gopixel-pdf__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 34px;
	padding: 0 11px;
	border: 1px solid transparent;
	border-radius: 9px;
	background: var(--gopixel-pdf-button-bg);
	color: var(--gopixel-pdf-text);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.gopixel-pdf__button:hover {
	background: var(--gopixel-pdf-button-hover);
	color: var(--gopixel-pdf-text);
	text-decoration: none;
}

.gopixel-pdf__button:active {
	transform: translateY(1px);
}

.gopixel-pdf__button:focus-visible {
	outline: 2px solid var(--gopixel-pdf-accent);
	outline-offset: 2px;
}

.gopixel-pdf__button--fullscreen {
	padding-inline: 13px;
	background: var(--gopixel-pdf-accent);
	color: #ffffff;
}

.gopixel-pdf__button--fullscreen:hover {
	background: #4338ca;
	background: color-mix(in srgb, var(--gopixel-pdf-accent) 86%, #000000);
	color: #ffffff;
}

.gopixel-pdf__button svg {
	flex: 0 0 auto;
}

.gopixel-pdf__button-icons {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.gopixel-pdf .gopixel-icon-compress {
	display: none;
}

.gopixel-pdf.is-fullscreen .gopixel-icon-expand {
	display: none;
}

.gopixel-pdf.is-fullscreen .gopixel-icon-compress {
	display: inline-block;
}

.gopixel-pdf__stage {
	position: relative;
	width: 100%;
	height: var(--gopixel-pdf-height);
	min-height: 280px;
	background: #525659;
}

.gopixel-pdf__frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: #525659;
}

.gopixel-pdf__noscript {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 24px;
	background: var(--gopixel-pdf-bar-bg);
	color: var(--gopixel-pdf-text);
	font-size: 14px;
	text-align: center;
}

.gopixel-pdf__noscript a {
	color: var(--gopixel-pdf-accent);
	font-weight: 600;
}

.gopixel-pdf:fullscreen,
.gopixel-pdf:-webkit-full-screen {
	width: 100vw;
	max-width: none;
	height: 100vh;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.gopixel-pdf:fullscreen .gopixel-pdf__stage,
.gopixel-pdf:-webkit-full-screen .gopixel-pdf__stage {
	height: calc(100vh - 55px);
	min-height: 0;
}

.gopixel-pdf--no-bar:fullscreen .gopixel-pdf__stage,
.gopixel-pdf--no-bar:-webkit-full-screen .gopixel-pdf__stage {
	height: 100vh;
}

.gopixel-pdf--notice,
.gopixel-pdf--error {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	width: min(100%, var(--gopixel-pdf-width, 100%));
	min-height: 0;
	padding: 20px;
	background: var(--gopixel-pdf-bar-bg);
	color: var(--gopixel-pdf-text);
	box-shadow: none;
}

.gopixel-pdf--notice {
	border-style: dashed;
}

.gopixel-pdf--error {
	border-color: #f0c7c7;
	background: #fff8f8;
}

.gopixel-pdf__notice-icon {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: rgba(79, 70, 229, 0.11);
	background: color-mix(in srgb, var(--gopixel-pdf-accent) 11%, transparent);
	color: var(--gopixel-pdf-accent);
}

.gopixel-pdf--error .gopixel-pdf__notice-icon {
	background: #fde8e8;
	color: #b42318;
}

.gopixel-pdf__notice-body {
	min-width: 0;
	font-size: 14px;
	line-height: 1.5;
}

.gopixel-pdf__notice-body strong {
	display: block;
	margin-bottom: 3px;
	font-size: 14.5px;
	font-weight: 650;
}

.gopixel-pdf__notice-body p {
	margin: 0 0 9px;
	color: var(--gopixel-pdf-muted);
}

.gopixel-pdf__notice-body code {
	display: inline-block;
	padding: 5px 8px;
	border: 1px solid var(--gopixel-pdf-border);
	border-radius: 6px;
	background: var(--gopixel-pdf-button-bg);
	color: var(--gopixel-pdf-text);
	font-size: 12px;
}

.gopixel-pdf.alignwide {
	width: 100%;
	max-width: 100%;
}

.gopixel-pdf.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	border-radius: 0;
	border-left: 0;
	border-right: 0;
}

.gopixel-pdf.aligncenter {
	margin-left: auto;
	margin-right: auto;
}

@media (prefers-color-scheme: dark) {
	.gopixel-pdf--theme-auto {
		--gopixel-pdf-border: #2a2e3a;
		--gopixel-pdf-bar-bg: #161821;
		--gopixel-pdf-text: #f4f5f8;
		--gopixel-pdf-muted: #a3a9ba;
		--gopixel-pdf-button-bg: #232633;
		--gopixel-pdf-button-hover: #2c3040;
		box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
		color-scheme: dark;
	}

	.gopixel-pdf--theme-auto.gopixel-pdf--error,
	.gopixel-pdf--theme-auto .gopixel-pdf--error {
		background: #211719;
		border-color: #4a2b2d;
	}

	.gopixel-pdf--theme-auto.gopixel-pdf--error .gopixel-pdf__notice-icon,
	.gopixel-pdf--theme-auto .gopixel-pdf--error .gopixel-pdf__notice-icon {
		background: #3a2225;
		color: #fda29b;
	}
}

.gopixel-pdf--theme-dark {
	--gopixel-pdf-border: #2a2e3a;
	--gopixel-pdf-bar-bg: #161821;
	--gopixel-pdf-text: #f4f5f8;
	--gopixel-pdf-muted: #a3a9ba;
	--gopixel-pdf-button-bg: #232633;
	--gopixel-pdf-button-hover: #2c3040;
	box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
	color-scheme: dark;
}

.gopixel-pdf--theme-dark.gopixel-pdf--error {
	background: #211719;
	border-color: #4a2b2d;
}

.gopixel-pdf--theme-dark.gopixel-pdf--error .gopixel-pdf__notice-icon {
	background: #3a2225;
	color: #fda29b;
}

.gopixel-pdf--theme-light {
	color-scheme: light;
}

@media (max-width: 560px) {
	.gopixel-pdf__bar {
		padding-left: 12px;
	}

	.gopixel-pdf__brand-icon {
		width: 28px;
		height: 28px;
		border-radius: 8px;
	}

	.gopixel-pdf__title {
		font-size: 13px;
	}

	.gopixel-pdf__button {
		width: 34px;
		padding: 0;
	}

	.gopixel-pdf__button-label,
	.gopixel-pdf__button--open span:not(.gopixel-pdf__button-icons) {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gopixel-pdf__button {
		transition: none;
	}
}

@media print {
	.gopixel-pdf {
		display: none !important;
	}
}
