/**
 * MMTM Galeries privées — styles frontend
 */

/* ===== Bouton de téléchargement sur chaque vignette ===== */
.wp-block-gallery .wp-block-image,
.wp-block-gallery figure {
	position: relative;
}

.mmtm-gp-download-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.mmtm-gp-download-btn:hover,
.mmtm-gp-download-btn:focus-visible {
	background: rgba(0, 0, 0, 0.9);
	outline: none;
	transform: translateY(-4px) scale(1.08);
}

.mmtm-gp-download-btn svg {
	display: block;
	pointer-events: none;
}

/* Visible au hover/focus */
.wp-block-gallery figure:hover .mmtm-gp-download-btn,
.wp-block-gallery figure:focus-within .mmtm-gp-download-btn,
.wp-block-gallery .wp-block-image:hover .mmtm-gp-download-btn,
.wp-block-gallery .wp-block-image:focus-within .mmtm-gp-download-btn {
	opacity: 1;
	transform: translateY(0);
}

/* Toujours visible sur tactile */
@media (hover: none) {
	.mmtm-gp-download-btn {
		opacity: 1;
		transform: none;
	}
}

/* ===== Boutons "Télécharger la galerie complète" ===== */
.actions_galerie_client {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 1.5rem 0;
	flex-wrap: wrap;
}

.telecharger-galerie a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	background: #111;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 500;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.telecharger-galerie a::before {
	content: '';
	display: inline-block;
	width: 18px;
	height: 18px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/><polyline points='7 10 12 15 17 10'/><line x1='12' y1='15' x2='12' y2='3'/></svg>");
	background-repeat: no-repeat;
}

.telecharger-galerie a:hover {
	background: #333;
}

.telecharger-galerie a.is-loading {
	opacity: 0.6;
	cursor: wait;
}

.telecharger-galerie a.is-loading::before {
	animation: mmtm-gp-spin 1s linear infinite;
}

@keyframes mmtm-gp-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.mmtm-gp-photo-count {
	color: #666;
	font-size: 0.9rem;
	font-style: italic;
}

/* Protection basique (dissuasif) */
.wp-block-gallery img {
	-webkit-user-drag: none;
	user-select: none;
	-webkit-user-select: none;
}
