/* =============================================================================
   ModalArt — modales.css
   Estilos del frontend para la visualización de modales
   ============================================================================= */

/* -----------------------------------------------------------------------------
   OVERLAY (fondo oscuro detrás del modal)
   ----------------------------------------------------------------------------- */

.modalart-overlay {
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.6);
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;

	/* Oculto por defecto */
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.3s ease,
		visibility 0.3s ease;
}

.modalart-overlay.modalart-visible {
	opacity: 1;
	visibility: visible;
}

/* -----------------------------------------------------------------------------
   CONTENEDOR DEL MODAL
   ----------------------------------------------------------------------------- */

.modalart-modal {
	position: relative;
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
	width: 100%;
	max-width: 600px;
	max-height: 90vh;
	overflow-y: auto;
	z-index: 99999;

	/* Animación de entrada */
	transform: translateY(-20px) scale(0.98);
	transition: transform 0.3s ease;
}

.modalart-overlay.modalart-visible .modalart-modal {
	transform: translateY(0) scale(1);
}

/* -----------------------------------------------------------------------------
   CABECERA DEL MODAL
   ----------------------------------------------------------------------------- */

.modalart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 16px;
	border-bottom: 1px solid #e5e7eb;
}

.modalart-titulo {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 600;
	color: #111827;
	line-height: 1.4;
}

/* -----------------------------------------------------------------------------
   BOTÓN DE CERRAR
   ----------------------------------------------------------------------------- */

.modalart-cerrar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	cursor: pointer;
	border-radius: 50%;
	color: #6b7280;
	font-size: 1.4rem;
	line-height: 1;
	flex-shrink: 0;
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
}

.modalart-cerrar:hover {
	background-color: #f3f4f6;
	color: #111827;
}

/* -----------------------------------------------------------------------------
   CUERPO DEL MODAL
   ----------------------------------------------------------------------------- */

.modalart-body {
	padding: 20px 24px 24px;
	color: #374151;
	font-size: 1rem;
	line-height: 1.7;
}

.modalart-body p:first-child {
	margin-top: 0;
}

.modalart-body p:last-child {
	margin-bottom: 0;
}

.modalart-body img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

.modalart-body a {
	color: #2563eb;
	text-decoration: underline;
}

.modalart-body a:hover {
	color: #1d4ed8;
}

/* -----------------------------------------------------------------------------
   BOTÓN DISPARADOR (generado por shortcode)
   ----------------------------------------------------------------------------- */

.modalart-trigger {
	display: inline-block;
	padding: 10px 20px;
	background-color: #2563eb;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition:
		background-color 0.2s ease,
		transform 0.1s ease;
}

.modalart-trigger:hover {
	background-color: #1d4ed8;
}

.modalart-trigger:active {
	transform: scale(0.98);
}

/* -----------------------------------------------------------------------------
   RESPONSIVE — pantallas pequeñas
   ----------------------------------------------------------------------------- */

@media (max-width: 480px) {
	.modalart-modal {
		max-width: 100%;
		border-radius: 12px 12px 0 0;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		max-height: 85vh;
	}

	.modalart-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.modalart-header {
		padding: 16px 20px 12px;
	}

	.modalart-body {
		padding: 16px 20px 24px;
	}
}

/* -----------------------------------------------------------------------------
   ACCESIBILIDAD — respetar preferencia de movimiento reducido
   ----------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.modalart-overlay,
	.modalart-modal {
		transition: none;
	}
}
