/**
 * PDF-Blätterkatalog (Flipbook) Stylesheet
 * phw-core / ivk-core
 */

/* ==========================================================================
   1. PDF-Vorschau-Indikator (Frontend)
   ========================================================================== */

a:has(> img)[href*=".pdf" i],
a:has(> picture)[href*=".pdf" i],
.elementor-widget-image a[href*=".pdf" i],
.wp-block-image a[href*=".pdf" i] {
	position: relative;
	cursor: pointer;
}

/* Interaktiver Hinweis-Badge auf PDF-Vorschaubildern */
.phw-pdf-badge,
.ivk-pdf-badge {
	position: absolute;
	bottom: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	background: rgba(18, 22, 28, 0.88);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 20px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	pointer-events: none;
	opacity: 0.92;
	transform: translateY(0);
	transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 2;
}

a:hover > .phw-pdf-badge,
a:hover > .ivk-pdf-badge,
.elementor-widget-image a:hover .phw-pdf-badge,
.elementor-widget-image a:hover .ivk-pdf-badge,
.wp-block-image a:hover .phw-pdf-badge,
.wp-block-image a:hover .ivk-pdf-badge {
	opacity: 1;
	background: var(--brand, #ff9900);
	color: #111;
	border-color: transparent;
	transform: translateY(-2px) scale(1.03);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.phw-pdf-badge svg,
.ivk-pdf-badge svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
	flex-shrink: 0;
}

/* ==========================================================================
   2. Lightbox Modal Overlay
   ========================================================================== */

.phw-pdf-modal,
.ivk-pdf-modal {
	position: fixed;
	inset: 0;
	z-index: 9999999;
	display: flex;
	flex-direction: column;
	background: rgba(14, 16, 20, 0.95);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.28s ease, visibility 0.28s ease;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
	overflow: hidden;
}

.phw-pdf-modal.is-active,
.ivk-pdf-modal.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* ==========================================================================
   3. Header Bar
   ========================================================================== */

.phw-pdf-header,
.ivk-pdf-header {
	height: 58px;
	min-height: 58px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	background: rgba(22, 26, 33, 0.9);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	color: #fff;
	z-index: 10;
}

.phw-pdf-header__left {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 35%;
	min-width: 0;
}

.phw-pdf-header__title {
	font-size: 14px;
	font-weight: 600;
	color: #f0f2f5;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: -0.01em;
}

.phw-pdf-header__center {
	display: flex;
	align-items: center;
	gap: 10px;
}

.phw-pdf-page-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 20px;
	letter-spacing: 0.02em;
}

.phw-pdf-header__right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.phw-pdf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 38px;
	padding: 0 14px;
	font-size: 13px;
	font-weight: 600;
	color: #e5e7eb;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.18s ease;
}

.phw-pdf-btn:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.28);
	text-decoration: none;
}

.phw-pdf-btn svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.phw-pdf-btn--icon-only {
	width: 38px;
	padding: 0;
}

.phw-pdf-btn--close {
	background: rgba(239, 68, 68, 0.15);
	border-color: rgba(239, 68, 68, 0.35);
	color: #fca5a5;
}

.phw-pdf-btn--close:hover {
	background: #ef4444;
	border-color: #ef4444;
	color: #fff;
}

/* ==========================================================================
   4. Viewport & Flipbook Container
   ========================================================================== */

.phw-pdf-viewport,
.ivk-pdf-viewport {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 16px;
}

.phw-pdf-book-container {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 98vw;
	max-height: calc(100vh - 136px);
}

/* Schatten auf dem Buchkörper */
.phw-pdf-book-container .stf__parent {
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 2px rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	overflow: hidden;
}

/* ==========================================================================
   5. Floating Navigation Arrows
   ========================================================================== */

.phw-pdf-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(26, 31, 40, 0.85);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.16);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 50;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.phw-pdf-arrow--prev {
	left: 20px;
}

.phw-pdf-arrow--next {
	right: 20px;
}

.phw-pdf-arrow:hover {
	background: var(--brand, #ff9900);
	color: #111;
	border-color: transparent;
	transform: translateY(-50%) scale(1.1);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.phw-pdf-arrow.is-disabled {
	opacity: 0.18;
	pointer-events: none;
}

.phw-pdf-arrow svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* ==========================================================================
   6. Footer Toolbar
   ========================================================================== */

.phw-pdf-footer,
.ivk-pdf-footer {
	height: 50px;
	min-height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	padding: 0 20px;
	background: rgba(22, 26, 33, 0.9);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	color: #9ca3af;
	font-size: 13px;
	z-index: 10;
}

.phw-pdf-scrubber {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	max-width: 480px;
}

.phw-pdf-scrubber input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	flex: 1;
	height: 6px;
	background: rgba(255, 255, 255, 0.16);
	border-radius: 3px;
	outline: none;
	cursor: pointer;
	transition: background 0.15s ease;
}

.phw-pdf-scrubber input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--brand, #ff9900);
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
	transition: transform 0.12s ease;
}

.phw-pdf-scrubber input[type="range"]::-webkit-slider-thumb:hover {
	transform: scale(1.25);
}

.phw-pdf-hint {
	display: none;
}

@media (min-width: 900px) {
	.phw-pdf-hint {
		display: inline-block;
		font-size: 12px;
		color: rgba(255, 255, 255, 0.45);
	}
}

/* ==========================================================================
   7. Loader & Spinner
   ========================================================================== */

.phw-pdf-loader {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	background: rgba(14, 16, 20, 0.88);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 100;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.phw-pdf-loader.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.phw-pdf-spinner {
	width: 44px;
	height: 44px;
	border: 3px solid rgba(255, 255, 255, 0.15);
	border-top-color: var(--brand, #ff9900);
	border-radius: 50%;
	animation: phw-pdf-spin 0.8s linear infinite;
}

@keyframes phw-pdf-spin {
	to { transform: rotate(360deg); }
}

.phw-pdf-loader__text {
	font-size: 14px;
	font-weight: 500;
	color: #e5e7eb;
	letter-spacing: -0.01em;
}

/* ==========================================================================
   8. Mobile & Responsive Layout
   ========================================================================== */

@media (max-width: 767px) {
	.phw-pdf-header,
	.ivk-pdf-header {
		height: 50px;
		min-height: 50px;
		padding: 0 12px;
	}

	.phw-pdf-header__left {
		max-width: 45%;
	}

	.phw-pdf-header__title {
		font-size: 13px;
	}

	.phw-pdf-page-pill {
		padding: 4px 10px;
		font-size: 12px;
	}

	.phw-pdf-btn span {
		display: none;
	}

	.phw-pdf-btn {
		width: 36px;
		height: 36px;
		padding: 0;
	}

	.phw-pdf-arrow {
		width: 40px;
		height: 40px;
	}

	.phw-pdf-arrow--prev {
		left: 8px;
	}

	.phw-pdf-arrow--next {
		right: 8px;
	}

	.phw-pdf-viewport,
	.ivk-pdf-viewport {
		padding: 8px;
	}

	.phw-pdf-footer,
	.ivk-pdf-footer {
		height: 44px;
		min-height: 44px;
		padding: 0 12px;
	}
}
