/* Flux Instagram – Ombeline Treich
   Reprend les réglages globaux Elementor du site (couleurs, polices) avec des valeurs de secours. */

.otig,
.otig-lb {
	--otig-ink: var(--e-global-color-primary, #121517);
	--otig-sand: var(--e-global-color-secondary, #D6CCC2);
	--otig-mist: #EDEDE9;
	--otig-paper: #fff;
	--otig-font-title: var(--e-global-typography-primary-font-family, "Juliette Regular"), "Cormorant Garamond", Georgia, serif;
	--otig-font-text: var(--e-global-typography-text-font-family, "Fira Sans"), system-ui, -apple-system, "Segoe UI", sans-serif;
	--otig-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ------------------------------------------------------------ Section */

.otig {
	--otig-gap: 8px;
	--otig-ratio: 4 / 5;
	width: 100%;
	color: var(--otig-ink);
	font-family: var(--otig-font-text);
}
.otig--carre { --otig-ratio: 1 / 1; }

.otig .otig__head {
	margin: 0 0 36px;
	text-align: center;
}
.otig .otig__title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: var(--otig-font-title);
	font-size: clamp(28px, 3.6vw, 36px);
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
}
.otig .otig__handle {
	margin: 4px 0 0;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.5;
	letter-spacing: .04em;
}
.otig .otig__handle a {
	color: inherit;
	text-decoration: none;
	background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
	transition: background-size .4s var(--otig-ease);
}
.otig .otig__handle a:hover,
.otig .otig__handle a:focus-visible { background-size: 100% 1px; }

.otig .otig__grid {
	display: grid;
	grid-template-columns: repeat(var(--otig-cols, 4), minmax(0, 1fr));
	gap: var(--otig-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}
.otig .otig__item {
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}
.otig .otig__item::before,
.otig .otig__item::marker { content: none; }

.otig .otig__tile {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: var(--otig-ratio);
	background: var(--otig-mist);
	color: #fff;
	text-decoration: none;
	outline: none;
}
.otig .otig__tile img {
	position: absolute;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
	transition: transform .9s var(--otig-ease);
}
.otig .otig__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 20px;
	height: 20px;
	color: #fff;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
	pointer-events: none;
}
.otig .otig__badge svg { display: block; width: 100%; height: 100%; fill: currentColor; }

.otig .otig__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 18px 16px;
	background: linear-gradient(to top, rgba(18, 21, 23, .78) 0%, rgba(18, 21, 23, .25) 45%, rgba(18, 21, 23, 0) 70%);
	opacity: 0;
	transition: opacity .45s var(--otig-ease);
	pointer-events: none;
}
.otig .otig__excerpt {
	display: -webkit-box;
	overflow: hidden;
	color: var(--otig-mist);
	font-size: 14px;
	font-weight: 300;
	line-height: 1.45;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	transform: translateY(8px);
	transition: transform .45s var(--otig-ease);
}

@media (hover: hover) {
	.otig .otig__tile:hover img { transform: scale(1.045); }
	.otig .otig__tile:hover .otig__overlay { opacity: 1; }
	.otig .otig__tile:hover .otig__excerpt { transform: none; }
}
.otig .otig__tile:focus-visible { outline: 2px solid var(--otig-ink); outline-offset: 3px; }
.otig .otig__tile:focus-visible .otig__overlay { opacity: 1; }
.otig .otig__tile:focus-visible .otig__excerpt { transform: none; }

.otig .otig__progress { display: none; }

.otig .otig__foot {
	margin-top: 36px;
	text-align: center;
}
.otig .otig__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 30px;
	border: 0;
	border-radius: 0;
	background: var(--otig-ink);
	color: var(--otig-mist);
	font-family: var(--otig-font-title);
	font-size: 16px;
	font-weight: 600;
	line-height: 16px;
	text-decoration: none;
	transition: background-color .3s, color .3s;
}
.otig .otig__btn:hover,
.otig .otig__btn:focus-visible {
	background: var(--otig-sand);
	color: var(--otig-ink);
}
.otig .otig__btn:focus-visible { outline: 2px solid var(--otig-ink); outline-offset: 3px; }
.otig .otig__ig { width: 17px; height: 17px; flex: none; }

