/* WP Gazette — numéros, lecteur et inscription */
.wgz {
	--wgz-accent: #EC6525;
	--wgz-encre: #1f2a30;
	--wgz-gris: #6b6b6b;
	--wgz-fond: #f4efe8;
	--wgz-rayon: 18px;
	color: var(--wgz-encre);
	font-family: inherit;
}
/* Sur ordinateur, la Gazette prend toute la largeur utile, même dans une page à colonne étroite. */
@media (min-width: 1000px) {
	.wgz.wgz {
		--wgz-largeur: max(100%, min(1240px, calc(100vw - 96px)));
		width: var(--wgz-largeur);
		max-width: none !important;
		margin-left: calc(50% - var(--wgz-largeur) / 2) !important;
		margin-right: 0 !important;
	}
}
.wgz *, .wgz *::before, .wgz *::after { box-sizing: border-box; }
.wgz svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wgz-vide { color: var(--wgz-gris); }

/* ---------- Les numéros (vignettes sur une ligne) ---------- */
.wgz-numeros {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	padding: 4px 4px 18px;
	margin: 0 -4px 28px;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
}
.wgz-numero {
	flex: 0 0 auto;
	width: 128px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	text-decoration: none !important;
	color: var(--wgz-encre);
	scroll-snap-align: start;
	position: relative;
}
.wgz-numero__couv {
	display: block;
	aspect-ratio: 210 / 297;
	background: #fff;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 16px rgba(0,0,0,.08);
	outline: 2px solid transparent;
	outline-offset: 3px;
	transition: transform .25s ease, box-shadow .25s ease, outline-color .2s ease;
}
.wgz-numero__couv img,
.wgz-numero__couv canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.wgz-numero:hover .wgz-numero__couv { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 12px 24px rgba(0,0,0,.12); }
.wgz-numero.is-actif .wgz-numero__couv { outline-color: var(--wgz-accent); }
.wgz-numero__titre { font-size: .9375rem; line-height: 1.3; font-weight: 500; }
.wgz-numero.is-actif .wgz-numero__titre { color: var(--wgz-accent); }
.wgz-numero__badge {
	margin-top: -4px;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--wgz-accent);
}

/* ---------- Lecteur ---------- */
.wgz-lecteur {
	background: var(--wgz-fond);
	border-radius: var(--wgz-rayon);
	padding: 18px 22px 22px;
	scroll-margin-top: 24px;
	outline: none;
}
.wgz-barre {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}
.wgz-barre__titre { display: flex; flex-direction: column; line-height: 1.25; }
.wgz-barre__nom { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wgz-gris); }
.wgz-barre__titre strong { font-size: 1.25rem; font-weight: 500; }
.wgz-barre__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wgz-bouton {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 8px 16px;
	border: 1.5px solid rgba(31,42,48,.25);
	border-radius: 999px;
	background: #fff;
	color: var(--wgz-encre) !important;
	font: inherit;
	font-size: .9375rem;
	font-weight: 500;
	text-decoration: none !important;
	cursor: pointer;
	transition: border-color .2s ease, color .2s ease;
}
.wgz-bouton:hover, .wgz-bouton:focus-visible { border-color: var(--wgz-accent); color: var(--wgz-accent) !important; }

.wgz-scene { position: relative; }
.wgz-pages {
	position: relative;
	min-height: 320px;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	overflow: hidden;
	touch-action: pan-y pinch-zoom;
}
.wgz-planche { display: flex; justify-content: center; position: relative; }
.wgz-entre-droite { animation: wgz-droite .35s ease both; }
.wgz-entre-gauche { animation: wgz-gauche .35s ease both; }
@keyframes wgz-droite { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes wgz-gauche { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

.wgz-page {
	position: relative;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 30px rgba(31,42,48,.14);
	cursor: zoom-in;
	flex: none;
}
.wgz-page canvas { display: block; }
.wgz-simple .wgz-page { border-radius: 4px; overflow: hidden; }
/* Journal ouvert : pli central ombré */
.wgz-page--gauche { border-radius: 4px 0 0 4px; }
.wgz-page--droite { border-radius: 0 4px 4px 0; }
.wgz-page--gauche::after,
.wgz-page--droite::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 34px;
	pointer-events: none;
}
.wgz-page--gauche::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.16), rgba(0,0,0,0)); }
.wgz-page--droite::after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.12), rgba(0,0,0,0)); }

.wgz-lien { position: absolute; display: block; z-index: 2; border-radius: 2px; cursor: pointer; }
.wgz-lien:hover, .wgz-lien:focus-visible { background: rgba(236,101,37,.12); outline: 2px solid var(--wgz-accent); outline-offset: 1px; }

.wgz-fleche {
	position: absolute;
	top: 50%;
	z-index: 3;
	width: 48px;
	height: 48px;
	margin-top: -24px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--wgz-encre);
	box-shadow: 0 4px 14px rgba(0,0,0,.14);
	cursor: pointer;
	transition: opacity .2s ease, color .2s ease, transform .2s ease;
}
.wgz-fleche svg { width: 22px; height: 22px; stroke-width: 2; }
.wgz-fleche:hover:not(:disabled) { color: var(--wgz-accent); transform: scale(1.06); }
.wgz-fleche:disabled { opacity: 0; pointer-events: none; }
.wgz-fleche--prec { left: 0; }
.wgz-fleche--suiv { right: 0; }

