/**
 * Nouyouin Aperçu PDF — galerie d'extrait.
 */

.nyap {
	--nyap-green: #184d47;
	--nyap-orange: #c14426;
	--nyap-muted: #6d6a63;
	--nyap-line: #e8e2d6;
	--nyap-soft: #faf8f4;
	margin: 10px 0 24px;
}

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

.nyap-head { margin-bottom: 18px; }

.nyap-title {
	margin: 0 0 4px;
	font-size: clamp(19px, 2.2vw, 24px);
	font-weight: 800;
	color: var(--nyap-green);
}

.nyap-sub {
	margin: 0;
	font-size: 14px;
	color: var(--nyap-muted);
}

.nyap-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 20px;
}

.nyap-page { margin: 0; }

.nyap-open {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 1px solid var(--nyap-line);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	cursor: zoom-in;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.nyap-open:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.nyap-open img {
	width: 100%;
	height: auto;
	display: block;
	/* Décourage l'enregistrement direct de l'image. */
	pointer-events: none;
	user-select: none;
}

.nyap-zoom {
	position: absolute;
	right: 10px;
	bottom: 10px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(24, 77, 71, 0.85);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
}

.nyap-caption {
	margin-top: 8px;
	text-align: center;
	font-size: 13px;
	color: var(--nyap-muted);
}

.nyap-teaser {
	margin: 22px 0 0;
	padding: 16px 18px;
	background: var(--nyap-soft);
	border-left: 4px solid var(--nyap-orange);
	border-radius: 8px;
	font-size: 15px;
	color: #3a2d1c;
}

/* ---------- Visionneuse ---------- */
.nyap-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px 20px;
	background: rgba(12, 12, 12, 0.94);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.nyap-lightbox.is-open { opacity: 1; pointer-events: auto; }

.nyap-lightbox img {
	max-width: 100%;
	max-height: 88vh;
	border-radius: 8px;
	user-select: none;
	pointer-events: none;
}

.nyap-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	font-size: 22px;
	cursor: pointer;
}

.nyap-nav:hover { background: var(--nyap-orange); }
.nyap-prev { left: 18px; }
.nyap-next { right: 18px; }

.nyap-close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	font-size: 22px;
	cursor: pointer;
}

.nyap-close:hover { background: var(--nyap-orange); }

.nyap-counter {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
}

@media (max-width: 560px) {
	.nyap-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
	.nyap-nav { width: 38px; height: 38px; }
	.nyap-prev { left: 8px; }
	.nyap-next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.nyap-open, .nyap-lightbox { transition: none; }
	.nyap-open:hover { transform: none; }
}

/* ---------- Bouton « Prévisualiser » près du panier ---------- */
.nyap-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 10px 0 0;
	padding: 12px 22px;
	border: 2px solid #184d47;
	border-radius: 10px;
	background: transparent;
	color: #184d47 !important;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
	vertical-align: middle;
}

.nyap-btn:hover,
.nyap-btn:focus-visible {
	background: #184d47;
	border-color: #184d47;
	color: #fff !important;
}

/* ---------- Nombre de pages sous le prix ---------- */
.nyap-pages {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 14px;
	padding: 6px 14px;
	border-radius: 999px;
	background: #faf8f4;
	border: 1px solid #e8e2d6;
	font-size: 14px;
	font-weight: 600;
	color: #3a2d1c;
}

@media (max-width: 560px) {
	.nyap-btn { width: 100%; justify-content: center; }
}
