/* Galeries dans l’analyse détaillée des fiches logiciel (shortcode + blocs). */

.gf-single__content .gallery {
	display: grid;
	grid-template-columns: repeat(var(--gf-gallery-cols, 3), minmax(0, 1fr));
	gap: var(--gf-space-3);
	margin: var(--gf-space-5) 0;
}

.gf-single__content .gallery-columns-1 { --gf-gallery-cols: 1; }
.gf-single__content .gallery-columns-2 { --gf-gallery-cols: 2; }
.gf-single__content .gallery-columns-3 { --gf-gallery-cols: 3; }
.gf-single__content .gallery-columns-4 { --gf-gallery-cols: 4; }
.gf-single__content .gallery-columns-5 { --gf-gallery-cols: 5; }
.gf-single__content .gallery-columns-6 { --gf-gallery-cols: 6; }
.gf-single__content .gallery-columns-7 { --gf-gallery-cols: 7; }
.gf-single__content .gallery-columns-8 { --gf-gallery-cols: 8; }
.gf-single__content .gallery-columns-9 { --gf-gallery-cols: 9; }

.gf-single__content .gallery br {
	display: none;
}

.gf-single__content .gallery .gallery-item {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	text-align: center;
}

.gf-single__content .gallery-icon {
	margin: 0;
}

.gf-single__content .gallery-icon a {
	display: block;
	border-radius: var(--gf-r-md);
	overflow: hidden;
	border: 1px solid var(--gf-line);
	background: var(--gf-surface);
	transition: box-shadow var(--gf-dur) var(--gf-ease), border-color var(--gf-dur) var(--gf-ease);
}

.gf-single__content .gallery-icon a:hover,
.gf-single__content .gallery-icon a:focus-visible {
	border-color: var(--gf-brand);
	box-shadow: 0 4px 16px rgba(31, 79, 216, 0.12);
}

.gf-single__content .gallery-icon img,
.gf-single__content .wp-block-gallery img,
.gf-single__content .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
}

.gf-single__content .gallery-caption {
	margin: var(--gf-space-2) 0 0;
	font-size: var(--gf-fs-sm);
	color: var(--gf-muted);
}

.gf-single__content .wp-block-gallery {
	display: grid;
	grid-template-columns: repeat(var(--gf-gallery-cols, 3), minmax(0, 1fr));
	gap: var(--gf-space-3);
	margin: var(--gf-space-5) 0;
	list-style: none;
	padding: 0;
}

.gf-single__content .wp-block-gallery.columns-1 { --gf-gallery-cols: 1; }
.gf-single__content .wp-block-gallery.columns-2 { --gf-gallery-cols: 2; }
.gf-single__content .wp-block-gallery.columns-3 { --gf-gallery-cols: 3; }
.gf-single__content .wp-block-gallery.columns-4 { --gf-gallery-cols: 4; }
.gf-single__content .wp-block-gallery.columns-5 { --gf-gallery-cols: 5; }
.gf-single__content .wp-block-gallery.columns-6 { --gf-gallery-cols: 6; }
.gf-single__content .wp-block-gallery.columns-7 { --gf-gallery-cols: 7; }
.gf-single__content .wp-block-gallery.columns-8 { --gf-gallery-cols: 8; }

.gf-single__content .wp-block-gallery .wp-block-image {
	margin: 0;
}

.gf-single__content .wp-block-gallery .wp-block-image a {
	display: block;
	border-radius: var(--gf-r-md);
	overflow: hidden;
	border: 1px solid var(--gf-line);
}

/* Lightbox (dialog natif) */
.gf-gallery-lightbox {
	padding: 0;
	border: 0;
	border-radius: var(--gf-r-md);
	max-width: min(96vw, 1200px);
	width: max-content;
	background: var(--gf-surface);
	box-shadow: 0 24px 64px rgba(22, 24, 29, 0.28);
}

.gf-gallery-lightbox::backdrop {
	background: rgba(22, 24, 29, 0.72);
	backdrop-filter: blur(4px);
}

.gf-gallery-lightbox__figure {
	margin: 0;
	padding: var(--gf-space-4);
}

.gf-gallery-lightbox__img {
	display: block;
	max-width: min(92vw, 1120px);
	max-height: 85vh;
	width: auto;
	height: auto;
	margin: 0 auto;
	border-radius: var(--gf-r-sm);
}

.gf-gallery-lightbox__caption {
	margin: var(--gf-space-3) 0 0;
	text-align: center;
	font-size: var(--gf-fs-sm);
	color: var(--gf-muted);
}

.gf-gallery-lightbox__close {
	position: absolute;
	top: var(--gf-space-2);
	right: var(--gf-space-2);
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	border-radius: 50%;
	background: var(--gf-ink);
	color: #fff;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
}

.gf-gallery-lightbox__close:hover,
.gf-gallery-lightbox__close:focus-visible {
	background: var(--gf-brand);
}

@media (max-width: 640px) {
	.gf-single__content .gallery,
	.gf-single__content .wp-block-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.gf-single__content .gallery-columns-1,
	.gf-single__content .wp-block-gallery.columns-1 {
		grid-template-columns: 1fr;
	}
}
