/*
 * Atmo Guyane : diaporamas et visionneuse des images d'articles (CREATIV3)
 * Utilisé par js/atmo-diaporama.js. Couleurs du thème : bleu #364B9B, cyan #0BBBEF,
 * dégradé du footer #53CFF4 > #8ED6A7 > #F5A415.
 */

:root {
	--atmo-bleu: #364B9B;
	--atmo-cyan: #0BBBEF;
	--atmo-degrade: linear-gradient(90deg, #53CFF4 0%, #8ED6A7 50%, #F5A415 100%);
	--atmo-nuit: #17224d;
}

/* ------------------------------------------------------------------
   Image seule dans le texte
   ------------------------------------------------------------------ */
[data-atmo-diaporama] .spip_document_image,
[data-atmo-diaporama] .spip_documents_center {
	margin: 1.75rem auto;
}

img.atmo-photo {
	display: block;
	max-width: 100%;
	height: auto;
	max-height: 560px;
	margin: 0 auto;
	border-radius: 14px;
	box-shadow: 0 14px 34px rgba(23, 34, 77, .16);
	object-fit: contain;
	transition: transform .3s ease, box-shadow .3s ease;
}

img.atmo-photo--portrait {
	max-height: 620px;
}

.atmo-photo__lien {
	display: block;
	position: relative;
	max-width: max-content;
	margin: 0 auto;
	border-radius: 14px;
	cursor: zoom-in;
}

.atmo-photo__lien:hover img.atmo-photo,
.atmo-photo__lien:focus-visible img.atmo-photo {
	transform: translateY(-2px);
	box-shadow: 0 20px 40px rgba(23, 34, 77, .22);
}

.atmo-photo__lien:focus-visible {
	outline: 3px solid var(--atmo-cyan);
	outline-offset: 4px;
}

/* ------------------------------------------------------------------
   Diaporama
   ------------------------------------------------------------------ */
.atmo-diapo {
	margin: 2rem 0;
}

.atmo-diapo__scene {
	position: relative;
	overflow: hidden;
	border-radius: 18px;
	background: var(--atmo-nuit);
	box-shadow: 0 18px 40px rgba(23, 34, 77, .22);
	isolation: isolate;
}

.atmo-diapo__piste {
	display: flex;
	aspect-ratio: 16 / 10;
	max-height: 520px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.atmo-diapo__piste::-webkit-scrollbar {
	display: none;
}

.atmo-diapo__piste:focus-visible {
	outline: 3px solid var(--atmo-cyan);
	outline-offset: -3px;
}

.atmo-diapo__vue {
	position: relative;
	flex: 0 0 100%;
	height: 100%;
	margin: 0;
	overflow: hidden;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

/* Fond flouté : la photo entière reste visible, sans bandes noires */
.atmo-diapo__fond {
	position: absolute;
	inset: -40px;
	width: calc(100% + 80px);
	height: calc(100% + 80px);
	object-fit: cover;
	filter: blur(26px) saturate(1.2) brightness(.65);
	z-index: 0;
}

.atmo-diapo__img {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	cursor: zoom-in;
}

/* Boutons */
.atmo-diapo__fleche,
.atmo-diapo__agrandir {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--atmo-bleu);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, transform .2s ease, opacity .2s ease;
}

.atmo-diapo__fleche {
	top: 50%;
	transform: translateY(-50%);
}

.atmo-diapo__fleche--prec { left: 16px; }
.atmo-diapo__fleche--suiv { right: 16px; }

.atmo-diapo__agrandir {
	top: 14px;
	right: 14px;
	width: 40px;
	height: 40px;
}

.atmo-diapo__fleche svg,
.atmo-diapo__agrandir svg,
.atmo-visionneuse button svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.atmo-diapo__agrandir svg {
	width: 18px;
	height: 18px;
}

.atmo-diapo__fleche:hover,
.atmo-diapo__fleche:focus-visible,
.atmo-diapo__agrandir:hover,
.atmo-diapo__agrandir:focus-visible {
	background: var(--atmo-cyan);
	color: #fff;
}

.atmo-diapo__fleche:focus-visible,
.atmo-diapo__agrandir:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.atmo-diapo__fleche:disabled {
	opacity: 0;
	pointer-events: none;
}

/* Compteur et barre de progression aux couleurs Atmo */
.atmo-diapo__compteur {
	position: absolute;
	z-index: 2;
	top: 14px;
	left: 14px;
	padding: .35rem .8rem;
	border-radius: 2rem;
	background: rgba(23, 34, 77, .72);
	color: #fff;
	font-size: .8rem;
	font-weight: 600;
	letter-spacing: .04em;
	line-height: 1.2;
	backdrop-filter: blur(4px);
}

.atmo-diapo__progres {
	position: absolute;
	z-index: 2;
	left: 0;
	bottom: 0;
	height: 5px;
	width: 0;
	background: var(--atmo-degrade);
	background-size: 100vw 100%;
	transition: width .35s ease;
}

/* Légende */
.atmo-diapo__legende {
	margin: .75rem .25rem 0;
	color: #5b6478;
	font-size: .9rem;
	font-style: italic;
	text-align: center;
}

/* Vignettes */
.atmo-diapo__vignettes {
	display: flex;
	gap: .6rem;
	margin-top: .9rem;
	padding: .3rem .2rem .5rem;
	overflow-x: auto;
	scrollbar-width: thin;
}

.atmo-diapo__vignette {
	position: relative;
	flex: 0 0 auto;
	width: 84px;
	height: 58px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: none;
	overflow: hidden;
	opacity: .55;
	cursor: pointer;
	transition: opacity .2s ease, transform .2s ease;
}

.atmo-diapo__vignette img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.atmo-diapo__vignette::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 10px;
	border: 3px solid transparent;
}

.atmo-diapo__vignette:hover,
.atmo-diapo__vignette:focus-visible {
	opacity: .9;
}

.atmo-diapo__vignette[aria-current="true"] {
	opacity: 1;
	transform: translateY(-2px);
}

.atmo-diapo__vignette[aria-current="true"]::after {
	border-color: var(--atmo-cyan);
}

.atmo-diapo__vignette:focus-visible {
	outline: 3px solid var(--atmo-bleu);
	outline-offset: 2px;
}

@media (max-width: 575px) {
	.atmo-diapo__scene { border-radius: 12px; }
	.atmo-diapo__fleche { width: 38px; height: 38px; }
	.atmo-diapo__fleche--prec { left: 8px; }
	.atmo-diapo__fleche--suiv { right: 8px; }
	.atmo-diapo__vignette { width: 64px; height: 46px; }
}

/* ------------------------------------------------------------------
   Visionneuse plein écran
   ------------------------------------------------------------------ */
html.atmo-visionneuse-ouverte {
	overflow: hidden;
}

.atmo-visionneuse {
	width: 100vw;
	height: 100vh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
}

.atmo-visionneuse::backdrop {
	background: rgba(13, 20, 46, .92);
}

.atmo-visionneuse__cadre {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	width: 100%;
	height: 100%;
	padding: 4.5rem 5rem 3rem;
	box-sizing: border-box;
}

.atmo-visionneuse__img {
	max-width: 100%;
	max-height: calc(100vh - 10rem);
	object-fit: contain;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.atmo-visionneuse__legende {
	margin: 0;
	max-width: 60rem;
	color: #e7ebf5;
	font-size: .95rem;
	text-align: center;
}

.atmo-visionneuse button {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease;
}

.atmo-visionneuse button:hover,
.atmo-visionneuse button:focus-visible {
	background: var(--atmo-cyan);
}

.atmo-visionneuse button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.atmo-visionneuse button:disabled {
	opacity: .25;
	cursor: default;
	background: rgba(255, 255, 255, .12);
}

.atmo-visionneuse__fleche {
	top: 50%;
	transform: translateY(-50%);
}

.atmo-visionneuse__fleche--prec { left: 1.25rem; }
.atmo-visionneuse__fleche--suiv { right: 1.25rem; }

.atmo-visionneuse__fermer {
	top: 1.25rem;
	right: 1.25rem;
}

.atmo-visionneuse__compteur {
	position: absolute;
	top: 1.6rem;
	left: 1.5rem;
	font-weight: 600;
	letter-spacing: .05em;
}

@media (max-width: 767px) {
	.atmo-visionneuse__cadre { padding: 4rem 1rem 5.5rem; }
	.atmo-visionneuse__fleche { top: auto; bottom: 1.25rem; transform: none; }
	.atmo-visionneuse__fleche--prec { left: calc(50% - 64px); }
	.atmo-visionneuse__fleche--suiv { right: calc(50% - 64px); }
}

@media (prefers-reduced-motion: reduce) {
	.atmo-diapo__piste { scroll-behavior: auto; }
	.atmo-diapo__progres,
	img.atmo-photo,
	.atmo-diapo__vignette { transition: none; }
}
