/*
 * pp-coa-pdfjs.css — styles for the in-place COA PDF.js viewer.
 *
 * Two surfaces:
 *   1. .pp-coa-canvas   — the crisp PDF canvas overlaid on a COA gallery slide.
 *                         Starts hidden (opacity 0); revealed only once the JS
 *                         has proven a render (.is-ready). If it never renders,
 *                         the underlying <img> shows through unchanged.
 *   2. .pp-coa-modal    — the custom full-document lightbox (all pages, zoom).
 *
 * Palette follows the PP theme (navy + gold) with hard fallbacks so this file
 * is self-contained. Scoped class names only; no global element selectors.
 */

/* ---- in-slide canvas overlay ------------------------------------------- */

.pp-coa-slide {
	position: relative;
}

.pp-coa-canvas {
	position: absolute;
	top: 0;
	left: 0;
	max-width: 100%;
	height: auto;
	opacity: 0;
	pointer-events: none; /* clicks fall through to the slide anchor */
	z-index: 1;
	background: #fff;
	transition: opacity 0.2s ease;
}

.pp-coa-canvas.is-ready {
	opacity: 1;
}

/* ---- modal / full-document viewer -------------------------------------- */

body.pp-coa-modal-open {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	overflow: hidden;
}

.pp-coa-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(0px, 3vw, 32px);
	background: rgba(10, 18, 33, 0.82);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	animation: pp-coa-fade 0.18s ease;
}

.pp-coa-modal[hidden] {
	display: none;
}

.pp-coa-modal__dialog {
	display: flex;
	flex-direction: column;
	width: min(1040px, 96vw);
	max-height: 94vh;
	background: #eef2f6;
	border-radius: 10px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	overflow: hidden;
	outline: none;
	animation: pp-coa-rise 0.2s ease;
}

.pp-coa-modal__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px 10px 18px;
	background: var(--pp-navy, #16233f);
	color: #fff;
	flex: 0 0 auto;
}

.pp-coa-modal__title {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pp-coa-modal__controls {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.pp-coa-modal__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--pp-navy, #16233f);
	background: #fff;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.pp-coa-modal__btn:hover,
.pp-coa-modal__btn:focus-visible {
	background: var(--pp-gold, #c9a227);
	color: #16233f;
	outline: 2px solid var(--pp-gold, #c9a227);
	outline-offset: 1px;
}

.pp-coa-modal__close {
	font-size: 22px;
	font-weight: 700;
}

.pp-coa-modal__scroll {
	flex: 1 1 auto;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 18px;
	background: #d8dee6;
}

.pp-coa-modal__pages {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	/* Grow to the widest (zoomed) page so the scroller can pan to reach it, but
	 * never narrower than the scroller so pages stay centred at zoom <= 1. */
	width: max-content;
	min-width: 100%;
	margin: 0 auto;
}

.pp-coa-modal__canvas {
	/* Display size is set inline by the viewer (base * zoom, true aspect) so a
	 * zoom > 1 visibly magnifies. Do NOT clamp width here (max-width) or force
	 * height:auto — that would pin the page to the container and distort it. */
	display: block;
	background: #fff;
	box-shadow: 0 3px 14px rgba(0, 0, 0, 0.25);
	border-radius: 2px;
}

.pp-coa-modal__status {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 160px;
	padding: 24px;
	color: var(--pp-navy, #16233f);
	font-size: 15px;
}

.pp-coa-modal__link {
	color: var(--pp-navy, #16233f);
	font-weight: 600;
	text-decoration: underline;
}

/* ---- motion preferences ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.pp-coa-canvas {
		transition: none;
	}
	.pp-coa-modal,
	.pp-coa-modal__dialog {
		animation: none;
	}
}

.pp-coa-no-motion,
.pp-coa-no-motion .pp-coa-modal__dialog {
	animation: none;
}

/* ---- small screens ----------------------------------------------------- */

@media (max-width: 600px) {
	.pp-coa-modal {
		padding: 0;
	}
	.pp-coa-modal__dialog {
		width: 100vw;
		max-height: 100vh;
		height: 100vh;
		border-radius: 0;
	}
	.pp-coa-modal__scroll {
		padding: 10px;
	}
}

@keyframes pp-coa-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes pp-coa-rise {
	from { transform: translateY(12px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}