/* Sommaire : les pages en miniature, regroupées comme dans le journal */
.wgz-sommaire { margin-top: 20px; text-align: center; }
.wgz-sommaire__liste { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.wgz-sommaire__vue {
	display: flex;
	padding: 4px;
	border: 2px solid transparent;
	border-radius: 6px;
	background: none;
	cursor: pointer;
	transition: border-color .2s ease;
}
.wgz-sommaire__vue .wgz-page { box-shadow: 0 1px 3px rgba(0,0,0,.18); cursor: pointer; border-radius: 1px; }
.wgz-sommaire__vue .wgz-page::after { display: none; }
.wgz-sommaire__vue:hover { border-color: rgba(31,42,48,.2); }
.wgz-sommaire__vue.is-actif { border-color: var(--wgz-accent); }
.wgz-sommaire__etiquette { margin-top: 8px; font-size: .875rem; color: var(--wgz-gris); }

.wgz-chargement { display: flex; align-items: center; gap: 12px; color: var(--wgz-gris); padding: 120px 0; }
.wgz-chargement span { width: 22px; height: 22px; border: 2px solid rgba(0,0,0,.12); border-top-color: var(--wgz-accent); border-radius: 50%; animation: wgz-tourne .8s linear infinite; }
@keyframes wgz-tourne { to { transform: rotate(360deg); } }
.wgz-erreur { padding: 60px 0; text-align: center; }

/* Téléphone : une page à la fois, pleine largeur ; on tourne en glissant le doigt */
@media (max-width: 781px) {
	.wgz-lecteur { padding: 14px 12px 16px; margin-left: -8px; margin-right: -8px; border-radius: 14px; }
	.wgz-barre__actions { width: 100%; }
	.wgz-bouton { flex: 1; justify-content: center; }
	.wgz-fleche { width: 40px; height: 40px; margin-top: -20px; background: rgba(255,255,255,.92); }
	.wgz-fleche--prec { left: 6px; }
	.wgz-fleche--suiv { right: 6px; }
	.wgz-numero { width: 104px; }
}
@media (prefers-reduced-motion: reduce) {
	.wgz-entre-droite, .wgz-entre-gauche { animation: none; }
}

/* ---------- Loupe (plein écran) ---------- */
.wgz-sans-defilement, .wgz-sans-defilement body { overflow: hidden !important; }
.wgz-loupe {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background: #15191c;
	color: #fff;
	font-family: inherit;
}
.wgz-loupe svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wgz-loupe__haut, .wgz-loupe__bas {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
	flex: none;
}
.wgz-loupe__info { font-size: .9375rem; opacity: .85; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wgz-loupe__outils { display: flex; gap: 8px; }
.wgz-loupe__btn {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255,255,255,.25);
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}
.wgz-loupe__btn:hover { border-color: var(--wgz-accent, #EC6525); color: var(--wgz-accent, #EC6525); }
.wgz-loupe__zone {
	flex: 1;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	touch-action: manipulation;
	padding: 8px 24px 24px;
	text-align: center;
}
.wgz-loupe__zone .wgz-page { display: inline-block; margin: 0 auto; cursor: zoom-in; vertical-align: top; text-align: left; border-radius: 3px; overflow: hidden; }
.wgz-loupe__zone.is-zoom .wgz-page { cursor: zoom-out; }
.wgz-loupe__nav {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 8px 16px;
	border: 1px solid rgba(255,255,255,.25);
	border-radius: 999px;
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: .9375rem;
	cursor: pointer;
}
.wgz-loupe__nav:disabled { opacity: .3; cursor: default; }
@media (max-width: 599px) {
	.wgz-loupe__zone { padding: 0 0 16px; }
	.wgz-loupe__zone .wgz-page { border-radius: 0; }
}

/* ---------- Inscription ---------- */
.wgz-inscription {
	margin-top: clamp(40px, 6vw, 72px);
	padding: clamp(24px, 4vw, 40px);
	border-radius: var(--wgz-rayon);
	border: 1px solid rgba(31,42,48,.12);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 24px 48px;
	align-items: center;
	scroll-margin-top: 24px;
}
.wgz-inscription h2 { margin: 0 0 8px; font-size: clamp(1.375rem, 2.2vw, 1.75rem); }
.wgz-inscription p { margin: 0; color: var(--wgz-gris); }
.wgz-inscription__form input[type="email"],
.wgz-inscription__form input[type="text"] {
	width: 100%;
	min-height: 48px;
	padding: 10px 16px;
	border: 1.5px solid rgba(31,42,48,.2);
	border-radius: 12px;
	font: inherit;
	background: #fff;
}
.wgz-inscription__form input:focus { border-color: var(--wgz-accent); outline: none; }
.wgz-inscription__form input[type="submit"],
.wgz-inscription__form button {
	min-height: 48px;
	padding: 10px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--wgz-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
@media (max-width: 781px) {
	.wgz-inscription { grid-template-columns: 1fr; }
}
