/* FGJ Instagram Feed — liste verticale, médias en contain. */

.fgj-ig-feed {
	--fgj-ig-border: #ddd8d0;
	--fgj-ig-muted: #706c66;
	--fgj-ig-surface: #f7f5f1;
	--fgj-ig-accent: #222;
	margin: 2em 0;
}

.fgj-ig-feed *,
.fgj-ig-feed *::before,
.fgj-ig-feed *::after {
	box-sizing: border-box;
}

.fgj-ig-profile {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 28px;
	color: inherit;
	text-decoration: none;
}

.fgj-ig-profile:hover,
.fgj-ig-profile:focus {
	text-decoration: none;
}

.fgj-ig-profile-avatar {
	display: block;
	width: 72px;
	height: 72px;
	max-width: none;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid var(--fgj-ig-border);
	background: var(--fgj-ig-surface);
}

.fgj-ig-profile-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.fgj-ig-profile-name {
	font-size: 1.08em;
	line-height: 1.25;
}

.fgj-ig-profile-user {
	color: var(--fgj-ig-muted);
	font-size: 0.94em;
}

.fgj-ig-posts {
	display: block;
}

.fgj-ig-post {
	display: grid;
	grid-template-columns: minmax(300px, 46%) minmax(0, 1fr);
	gap: 28px;
	align-items: stretch;
	margin: 0 0 48px;
}

.fgj-ig-media {
	position: relative;
	height: 100%;
	min-height: 0;
	overflow: hidden;
	border: 1px solid var(--fgj-ig-border);
	background: var(--fgj-ig-surface);
}

.fgj-ig-single,
.fgj-ig-carousel {
	display: block;
	width: 100%;
	height: 100%;
}

.fgj-ig-carousel {
	position: relative;
	overflow: hidden;
}

.fgj-ig-track {
	display: flex;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.fgj-ig-track::-webkit-scrollbar {
	display: none;
}

.fgj-ig-slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.fgj-ig-visual-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.fgj-ig-image,
.fgj-ig-video {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	object-fit: contain;
	object-position: center center;
	background: transparent;
	transform: none;
}

.fgj-ig-video {
	background: #111;
}

.fgj-ig-video-badge {
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.58);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	pointer-events: none;
}

.fgj-ig-nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: #222;
	cursor: pointer;
	opacity: 0;
	transform: translateY(-50%) scale(0.92);
	transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.fgj-ig-nav svg {
	display: block;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.fgj-ig-carousel:hover .fgj-ig-nav,
.fgj-ig-carousel:focus-within .fgj-ig-nav,
.fgj-ig-nav:focus-visible {
	opacity: 1;
	transform: translateY(-50%) scale(1);
}

.fgj-ig-nav:hover,
.fgj-ig-nav:focus {
	background: #fff;
}

.fgj-ig-prev { left: 9px; }
.fgj-ig-next { right: 9px; }

.fgj-ig-counter {
	position: absolute;
	right: 9px;
	bottom: 8px;
	z-index: 3;
	padding: 2px 7px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.58);
	color: #fff;
	font-size: 11px;
	line-height: 1.5;
}

.fgj-ig-content {
	min-width: 0;
	padding: 1px 0;
}

.fgj-ig-meta {
	display: flex;
	align-items: baseline;
	justify-content: flex-start;
	gap: 18px;
	margin: 0 0 0.85em;
}

.fgj-ig-feed .fgj-ig-content a.fgj-ig-date-link {
	display: block;
	margin-left: 0;
	color: #8d8983;
	text-decoration: none;
}

.fgj-ig-feed .fgj-ig-content a.fgj-ig-date-link:hover,
.fgj-ig-feed .fgj-ig-content a.fgj-ig-date-link:focus {
	color: #5f5b56;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.fgj-ig-date {
	display: block;
	margin: 0;
	color: inherit;
	font-size: 0.9em;
	font-weight: 400;
	line-height: 1.4;
	text-align: right;
	white-space: nowrap;
}

.fgj-ig-caption {
	font-size: 1em;
	line-height: 1.66;
	overflow-wrap: anywhere;
	white-space: normal;
}

.fgj-ig-mention {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.fgj-ig-mention:hover,
.fgj-ig-mention:focus {
	color: #000;
}

.fgj-ig-actions {
	display: flex;
	justify-content: center;
	margin: 10px 0 34px;
}

.fgj-ig-load-more {
	display: inline-block;
	padding: 10px 22px;
	border: 1px solid #222;
	border-radius: 0;
	background: #fff;
	color: #222;
	font: inherit;
	cursor: pointer;
}

.fgj-ig-load-more:hover,
.fgj-ig-load-more:focus {
	background: #222;
	color: #fff;
}

.fgj-ig-load-more:disabled {
	cursor: wait;
	opacity: 0.65;
}

.fgj-ig-empty,
.fgj-ig-error,
.fgj-ig-load-error,
.fgj-ig-noscript {
	color: var(--fgj-ig-muted);
}

.fgj-ig-error-detail {
	display: block;
	margin-top: 4px;
	font-size: 0.85em;
}

/* Le thème Touchfolio limite certaines images à 150 px sur petit écran. */
.entry-content .fgj-ig-feed img,
.fgj-ig-feed .entry-content img,
.fgj-ig-feed img {
	max-width: none;
}

@media only screen and (max-width: 840px) {
	.fgj-ig-post {
		grid-template-columns: 1fr;
		gap: 16px;
		margin-bottom: 42px;
	}

	.fgj-ig-media {
		height: auto;
		aspect-ratio: 4 / 5;
	}

	.fgj-ig-date {
		text-align: left;
	}

	.fgj-ig-profile-avatar {
		width: 58px;
		height: 58px;
	}
}

@media only screen and (max-width: 500px) {
	.fgj-ig-feed {
		margin-top: 1.5em;
	}

	.fgj-ig-post {
		margin-bottom: 38px;
	}

	.fgj-ig-nav {
		width: 32px;
		height: 32px;
		font-size: 24px;
	}
}
