/* PDF Modal Viewer – Frontend Styles
   Bewusst schlank & konfliktarm: alle Klassen mit .pdfmv- Präfix. */

/* ---------- Trigger / Ausrichtung ---------- */
.pdfmv-wrap { display: block; max-width: 100%; }
.pdfmv-align-left   { text-align: left; }
.pdfmv-align-center { text-align: center; }
.pdfmv-align-right  { text-align: right; }

.pdfmv-trigger { cursor: pointer; }
.pdfmv-trigger:focus-visible {
	outline: 3px solid #2563eb;
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---------- Thumbnail ---------- */
.pdfmv-thumb {
	position: relative;
	display: inline-block;
	max-width: 100%;
	line-height: 0;
	text-decoration: none;
	transition: transform .18s ease, box-shadow .18s ease;
}
.pdfmv-thumb img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}
.pdfmv-thumb.pdfmv-shadow { box-shadow: 0 6px 20px rgba(15, 23, 42, .18); }
.pdfmv-thumb:hover { transform: translateY(-2px); }
.pdfmv-thumb:hover.pdfmv-shadow { box-shadow: 0 10px 28px rgba(15, 23, 42, .26); }

.pdfmv-thumb-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: rgba(15, 23, 42, 0);
	opacity: 0;
	transition: opacity .18s ease, background .18s ease;
	border-radius: inherit;
}
.pdfmv-thumb:hover .pdfmv-thumb-overlay,
.pdfmv-thumb:focus-visible .pdfmv-thumb-overlay {
	opacity: 1;
	background: rgba(15, 23, 42, .28);
}
.pdfmv-thumb-overlay svg {
	width: 40px; height: 40px;
	background: rgba(0,0,0,.35);
	border-radius: 50%;
	padding: 8px;
}
.pdfmv-thumb-caption {
	display: block;
	margin-top: 8px;
	line-height: 1.35;
	font-size: .95em;
}

/* ---------- Textlink ---------- */
.pdfmv-textlink {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.pdfmv-textlink .pdfmv-icon { flex: 0 0 auto; }

/* ---------- Button ---------- */
.pdfmv-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border: 0;
	transition: filter .15s ease, transform .15s ease;
}
.pdfmv-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.pdfmv-button .pdfmv-icon { flex: 0 0 auto; }

/* ---------- Editor-Hinweis ---------- */
.pdfmv-notice {
	display: inline-block;
	padding: 4px 8px;
	font-size: 13px;
	color: #92400e;
	background: #fef3c7;
	border: 1px solid #fde68a;
	border-radius: 4px;
}

/* ================= Modal ================= */
.pdfmv-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(15, 23, 42, .72);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.pdfmv-modal.is-open { opacity: 1; visibility: visible; }

.pdfmv-dialog {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 960px;
	height: 100%;
	max-height: 92vh;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0,0,0,.4);
	transform: translateY(12px) scale(.985);
	transition: transform .2s ease;
}
.pdfmv-modal.is-open .pdfmv-dialog { transform: none; }

.pdfmv-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: #0f172a;
	color: #fff;
	flex: 0 0 auto;
}
.pdfmv-bar-title {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.pdfmv-bar-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	color: #fff;
	background: rgba(255,255,255,.10);
	border: 0;
	border-radius: 8px;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s ease;
}
.pdfmv-bar-btn:hover { background: rgba(255,255,255,.22); }
.pdfmv-bar-btn svg { width: 18px; height: 18px; fill: currentColor; }
.pdfmv-bar-btn .pdfmv-btn-text { display: inline; }
.pdfmv-bar-close { background: rgba(255,255,255,.14); }

.pdfmv-pageinfo {
	font-size: 13px;
	opacity: .85;
	min-width: 74px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.pdfmv-body {
	position: relative;
	flex: 1 1 auto;
	overflow: auto;
	background: #525659;
	-webkit-overflow-scrolling: touch;
}
.pdfmv-canvas-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 16px;
	min-height: 100%;
}
.pdfmv-page {
	max-width: 100%;
	height: auto;
	background: #fff;
	box-shadow: 0 3px 12px rgba(0,0,0,.35);
}
.pdfmv-body iframe {
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
}

.pdfmv-status {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
	align-items: center;
	justify-content: center;
	color: #e2e8f0;
	font-size: 15px;
	text-align: center;
	padding: 24px;
}
.pdfmv-spinner {
	width: 42px; height: 42px;
	border: 4px solid rgba(255,255,255,.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pdfmv-spin .8s linear infinite;
}
@keyframes pdfmv-spin { to { transform: rotate(360deg); } }

.pdfmv-status .pdfmv-fallback-link {
	color: #fff;
	background: #2563eb;
	padding: 10px 18px;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
}

/* ---------- Mobile: Vollbild-Modal ---------- */
@media (max-width: 640px) {
	.pdfmv-modal { padding: 0; }
	.pdfmv-dialog {
		max-width: 100%;
		max-height: 100%;
		height: 100%;
		border-radius: 0;
	}
	.pdfmv-bar-btn .pdfmv-btn-text { display: none; } /* nur Icons auf dem Handy */
	.pdfmv-canvas-wrap { padding: 8px; gap: 8px; }
	.pdfmv-bar-title { font-size: 14px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.pdfmv-modal, .pdfmv-dialog, .pdfmv-thumb,
	.pdfmv-thumb-overlay, .pdfmv-button { transition: none; }
	.pdfmv-spinner { animation: none; }
}

/* Body-Scroll-Sperre bei offenem Modal */
html.pdfmv-lock, body.pdfmv-lock { overflow: hidden !important; }