.otig .otig-sr,
.otig-lb .otig-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Mobile (point de rupture Elementor : 767 px) */
@media (max-width: 767px) {
	.otig .otig__head { margin-bottom: 24px; }
	.otig .otig__foot { margin-top: 28px; }
	.otig .otig__overlay { display: none; }

	.otig--m-grille .otig__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 6px;
	}

	.otig--m-carrousel .otig__grid {
		display: flex;
		gap: 10px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.otig--m-carrousel .otig__grid::-webkit-scrollbar { display: none; }
	.otig--m-carrousel .otig__item {
		flex: 0 0 72%;
		scroll-snap-align: start;
	}
	.otig--m-carrousel.otig--scrollable .otig__progress {
		display: block;
		position: relative;
		height: 2px;
		margin: 18px auto 0;
		max-width: 160px;
		overflow: hidden;
		background: var(--otig-mist);
	}
	.otig--m-carrousel .otig__progress span {
		display: block;
		height: 100%;
		width: 30%;
		background: var(--otig-ink);
	}
}

/* ------------------------------------------------------- Visionneuse */

html.otig-lock { overflow: hidden; }

dialog.otig-lb {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--otig-ink);
	font-family: var(--otig-font-text);
	overflow: hidden;
	--otig-ar: .8;
	--otig-side: 340px;
	--otig-h: min(calc(100vh - 96px), calc((min(100vw - 176px, 1120px) - var(--otig-side)) / var(--otig-ar)));
}
dialog.otig-lb[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}
dialog.otig-lb::backdrop { background: rgba(18, 21, 23, .9); }
dialog.otig-lb:focus { outline: none; }

