/* =====================================================================
   TO13 — galerie photos joueur (champ ACF galerie_photos_joueur)
   Wrap par TO13_SL_Tweaks dans <div class="to13-player-gallery"> + grid
   ===================================================================== */

.to13-player-gallery {
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr;
	margin: 16px 0;
}

/* Variantes nombre de colonnes (mobile = 1 col, desktop = N) */
@media (min-width: 600px) {
	.to13-player-gallery--cols-2,
	.to13-player-gallery--cols-3,
	.to13-player-gallery--cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (min-width: 900px) {
	.to13-player-gallery--cols-3 { grid-template-columns: repeat(3, 1fr); }
	.to13-player-gallery--cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Chaque "cellule" = soit un <figure class="wp-caption"> (shortcode caption),
   soit un <p> contenant l'<img>, soit l'<img> seul (selon le contenu ACF). */
.to13-player-gallery > * {
	margin: 0 !important;
	padding: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
}

/* Figure caption WP : on garde l'inline structure mais on neutralise les
   width/height inline posés par le shortcode [caption width="2250"]. */
.to13-player-gallery .wp-caption {
	width: 100% !important;
	max-width: 100% !important;
}
.to13-player-gallery .wp-caption-text {
	font-size: 12px;
	color: #5b6470;
	margin-top: 4px;
	text-align: center;
}

/* Lien lightbox + image : ratio 4/3 cover, sans dépasser la cellule */
.to13-player-gallery a.to13-gallery-link {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	background: #f0f2f5;
	aspect-ratio: 4 / 3;
	box-shadow: 0 1px 3px rgba(11, 21, 48, 0.06);
	transition: transform 0.18s, box-shadow 0.18s;
}
.to13-player-gallery a.to13-gallery-link:hover,
.to13-player-gallery a.to13-gallery-link:focus {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(11, 21, 48, 0.16);
}
.to13-player-gallery a.to13-gallery-link img,
.to13-player-gallery img.to13-gallery-img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
	margin: 0;
}
