/* Artisites Instagram — fil (intégration officielle du profil).
   Surchargeable par le thème via les variables --aif-*. */

.aif {
	--aif-btn-bg: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	--aif-btn-text: #fff;
	--aif-radius: 12px;
	box-sizing: border-box;
	max-width: calc(var(--aif-max, 900px) + 32px);
	margin: 0 auto;
	padding: 48px 16px;
}

.aif__title {
	margin: 0 0 20px;
	text-align: center;
}

/* L'intégration Instagram = en-tête de profil (~165 px) + 2 rangées de
   3 carrés (2/3 de la largeur). Le padding en % suit la largeur. */
.aif-frame {
	position: relative;
	height: 0;
	padding-top: calc(66.67% + 165px);
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, .08);
	border-radius: var(--aif-radius);
	background: #fff;
}
.aif-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.aif-foot {
	margin: 20px 0 0;
	text-align: center;
}
.aif-follow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 999px;
	background: var(--aif-btn-bg);
	color: var(--aif-btn-text);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease;
}
.aif-follow:hover,
.aif-follow:focus-visible {
	color: var(--aif-btn-text);
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(220, 39, 67, .3);
}
.aif-follow:focus-visible { outline: 3px solid #dc2743; outline-offset: 3px; }
.aif-follow__icon { width: 18px; height: 18px; }

/* Grille Artisites (publications saisies, avec vues et j'aime). */
.aif__handle {
	margin: -12px 0 20px;
	text-align: center;
	font-weight: 600;
}
.aif__handle a { color: inherit; text-decoration: none; }
.aif__handle a:hover, .aif__handle a:focus-visible { text-decoration: underline; }

.aif-grid {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
}
.aif-post { margin: 0; }
.aif-post__link {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: var(--aif-radius);
	background: #f2f2f2;
	color: #fff;
	text-decoration: none;
}
.aif-post__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
}
/* Voile bas : chiffres lisibles sur toute photo. */
.aif-post__link::after {
	content: "";
	position: absolute;
	inset: 55% 0 0;
	background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent);
	pointer-events: none;
}
.aif-post__stats {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 8px;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.2;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.aif-post__stat { display: inline-flex; align-items: center; gap: 5px; }
.aif-post__stat svg { width: 16px; height: 16px; flex: none; }
.aif-post__reel {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 1;
	display: flex;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
}
.aif-post__reel svg { width: 22px; height: 22px; }
.aif-post__legende {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 14px 38px;
	background: rgba(0, 0, 0, .55);
	font-size: .875rem;
	line-height: 1.35;
	text-align: center;
	opacity: 0;
	transition: opacity .2s ease;
}
.aif-post__link:hover .aif-post__img,
.aif-post__link:focus-visible .aif-post__img { transform: scale(1.04); }
.aif-post__link:hover .aif-post__legende,
.aif-post__link:focus-visible .aif-post__legende { opacity: 1; }
.aif-post__link:focus-visible { outline: 3px solid #dc2743; outline-offset: 2px; }

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

@media (max-width: 600px) {
	.aif { padding: 36px 16px; }
	.aif-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
	.aif-post__stats { font-size: .8rem; gap: 2px 10px; }
	.aif-frame { padding-top: calc(66.67% + 155px); }
}

@media (prefers-reduced-motion: reduce) {
	.aif-follow, .aif-post__img, .aif-post__legende { transition: none; }
	.aif-post__link:hover .aif-post__img, .aif-post__link:focus-visible .aif-post__img { transform: none; }
}