.otig-lb .otig-lb__panel {
	display: flex;
	height: var(--otig-h);
	background: var(--otig-paper);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.otig-lb .otig-lb__panel.is-in { animation: otig-in .45s var(--otig-ease); }
@keyframes otig-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

.otig-lb .otig-lb__media {
	position: relative;
	flex: none;
	width: calc(var(--otig-h) * var(--otig-ar));
	height: 100%;
	background: #0d0f10;
}
.otig-lb .otig-lb__track {
	position: absolute;
	inset: 0;
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.otig-lb .otig-lb__track::-webkit-scrollbar { display: none; }
.otig-lb .otig-lb__slide {
	position: relative;
	flex: 0 0 100%;
	height: 100%;
	scroll-snap-align: center;
}
.otig-lb .otig-lb__slide img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: contain;
}

.otig-lb .otig-lb__play {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	color: #fff;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: .02em;
	text-decoration: none;
	background: rgba(18, 21, 23, .25);
	transition: background-color .3s;
}
.otig-lb .otig-lb__play:hover { background: rgba(18, 21, 23, .4); color: #fff; }
.otig-lb .otig-lb__playicon {
	display: grid;
	place-items: center;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--otig-ink);
}
.otig-lb .otig-lb__playicon svg { width: 26px; height: 26px; margin-left: 4px; fill: currentColor; }

.otig-lb .otig-lb__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 14px;
	display: flex;
	justify-content: center;
	gap: 6px;
	pointer-events: none;
}
.otig-lb .otig-lb__dots button {
	width: 6px;
	height: 6px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .5);
	pointer-events: auto;
	cursor: pointer;
	transition: background-color .3s, transform .3s;
}
.otig-lb .otig-lb__dots button.is-active { background: #fff; transform: scale(1.25); }

.otig-lb .otig-lb__side {
	position: relative;
	flex: none;
	width: var(--otig-side);
}
.otig-lb .otig-lb__scroll {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	padding: 30px 30px 26px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.otig-lb .otig-lb__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 0 20px;
	padding: 0 0 18px;
	border-bottom: 1px solid var(--otig-mist);
}
.otig-lb .otig-lb__user {
	color: var(--otig-ink);
	font-family: var(--otig-font-title);
	font-size: 22px;
	line-height: 1.4;
	text-decoration: none;
}
.otig-lb .otig-lb__user:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.otig-lb .otig-lb__date {
	font-size: 13px;
	font-weight: 300;
	letter-spacing: .03em;
	opacity: .7;
}
.otig-lb .otig-lb__caption {
	font-size: 15px;
	font-weight: 300;
	line-height: 1.65;
	overflow-wrap: anywhere;
}
.otig-lb .otig-lb__caption p { margin: 0 0 .85em; padding: 0; }
.otig-lb .otig-lb__caption p:last-child { margin-bottom: 0; }

.otig-lb .otig-lb__link {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 10px;
	margin-top: auto;
	padding: 12px 24px;
	background: var(--otig-ink);
	color: var(--otig-mist);
	font-family: var(--otig-font-title);
	font-size: 16px;
	font-weight: 600;
	line-height: 16px;
	text-decoration: none;
	transition: background-color .3s, color .3s;
}
.otig-lb .otig-lb__caption { margin-bottom: 28px; }
.otig-lb .otig-lb__link:hover,
.otig-lb .otig-lb__link:focus-visible { background: var(--otig-sand); color: var(--otig-ink); }
.otig-lb .otig-lb__link svg {
	width: 15px;
	height: 15px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Boutons de la visionneuse : neutralise les styles de bouton du thème. */
.otig-lb button.otig-lb__btn,
.otig-lb button.otig-lb__btn:hover,
.otig-lb button.otig-lb__btn:focus {
	position: fixed;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	opacity: .8;
	transition: opacity .25s, background-color .25s;
}
.otig-lb button.otig-lb__btn:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.otig-lb button.otig-lb__btn:focus-visible { opacity: 1; outline: 2px solid #fff; outline-offset: 2px; }
.otig-lb button.otig-lb__btn[hidden] { display: none; }
.otig-lb .otig-lb__btn svg {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.otig-lb .otig-lb__close { top: 18px; right: 18px; }
.otig-lb .otig-lb__prev { top: calc(50% - 24px); left: 22px; }
.otig-lb .otig-lb__next { top: calc(50% - 24px); right: 22px; }

.otig-lb .otig-lb__count {
	position: fixed;
	bottom: 18px;
	left: 0;
	right: 0;
	margin: 0;
	color: rgba(255, 255, 255, .75);
	font-size: 13px;
	font-weight: 300;
	letter-spacing: .08em;
	text-align: center;
	pointer-events: none;
}

/* Visionneuse sur tablette portrait et mobile : image en haut, texte dessous. */
@media (max-width: 900px) {
	dialog.otig-lb {
		--otig-mh: min(calc(100vw / var(--otig-ar)), 62vh);
	}
	dialog.otig-lb[open] { align-items: stretch; }
	.otig-lb .otig-lb__panel {
		flex-direction: column;
		width: 100%;
		height: 100%;
		box-shadow: none;
	}
	.otig-lb .otig-lb__media {
		width: 100%;
		height: var(--otig-mh);
	}
	.otig-lb .otig-lb__side { flex: 1; width: 100%; }
	.otig-lb .otig-lb__scroll { padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }
	.otig-lb .otig-lb__user { font-size: 20px; }
	.otig-lb .otig-lb__count { display: none; }

	.otig-lb button.otig-lb__btn,
	.otig-lb button.otig-lb__btn:hover,
	.otig-lb button.otig-lb__btn:focus {
		position: absolute;
		width: 40px;
		height: 40px;
		background: rgba(18, 21, 23, .45);
		opacity: 1;
	}
	.otig-lb .otig-lb__btn svg { width: 22px; height: 22px; }
	.otig-lb .otig-lb__close { top: 12px; right: 12px; }
	.otig-lb .otig-lb__prev { top: calc(var(--otig-mh) / 2 - 20px); left: 10px; }
	.otig-lb .otig-lb__next { top: calc(var(--otig-mh) / 2 - 20px); right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.otig .otig__tile img,
	.otig .otig__overlay,
	.otig .otig__excerpt { transition: none; }
	.otig-lb .otig-lb__panel.is-in { animation: none; }
}
